@forgeroute/ui 0.5.26 → 0.5.27

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.
Files changed (77) hide show
  1. package/fesm2022/forgeroute-ui-card-list-item.mjs +30 -8
  2. package/fesm2022/forgeroute-ui-card-list-item.mjs.map +1 -1
  3. package/fesm2022/forgeroute-ui-checkbox.mjs +2 -2
  4. package/fesm2022/forgeroute-ui-checkbox.mjs.map +1 -1
  5. package/fesm2022/forgeroute-ui-color-input.mjs +2 -2
  6. package/fesm2022/forgeroute-ui-color-input.mjs.map +1 -1
  7. package/fesm2022/forgeroute-ui-combobox.mjs +2 -2
  8. package/fesm2022/forgeroute-ui-combobox.mjs.map +1 -1
  9. package/fesm2022/forgeroute-ui-contact-picker.mjs +4 -4
  10. package/fesm2022/forgeroute-ui-contact-picker.mjs.map +1 -1
  11. package/fesm2022/forgeroute-ui-conversations.mjs +2 -0
  12. package/fesm2022/forgeroute-ui-conversations.mjs.map +1 -1
  13. package/fesm2022/forgeroute-ui-data-table-core.mjs +2 -2
  14. package/fesm2022/forgeroute-ui-data-table-core.mjs.map +1 -1
  15. package/fesm2022/forgeroute-ui-date-input.mjs +2 -2
  16. package/fesm2022/forgeroute-ui-date-input.mjs.map +1 -1
  17. package/fesm2022/forgeroute-ui-datetime-input.mjs +2 -2
  18. package/fesm2022/forgeroute-ui-datetime-input.mjs.map +1 -1
  19. package/fesm2022/forgeroute-ui-detail-card.mjs +20 -4
  20. package/fesm2022/forgeroute-ui-detail-card.mjs.map +1 -1
  21. package/fesm2022/forgeroute-ui-dropdown.mjs +16 -2
  22. package/fesm2022/forgeroute-ui-dropdown.mjs.map +1 -1
  23. package/fesm2022/forgeroute-ui-file-input.mjs +7 -5
  24. package/fesm2022/forgeroute-ui-file-input.mjs.map +1 -1
  25. package/fesm2022/forgeroute-ui-icon-picker.mjs +2 -2
  26. package/fesm2022/forgeroute-ui-icon-picker.mjs.map +1 -1
  27. package/fesm2022/forgeroute-ui-media.mjs +67 -2
  28. package/fesm2022/forgeroute-ui-media.mjs.map +1 -1
  29. package/fesm2022/forgeroute-ui-messaging.mjs +3 -0
  30. package/fesm2022/forgeroute-ui-messaging.mjs.map +1 -1
  31. package/fesm2022/forgeroute-ui-multi-select.mjs +2 -2
  32. package/fesm2022/forgeroute-ui-multi-select.mjs.map +1 -1
  33. package/fesm2022/forgeroute-ui-notes.mjs +1 -0
  34. package/fesm2022/forgeroute-ui-notes.mjs.map +1 -1
  35. package/fesm2022/forgeroute-ui-option-card.mjs +1 -0
  36. package/fesm2022/forgeroute-ui-option-card.mjs.map +1 -1
  37. package/fesm2022/forgeroute-ui-payments.mjs +3 -0
  38. package/fesm2022/forgeroute-ui-payments.mjs.map +1 -1
  39. package/fesm2022/forgeroute-ui-pdf.mjs +1 -0
  40. package/fesm2022/forgeroute-ui-pdf.mjs.map +1 -1
  41. package/fesm2022/forgeroute-ui-quickbooks.mjs +1 -0
  42. package/fesm2022/forgeroute-ui-quickbooks.mjs.map +1 -1
  43. package/fesm2022/forgeroute-ui-radio-matrix.mjs +2 -2
  44. package/fesm2022/forgeroute-ui-radio-matrix.mjs.map +1 -1
  45. package/fesm2022/forgeroute-ui-radio.mjs +2 -2
  46. package/fesm2022/forgeroute-ui-radio.mjs.map +1 -1
  47. package/fesm2022/forgeroute-ui-select.mjs +2 -2
  48. package/fesm2022/forgeroute-ui-select.mjs.map +1 -1
  49. package/fesm2022/forgeroute-ui-setup.mjs +1 -0
  50. package/fesm2022/forgeroute-ui-setup.mjs.map +1 -1
  51. package/fesm2022/forgeroute-ui-square.mjs +1 -0
  52. package/fesm2022/forgeroute-ui-square.mjs.map +1 -1
  53. package/fesm2022/forgeroute-ui-star-rating.mjs +2 -2
  54. package/fesm2022/forgeroute-ui-star-rating.mjs.map +1 -1
  55. package/fesm2022/forgeroute-ui-stripe.mjs +1 -0
  56. package/fesm2022/forgeroute-ui-stripe.mjs.map +1 -1
  57. package/fesm2022/forgeroute-ui-swatch-picker.mjs +2 -2
  58. package/fesm2022/forgeroute-ui-swatch-picker.mjs.map +1 -1
  59. package/fesm2022/forgeroute-ui-table-toolbar.mjs +17 -5
  60. package/fesm2022/forgeroute-ui-table-toolbar.mjs.map +1 -1
  61. package/fesm2022/forgeroute-ui-text-input.mjs +2 -2
  62. package/fesm2022/forgeroute-ui-text-input.mjs.map +1 -1
  63. package/fesm2022/forgeroute-ui-textarea-input.mjs +23 -36
  64. package/fesm2022/forgeroute-ui-textarea-input.mjs.map +1 -1
  65. package/fesm2022/forgeroute-ui-time-input.mjs +2 -2
  66. package/fesm2022/forgeroute-ui-time-input.mjs.map +1 -1
  67. package/package.json +1 -1
  68. package/types/forgeroute-ui-card-list-item.d.ts +11 -3
  69. package/types/forgeroute-ui-detail-card.d.ts +7 -0
  70. package/types/forgeroute-ui-dropdown.d.ts +2 -0
  71. package/types/forgeroute-ui-media.d.ts +28 -0
  72. package/types/forgeroute-ui-messaging.d.ts +4 -4
  73. package/types/forgeroute-ui-payments.d.ts +1 -1
  74. package/types/forgeroute-ui-quickbooks.d.ts +1 -1
  75. package/types/forgeroute-ui-square.d.ts +4 -4
  76. package/types/forgeroute-ui-stripe.d.ts +4 -4
  77. package/types/forgeroute-ui-textarea-input.d.ts +9 -9
@@ -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 /** 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-menu .dd-item:not(:disabled)'));\n }\n\n private _focusTrigger() {\n this._host.nativeElement.querySelector<HTMLElement>('.dd-trigger')?.focus();\n }\n}\n"],"mappings":";;;AAKA,MAAM,oBAAoB,OAAO,IAAG,GAAA,YAAA,CAAA,E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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;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"}
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 /** The visible vertical range for the menu: the screen narrowed by each ancestor that clips its overflow (auto / scroll / hidden / clip). */\n private _verticalBounds(host: HTMLElement, vh: number): { top: number; bottom: number } {\n let top = 0, bottom = vh;\n for (let el = host.parentElement; el && el !== document.body && el !== document.documentElement; el = el.parentElement) {\n const overflowY = getComputedStyle(el).overflowY;\n if (overflowY === 'visible') continue;\n const r = el.getBoundingClientRect();\n top = Math.max(top, r.top);\n bottom = Math.min(bottom, r.bottom);\n }\n return { top, bottom };\n }\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 // The room above/below is measured against the screen AND every scrolling/clipping ancestor (e.g. a side panel's scrolling body), because an\n // ancestor with overflow cuts the absolutely positioned menu off at its own edge, not at the screen's.\n const { top: boundTop, bottom: boundBottom } = this._verticalBounds(host, vh);\n const below = boundBottom - t.bottom - GAP - MARGIN;\n const above = t.top - boundTop - 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 }\n\n private _focusTrigger() {\n this._host.nativeElement.querySelector<HTMLElement>('.dd-trigger')?.focus();\n }\n}\n"],"mappings":";;;AAKA,MAAM,oBAAoB,OAAO,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,oBAAA,CAAA,+BAAA,CAAA,CAAA;AAgLpC,IAAa,oBAAb,MAAa,kBAAiB;CAsD5B,cAAA;EArDmB,KAAA,SAAS,OAAO,eAAe;EACzC,KAAA,QAAc,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;EACvB,KAAA,QAAc,MAAsB,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;EAEvC,KAAA,SAAc,MAA8C,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;EACjE,KAAA,SAAc,MAAM,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;EAC1B,KAAA,cAAc,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;EACvB,KAAA,UAAc,MAA0B,UAAS,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;EAEjD,KAAA,OAAc,MAAmB,MAAK,GAAA,YAAA,CAAA,EA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AA;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"}
@@ -109,7 +109,7 @@ var FileInputComponent = class FileInputComponent {
109
109
  this._dragging = signal(false, ...ngDevMode ? [{ debugName: "_dragging" }] : /* istanbul ignore next */ []);
110
110
  this._toast = inject(ToastService);
111
111
  this._rejection = signal("", ...ngDevMode ? [{ debugName: "_rejection" }] : /* istanbul ignore next */ []);
112
- this._describedBy = computed(() => mergeDescribedBy(this._shownError() ? this._inputId + "-desc" : "", this.ariaDescribedBy()), ...ngDevMode ? [{ debugName: "_describedBy" }] : /* istanbul ignore next */ []);
112
+ this._describedBy = computed(() => mergeDescribedBy(this._shownError() ? this._inputId + "-desc" : this.hint() ? this._inputId + "-hint" : "", this.ariaDescribedBy()), ...ngDevMode ? [{ debugName: "_describedBy" }] : /* istanbul ignore next */ []);
113
113
  this._rejected = signal([], ...ngDevMode ? [{ debugName: "_rejected" }] : /* istanbul ignore next */ []);
114
114
  this.rejections = this._rejected.asReadonly();
115
115
  this.rejectionLines = computed(() => this._rejected().map((r) => this.labels.t("fileInput.notAdded", {
@@ -554,7 +554,6 @@ var FileInputComponent = class FileInputComponent {
554
554
  <label class="fi-label" [for]="_inputId">
555
555
  {{ label() }}
556
556
  @if (required()) { <span class="fi-required" aria-hidden="true">*</span> }
557
- @if (hint()) { <span class="fi-hint-inline">({{ hint() }})</span> }
558
557
  </label>
559
558
  }
560
559
  <input
@@ -602,11 +601,13 @@ var FileInputComponent = class FileInputComponent {
602
601
  } @else {
603
602
  <p class="fi-desc fi-desc-error" [id]="_inputId + '-desc'" role="alert">{{ _shownError() }}</p>
604
603
  }
604
+ } @else if (hint()) {
605
+ <p class="fi-desc" [id]="_inputId + '-hint'">{{ hint() }}</p>
605
606
  }
606
607
  </div>
607
608
  `,
608
609
  isInline: true,
609
- styles: [":host{display:block}:host(:has(.fi-hidden)){display:contents}.fi-field{display:flex;flex-direction:column;gap:6px}.fi-hidden{display:contents}.fi-label{font-size:.8125rem;font-weight:600;color:#374151;line-height:1}.fi-required{color:#dc2626;margin-left:2px}.fi-hint-inline{font-size:.75rem;color:#94a3b8;font-weight:400;margin-left:4px}.fi-native{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}.fi-row{display:flex;align-items:stretch;gap:8px}.fi-control{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:1 1 auto;min-width:0;box-sizing:border-box;text-align:left;padding:9px 12px;font-size:.875rem;font-family:inherit;color:#1e293b;background:#fff;border:1px solid #7c8ba1;border-radius:8px;outline:none;cursor:pointer;transition:border-color .15s,box-shadow .15s}.fi-control:focus-visible{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61f}.fi-control:has(ui-image-preview){padding-top:6px;padding-bottom:6px}.fi-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fi-loading{overflow:visible}.fi-placeholder{color:#64748b}.fi-browse{flex-shrink:0;font-size:.75rem;font-weight:600;color:#374151;padding:3px 10px;border:1px solid #e2e8f0;border-radius:6px;background:#f8fafc}.fi-remove{flex-shrink:0;align-self:center;font-family:inherit;font-size:.75rem;font-weight:600;color:#b91c1c;padding:6px 10px;border:1px solid #fecaca;border-radius:6px;background:#fff;cursor:pointer;-webkit-appearance:none;appearance:none}.fi-remove:hover{background:#fef2f2}.fi-remove:focus-visible{outline:2px solid #ef4444;outline-offset:2px}.fi-sr{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}.fi-error .fi-control{border-color:#ef4444}.fi-error .fi-control:focus-visible{box-shadow:0 0 0 3px #ef44441f}.fi-drag .fi-control{border-color:#3b82f6;border-style:dashed;background:#eff6ff}.fi-disabled .fi-control{opacity:.5;cursor:not-allowed}.fi-desc{margin:0;font-size:.75rem;line-height:1.4;color:#64748b}.fi-desc-error{color:#dc2626}.fi-reject-list{margin:4px 0 0;padding-left:18px}.fi-reject-list li{margin:0 0 2px}@media(max-width:480px){.fi-control{font-size:1rem}.fi-remove{padding:10px 12px}}@media(pointer:coarse){.fi-control,.fi-remove{min-height:44px}}\n"],
610
+ styles: [":host{display:block}:host(:has(.fi-hidden)){display:contents}.fi-field{display:flex;flex-direction:column;gap:6px}.fi-hidden{display:contents}.fi-label{font-size:.8125rem;font-weight:600;color:#374151;line-height:1}.fi-required{color:#dc2626;margin-left:2px}.fi-native{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}.fi-row{display:flex;align-items:stretch;gap:8px}.fi-control{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:1 1 auto;min-width:0;box-sizing:border-box;text-align:left;padding:9px 12px;font-size:.875rem;font-family:inherit;color:#1e293b;background:#fff;border:1px solid #7c8ba1;border-radius:8px;outline:none;cursor:pointer;transition:border-color .15s,box-shadow .15s}.fi-control:focus-visible{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61f}.fi-control:has(ui-image-preview){padding-top:6px;padding-bottom:6px}.fi-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fi-loading{overflow:visible}.fi-placeholder{color:#64748b}.fi-browse{flex-shrink:0;font-size:.75rem;font-weight:600;color:#374151;padding:3px 10px;border:1px solid #e2e8f0;border-radius:6px;background:#f8fafc}.fi-remove{flex-shrink:0;align-self:center;font-family:inherit;font-size:.75rem;font-weight:600;color:#b91c1c;padding:6px 10px;border:1px solid #fecaca;border-radius:6px;background:#fff;cursor:pointer;-webkit-appearance:none;appearance:none}.fi-remove:hover{background:#fef2f2}.fi-remove:focus-visible{outline:2px solid #ef4444;outline-offset:2px}.fi-sr{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}.fi-error .fi-control{border-color:#ef4444}.fi-error .fi-control:focus-visible{box-shadow:0 0 0 3px #ef44441f}.fi-drag .fi-control{border-color:#3b82f6;border-style:dashed;background:#eff6ff}.fi-disabled .fi-control{opacity:.5;cursor:not-allowed}.fi-desc{margin:-6px 0 0;font-size:.75rem;line-height:1.4;color:#64748b}.fi-desc-error{color:#dc2626}.fi-reject-list{margin:4px 0 0;padding-left:18px}.fi-reject-list li{margin:0 0 2px}@media(max-width:480px){.fi-control{font-size:1rem}.fi-remove{padding:10px 12px}}@media(pointer:coarse){.fi-control,.fi-remove{min-height:44px}}\n"],
610
611
  dependencies: [{
611
612
  kind: "component",
612
613
  type: ImagePreviewComponent,
@@ -672,7 +673,6 @@ i0.ɵɵngDeclareClassMetadata({
672
673
  <label class="fi-label" [for]="_inputId">
673
674
  {{ label() }}
674
675
  @if (required()) { <span class="fi-required" aria-hidden="true">*</span> }
675
- @if (hint()) { <span class="fi-hint-inline">({{ hint() }})</span> }
676
676
  </label>
677
677
  }
678
678
  <input
@@ -720,10 +720,12 @@ i0.ɵɵngDeclareClassMetadata({
720
720
  } @else {
721
721
  <p class="fi-desc fi-desc-error" [id]="_inputId + '-desc'" role="alert">{{ _shownError() }}</p>
722
722
  }
723
+ } @else if (hint()) {
724
+ <p class="fi-desc" [id]="_inputId + '-hint'">{{ hint() }}</p>
723
725
  }
724
726
  </div>
725
727
  `,
726
- styles: [":host{display:block}:host(:has(.fi-hidden)){display:contents}.fi-field{display:flex;flex-direction:column;gap:6px}.fi-hidden{display:contents}.fi-label{font-size:.8125rem;font-weight:600;color:#374151;line-height:1}.fi-required{color:#dc2626;margin-left:2px}.fi-hint-inline{font-size:.75rem;color:#94a3b8;font-weight:400;margin-left:4px}.fi-native{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}.fi-row{display:flex;align-items:stretch;gap:8px}.fi-control{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:1 1 auto;min-width:0;box-sizing:border-box;text-align:left;padding:9px 12px;font-size:.875rem;font-family:inherit;color:#1e293b;background:#fff;border:1px solid #7c8ba1;border-radius:8px;outline:none;cursor:pointer;transition:border-color .15s,box-shadow .15s}.fi-control:focus-visible{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61f}.fi-control:has(ui-image-preview){padding-top:6px;padding-bottom:6px}.fi-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fi-loading{overflow:visible}.fi-placeholder{color:#64748b}.fi-browse{flex-shrink:0;font-size:.75rem;font-weight:600;color:#374151;padding:3px 10px;border:1px solid #e2e8f0;border-radius:6px;background:#f8fafc}.fi-remove{flex-shrink:0;align-self:center;font-family:inherit;font-size:.75rem;font-weight:600;color:#b91c1c;padding:6px 10px;border:1px solid #fecaca;border-radius:6px;background:#fff;cursor:pointer;-webkit-appearance:none;appearance:none}.fi-remove:hover{background:#fef2f2}.fi-remove:focus-visible{outline:2px solid #ef4444;outline-offset:2px}.fi-sr{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}.fi-error .fi-control{border-color:#ef4444}.fi-error .fi-control:focus-visible{box-shadow:0 0 0 3px #ef44441f}.fi-drag .fi-control{border-color:#3b82f6;border-style:dashed;background:#eff6ff}.fi-disabled .fi-control{opacity:.5;cursor:not-allowed}.fi-desc{margin:0;font-size:.75rem;line-height:1.4;color:#64748b}.fi-desc-error{color:#dc2626}.fi-reject-list{margin:4px 0 0;padding-left:18px}.fi-reject-list li{margin:0 0 2px}@media(max-width:480px){.fi-control{font-size:1rem}.fi-remove{padding:10px 12px}}@media(pointer:coarse){.fi-control,.fi-remove{min-height:44px}}\n"]
728
+ styles: [":host{display:block}:host(:has(.fi-hidden)){display:contents}.fi-field{display:flex;flex-direction:column;gap:6px}.fi-hidden{display:contents}.fi-label{font-size:.8125rem;font-weight:600;color:#374151;line-height:1}.fi-required{color:#dc2626;margin-left:2px}.fi-native{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}.fi-row{display:flex;align-items:stretch;gap:8px}.fi-control{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:1 1 auto;min-width:0;box-sizing:border-box;text-align:left;padding:9px 12px;font-size:.875rem;font-family:inherit;color:#1e293b;background:#fff;border:1px solid #7c8ba1;border-radius:8px;outline:none;cursor:pointer;transition:border-color .15s,box-shadow .15s}.fi-control:focus-visible{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61f}.fi-control:has(ui-image-preview){padding-top:6px;padding-bottom:6px}.fi-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fi-loading{overflow:visible}.fi-placeholder{color:#64748b}.fi-browse{flex-shrink:0;font-size:.75rem;font-weight:600;color:#374151;padding:3px 10px;border:1px solid #e2e8f0;border-radius:6px;background:#f8fafc}.fi-remove{flex-shrink:0;align-self:center;font-family:inherit;font-size:.75rem;font-weight:600;color:#b91c1c;padding:6px 10px;border:1px solid #fecaca;border-radius:6px;background:#fff;cursor:pointer;-webkit-appearance:none;appearance:none}.fi-remove:hover{background:#fef2f2}.fi-remove:focus-visible{outline:2px solid #ef4444;outline-offset:2px}.fi-sr{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}.fi-error .fi-control{border-color:#ef4444}.fi-error .fi-control:focus-visible{box-shadow:0 0 0 3px #ef44441f}.fi-drag .fi-control{border-color:#3b82f6;border-style:dashed;background:#eff6ff}.fi-disabled .fi-control{opacity:.5;cursor:not-allowed}.fi-desc{margin:-6px 0 0;font-size:.75rem;line-height:1.4;color:#64748b}.fi-desc-error{color:#dc2626}.fi-reject-list{margin:4px 0 0;padding-left:18px}.fi-reject-list li{margin:0 0 2px}@media(max-width:480px){.fi-control{font-size:1rem}.fi-remove{padding:10px 12px}}@media(pointer:coarse){.fi-control,.fi-remove{min-height:44px}}\n"]
727
729
  }]
728
730
  }],
729
731
  ctorParameters: () => [],
@@ -1 +1 @@
1
- {"version":3,"file":"forgeroute-ui-file-input.mjs","names":[],"sources":["../../../projects/forgeroute-ui/file-input/src/lib/file-input/file-input.component.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, DestroyRef, effect, forwardRef, inject, input, output, signal, computed, viewChild, ElementRef } from '@angular/core';\nimport { AbstractControl, ControlValueAccessor, NG_VALIDATORS, NG_VALUE_ACCESSOR, ValidationErrors, Validator } from '@angular/forms';\nimport { ImagePreviewComponent } from '@forgeroute/ui/image-preview';\nimport { SkeletonComponent } from '@forgeroute/ui/skeleton';\nimport { ToastService } from '@forgeroute/ui/core';\nimport { FieldIssue, UiFieldValidity, createFieldReveal, issueToErrors, mergeDescribedBy, requiredIssue } from '@forgeroute/ui/core';\nimport { UiLabelsService, uiLocale, uiText } from '@forgeroute/ui/core';\nimport { uiFormatNumber } from '@forgeroute/ui/core';\n\n/** Why a chosen file was refused. */\n/** 'type' = not an accepted type, 'size' = over `maxSize`, 'empty' = a 0-byte file (`rejectEmpty`), 'small' = under `minSize`. */\nexport type FileRejectReason = 'type' | 'size' | 'empty' | 'small';\n\n/** A refused file with the message the field shows (also emitted by `(fileRejected)`). */\nexport interface FileRejection {\n file: File;\n reason: FileRejectReason;\n message: string;\n}\n\n/** \"1.5 MB\", \"820 KB\", \"12 B\" (binary units, one decimal for MB and above). */\nexport function formatFileSize(bytes: number): string {\n if (bytes < 1024) return `${bytes} B`;\n if (bytes < 1024 * 1024) return `${Math.round(bytes / 1024)} KB`;\n const mb = bytes / (1024 * 1024);\n const one = (n: number) => uiFormatNumber(Number(n.toFixed(1)), uiLocale(), { maximumFractionDigits: 1 }); // rounded like toFixed(1), written with the locale's decimal mark\n return mb < 1024 ? `${one(mb)} MB` : `${one(mb / 1024)} GB`;\n}\n\n/**\n * The size caption of an attachment chip: \"820 KB\" below 1 MB (rounded to whole KB), else \"1.5 MB\" / \"1.0 MB\" (always one decimal) written with the active\n * locale's decimal mark (\"1,5 MB\" in a locale that uses a comma). English output is exactly `${n.toFixed(1)} MB` as before.\n */\nexport function formatAttachmentSize(bytes: number): string {\n if (bytes < 1024 * 1024) return `${Math.round(bytes / 1024)} KB`;\n const mb = Number((bytes / (1024 * 1024)).toFixed(1));\n return `${uiFormatNumber(mb, uiLocale(), { minimumFractionDigits: 1, maximumFractionDigits: 1 })} MB`;\n}\n\n/** True when `file` matches one token of a native `accept` string (`.pdf`, `image/png`, `image/*`). Empty `accept` accepts everything. */\nexport function fileMatchesAccept(file: File, accept: string): boolean {\n const tokens = accept.split(',').map(t => t.trim().toLowerCase()).filter(Boolean);\n if (tokens.length === 0) return true;\n const name = file.name.toLowerCase();\n const type = (file.type || '').toLowerCase();\n return tokens.some(t => {\n if (t.startsWith('.')) return name.endsWith(t);\n if (t.endsWith('/*')) return !!type && type.startsWith(t.slice(0, -1));\n return !!type && type === t;\n });\n}\n\n/** \"PDF\", \"PNG, JPEG and WEBP\" from an `accept` string, for the default type message. */\nexport function acceptLabel(accept: string): string {\n const names = accept.split(',').map(t => t.trim()).filter(Boolean).map(t => {\n if (t.startsWith('.')) return t.slice(1).toUpperCase();\n if (t.endsWith('/*')) {\n const kind = t.slice(0, -2);\n return kind === 'image' ? uiText('fileInput.word.image') : kind === 'video' ? uiText('fileInput.word.video') : kind === 'audio' ? uiText('fileInput.word.audio') : kind;\n }\n const sub = t.split('/')[1] ?? t;\n return sub.toUpperCase();\n });\n const unique = [...new Set(names)];\n if (unique.length <= 1) return unique[0] ?? '';\n const last = unique[unique.length - 1];\n // A last item that starts with the sound \"i\" (i-, hi- but not hie-: \"imagen\", \"icono\", \"hielo\" is not one) takes the joiner \"e\" in Spanish (\"video e imagen\").\n const iSound = /^(?:i|hi(?!e))/i.test(last.normalize('NFD').replace(/[\\u0300-\\u036f]/g, ''));\n return uiText(iSound ? 'common.listAndBeforeI' : 'common.listAnd', { list: unique.slice(0, -1).join(', '), last });\n}\n\n/**\n * File picker styled like the other `ui-*` inputs (label, hint, required marker, error, disabled).\n * Value (ngModel / forms) is `File | null`, or `File[]` when `multiple` is set.\n *\n * Set `[showField]=\"false\"` for a picker with no visible field and call `open()` from the host\n * (e.g. an \"Attach document\" menu action). `(filesSelected)` fires in both modes.\n *\n * Built in (all opt-in, nothing changes unless an input is set):\n * - `clearable`: a Remove button next to the chosen file; `(fileRemoved)` fires after it clears the selection.\n * - `accept` is enforced on picked AND dropped files (`enforceAccept`, on by default), `maxSize` (bytes) refuses bigger\n * files, `rejectEmpty` refuses a 0-byte file (`emptyMessage`) and `minSize` (bytes) refuses smaller ones (`minSizeMessage`). A refused file is never added to the value: the field shows the message (`typeMessage` / `sizeMessage`\n * override the wording, also in picker-only mode), and `(fileRejected)` emits `{ file, reason, message }`.\n * - `required` is a real rule: Angular `Validator` + `UiFieldValidity` (`invalid`, `errorMessage`, `invalidChange`,\n * `showErrors`), like the other inputs. The message (built-in and host `error`) shows only after the user used the field; `[showErrors]=\"true\"` also reveals it. A refused file is always shown at once.\n * - `dropzone`: the field accepts files dropped on it.\n * - `showDetails`: file size after the name; `preview`: a thumbnail of a chosen image.\n * - `loading` (+ `loadingText`): a `ui-skeleton` replaces the file name while the host works on the file (scanning, uploading).\n */\n@Component({\n selector: 'ui-file-input',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [ImagePreviewComponent, SkeletonComponent],\n providers: [{\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => FileInputComponent),\n multi: true,\n }, {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => FileInputComponent),\n multi: true,\n }, {\n provide: UiFieldValidity,\n useExisting: forwardRef(() => FileInputComponent),\n }],\n template: `\n <div class=\"fi-field\" [class.fi-error]=\"!!_shownError()\" [class.fi-disabled]=\"disabled()\" [class.fi-hidden]=\"!showField()\" [class.fi-drag]=\"_dragging()\">\n @if (showField() && label()) {\n <label class=\"fi-label\" [for]=\"_inputId\">\n {{ label() }}\n @if (required()) { <span class=\"fi-required\" aria-hidden=\"true\">*</span> }\n @if (hint()) { <span class=\"fi-hint-inline\">({{ hint() }})</span> }\n </label>\n }\n <input\n #fileEl\n type=\"file\"\n class=\"fi-native\"\n [id]=\"_inputId\"\n [attr.accept]=\"accept() || null\"\n [multiple]=\"multiple()\"\n [disabled]=\"disabled()\"\n [attr.required]=\"required() || null\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-invalid]=\"_shownError() ? 'true' : null\"\n [attr.aria-describedby]=\"_describedBy()\"\n [attr.tabindex]=\"showField() ? -1 : null\"\n (change)=\"onChange($event)\"\n (blur)=\"_onTouched()\" />\n @if (showField()) {\n <div class=\"fi-row\">\n <button type=\"button\" class=\"fi-control\" [disabled]=\"disabled() || loading()\" [attr.aria-busy]=\"loading() ? 'true' : null\"\n [attr.aria-describedby]=\"_describedBy()\"\n (click)=\"open()\" (blur)=\"_touch()\"\n (dragenter)=\"onDragOver($event)\" (dragover)=\"onDragOver($event)\" (dragleave)=\"onDragLeave($event)\" (drop)=\"onDrop($event)\">\n @if (_previewUrl(); as src) {\n <ui-image-preview [src]=\"src\" alt=\"\" shape=\"rounded\" size=\"sm\" placeholder=\"image\" />\n }\n @if (loading()) {\n <span class=\"fi-name fi-loading\"><ui-skeleton [height]=\"14\" width=\"60%\" [radius]=\"4\" /></span>\n <span class=\"fi-sr\" role=\"status\">{{ loadingText() || labels.t('fileInput.processing') }}</span>\n } @else {\n <span class=\"fi-name\" [class.fi-placeholder]=\"!summary()\">{{ summary() || placeholder() }}</span>\n }\n <span class=\"fi-browse\">{{ buttonLabel() }}</span>\n </button>\n @if (clearable() && _files().length > 0 && !loading() && !disabled()) {\n <button type=\"button\" class=\"fi-remove\" [attr.aria-label]=\"removeLabel() + (summary() ? ' ' + summary() : '')\" (click)=\"remove()\">{{ removeLabel() }}</button>\n }\n </div>\n }\n @if (_shownError()) {\n @if (_showRejectList()) {\n <ul class=\"fi-desc fi-desc-error fi-reject-list\" [id]=\"_inputId + '-desc'\" role=\"alert\">\n @for (line of rejectionLines(); track $index) { <li>{{ line }}</li> }\n </ul>\n } @else {\n <p class=\"fi-desc fi-desc-error\" [id]=\"_inputId + '-desc'\" role=\"alert\">{{ _shownError() }}</p>\n }\n }\n </div>\n `,\n styles: [`\n :host { display: block; }\n :host(:has(.fi-hidden)) { display: contents; }\n\n .fi-field { display: flex; flex-direction: column; gap: 6px; }\n .fi-hidden { display: contents; }\n\n .fi-label { font-size: 0.8125rem; font-weight: 600; color: #374151; line-height: 1; }\n .fi-required { color: #dc2626; margin-left: 2px; }\n .fi-hint-inline { font-size: 0.75rem; color: #94a3b8; font-weight: 400; margin-left: 4px; }\n\n /* Native control stays in the DOM (forms, a11y, programmatic click) but is visually hidden. */\n .fi-native {\n position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;\n overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;\n }\n\n .fi-row { display: flex; align-items: stretch; gap: 8px; }\n .fi-control {\n display: flex; align-items: center; justify-content: space-between; gap: 12px;\n flex: 1 1 auto; min-width: 0; box-sizing: border-box; text-align: left;\n padding: 9px 12px; font-size: 0.875rem; font-family: inherit;\n color: #1e293b; background: #fff;\n border: 1px solid #7c8ba1; border-radius: 8px;\n outline: none; cursor: pointer;\n transition: border-color 0.15s, box-shadow 0.15s;\n &:focus-visible {\n border-color: #3b82f6;\n box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);\n }\n }\n .fi-control:has(ui-image-preview) { padding-top: 6px; padding-bottom: 6px; }\n .fi-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n .fi-loading { overflow: visible; }\n .fi-placeholder { color: #64748b; }\n .fi-browse {\n flex-shrink: 0; font-size: 0.75rem; font-weight: 600; color: #374151;\n padding: 3px 10px; border: 1px solid #e2e8f0; border-radius: 6px; background: #f8fafc;\n }\n .fi-remove {\n flex-shrink: 0; align-self: center; font-family: inherit; font-size: 0.75rem; font-weight: 600; color: #b91c1c;\n padding: 6px 10px; border: 1px solid #fecaca; border-radius: 6px; background: #fff; cursor: pointer;\n -webkit-appearance: none; appearance: none;\n &:hover { background: #fef2f2; }\n &:focus-visible { outline: 2px solid #ef4444; outline-offset: 2px; }\n }\n .fi-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }\n\n .fi-error .fi-control {\n border-color: #ef4444;\n &:focus-visible { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12); }\n }\n .fi-drag .fi-control { border-color: #3b82f6; border-style: dashed; background: #eff6ff; }\n .fi-disabled .fi-control { opacity: 0.5; cursor: not-allowed; }\n\n .fi-desc { margin: 0; font-size: 0.75rem; line-height: 1.4; color: #64748b; }\n .fi-desc-error { color: #dc2626; }\n .fi-reject-list { margin: 4px 0 0; padding-left: 18px; }\n .fi-reject-list li { margin: 0 0 2px; }\n\n @media (max-width: 480px) { .fi-control { font-size: 1rem; } .fi-remove { padding: 10px 12px; } }\n @media (pointer: coarse) { .fi-control, .fi-remove { min-height: 44px; } }\n `],\n})\nexport class FileInputComponent implements ControlValueAccessor, Validator, UiFieldValidity {\n protected readonly labels = inject(UiLabelsService);\n readonly label = input('');\n /** Accessible name for a field with no visible label. */\n readonly ariaLabel = input('');\n readonly placeholderInput = input<string | null>(null, { alias: 'placeholder' });\n readonly placeholder = computed(() => this.placeholderInput() ?? this.labels.t('fileInput.placeholder'));\n readonly buttonLabelInput = input<string | null>(null, { alias: 'buttonLabel' });\n readonly buttonLabel = computed(() => this.buttonLabelInput() ?? this.labels.t('fileInput.buttonLabel'));\n /** Native `accept` string, e.g. \".pdf,.png\". Also enforced on picked and dropped files unless `enforceAccept` is false. */\n readonly accept = input('');\n readonly multiple = input(false);\n /** A file must be chosen (a real rule: Validator + UiFieldValidity, message shown only after the user used the field; `showErrors=\"true\"` reveals it at once). */\n readonly required = input(false);\n readonly hint = input('');\n /** Host-provided error message (wins over the built-in ones). Shown under a visible field only. */\n readonly error = input('');\n /** false = no visible field; open the picker from the host with `open()`. */\n readonly showField = input(true);\n /** The host's \"tried to submit\" flag (e.g. after a failed Save click). `true` reveals the \"required\" message before the user used the field. */\n readonly showErrors = input(false);\n\n /**\n * Also report every refused file (wrong type, too big, too small, empty) with a `ToastService` error toast that names the file and\n * the reason, e.g. `\"scan.exe\" was not added. Only PDF files are allowed.` Meant for the picker-only mode (`[showField]=\"false\"`),\n * where no field is visible to show the message; it works with a visible field too. Several refused files make ONE toast listing each.\n * Default `false`: nothing is toasted (the field message and `(fileRejected)` are unchanged). Needs a `ui-toast` outlet like any toast.\n */\n readonly toastOnReject = input(false);\n /**\n * When several files are refused in one pick or drop, show EVERY one inside the field as a list (each line\n * `\"name\" was not added. <reason>`) instead of only the first refusal message. No toast is raised. The same list is available to the\n * host through `rejections` and `(filesRejected)`. Default `false`: the field shows the first refusal message only (unchanged).\n */\n readonly listRejections = input(false);\n /** Id(s) of host elements that describe the picker (space-separated), added after the field's own error text, like `ui-text-input`'s `ariaDescribedBy`. Empty: nothing is added. */\n readonly ariaDescribedBy = input('');\n /** Show a Remove button next to the chosen file. */\n readonly clearable = input(false);\n readonly removeLabelInput = input<string | null>(null, { alias: 'removeLabel' });\n readonly removeLabel = computed(() => this.removeLabelInput() ?? this.labels.t('fileInput.removeLabel'));\n /** Largest allowed file in bytes; a bigger file is refused. null = no limit. */\n readonly maxSize = input<number | null>(null);\n /** Refuse files that do not match `accept` (picked or dropped). */\n readonly enforceAccept = input(true);\n /** Replaces the built-in \"Only PDF files are allowed.\" message. */\n readonly typeMessage = input('');\n /** Replaces the built-in \"The file must be 5 MB or smaller.\" message. */\n readonly sizeMessage = input('');\n /** Refuse a file with no content (0 bytes). Off by default. */\n readonly rejectEmpty = input(false);\n /** Replaces the built-in \"The file is empty.\" message. */\n readonly emptyMessage = input('');\n /** Smallest allowed file in bytes; a smaller (non-empty) file is refused. null = no minimum. */\n readonly minSize = input<number | null>(null);\n /** Replaces the built-in \"The file must be at least 10 KB.\" message. */\n readonly minSizeMessage = input('');\n /** The field accepts files dropped on it. */\n readonly dropzone = input(false);\n /** Show the file size after the name. */\n readonly showDetails = input(false);\n /** Show a thumbnail when the chosen file is an image. */\n readonly preview = input(false);\n /** The host is working on the file (scanning, uploading): a skeleton replaces the name and Browse / Remove are disabled. */\n readonly loading = input(false);\n /** Screen-reader text while `loading` (default \"Processing…\"). */\n readonly loadingText = input('');\n\n /** Emits the chosen (accepted) files (one or many) each time the user picks or drops. */\n readonly filesSelected = output<File[]>();\n /** A picked or dropped file was refused (wrong type or too big). */\n readonly fileRejected = output<FileRejection>();\n /** Every file refused by ONE pick or drop, in one event (fires only when at least one file was refused; `(fileRejected)` still fires per file). */\n readonly filesRejected = output<FileRejection[]>();\n /** The Remove button cleared the selection. */\n readonly fileRemoved = output<void>();\n /** Emits whenever the field becomes invalid / valid. */\n readonly invalidChange = output<boolean>();\n\n readonly _disabledInput = input(false, { alias: 'disabled' });\n private readonly _cvaDisabled = signal(false);\n protected readonly disabled = computed(() => this._disabledInput() || this._cvaDisabled());\n\n protected readonly _files = signal<File[]>([]);\n protected readonly _inputId = `fi-${Math.random().toString(36).slice(2, 8)}`;\n private readonly fileEl = viewChild<ElementRef<HTMLInputElement>>('fileEl');\n protected readonly _dragging = signal(false);\n /** Message of the last refused file ('' when the last pick was fine); shown in every mode. */\n private readonly _toast = inject(ToastService);\n private readonly _rejection = signal('');\n /** `aria-describedby` of the native input and the drop zone: the shown error text, then the host's ids. Absent when neither exists. */\n protected readonly _describedBy = computed(() => mergeDescribedBy(this._shownError() ? this._inputId + '-desc' : '', this.ariaDescribedBy()));\n private readonly _rejected = signal<FileRejection[]>([]);\n /** The files refused by the last pick or drop (empty when the last pick was fine, after Remove / clear, and when files are set from the form). */\n readonly rejections = this._rejected.asReadonly();\n /** One line per refused file: `\"name\" was not added. <reason>`. */\n readonly rejectionLines = computed(() => this._rejected().map(r => this.labels.t('fileInput.notAdded', { name: r.file.name, message: r.message })));\n /** The list replaces the single message only while it is the refusal that is shown (a host `[error]` on a visible field wins). */\n protected readonly _showRejectList = computed(() =>\n this.listRejections() && this._rejected().length > 0 && !(this.showField() && this.error()));\n private readonly _reveal = createFieldReveal(this.showErrors);\n private readonly _issue = computed((): FieldIssue | null =>\n this.disabled() || !this.required() || this._files().length > 0 ? null : requiredIssue(this.label() || this.labels.t('common.file')));\n /** True while a required field is empty, the last pick was refused, or the host passed an `[error]`. */\n readonly invalid = computed(() => !!this.error() || !!this._rejection() || !!this._issue());\n /** Message of the first broken built-in rule ('' when valid), shown or not. */\n readonly errorMessage = computed(() =>\n (this.listRejections() && this._rejected().length > 0 ? this.rejectionLines().join(' ') : this._rejection()) || this._issue()?.message || '');\n /** What the field shows: the host error (visible field only), a refused file, or the revealed built-in message. */\n protected readonly _shownError = computed(() =>\n (this.listRejections() && this._rejected().length > 0 && this.showField() ? this.error() : '') || this._rejection() || (this._reveal.revealed() ? ((this.showField() ? this.error() : '') || (this._issue()?.message ?? '')) : ''));\n\n protected readonly summary = computed(() => {\n const f = this._files();\n if (f.length === 0) return '';\n const size = this.showDetails() ? ` · ${formatFileSize(f.reduce((n, x) => n + x.size, 0))}` : '';\n return (f.length === 1 ? f[0].name : this.labels.t('fileInput.filesSelected', { count: f.length })) + size;\n });\n\n /** Object URL of the chosen image (single file) while `preview` is on. */\n protected readonly _previewUrl = signal<string | null>(null);\n private _urlToRevoke: string | null = null;\n private _onValidatorChange = () => {};\n\n protected _onChange = (_: File | File[] | null) => {};\n protected _onTouched = () => {};\n\n constructor() {\n effect(() => { this.invalidChange.emit(this.invalid()); });\n effect(() => {\n const files = this._files();\n const want = this.preview() && files.length === 1 && (files[0].type || '').startsWith('image/') ? files[0] : null;\n this.revokePreview();\n if (want) {\n this._urlToRevoke = URL.createObjectURL(want);\n this._previewUrl.set(this._urlToRevoke);\n } else {\n this._previewUrl.set(null);\n }\n });\n inject(DestroyRef).onDestroy(() => this.revokePreview());\n }\n\n private revokePreview(): void {\n if (this._urlToRevoke) { URL.revokeObjectURL(this._urlToRevoke); this._urlToRevoke = null; }\n }\n\n /** Re-run the form control's validation when a rule input changes. */\n ngOnChanges() { this._onValidatorChange(); }\n\n validate(_control: AbstractControl): ValidationErrors | null {\n return issueToErrors(this._issue());\n }\n registerOnValidatorChange(fn: () => void) { this._onValidatorChange = fn; }\n\n /** Opens the native file dialog. */\n open(): void {\n if (!this.disabled() && !this.loading()) this.fileEl()?.nativeElement.click();\n }\n\n /** Clears the selection (and the native input, so the same file can be picked again) and any \"refused file\" message. */\n clear(): void {\n const el = this.fileEl()?.nativeElement;\n if (el) el.value = '';\n this._files.set([]);\n this.setRejections([]);\n this._onChange(this.multiple() ? [] : null);\n }\n\n /** The Remove button: clears, then tells the host. */\n protected remove(): void {\n this.clear();\n this._touch();\n this.fileRemoved.emit();\n }\n\n writeValue(val: File | File[] | null) {\n const files = Array.isArray(val) ? val : val ? [val] : [];\n this._files.set(files);\n if (files.length > 0) this.setRejections([]);\n const el = this.fileEl()?.nativeElement;\n if (files.length === 0 && el) el.value = '';\n }\n registerOnChange(fn: (v: File | File[] | null) => void) { this._onChange = fn; }\n registerOnTouched(fn: () => void) { this._onTouched = fn; }\n setDisabledState(d: boolean) { this._cvaDisabled.set(d); }\n\n protected _touch(): void {\n this._onTouched();\n this._reveal.touched.set(true);\n }\n\n protected onChange(event: Event) {\n const el = event.target as HTMLInputElement;\n this.accept$(Array.from(el.files ?? []), el);\n // Visible field keeps its selection; picker-only mode resets so the same file can be chosen again.\n if (!this.showField()) el.value = '';\n }\n\n // ── Drag and drop ──────────────────────────────────────────────\n protected onDragOver(event: DragEvent): void {\n if (!this.dropzone() || this.disabled() || this.loading()) return;\n event.preventDefault();\n if (event.dataTransfer) event.dataTransfer.dropEffect = 'copy';\n this._dragging.set(true);\n }\n\n protected onDragLeave(event: DragEvent): void {\n if (!this.dropzone()) return;\n // Ignore leaves into a child of the field\n const next = event.relatedTarget as Node | null;\n if (next && (event.currentTarget as Node).contains(next)) return;\n this._dragging.set(false);\n }\n\n protected onDrop(event: DragEvent): void {\n if (!this.dropzone()) return;\n event.preventDefault();\n this._dragging.set(false);\n if (this.disabled() || this.loading()) return;\n const dropped = Array.from(event.dataTransfer?.files ?? []);\n if (dropped.length === 0) return;\n this.accept$(this.multiple() ? dropped : dropped.slice(0, 1), this.fileEl()?.nativeElement ?? null);\n }\n\n /** Keeps the first-message string (the `invalid` state) and the full list in step. */\n private setRejections(list: FileRejection[]): void {\n this._rejected.set(list);\n this._rejection.set(list[0]?.message ?? '');\n }\n\n // ── Validating the chosen files ────────────────────────────────\n private rejectionFor(file: File): FileRejection | null {\n const accept = this.accept();\n if (this.enforceAccept() && accept && !fileMatchesAccept(file, accept)) {\n return { file, reason: 'type', message: this.typeMessage() || this.labels.t('fileInput.onlyTypesAllowed', { types: acceptLabel(accept) }) };\n }\n if (file.size === 0 && this.rejectEmpty()) {\n return { file, reason: 'empty', message: this.emptyMessage() || this.labels.t('fileInput.empty') };\n }\n const max = this.maxSize();\n if (max != null && file.size > max) {\n return { file, reason: 'size', message: this.sizeMessage() || this.labels.t('fileInput.tooBig', { size: formatFileSize(max) }) };\n }\n const min = this.minSize();\n if (min != null && file.size < min) {\n return { file, reason: 'small', message: this.minSizeMessage() || this.labels.t('fileInput.tooSmall', { size: formatFileSize(min) }) };\n }\n return null;\n }\n\n /** Applies picked / dropped files: refused ones raise the message and `fileRejected`, accepted ones become the value. */\n private accept$(files: File[], native: HTMLInputElement | null): void {\n if (files.length === 0) { // dialog cancelled: the selection is emptied, nothing is emitted\n this._files.set([]);\n this.setRejections([]);\n this._onChange(this.multiple() ? [] : null);\n this._onTouched();\n return;\n }\n const ok: File[] = [];\n const rejected: FileRejection[] = [];\n for (const f of files) {\n const r = this.rejectionFor(f);\n if (r) rejected.push(r); else ok.push(f);\n }\n this.setRejections(rejected);\n rejected.forEach(r => this.fileRejected.emit(r));\n if (rejected.length > 0) this.filesRejected.emit(rejected);\n if (this.toastOnReject() && rejected.length > 0) {\n this._toast.error(rejected.map(r => this.labels.t('fileInput.notAdded', { name: r.file.name, message: r.message })).join(' '));\n }\n if (ok.length === 0) {\n // Nothing usable was chosen: empty the picker so a refused file's name does not linger\n if (native) native.value = '';\n this._files.set([]);\n this._onChange(this.multiple() ? [] : null);\n this._touch();\n return;\n }\n this._files.set(ok);\n this._onChange(this.multiple() ? ok : ok[0]);\n this._touch();\n this.filesSelected.emit(ok);\n }\n}\n"],"mappings":";;;;;;AAqBA,SAAgB,eAAe,OAAa;CAC1C,IAAI,QAAQ,MAAM,OAAO,GAAG,MAAK;CACjC,IAAI,QAAQ,SAAa,OAAO,GAAG,KAAK,MAAM,QAAQ,IAAI,EAAC;CAC3D,MAAM,KAAK,QAAS;CACpB,MAAM,OAAO,MAAc,eAAe,OAAO,EAAE,QAAQ,CAAC,CAAC,GAAG,SAAQ,GAAI,EAAE,uBAAuB,EAAC,CAAE;CACxG,OAAO,KAAK,OAAO,GAAG,IAAI,EAAE,EAAC,OAAQ,GAAG,IAAI,KAAK,IAAI,EAAC;AACxD;AAMA,SAAgB,qBAAqB,OAAa;CAChD,IAAI,QAAQ,SAAa,OAAO,GAAG,KAAK,MAAM,QAAQ,IAAI,EAAC;CAC3D,MAAM,KAAK,QAAQ,QAAS,QAAO,CAAO,QAAQ,CAAC,CAAC;CACpD,OAAO,GAAG,eAAe,IAAI,SAAQ,GAAI;EAAE,uBAAuB;EAAG,uBAAuB;CAAC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A;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,eAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,eAAA;EAAA,CAAA;EAAA,cAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,cAAA;EAAA,CAAA;EAAA,eAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,eAAA;EAAA,CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,aAAA;EAAA,CAAA;EAAA,eAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,eAAA;EAAA,CAAA;EAAA,gBAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,UAAQ,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
1
+ {"version":3,"file":"forgeroute-ui-file-input.mjs","names":[],"sources":["../../../projects/forgeroute-ui/file-input/src/lib/file-input/file-input.component.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, DestroyRef, effect, forwardRef, inject, input, output, signal, computed, viewChild, ElementRef } from '@angular/core';\nimport { AbstractControl, ControlValueAccessor, NG_VALIDATORS, NG_VALUE_ACCESSOR, ValidationErrors, Validator } from '@angular/forms';\nimport { ImagePreviewComponent } from '@forgeroute/ui/image-preview';\nimport { SkeletonComponent } from '@forgeroute/ui/skeleton';\nimport { ToastService } from '@forgeroute/ui/core';\nimport { FieldIssue, UiFieldValidity, createFieldReveal, issueToErrors, mergeDescribedBy, requiredIssue } from '@forgeroute/ui/core';\nimport { UiLabelsService, uiLocale, uiText } from '@forgeroute/ui/core';\nimport { uiFormatNumber } from '@forgeroute/ui/core';\n\n/** Why a chosen file was refused. */\n/** 'type' = not an accepted type, 'size' = over `maxSize`, 'empty' = a 0-byte file (`rejectEmpty`), 'small' = under `minSize`. */\nexport type FileRejectReason = 'type' | 'size' | 'empty' | 'small';\n\n/** A refused file with the message the field shows (also emitted by `(fileRejected)`). */\nexport interface FileRejection {\n file: File;\n reason: FileRejectReason;\n message: string;\n}\n\n/** \"1.5 MB\", \"820 KB\", \"12 B\" (binary units, one decimal for MB and above). */\nexport function formatFileSize(bytes: number): string {\n if (bytes < 1024) return `${bytes} B`;\n if (bytes < 1024 * 1024) return `${Math.round(bytes / 1024)} KB`;\n const mb = bytes / (1024 * 1024);\n const one = (n: number) => uiFormatNumber(Number(n.toFixed(1)), uiLocale(), { maximumFractionDigits: 1 }); // rounded like toFixed(1), written with the locale's decimal mark\n return mb < 1024 ? `${one(mb)} MB` : `${one(mb / 1024)} GB`;\n}\n\n/**\n * The size caption of an attachment chip: \"820 KB\" below 1 MB (rounded to whole KB), else \"1.5 MB\" / \"1.0 MB\" (always one decimal) written with the active\n * locale's decimal mark (\"1,5 MB\" in a locale that uses a comma). English output is exactly `${n.toFixed(1)} MB` as before.\n */\nexport function formatAttachmentSize(bytes: number): string {\n if (bytes < 1024 * 1024) return `${Math.round(bytes / 1024)} KB`;\n const mb = Number((bytes / (1024 * 1024)).toFixed(1));\n return `${uiFormatNumber(mb, uiLocale(), { minimumFractionDigits: 1, maximumFractionDigits: 1 })} MB`;\n}\n\n/** True when `file` matches one token of a native `accept` string (`.pdf`, `image/png`, `image/*`). Empty `accept` accepts everything. */\nexport function fileMatchesAccept(file: File, accept: string): boolean {\n const tokens = accept.split(',').map(t => t.trim().toLowerCase()).filter(Boolean);\n if (tokens.length === 0) return true;\n const name = file.name.toLowerCase();\n const type = (file.type || '').toLowerCase();\n return tokens.some(t => {\n if (t.startsWith('.')) return name.endsWith(t);\n if (t.endsWith('/*')) return !!type && type.startsWith(t.slice(0, -1));\n return !!type && type === t;\n });\n}\n\n/** \"PDF\", \"PNG, JPEG and WEBP\" from an `accept` string, for the default type message. */\nexport function acceptLabel(accept: string): string {\n const names = accept.split(',').map(t => t.trim()).filter(Boolean).map(t => {\n if (t.startsWith('.')) return t.slice(1).toUpperCase();\n if (t.endsWith('/*')) {\n const kind = t.slice(0, -2);\n return kind === 'image' ? uiText('fileInput.word.image') : kind === 'video' ? uiText('fileInput.word.video') : kind === 'audio' ? uiText('fileInput.word.audio') : kind;\n }\n const sub = t.split('/')[1] ?? t;\n return sub.toUpperCase();\n });\n const unique = [...new Set(names)];\n if (unique.length <= 1) return unique[0] ?? '';\n const last = unique[unique.length - 1];\n // A last item that starts with the sound \"i\" (i-, hi- but not hie-: \"imagen\", \"icono\", \"hielo\" is not one) takes the joiner \"e\" in Spanish (\"video e imagen\").\n const iSound = /^(?:i|hi(?!e))/i.test(last.normalize('NFD').replace(/[\\u0300-\\u036f]/g, ''));\n return uiText(iSound ? 'common.listAndBeforeI' : 'common.listAnd', { list: unique.slice(0, -1).join(', '), last });\n}\n\n/**\n * File picker styled like the other `ui-*` inputs (label, hint, required marker, error, disabled).\n * Value (ngModel / forms) is `File | null`, or `File[]` when `multiple` is set.\n *\n * Set `[showField]=\"false\"` for a picker with no visible field and call `open()` from the host\n * (e.g. an \"Attach document\" menu action). `(filesSelected)` fires in both modes.\n *\n * Built in (all opt-in, nothing changes unless an input is set):\n * - `clearable`: a Remove button next to the chosen file; `(fileRemoved)` fires after it clears the selection.\n * - `accept` is enforced on picked AND dropped files (`enforceAccept`, on by default), `maxSize` (bytes) refuses bigger\n * files, `rejectEmpty` refuses a 0-byte file (`emptyMessage`) and `minSize` (bytes) refuses smaller ones (`minSizeMessage`). A refused file is never added to the value: the field shows the message (`typeMessage` / `sizeMessage`\n * override the wording, also in picker-only mode), and `(fileRejected)` emits `{ file, reason, message }`.\n * - `required` is a real rule: Angular `Validator` + `UiFieldValidity` (`invalid`, `errorMessage`, `invalidChange`,\n * `showErrors`), like the other inputs. The message (built-in and host `error`) shows only after the user used the field; `[showErrors]=\"true\"` also reveals it. A refused file is always shown at once.\n * - `dropzone`: the field accepts files dropped on it.\n * - `showDetails`: file size after the name; `preview`: a thumbnail of a chosen image.\n * - `loading` (+ `loadingText`): a `ui-skeleton` replaces the file name while the host works on the file (scanning, uploading).\n */\n@Component({\n selector: 'ui-file-input',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [ImagePreviewComponent, SkeletonComponent],\n providers: [{\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => FileInputComponent),\n multi: true,\n }, {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => FileInputComponent),\n multi: true,\n }, {\n provide: UiFieldValidity,\n useExisting: forwardRef(() => FileInputComponent),\n }],\n template: `\n <div class=\"fi-field\" [class.fi-error]=\"!!_shownError()\" [class.fi-disabled]=\"disabled()\" [class.fi-hidden]=\"!showField()\" [class.fi-drag]=\"_dragging()\">\n @if (showField() && label()) {\n <label class=\"fi-label\" [for]=\"_inputId\">\n {{ label() }}\n @if (required()) { <span class=\"fi-required\" aria-hidden=\"true\">*</span> }\n </label>\n }\n <input\n #fileEl\n type=\"file\"\n class=\"fi-native\"\n [id]=\"_inputId\"\n [attr.accept]=\"accept() || null\"\n [multiple]=\"multiple()\"\n [disabled]=\"disabled()\"\n [attr.required]=\"required() || null\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-invalid]=\"_shownError() ? 'true' : null\"\n [attr.aria-describedby]=\"_describedBy()\"\n [attr.tabindex]=\"showField() ? -1 : null\"\n (change)=\"onChange($event)\"\n (blur)=\"_onTouched()\" />\n @if (showField()) {\n <div class=\"fi-row\">\n <button type=\"button\" class=\"fi-control\" [disabled]=\"disabled() || loading()\" [attr.aria-busy]=\"loading() ? 'true' : null\"\n [attr.aria-describedby]=\"_describedBy()\"\n (click)=\"open()\" (blur)=\"_touch()\"\n (dragenter)=\"onDragOver($event)\" (dragover)=\"onDragOver($event)\" (dragleave)=\"onDragLeave($event)\" (drop)=\"onDrop($event)\">\n @if (_previewUrl(); as src) {\n <ui-image-preview [src]=\"src\" alt=\"\" shape=\"rounded\" size=\"sm\" placeholder=\"image\" />\n }\n @if (loading()) {\n <span class=\"fi-name fi-loading\"><ui-skeleton [height]=\"14\" width=\"60%\" [radius]=\"4\" /></span>\n <span class=\"fi-sr\" role=\"status\">{{ loadingText() || labels.t('fileInput.processing') }}</span>\n } @else {\n <span class=\"fi-name\" [class.fi-placeholder]=\"!summary()\">{{ summary() || placeholder() }}</span>\n }\n <span class=\"fi-browse\">{{ buttonLabel() }}</span>\n </button>\n @if (clearable() && _files().length > 0 && !loading() && !disabled()) {\n <button type=\"button\" class=\"fi-remove\" [attr.aria-label]=\"removeLabel() + (summary() ? ' ' + summary() : '')\" (click)=\"remove()\">{{ removeLabel() }}</button>\n }\n </div>\n }\n @if (_shownError()) {\n @if (_showRejectList()) {\n <ul class=\"fi-desc fi-desc-error fi-reject-list\" [id]=\"_inputId + '-desc'\" role=\"alert\">\n @for (line of rejectionLines(); track $index) { <li>{{ line }}</li> }\n </ul>\n } @else {\n <p class=\"fi-desc fi-desc-error\" [id]=\"_inputId + '-desc'\" role=\"alert\">{{ _shownError() }}</p>\n }\n } @else if (hint()) {\n <p class=\"fi-desc\" [id]=\"_inputId + '-hint'\">{{ hint() }}</p>\n }\n </div>\n `,\n styles: [`\n :host { display: block; }\n :host(:has(.fi-hidden)) { display: contents; }\n\n .fi-field { display: flex; flex-direction: column; gap: 6px; }\n .fi-hidden { display: contents; }\n\n .fi-label { font-size: 0.8125rem; font-weight: 600; color: #374151; line-height: 1; }\n .fi-required { color: #dc2626; margin-left: 2px; }\n\n /* Native control stays in the DOM (forms, a11y, programmatic click) but is visually hidden. */\n .fi-native {\n position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;\n overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;\n }\n\n .fi-row { display: flex; align-items: stretch; gap: 8px; }\n .fi-control {\n display: flex; align-items: center; justify-content: space-between; gap: 12px;\n flex: 1 1 auto; min-width: 0; box-sizing: border-box; text-align: left;\n padding: 9px 12px; font-size: 0.875rem; font-family: inherit;\n color: #1e293b; background: #fff;\n border: 1px solid #7c8ba1; border-radius: 8px;\n outline: none; cursor: pointer;\n transition: border-color 0.15s, box-shadow 0.15s;\n &:focus-visible {\n border-color: #3b82f6;\n box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);\n }\n }\n .fi-control:has(ui-image-preview) { padding-top: 6px; padding-bottom: 6px; }\n .fi-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n .fi-loading { overflow: visible; }\n .fi-placeholder { color: #64748b; }\n .fi-browse {\n flex-shrink: 0; font-size: 0.75rem; font-weight: 600; color: #374151;\n padding: 3px 10px; border: 1px solid #e2e8f0; border-radius: 6px; background: #f8fafc;\n }\n .fi-remove {\n flex-shrink: 0; align-self: center; font-family: inherit; font-size: 0.75rem; font-weight: 600; color: #b91c1c;\n padding: 6px 10px; border: 1px solid #fecaca; border-radius: 6px; background: #fff; cursor: pointer;\n -webkit-appearance: none; appearance: none;\n &:hover { background: #fef2f2; }\n &:focus-visible { outline: 2px solid #ef4444; outline-offset: 2px; }\n }\n .fi-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }\n\n .fi-error .fi-control {\n border-color: #ef4444;\n &:focus-visible { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12); }\n }\n .fi-drag .fi-control { border-color: #3b82f6; border-style: dashed; background: #eff6ff; }\n .fi-disabled .fi-control { opacity: 0.5; cursor: not-allowed; }\n\n .fi-desc { margin: -6px 0 0; font-size: 0.75rem; line-height: 1.4; color: #64748b; }\n .fi-desc-error { color: #dc2626; }\n .fi-reject-list { margin: 4px 0 0; padding-left: 18px; }\n .fi-reject-list li { margin: 0 0 2px; }\n\n @media (max-width: 480px) { .fi-control { font-size: 1rem; } .fi-remove { padding: 10px 12px; } }\n @media (pointer: coarse) { .fi-control, .fi-remove { min-height: 44px; } }\n `],\n})\nexport class FileInputComponent implements ControlValueAccessor, Validator, UiFieldValidity {\n protected readonly labels = inject(UiLabelsService);\n readonly label = input('');\n /** Accessible name for a field with no visible label. */\n readonly ariaLabel = input('');\n readonly placeholderInput = input<string | null>(null, { alias: 'placeholder' });\n readonly placeholder = computed(() => this.placeholderInput() ?? this.labels.t('fileInput.placeholder'));\n readonly buttonLabelInput = input<string | null>(null, { alias: 'buttonLabel' });\n readonly buttonLabel = computed(() => this.buttonLabelInput() ?? this.labels.t('fileInput.buttonLabel'));\n /** Native `accept` string, e.g. \".pdf,.png\". Also enforced on picked and dropped files unless `enforceAccept` is false. */\n readonly accept = input('');\n readonly multiple = input(false);\n /** A file must be chosen (a real rule: Validator + UiFieldValidity, message shown only after the user used the field; `showErrors=\"true\"` reveals it at once). */\n readonly required = input(false);\n readonly hint = input('');\n /** Host-provided error message (wins over the built-in ones). Shown under a visible field only. */\n readonly error = input('');\n /** false = no visible field; open the picker from the host with `open()`. */\n readonly showField = input(true);\n /** The host's \"tried to submit\" flag (e.g. after a failed Save click). `true` reveals the \"required\" message before the user used the field. */\n readonly showErrors = input(false);\n\n /**\n * Also report every refused file (wrong type, too big, too small, empty) with a `ToastService` error toast that names the file and\n * the reason, e.g. `\"scan.exe\" was not added. Only PDF files are allowed.` Meant for the picker-only mode (`[showField]=\"false\"`),\n * where no field is visible to show the message; it works with a visible field too. Several refused files make ONE toast listing each.\n * Default `false`: nothing is toasted (the field message and `(fileRejected)` are unchanged). Needs a `ui-toast` outlet like any toast.\n */\n readonly toastOnReject = input(false);\n /**\n * When several files are refused in one pick or drop, show EVERY one inside the field as a list (each line\n * `\"name\" was not added. <reason>`) instead of only the first refusal message. No toast is raised. The same list is available to the\n * host through `rejections` and `(filesRejected)`. Default `false`: the field shows the first refusal message only (unchanged).\n */\n readonly listRejections = input(false);\n /** Id(s) of host elements that describe the picker (space-separated), added after the field's own error text, like `ui-text-input`'s `ariaDescribedBy`. Empty: nothing is added. */\n readonly ariaDescribedBy = input('');\n /** Show a Remove button next to the chosen file. */\n readonly clearable = input(false);\n readonly removeLabelInput = input<string | null>(null, { alias: 'removeLabel' });\n readonly removeLabel = computed(() => this.removeLabelInput() ?? this.labels.t('fileInput.removeLabel'));\n /** Largest allowed file in bytes; a bigger file is refused. null = no limit. */\n readonly maxSize = input<number | null>(null);\n /** Refuse files that do not match `accept` (picked or dropped). */\n readonly enforceAccept = input(true);\n /** Replaces the built-in \"Only PDF files are allowed.\" message. */\n readonly typeMessage = input('');\n /** Replaces the built-in \"The file must be 5 MB or smaller.\" message. */\n readonly sizeMessage = input('');\n /** Refuse a file with no content (0 bytes). Off by default. */\n readonly rejectEmpty = input(false);\n /** Replaces the built-in \"The file is empty.\" message. */\n readonly emptyMessage = input('');\n /** Smallest allowed file in bytes; a smaller (non-empty) file is refused. null = no minimum. */\n readonly minSize = input<number | null>(null);\n /** Replaces the built-in \"The file must be at least 10 KB.\" message. */\n readonly minSizeMessage = input('');\n /** The field accepts files dropped on it. */\n readonly dropzone = input(false);\n /** Show the file size after the name. */\n readonly showDetails = input(false);\n /** Show a thumbnail when the chosen file is an image. */\n readonly preview = input(false);\n /** The host is working on the file (scanning, uploading): a skeleton replaces the name and Browse / Remove are disabled. */\n readonly loading = input(false);\n /** Screen-reader text while `loading` (default \"Processing…\"). */\n readonly loadingText = input('');\n\n /** Emits the chosen (accepted) files (one or many) each time the user picks or drops. */\n readonly filesSelected = output<File[]>();\n /** A picked or dropped file was refused (wrong type or too big). */\n readonly fileRejected = output<FileRejection>();\n /** Every file refused by ONE pick or drop, in one event (fires only when at least one file was refused; `(fileRejected)` still fires per file). */\n readonly filesRejected = output<FileRejection[]>();\n /** The Remove button cleared the selection. */\n readonly fileRemoved = output<void>();\n /** Emits whenever the field becomes invalid / valid. */\n readonly invalidChange = output<boolean>();\n\n readonly _disabledInput = input(false, { alias: 'disabled' });\n private readonly _cvaDisabled = signal(false);\n protected readonly disabled = computed(() => this._disabledInput() || this._cvaDisabled());\n\n protected readonly _files = signal<File[]>([]);\n protected readonly _inputId = `fi-${Math.random().toString(36).slice(2, 8)}`;\n private readonly fileEl = viewChild<ElementRef<HTMLInputElement>>('fileEl');\n protected readonly _dragging = signal(false);\n /** Message of the last refused file ('' when the last pick was fine); shown in every mode. */\n private readonly _toast = inject(ToastService);\n private readonly _rejection = signal('');\n /** `aria-describedby` of the native input and the drop zone: the shown error text, then the host's ids. Absent when neither exists. */\n protected readonly _describedBy = computed(() => mergeDescribedBy(this._shownError() ? this._inputId + '-desc' : (this.hint() ? this._inputId + '-hint' : ''), this.ariaDescribedBy()));\n private readonly _rejected = signal<FileRejection[]>([]);\n /** The files refused by the last pick or drop (empty when the last pick was fine, after Remove / clear, and when files are set from the form). */\n readonly rejections = this._rejected.asReadonly();\n /** One line per refused file: `\"name\" was not added. <reason>`. */\n readonly rejectionLines = computed(() => this._rejected().map(r => this.labels.t('fileInput.notAdded', { name: r.file.name, message: r.message })));\n /** The list replaces the single message only while it is the refusal that is shown (a host `[error]` on a visible field wins). */\n protected readonly _showRejectList = computed(() =>\n this.listRejections() && this._rejected().length > 0 && !(this.showField() && this.error()));\n private readonly _reveal = createFieldReveal(this.showErrors);\n private readonly _issue = computed((): FieldIssue | null =>\n this.disabled() || !this.required() || this._files().length > 0 ? null : requiredIssue(this.label() || this.labels.t('common.file')));\n /** True while a required field is empty, the last pick was refused, or the host passed an `[error]`. */\n readonly invalid = computed(() => !!this.error() || !!this._rejection() || !!this._issue());\n /** Message of the first broken built-in rule ('' when valid), shown or not. */\n readonly errorMessage = computed(() =>\n (this.listRejections() && this._rejected().length > 0 ? this.rejectionLines().join(' ') : this._rejection()) || this._issue()?.message || '');\n /** What the field shows: the host error (visible field only), a refused file, or the revealed built-in message. */\n protected readonly _shownError = computed(() =>\n (this.listRejections() && this._rejected().length > 0 && this.showField() ? this.error() : '') || this._rejection() || (this._reveal.revealed() ? ((this.showField() ? this.error() : '') || (this._issue()?.message ?? '')) : ''));\n\n protected readonly summary = computed(() => {\n const f = this._files();\n if (f.length === 0) return '';\n const size = this.showDetails() ? ` · ${formatFileSize(f.reduce((n, x) => n + x.size, 0))}` : '';\n return (f.length === 1 ? f[0].name : this.labels.t('fileInput.filesSelected', { count: f.length })) + size;\n });\n\n /** Object URL of the chosen image (single file) while `preview` is on. */\n protected readonly _previewUrl = signal<string | null>(null);\n private _urlToRevoke: string | null = null;\n private _onValidatorChange = () => {};\n\n protected _onChange = (_: File | File[] | null) => {};\n protected _onTouched = () => {};\n\n constructor() {\n effect(() => { this.invalidChange.emit(this.invalid()); });\n effect(() => {\n const files = this._files();\n const want = this.preview() && files.length === 1 && (files[0].type || '').startsWith('image/') ? files[0] : null;\n this.revokePreview();\n if (want) {\n this._urlToRevoke = URL.createObjectURL(want);\n this._previewUrl.set(this._urlToRevoke);\n } else {\n this._previewUrl.set(null);\n }\n });\n inject(DestroyRef).onDestroy(() => this.revokePreview());\n }\n\n private revokePreview(): void {\n if (this._urlToRevoke) { URL.revokeObjectURL(this._urlToRevoke); this._urlToRevoke = null; }\n }\n\n /** Re-run the form control's validation when a rule input changes. */\n ngOnChanges() { this._onValidatorChange(); }\n\n validate(_control: AbstractControl): ValidationErrors | null {\n return issueToErrors(this._issue());\n }\n registerOnValidatorChange(fn: () => void) { this._onValidatorChange = fn; }\n\n /** Opens the native file dialog. */\n open(): void {\n if (!this.disabled() && !this.loading()) this.fileEl()?.nativeElement.click();\n }\n\n /** Clears the selection (and the native input, so the same file can be picked again) and any \"refused file\" message. */\n clear(): void {\n const el = this.fileEl()?.nativeElement;\n if (el) el.value = '';\n this._files.set([]);\n this.setRejections([]);\n this._onChange(this.multiple() ? [] : null);\n }\n\n /** The Remove button: clears, then tells the host. */\n protected remove(): void {\n this.clear();\n this._touch();\n this.fileRemoved.emit();\n }\n\n writeValue(val: File | File[] | null) {\n const files = Array.isArray(val) ? val : val ? [val] : [];\n this._files.set(files);\n if (files.length > 0) this.setRejections([]);\n const el = this.fileEl()?.nativeElement;\n if (files.length === 0 && el) el.value = '';\n }\n registerOnChange(fn: (v: File | File[] | null) => void) { this._onChange = fn; }\n registerOnTouched(fn: () => void) { this._onTouched = fn; }\n setDisabledState(d: boolean) { this._cvaDisabled.set(d); }\n\n protected _touch(): void {\n this._onTouched();\n this._reveal.touched.set(true);\n }\n\n protected onChange(event: Event) {\n const el = event.target as HTMLInputElement;\n this.accept$(Array.from(el.files ?? []), el);\n // Visible field keeps its selection; picker-only mode resets so the same file can be chosen again.\n if (!this.showField()) el.value = '';\n }\n\n // ── Drag and drop ──────────────────────────────────────────────\n protected onDragOver(event: DragEvent): void {\n if (!this.dropzone() || this.disabled() || this.loading()) return;\n event.preventDefault();\n if (event.dataTransfer) event.dataTransfer.dropEffect = 'copy';\n this._dragging.set(true);\n }\n\n protected onDragLeave(event: DragEvent): void {\n if (!this.dropzone()) return;\n // Ignore leaves into a child of the field\n const next = event.relatedTarget as Node | null;\n if (next && (event.currentTarget as Node).contains(next)) return;\n this._dragging.set(false);\n }\n\n protected onDrop(event: DragEvent): void {\n if (!this.dropzone()) return;\n event.preventDefault();\n this._dragging.set(false);\n if (this.disabled() || this.loading()) return;\n const dropped = Array.from(event.dataTransfer?.files ?? []);\n if (dropped.length === 0) return;\n this.accept$(this.multiple() ? dropped : dropped.slice(0, 1), this.fileEl()?.nativeElement ?? null);\n }\n\n /** Keeps the first-message string (the `invalid` state) and the full list in step. */\n private setRejections(list: FileRejection[]): void {\n this._rejected.set(list);\n this._rejection.set(list[0]?.message ?? '');\n }\n\n // ── Validating the chosen files ────────────────────────────────\n private rejectionFor(file: File): FileRejection | null {\n const accept = this.accept();\n if (this.enforceAccept() && accept && !fileMatchesAccept(file, accept)) {\n return { file, reason: 'type', message: this.typeMessage() || this.labels.t('fileInput.onlyTypesAllowed', { types: acceptLabel(accept) }) };\n }\n if (file.size === 0 && this.rejectEmpty()) {\n return { file, reason: 'empty', message: this.emptyMessage() || this.labels.t('fileInput.empty') };\n }\n const max = this.maxSize();\n if (max != null && file.size > max) {\n return { file, reason: 'size', message: this.sizeMessage() || this.labels.t('fileInput.tooBig', { size: formatFileSize(max) }) };\n }\n const min = this.minSize();\n if (min != null && file.size < min) {\n return { file, reason: 'small', message: this.minSizeMessage() || this.labels.t('fileInput.tooSmall', { size: formatFileSize(min) }) };\n }\n return null;\n }\n\n /** Applies picked / dropped files: refused ones raise the message and `fileRejected`, accepted ones become the value. */\n private accept$(files: File[], native: HTMLInputElement | null): void {\n if (files.length === 0) { // dialog cancelled: the selection is emptied, nothing is emitted\n this._files.set([]);\n this.setRejections([]);\n this._onChange(this.multiple() ? [] : null);\n this._onTouched();\n return;\n }\n const ok: File[] = [];\n const rejected: FileRejection[] = [];\n for (const f of files) {\n const r = this.rejectionFor(f);\n if (r) rejected.push(r); else ok.push(f);\n }\n this.setRejections(rejected);\n rejected.forEach(r => this.fileRejected.emit(r));\n if (rejected.length > 0) this.filesRejected.emit(rejected);\n if (this.toastOnReject() && rejected.length > 0) {\n this._toast.error(rejected.map(r => this.labels.t('fileInput.notAdded', { name: r.file.name, message: r.message })).join(' '));\n }\n if (ok.length === 0) {\n // Nothing usable was chosen: empty the picker so a refused file's name does not linger\n if (native) native.value = '';\n this._files.set([]);\n this._onChange(this.multiple() ? [] : null);\n this._touch();\n return;\n }\n this._files.set(ok);\n this._onChange(this.multiple() ? ok : ok[0]);\n this._touch();\n this.filesSelected.emit(ok);\n }\n}\n"],"mappings":";;;;;;AAqBA,SAAgB,eAAe,OAAa;CAC1C,IAAI,QAAQ,MAAM,OAAO,GAAG,MAAK;CACjC,IAAI,QAAQ,SAAa,OAAO,GAAG,KAAK,MAAM,QAAQ,IAAI,EAAC;CAC3D,MAAM,KAAK,QAAS;CACpB,MAAM,OAAO,MAAc,eAAe,OAAO,EAAE,QAAQ,CAAC,CAAC,GAAG,SAAQ,GAAI,EAAE,uBAAuB,EAAC,CAAE;CACxG,OAAO,KAAK,OAAO,GAAG,IAAI,EAAE,EAAC,OAAQ,GAAG,IAAI,KAAK,IAAI,EAAC;AACxD;AAMA,SAAgB,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A,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,eAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,eAAA;EAAA,CAAA;EAAA,cAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,cAAA;EAAA,CAAA;EAAA,eAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,eAAA;EAAA,CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,aAAA;EAAA,CAAA;EAAA,eAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,eAAA;EAAA,CAAA;EAAA,gBAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,UAAQ,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
@@ -251,7 +251,7 @@ var IconPickerComponent = class IconPickerComponent {
251
251
  </fieldset>
252
252
  `,
253
253
  isInline: true,
254
- styles: [":host{display:block}.ip-field{display:flex;flex-direction:column;gap:6px;border:0;margin:0;padding:0;min-width:0}.ip-label{padding:0;margin-bottom:6px;font-size:.8125rem;font-weight:600;color:#374151;line-height:1}.ip-required{color:#dc2626;margin-left:2px}.ip-options{display:flex;flex-wrap:wrap;gap:8px;min-width:0}.ip-options.ip-grid{display:grid;grid-template-columns:repeat(var(--ip-cols),max-content)}.ip-option{position:relative;display:inline-flex;cursor:pointer}.ip-input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:inherit}.ip-swatch{display:inline-flex;align-items:center;justify-content:center;position:relative;width:36px;height:36px;border-radius:8px;box-sizing:border-box;background:#fff;color:#334155;border:1px solid #cbd5e1;box-shadow:0 0 0 0 transparent;transition:box-shadow .12s}.ip-option:hover .ip-swatch{border-color:#64748b}.ip-input:focus-visible+.ip-swatch{outline:2px solid #3b82f6;outline-offset:3px}.ip-option.ip-selected .ip-swatch{background:#1e293b;color:#fff;border-color:#1e293b}.ip-check{position:absolute;right:2px;bottom:2px;padding:1px;border-radius:50%;background:#fff;color:#1e293b;border:1px solid #1e293b;box-sizing:content-box}.ip-option-disabled{cursor:not-allowed;opacity:.45}.ip-error .ip-option .ip-swatch{border-color:#dc2626}.ip-desc{margin:0;font-size:.75rem;line-height:1.4;color:#64748b;overflow-wrap:anywhere}.ip-desc-error{color:#dc2626}@media(pointer:coarse),(max-width:480px){.ip-options{gap:4px}.ip-option{min-width:44px;min-height:44px;align-items:center;justify-content:center}.ip-options.ip-grid{grid-template-columns:repeat(auto-fill,44px)}}\n"],
254
+ styles: [":host{display:block}.ip-field{display:flex;flex-direction:column;gap:6px;border:0;margin:0;padding:0;min-width:0}.ip-label{padding:0;margin-bottom:6px;font-size:.8125rem;font-weight:600;color:#374151;line-height:1}.ip-required{color:#dc2626;margin-left:2px}.ip-options{display:flex;flex-wrap:wrap;gap:8px;min-width:0}.ip-options.ip-grid{display:grid;grid-template-columns:repeat(var(--ip-cols),max-content)}.ip-option{position:relative;display:inline-flex;cursor:pointer}.ip-input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:inherit}.ip-swatch{display:inline-flex;align-items:center;justify-content:center;position:relative;width:36px;height:36px;border-radius:8px;box-sizing:border-box;background:#fff;color:#334155;border:1px solid #cbd5e1;box-shadow:0 0 0 0 transparent;transition:box-shadow .12s}.ip-option:hover .ip-swatch{border-color:#64748b}.ip-input:focus-visible+.ip-swatch{outline:2px solid #3b82f6;outline-offset:3px}.ip-option.ip-selected .ip-swatch{background:#1e293b;color:#fff;border-color:#1e293b}.ip-check{position:absolute;right:2px;bottom:2px;padding:1px;border-radius:50%;background:#fff;color:#1e293b;border:1px solid #1e293b;box-sizing:content-box}.ip-option-disabled{cursor:not-allowed;opacity:.45}.ip-error .ip-option .ip-swatch{border-color:#dc2626}.ip-desc{margin:-6px 0 0;font-size:.75rem;line-height:1.4;color:#64748b;overflow-wrap:anywhere}.ip-desc-error{color:#dc2626}@media(pointer:coarse),(max-width:480px){.ip-options{gap:4px}.ip-option{min-width:44px;min-height:44px;align-items:center;justify-content:center}.ip-options.ip-grid{grid-template-columns:repeat(auto-fill,44px)}}\n"],
255
255
  changeDetection: i0.ChangeDetectionStrategy.OnPush
256
256
  });
257
257
  }
@@ -332,7 +332,7 @@ i0.ɵɵngDeclareClassMetadata({
332
332
  }
333
333
  </fieldset>
334
334
  `,
335
- styles: [":host{display:block}.ip-field{display:flex;flex-direction:column;gap:6px;border:0;margin:0;padding:0;min-width:0}.ip-label{padding:0;margin-bottom:6px;font-size:.8125rem;font-weight:600;color:#374151;line-height:1}.ip-required{color:#dc2626;margin-left:2px}.ip-options{display:flex;flex-wrap:wrap;gap:8px;min-width:0}.ip-options.ip-grid{display:grid;grid-template-columns:repeat(var(--ip-cols),max-content)}.ip-option{position:relative;display:inline-flex;cursor:pointer}.ip-input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:inherit}.ip-swatch{display:inline-flex;align-items:center;justify-content:center;position:relative;width:36px;height:36px;border-radius:8px;box-sizing:border-box;background:#fff;color:#334155;border:1px solid #cbd5e1;box-shadow:0 0 0 0 transparent;transition:box-shadow .12s}.ip-option:hover .ip-swatch{border-color:#64748b}.ip-input:focus-visible+.ip-swatch{outline:2px solid #3b82f6;outline-offset:3px}.ip-option.ip-selected .ip-swatch{background:#1e293b;color:#fff;border-color:#1e293b}.ip-check{position:absolute;right:2px;bottom:2px;padding:1px;border-radius:50%;background:#fff;color:#1e293b;border:1px solid #1e293b;box-sizing:content-box}.ip-option-disabled{cursor:not-allowed;opacity:.45}.ip-error .ip-option .ip-swatch{border-color:#dc2626}.ip-desc{margin:0;font-size:.75rem;line-height:1.4;color:#64748b;overflow-wrap:anywhere}.ip-desc-error{color:#dc2626}@media(pointer:coarse),(max-width:480px){.ip-options{gap:4px}.ip-option{min-width:44px;min-height:44px;align-items:center;justify-content:center}.ip-options.ip-grid{grid-template-columns:repeat(auto-fill,44px)}}\n"]
335
+ styles: [":host{display:block}.ip-field{display:flex;flex-direction:column;gap:6px;border:0;margin:0;padding:0;min-width:0}.ip-label{padding:0;margin-bottom:6px;font-size:.8125rem;font-weight:600;color:#374151;line-height:1}.ip-required{color:#dc2626;margin-left:2px}.ip-options{display:flex;flex-wrap:wrap;gap:8px;min-width:0}.ip-options.ip-grid{display:grid;grid-template-columns:repeat(var(--ip-cols),max-content)}.ip-option{position:relative;display:inline-flex;cursor:pointer}.ip-input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:inherit}.ip-swatch{display:inline-flex;align-items:center;justify-content:center;position:relative;width:36px;height:36px;border-radius:8px;box-sizing:border-box;background:#fff;color:#334155;border:1px solid #cbd5e1;box-shadow:0 0 0 0 transparent;transition:box-shadow .12s}.ip-option:hover .ip-swatch{border-color:#64748b}.ip-input:focus-visible+.ip-swatch{outline:2px solid #3b82f6;outline-offset:3px}.ip-option.ip-selected .ip-swatch{background:#1e293b;color:#fff;border-color:#1e293b}.ip-check{position:absolute;right:2px;bottom:2px;padding:1px;border-radius:50%;background:#fff;color:#1e293b;border:1px solid #1e293b;box-sizing:content-box}.ip-option-disabled{cursor:not-allowed;opacity:.45}.ip-error .ip-option .ip-swatch{border-color:#dc2626}.ip-desc{margin:-6px 0 0;font-size:.75rem;line-height:1.4;color:#64748b;overflow-wrap:anywhere}.ip-desc-error{color:#dc2626}@media(pointer:coarse),(max-width:480px){.ip-options{gap:4px}.ip-option{min-width:44px;min-height:44px;align-items:center;justify-content:center}.ip-options.ip-grid{grid-template-columns:repeat(auto-fill,44px)}}\n"]
336
336
  }]
337
337
  }],
338
338
  ctorParameters: () => [],
@@ -1 +1 @@
1
- {"version":3,"file":"forgeroute-ui-icon-picker.mjs","names":[],"sources":["../../../projects/forgeroute-ui/icon-picker/src/lib/icon-picker/icon-picker.component.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, ElementRef, input, output, signal, computed, effect, forwardRef, inject } from '@angular/core';\nimport { AbstractControl, ControlValueAccessor, NG_VALIDATORS, NG_VALUE_ACCESSOR, ValidationErrors, Validator } from '@angular/forms';\nimport { iconPath } from '@forgeroute/ui/icon';\nimport { FieldIssue, UiFieldValidity, createFieldReveal, issueToErrors, requiredIssue } from '@forgeroute/ui/core';\nimport { uiText } from '@forgeroute/ui/core';\n\nexport interface IconPickerOption {\n value: string;\n /** Accessible name and tooltip of the icon (e.g. \"Wrench\"). */\n label: string;\n /** Key of a library icon (`<ui-icon>` / action key such as `wrench`, `history`). Defaults to `value` when neither `iconKey` nor `path` is given. */\n iconKey?: string;\n /** Raw SVG path (`d` value, 24x24 stroke icon); wins over `iconKey`. */\n path?: string;\n disabled?: boolean;\n /** `data-testid` of this option's native radio input; none when omitted. */\n testId?: string;\n}\n\n/**\n * (library source 2026-11-05, not yet published) Icon picker: a `<fieldset role=\"radiogroup\">` of native radio inputs\n * (arrow keys move + select natively, Home / End jump to the first / last enabled icon), ControlValueAccessor with a string value\n * (`''` = nothing selected). The selected icon is inverted and shows a check mark (never colour alone); every icon is named by its `label`\n * (accessible name + `title` tooltip). Built-in validation like `ui-radio-group`: `required` -> \"<label> is required.\"; a value that is not one\n * of the `options` -> \"Select a valid option.\" (not checked while `options` is empty); a disabled picker is never invalid.\n * `disabled` combines with the forms API (`setDisabledState`). 44px touch targets on touch devices and phones; the icons wrap.\n */\n@Component({\n selector: 'ui-icon-picker',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => IconPickerComponent), multi: true },\n { provide: NG_VALIDATORS, useExisting: forwardRef(() => IconPickerComponent), multi: true },\n { provide: UiFieldValidity, useExisting: forwardRef(() => IconPickerComponent) },\n ],\n template: `\n <fieldset\n class=\"ip-field\"\n role=\"radiogroup\"\n [class.ip-error]=\"_activeError()\"\n [class.ip-disabled]=\"disabled()\"\n [disabled]=\"disabled()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-invalid]=\"_activeError() ? 'true' : null\"\n [attr.aria-describedby]=\"(_activeError() || hint()) ? _descId : null\"\n (focusout)=\"onFocusOut($event)\"\n (keydown)=\"onKeydown($event)\">\n @if (label()) {\n <legend class=\"ip-label\">\n {{ label() }}\n @if (required()) { <span class=\"ip-required\" aria-hidden=\"true\">*</span> }\n </legend>\n }\n <div class=\"ip-options\" [class.ip-grid]=\"columns() > 0\" [style.--ip-cols]=\"columns() > 0 ? columns() : null\">\n @for (opt of options(); track opt.value) {\n <label class=\"ip-option\" [class.ip-selected]=\"_value() === opt.value\" [class.ip-option-disabled]=\"disabled() || !!opt.disabled\" [attr.title]=\"opt.label\">\n <input class=\"ip-input\" type=\"radio\"\n [name]=\"_name\"\n [value]=\"opt.value\"\n [checked]=\"_value() === opt.value\"\n [disabled]=\"disabled() || !!opt.disabled\"\n [attr.aria-label]=\"opt.label\"\n [attr.data-testid]=\"opt.testId || null\"\n (change)=\"onSelect(opt.value)\" />\n <span class=\"ip-swatch\" aria-hidden=\"true\">\n <svg class=\"ip-glyph\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\n <path [attr.d]=\"_path(opt)\"/>\n </svg>\n @if (_value() === opt.value) {\n <svg class=\"ip-check\" width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"4\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\n <path d=\"M5 12.5l4.5 4.5L19 7.5\"/>\n </svg>\n }\n </span>\n </label>\n }\n </div>\n @if (_activeError()) {\n <p class=\"ip-desc ip-desc-error\" [id]=\"_descId\" role=\"alert\">{{ _activeError() }}</p>\n } @else if (hint()) {\n <p class=\"ip-desc\" [id]=\"_descId\">{{ hint() }}</p>\n }\n </fieldset>\n `,\n styles: [`\n :host { display: block; }\n .ip-field { display: flex; flex-direction: column; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }\n .ip-label { padding: 0; margin-bottom: 6px; font-size: 0.8125rem; font-weight: 600; color: #374151; line-height: 1; }\n .ip-required { color: #dc2626; margin-left: 2px; }\n .ip-options { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }\n .ip-options.ip-grid { display: grid; grid-template-columns: repeat(var(--ip-cols), max-content); }\n .ip-option { position: relative; display: inline-flex; cursor: pointer; }\n .ip-input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: inherit; }\n .ip-swatch {\n display: inline-flex; align-items: center; justify-content: center;\n position: relative; width: 36px; height: 36px; border-radius: 8px; box-sizing: border-box;\n background: #fff; color: #334155; border: 1px solid #cbd5e1; box-shadow: 0 0 0 0 transparent;\n transition: box-shadow 0.12s;\n }\n .ip-option:hover .ip-swatch { border-color: #64748b; }\n .ip-input:focus-visible + .ip-swatch { outline: 2px solid #3b82f6; outline-offset: 3px; }\n /* three classes like the hover rule above, later in the source, so hovering the selected tile keeps its look */\n .ip-option.ip-selected .ip-swatch { background: #1e293b; color: #fff; border-color: #1e293b; }\n .ip-check { position: absolute; right: 2px; bottom: 2px; padding: 1px; border-radius: 50%; background: #fff; color: #1e293b; border: 1px solid #1e293b; box-sizing: content-box; }\n .ip-option-disabled { cursor: not-allowed; opacity: 0.45; }\n .ip-error .ip-option .ip-swatch { border-color: #dc2626; }\n .ip-desc { margin: 0; font-size: 0.75rem; line-height: 1.4; color: #64748b; overflow-wrap: anywhere; }\n .ip-desc-error { color: #dc2626; }\n @media (pointer: coarse), (max-width: 480px) {\n .ip-options { gap: 4px; }\n .ip-option { min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }\n .ip-options.ip-grid { grid-template-columns: repeat(auto-fill, 44px); }\n }\n `],\n})\nexport class IconPickerComponent implements ControlValueAccessor, Validator, UiFieldValidity {\n private readonly _el = inject<ElementRef<HTMLElement>>(ElementRef);\n\n readonly label = input('');\n readonly options = input<IconPickerOption[]>([]);\n readonly required = input(false);\n readonly hint = input('');\n readonly error = input('');\n /** The host's \"tried to submit\" flag (e.g. after a failed Save click). `true` reveals the message of an untouched field at once (the field also shows it after the user left THIS field); switching it from true back to false forgets that the field was left. */\n readonly showErrors = input(false);\n /** SVG path drawn for an option: its `path`, else the library icon `iconKey` (default: the option's `value`); '' when unknown. */\n protected _path(o: IconPickerOption): string { return o.path || iconPath(o.iconKey || o.value) || ''; }\n\n /** Fixed number of icons per row (0 = wrap freely, the default). On a phone the row wraps by width instead. */\n readonly columns = input(0);\n /** Native `name` shared by the radios; a unique one is generated when omitted. */\n readonly name = input('');\n\n readonly _disabledInput = input(false, { alias: 'disabled' });\n private readonly _cvaDisabled = signal(false);\n protected readonly disabled = computed(() => this._disabledInput() || this._cvaDisabled());\n\n private readonly _generatedName = `ip-${Math.random().toString(36).slice(2, 8)}`;\n protected get _name(): string { return this.name() || this._generatedName; }\n protected readonly _descId = `${this._generatedName}-desc`;\n protected readonly _value = signal('');\n\n private readonly _reveal = createFieldReveal(this.showErrors);\n private readonly _issue = computed(() => this._check(this._value()));\n readonly invalid = computed(() => !!this.error() || !!this._issue());\n readonly errorMessage = computed(() => this._issue()?.message ?? '');\n readonly invalidChange = output<boolean>();\n /** Emits the chosen value on a user pick. */\n readonly valueChange = output<string>();\n protected readonly _activeError = computed(() => this._reveal.revealed() ? (this.error() || this.errorMessage()) : '');\n private _onValidatorChange = () => {};\n\n constructor() {\n effect(() => { this.invalidChange.emit(this.invalid()); });\n }\n\n ngOnChanges() { this._onValidatorChange(); }\n\n validate(control: AbstractControl): ValidationErrors | null {\n const v = control.value;\n return issueToErrors(this._check(v == null ? '' : String(v)));\n }\n registerOnValidatorChange(fn: () => void) { this._onValidatorChange = fn; }\n\n private _onChange = (_: string) => {};\n private _onTouched = () => {};\n\n writeValue(val: string) { this._value.set(val ?? ''); }\n registerOnChange(fn: (v: string) => void) { this._onChange = fn; }\n registerOnTouched(fn: () => void) { this._onTouched = fn; }\n setDisabledState(d: boolean) { this._cvaDisabled.set(d); }\n\n protected onSelect(value: string) {\n if (this.disabled()) return;\n this._value.set(value);\n this._onChange(value);\n this.valueChange.emit(value);\n }\n\n /** Home / End select the first / last enabled icon (arrow keys are native radio behaviour). */\n protected onKeydown(e: KeyboardEvent) {\n if ((e.key !== 'Home' && e.key !== 'End') || this.disabled()) return;\n const opts = this.options();\n const enabled = opts.filter(o => !o.disabled);\n if (!enabled.length) return;\n e.preventDefault();\n const target = e.key === 'Home' ? enabled[0] : enabled[enabled.length - 1];\n this.onSelect(target.value);\n const inputs = this._el.nativeElement.querySelectorAll<HTMLInputElement>('input[type=radio]');\n inputs[opts.indexOf(target)]?.focus();\n }\n\n /** Touched once focus leaves the whole group. */\n protected onFocusOut(event: FocusEvent) {\n const next = event.relatedTarget as Node | null;\n if (next && (event.currentTarget as HTMLElement).contains(next)) return;\n this._onTouched();\n this._reveal.touched.set(true);\n }\n\n private _check(value: string): FieldIssue | null {\n if (this.disabled()) return null;\n if (!value) return this.required() ? requiredIssue(this.label()) : null;\n const opts = this.options();\n if (opts.length > 0 && !opts.some(o => o.value === value)) return { key: 'option', message: uiText('common.selectValidOption') };\n return null;\n }\n}\n"],"mappings":";;;;;AAoHA,IAAa,sBAAb,MAAa,oBAAmB;CAWpB,MAAM,GAAmB;EAAY,OAAO,EAAE,QAAQ,SAAS,EAAE,WAAW,EAAE,KAAK,KAAK;CAAI;CAYtG,I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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDT,UAAA;GAAA,QAAA,CAAA,smDAAA;GAAA,iBAAA,GAAA,wBAAA;EAAA,CAAA;CAAA;;AAgCU,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAmB,YAAA,CAAA;EAzF/B,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAgB,YACd;GAAI,iBACC,wBAAwB;GAAM,WACpC;IACT;KAAE,SAAS;KAAmB,aAAa,iBAAgB,mBAAoB;KAAG,OAAO;IAAI;IAC7F;KAAE,SAAS;KAAe,aAAa,iBAAgB,mBAAoB;KAAG,OAAO;IAAI;IACzF;KAAE,SAAS;KAAiB,aAAa,iBAAgB,mBAAoB;IAAC;GAC/E;GAAA,UACS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDT,QAAA,CAAA,smDAAA;EAAA,CAAA"}
1
+ {"version":3,"file":"forgeroute-ui-icon-picker.mjs","names":[],"sources":["../../../projects/forgeroute-ui/icon-picker/src/lib/icon-picker/icon-picker.component.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, ElementRef, input, output, signal, computed, effect, forwardRef, inject } from '@angular/core';\nimport { AbstractControl, ControlValueAccessor, NG_VALIDATORS, NG_VALUE_ACCESSOR, ValidationErrors, Validator } from '@angular/forms';\nimport { iconPath } from '@forgeroute/ui/icon';\nimport { FieldIssue, UiFieldValidity, createFieldReveal, issueToErrors, requiredIssue } from '@forgeroute/ui/core';\nimport { uiText } from '@forgeroute/ui/core';\n\nexport interface IconPickerOption {\n value: string;\n /** Accessible name and tooltip of the icon (e.g. \"Wrench\"). */\n label: string;\n /** Key of a library icon (`<ui-icon>` / action key such as `wrench`, `history`). Defaults to `value` when neither `iconKey` nor `path` is given. */\n iconKey?: string;\n /** Raw SVG path (`d` value, 24x24 stroke icon); wins over `iconKey`. */\n path?: string;\n disabled?: boolean;\n /** `data-testid` of this option's native radio input; none when omitted. */\n testId?: string;\n}\n\n/**\n * (library source 2026-11-05, not yet published) Icon picker: a `<fieldset role=\"radiogroup\">` of native radio inputs\n * (arrow keys move + select natively, Home / End jump to the first / last enabled icon), ControlValueAccessor with a string value\n * (`''` = nothing selected). The selected icon is inverted and shows a check mark (never colour alone); every icon is named by its `label`\n * (accessible name + `title` tooltip). Built-in validation like `ui-radio-group`: `required` -> \"<label> is required.\"; a value that is not one\n * of the `options` -> \"Select a valid option.\" (not checked while `options` is empty); a disabled picker is never invalid.\n * `disabled` combines with the forms API (`setDisabledState`). 44px touch targets on touch devices and phones; the icons wrap.\n */\n@Component({\n selector: 'ui-icon-picker',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => IconPickerComponent), multi: true },\n { provide: NG_VALIDATORS, useExisting: forwardRef(() => IconPickerComponent), multi: true },\n { provide: UiFieldValidity, useExisting: forwardRef(() => IconPickerComponent) },\n ],\n template: `\n <fieldset\n class=\"ip-field\"\n role=\"radiogroup\"\n [class.ip-error]=\"_activeError()\"\n [class.ip-disabled]=\"disabled()\"\n [disabled]=\"disabled()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-invalid]=\"_activeError() ? 'true' : null\"\n [attr.aria-describedby]=\"(_activeError() || hint()) ? _descId : null\"\n (focusout)=\"onFocusOut($event)\"\n (keydown)=\"onKeydown($event)\">\n @if (label()) {\n <legend class=\"ip-label\">\n {{ label() }}\n @if (required()) { <span class=\"ip-required\" aria-hidden=\"true\">*</span> }\n </legend>\n }\n <div class=\"ip-options\" [class.ip-grid]=\"columns() > 0\" [style.--ip-cols]=\"columns() > 0 ? columns() : null\">\n @for (opt of options(); track opt.value) {\n <label class=\"ip-option\" [class.ip-selected]=\"_value() === opt.value\" [class.ip-option-disabled]=\"disabled() || !!opt.disabled\" [attr.title]=\"opt.label\">\n <input class=\"ip-input\" type=\"radio\"\n [name]=\"_name\"\n [value]=\"opt.value\"\n [checked]=\"_value() === opt.value\"\n [disabled]=\"disabled() || !!opt.disabled\"\n [attr.aria-label]=\"opt.label\"\n [attr.data-testid]=\"opt.testId || null\"\n (change)=\"onSelect(opt.value)\" />\n <span class=\"ip-swatch\" aria-hidden=\"true\">\n <svg class=\"ip-glyph\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\n <path [attr.d]=\"_path(opt)\"/>\n </svg>\n @if (_value() === opt.value) {\n <svg class=\"ip-check\" width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"4\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\n <path d=\"M5 12.5l4.5 4.5L19 7.5\"/>\n </svg>\n }\n </span>\n </label>\n }\n </div>\n @if (_activeError()) {\n <p class=\"ip-desc ip-desc-error\" [id]=\"_descId\" role=\"alert\">{{ _activeError() }}</p>\n } @else if (hint()) {\n <p class=\"ip-desc\" [id]=\"_descId\">{{ hint() }}</p>\n }\n </fieldset>\n `,\n styles: [`\n :host { display: block; }\n .ip-field { display: flex; flex-direction: column; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }\n .ip-label { padding: 0; margin-bottom: 6px; font-size: 0.8125rem; font-weight: 600; color: #374151; line-height: 1; }\n .ip-required { color: #dc2626; margin-left: 2px; }\n .ip-options { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }\n .ip-options.ip-grid { display: grid; grid-template-columns: repeat(var(--ip-cols), max-content); }\n .ip-option { position: relative; display: inline-flex; cursor: pointer; }\n .ip-input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: inherit; }\n .ip-swatch {\n display: inline-flex; align-items: center; justify-content: center;\n position: relative; width: 36px; height: 36px; border-radius: 8px; box-sizing: border-box;\n background: #fff; color: #334155; border: 1px solid #cbd5e1; box-shadow: 0 0 0 0 transparent;\n transition: box-shadow 0.12s;\n }\n .ip-option:hover .ip-swatch { border-color: #64748b; }\n .ip-input:focus-visible + .ip-swatch { outline: 2px solid #3b82f6; outline-offset: 3px; }\n /* three classes like the hover rule above, later in the source, so hovering the selected tile keeps its look */\n .ip-option.ip-selected .ip-swatch { background: #1e293b; color: #fff; border-color: #1e293b; }\n .ip-check { position: absolute; right: 2px; bottom: 2px; padding: 1px; border-radius: 50%; background: #fff; color: #1e293b; border: 1px solid #1e293b; box-sizing: content-box; }\n .ip-option-disabled { cursor: not-allowed; opacity: 0.45; }\n .ip-error .ip-option .ip-swatch { border-color: #dc2626; }\n .ip-desc { margin: -6px 0 0; font-size: 0.75rem; line-height: 1.4; color: #64748b; overflow-wrap: anywhere; }\n .ip-desc-error { color: #dc2626; }\n @media (pointer: coarse), (max-width: 480px) {\n .ip-options { gap: 4px; }\n .ip-option { min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }\n .ip-options.ip-grid { grid-template-columns: repeat(auto-fill, 44px); }\n }\n `],\n})\nexport class IconPickerComponent implements ControlValueAccessor, Validator, UiFieldValidity {\n private readonly _el = inject<ElementRef<HTMLElement>>(ElementRef);\n\n readonly label = input('');\n readonly options = input<IconPickerOption[]>([]);\n readonly required = input(false);\n readonly hint = input('');\n readonly error = input('');\n /** The host's \"tried to submit\" flag (e.g. after a failed Save click). `true` reveals the message of an untouched field at once (the field also shows it after the user left THIS field); switching it from true back to false forgets that the field was left. */\n readonly showErrors = input(false);\n /** SVG path drawn for an option: its `path`, else the library icon `iconKey` (default: the option's `value`); '' when unknown. */\n protected _path(o: IconPickerOption): string { return o.path || iconPath(o.iconKey || o.value) || ''; }\n\n /** Fixed number of icons per row (0 = wrap freely, the default). On a phone the row wraps by width instead. */\n readonly columns = input(0);\n /** Native `name` shared by the radios; a unique one is generated when omitted. */\n readonly name = input('');\n\n readonly _disabledInput = input(false, { alias: 'disabled' });\n private readonly _cvaDisabled = signal(false);\n protected readonly disabled = computed(() => this._disabledInput() || this._cvaDisabled());\n\n private readonly _generatedName = `ip-${Math.random().toString(36).slice(2, 8)}`;\n protected get _name(): string { return this.name() || this._generatedName; }\n protected readonly _descId = `${this._generatedName}-desc`;\n protected readonly _value = signal('');\n\n private readonly _reveal = createFieldReveal(this.showErrors);\n private readonly _issue = computed(() => this._check(this._value()));\n readonly invalid = computed(() => !!this.error() || !!this._issue());\n readonly errorMessage = computed(() => this._issue()?.message ?? '');\n readonly invalidChange = output<boolean>();\n /** Emits the chosen value on a user pick. */\n readonly valueChange = output<string>();\n protected readonly _activeError = computed(() => this._reveal.revealed() ? (this.error() || this.errorMessage()) : '');\n private _onValidatorChange = () => {};\n\n constructor() {\n effect(() => { this.invalidChange.emit(this.invalid()); });\n }\n\n ngOnChanges() { this._onValidatorChange(); }\n\n validate(control: AbstractControl): ValidationErrors | null {\n const v = control.value;\n return issueToErrors(this._check(v == null ? '' : String(v)));\n }\n registerOnValidatorChange(fn: () => void) { this._onValidatorChange = fn; }\n\n private _onChange = (_: string) => {};\n private _onTouched = () => {};\n\n writeValue(val: string) { this._value.set(val ?? ''); }\n registerOnChange(fn: (v: string) => void) { this._onChange = fn; }\n registerOnTouched(fn: () => void) { this._onTouched = fn; }\n setDisabledState(d: boolean) { this._cvaDisabled.set(d); }\n\n protected onSelect(value: string) {\n if (this.disabled()) return;\n this._value.set(value);\n this._onChange(value);\n this.valueChange.emit(value);\n }\n\n /** Home / End select the first / last enabled icon (arrow keys are native radio behaviour). */\n protected onKeydown(e: KeyboardEvent) {\n if ((e.key !== 'Home' && e.key !== 'End') || this.disabled()) return;\n const opts = this.options();\n const enabled = opts.filter(o => !o.disabled);\n if (!enabled.length) return;\n e.preventDefault();\n const target = e.key === 'Home' ? enabled[0] : enabled[enabled.length - 1];\n this.onSelect(target.value);\n const inputs = this._el.nativeElement.querySelectorAll<HTMLInputElement>('input[type=radio]');\n inputs[opts.indexOf(target)]?.focus();\n }\n\n /** Touched once focus leaves the whole group. */\n protected onFocusOut(event: FocusEvent) {\n const next = event.relatedTarget as Node | null;\n if (next && (event.currentTarget as HTMLElement).contains(next)) return;\n this._onTouched();\n this._reveal.touched.set(true);\n }\n\n private _check(value: string): FieldIssue | null {\n if (this.disabled()) return null;\n if (!value) return this.required() ? requiredIssue(this.label()) : null;\n const opts = this.options();\n if (opts.length > 0 && !opts.some(o => o.value === value)) return { key: 'option', message: uiText('common.selectValidOption') };\n return null;\n }\n}\n"],"mappings":";;;;;AAoHA,IAAa,sBAAb,MAAa,oBAAmB;CAWpB,MAAM,GAAmB;EAAY,OAAO,EAAE,QAAQ,SAAS,EAAE,WAAW,EAAE,KAAK,KAAK;CAAI;CAYtG,IAAc,QAAK;EAAa,OAAO,KAAK,KAAI,KAAM,KAAK;CAAgB;CAc3E,cAAA;EApCiB,KAAA,MAAM,OAAgC,UAAU;EAExD,KAAA,QAAW,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;EACpB,KAAA,UAAW,MAA0B,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;EACxC,KAAA,WAAW,MAAM,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;EACvB,KAAA,OAAW,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;EACpB,KAAA,QAAW,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;EAEpB,KAAA,aAAa,MAAM,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,aAAA,CAAA,+BAAA,CAAA,CAAA;EAKzB,KAAA,UAAW,MAAM,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;EAEnB,KAAA,OA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