@forgeroute/ui 0.5.22 → 0.5.23

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.
@@ -396,7 +396,7 @@ var ColumnFilterComponent = class ColumnFilterComponent {
396
396
  </div>
397
397
  `,
398
398
  isInline: true,
399
- styles: [":host{display:inline-block;position:relative}.cf-wrapper{position:relative}.cf-trigger{display:inline-flex;align-items:center;gap:4px;background:none;border:none;cursor:pointer;color:#94a3b8;padding:2px 4px;border-radius:4px;font-family:inherit;font-size:.75rem;transition:color .15s}.cf-trigger:hover{color:#1e293b}.cf-trigger.cf-active{color:#3b82f6}.cf-trigger:focus-visible{outline:2px solid #3b82f6;outline-offset:2px}@media(max-width:640px),(pointer:coarse){.cf-trigger{position:relative}.cf-trigger:after{content:\"\";position:absolute;top:50%;left:50%;width:44px;height:44px;transform:translate(-50%,-50%)}}.cf-active-label{font-size:.75rem;font-weight:500;color:#3b82f6}.cf-trigger--chip{min-height:44px;padding:0 14px;gap:6px;border:1px solid #e2e8f0;border-radius:999px;background:#fff;color:#334155;font-size:.8125rem;font-weight:500}.cf-trigger--chip.cf-active{border-color:#bfdbfe;background:#eff6ff}.cf-trigger--chip:after{display:none}.cf-chip-label{white-space:nowrap}.cf-dropdown{position:fixed;display:flex;flex-direction:column;max-height:calc(100vh - 16px);z-index:9999;background:#fff;border:1px solid #e2e8f0;border-radius:12px;box-shadow:0 4px 6px #0000000a,0 12px 28px #0000001a;min-width:220px;animation:cf-drop .16s cubic-bezier(.16,1,.3,1)}.cf-header{display:flex;align-items:center;justify-content:space-between;padding:12px 12px 10px 16px;border-bottom:1px solid #f1f5f9}.cf-header-label{font-size:.7rem;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:#64748b}.cf-close{display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:6px;background:none;border:none;cursor:pointer;color:#94a3b8;flex-shrink:0;transition:background .13s,color .13s}.cf-close:hover{background:#f1f5f9;color:#1e293b}@media(max-width:640px),(pointer:coarse){.cf-close{position:relative}.cf-close:after{content:\"\";position:absolute;inset:-10px}}.cf-options{padding:6px 8px;overflow-y:auto;min-height:0}.cf-option{display:flex;align-items:center;gap:10px;width:100%;padding:10px;background:none;border:none;border-bottom:1px solid #e2e8f0;cursor:pointer;font-size:.875rem;font-weight:400;color:#1e293b;font-family:inherit;text-align:left;border-radius:0;transition:background .12s}.cf-option:last-child{border-bottom:none}.cf-option:hover{background:#f8fafc}.cf-option.cf-selected{background:#eff6ff;color:#1d4ed8;font-weight:500}.cf-option:focus-visible{outline:2px solid #3b82f6;outline-offset:-2px}.cf-checkbox{flex-shrink:0;width:16px;height:16px;border-radius:4px;border:1.5px solid #7c8ba1;display:flex;align-items:center;justify-content:center;background:#fff;transition:background .12s,border-color .12s}.cf-checkbox.cf-checkbox--checked{background:#3b82f6;border-color:#3b82f6;color:#fff}.cf-count{margin-left:auto;font-size:.7rem;font-weight:600;line-height:1;background:#f1f5f9;color:#475569;border-radius:999px;padding:2px 7px;min-width:22px;text-align:center}.cf-option.cf-selected .cf-count{background:#dbeafe;color:#1d4ed8}.cf-range{display:flex;flex-direction:column;gap:12px;padding:12px 16px;min-width:220px}.cf-footer--range .cf-clear:disabled,.cf-footer--range .cf-apply:disabled{opacity:.5;cursor:not-allowed}.cf-footer{display:flex;gap:8px;padding:10px 12px 12px;border-top:1px solid #f1f5f9}.cf-clear{flex:1;padding:8px;border-radius:8px;border:1px solid #e2e8f0;background:#fff;font-size:.8125rem;color:#64748b;cursor:pointer;font-family:inherit;font-weight:500;transition:background .12s,color .12s}.cf-clear:hover{background:#f8fafc;color:#1e293b}.cf-apply{flex:1;padding:8px;border-radius:8px;border:none;background:#0f172a;color:#fff;font-size:.8125rem;cursor:pointer;font-family:inherit;font-weight:600;transition:background .12s}.cf-apply:hover{background:#1e293b}@keyframes cf-drop{0%{opacity:0;transform:translateY(-4px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}@media(max-width:1024px){.cf-trigger{padding:6px 8px}.cf-option{padding:11px 10px;min-height:40px}.cf-clear,.cf-apply{padding:10px}}@media(pointer:coarse),(max-width:640px){.cf-footer--range .cf-clear,.cf-footer--range .cf-apply{min-height:44px}}@media(max-width:640px){.cf-dropdown{min-width:200px;max-width:calc(100vw - 16px)}.cf-option{padding:12px 10px;min-height:44px}.cf-clear,.cf-apply{padding:11px}}@media(prefers-reduced-motion:reduce){.cf-dropdown{animation:none}}\n"],
399
+ styles: [":host{display:inline-block;position:relative}.cf-wrapper{position:relative}.cf-trigger{display:inline-flex;align-items:center;gap:4px;background:none;border:none;cursor:pointer;color:#94a3b8;padding:2px 4px;border-radius:4px;font-family:inherit;font-size:.75rem;transition:color .15s}.cf-trigger:hover{color:#1e293b}.cf-trigger.cf-active{color:#3b82f6}.cf-trigger:focus-visible{outline:2px solid #3b82f6;outline-offset:2px}@media(max-width:640px),(pointer:coarse){.cf-trigger{position:relative}.cf-trigger:after{content:\"\";position:absolute;top:50%;left:50%;width:44px;height:44px;transform:translate(-50%,-50%)}}.cf-active-label{font-size:.75rem;font-weight:500;color:#3b82f6}.cf-trigger--chip{min-height:44px;padding:0 14px;gap:6px;border:1px solid #e2e8f0;border-radius:999px;background:#fff;color:#334155;font-size:.8125rem;font-weight:500}.cf-trigger--chip.cf-active{border-color:#bfdbfe;background:#eff6ff}.cf-trigger--chip:after{display:none}.cf-chip-label{white-space:nowrap}.cf-dropdown{position:fixed;display:flex;flex-direction:column;max-height:min(420px,calc(100vh - 16px));z-index:9999;background:#fff;border:1px solid #e2e8f0;border-radius:12px;box-shadow:0 4px 6px #0000000a,0 12px 28px #0000001a;min-width:220px;animation:cf-drop .16s cubic-bezier(.16,1,.3,1)}.cf-header{display:flex;align-items:center;justify-content:space-between;padding:12px 12px 10px 16px;background:#f8fafc;border-bottom:1px solid #e2e8f0;border-radius:12px 12px 0 0;flex-shrink:0}.cf-header-label{font-size:.7rem;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:#64748b}.cf-close{display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:6px;background:none;border:none;cursor:pointer;color:#94a3b8;flex-shrink:0;transition:background .13s,color .13s}.cf-close:hover{background:#f1f5f9;color:#1e293b}@media(max-width:640px),(pointer:coarse){.cf-close{position:relative}.cf-close:after{content:\"\";position:absolute;inset:-10px}}.cf-options{padding:6px 8px;overflow-y:auto;min-height:0}.cf-option{display:flex;align-items:center;gap:10px;width:100%;padding:10px;background:none;border:none;border-bottom:1px solid #e2e8f0;cursor:pointer;font-size:.875rem;font-weight:400;color:#1e293b;font-family:inherit;text-align:left;border-radius:0;transition:background .12s}.cf-option:last-child{border-bottom:none}.cf-option:hover{background:#f8fafc}.cf-option.cf-selected{background:#eff6ff;color:#1d4ed8;font-weight:500}.cf-option:focus-visible{outline:2px solid #3b82f6;outline-offset:-2px}.cf-checkbox{flex-shrink:0;width:16px;height:16px;border-radius:4px;border:1.5px solid #7c8ba1;display:flex;align-items:center;justify-content:center;background:#fff;transition:background .12s,border-color .12s}.cf-checkbox.cf-checkbox--checked{background:#3b82f6;border-color:#3b82f6;color:#fff}.cf-count{margin-left:auto;font-size:.7rem;font-weight:600;line-height:1;background:#f1f5f9;color:#475569;border-radius:999px;padding:2px 7px;min-width:22px;text-align:center}.cf-option.cf-selected .cf-count{background:#dbeafe;color:#1d4ed8}.cf-range{display:flex;flex-direction:column;gap:12px;padding:12px 16px;min-width:220px}.cf-footer--range .cf-clear:disabled,.cf-footer--range .cf-apply:disabled{opacity:.5;cursor:not-allowed}.cf-footer{display:flex;gap:8px;padding:10px 12px 12px;background:#f8fafc;border-top:1px solid #e2e8f0;border-radius:0 0 12px 12px;flex-shrink:0}.cf-clear{flex:1;padding:8px;border-radius:8px;border:1px solid #e2e8f0;background:#fff;font-size:.8125rem;color:#64748b;cursor:pointer;font-family:inherit;font-weight:500;transition:background .12s,color .12s}.cf-clear:hover{background:#f8fafc;color:#1e293b}.cf-apply{flex:1;padding:8px;border-radius:8px;border:none;background:#0f172a;color:#fff;font-size:.8125rem;cursor:pointer;font-family:inherit;font-weight:600;transition:background .12s}.cf-apply:hover{background:#1e293b}@keyframes cf-drop{0%{opacity:0;transform:translateY(-4px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}@media(max-width:1024px){.cf-trigger{padding:6px 8px}.cf-option{padding:11px 10px;min-height:40px}.cf-clear,.cf-apply{padding:10px}}@media(pointer:coarse),(max-width:640px){.cf-footer--range .cf-clear,.cf-footer--range .cf-apply{min-height:44px}}@media(max-width:640px){.cf-dropdown{min-width:200px;max-width:calc(100vw - 16px)}.cf-option{padding:12px 10px;min-height:44px}.cf-clear,.cf-apply{padding:11px}}@media(prefers-reduced-motion:reduce){.cf-dropdown{animation:none}}\n"],
400
400
  dependencies: [
401
401
  {
402
402
  kind: "ngmodule",
@@ -573,7 +573,7 @@ i0.ɵɵngDeclareClassMetadata({
573
573
  }
574
574
  </div>
575
575
  `,
576
- styles: [":host{display:inline-block;position:relative}.cf-wrapper{position:relative}.cf-trigger{display:inline-flex;align-items:center;gap:4px;background:none;border:none;cursor:pointer;color:#94a3b8;padding:2px 4px;border-radius:4px;font-family:inherit;font-size:.75rem;transition:color .15s}.cf-trigger:hover{color:#1e293b}.cf-trigger.cf-active{color:#3b82f6}.cf-trigger:focus-visible{outline:2px solid #3b82f6;outline-offset:2px}@media(max-width:640px),(pointer:coarse){.cf-trigger{position:relative}.cf-trigger:after{content:\"\";position:absolute;top:50%;left:50%;width:44px;height:44px;transform:translate(-50%,-50%)}}.cf-active-label{font-size:.75rem;font-weight:500;color:#3b82f6}.cf-trigger--chip{min-height:44px;padding:0 14px;gap:6px;border:1px solid #e2e8f0;border-radius:999px;background:#fff;color:#334155;font-size:.8125rem;font-weight:500}.cf-trigger--chip.cf-active{border-color:#bfdbfe;background:#eff6ff}.cf-trigger--chip:after{display:none}.cf-chip-label{white-space:nowrap}.cf-dropdown{position:fixed;display:flex;flex-direction:column;max-height:calc(100vh - 16px);z-index:9999;background:#fff;border:1px solid #e2e8f0;border-radius:12px;box-shadow:0 4px 6px #0000000a,0 12px 28px #0000001a;min-width:220px;animation:cf-drop .16s cubic-bezier(.16,1,.3,1)}.cf-header{display:flex;align-items:center;justify-content:space-between;padding:12px 12px 10px 16px;border-bottom:1px solid #f1f5f9}.cf-header-label{font-size:.7rem;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:#64748b}.cf-close{display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:6px;background:none;border:none;cursor:pointer;color:#94a3b8;flex-shrink:0;transition:background .13s,color .13s}.cf-close:hover{background:#f1f5f9;color:#1e293b}@media(max-width:640px),(pointer:coarse){.cf-close{position:relative}.cf-close:after{content:\"\";position:absolute;inset:-10px}}.cf-options{padding:6px 8px;overflow-y:auto;min-height:0}.cf-option{display:flex;align-items:center;gap:10px;width:100%;padding:10px;background:none;border:none;border-bottom:1px solid #e2e8f0;cursor:pointer;font-size:.875rem;font-weight:400;color:#1e293b;font-family:inherit;text-align:left;border-radius:0;transition:background .12s}.cf-option:last-child{border-bottom:none}.cf-option:hover{background:#f8fafc}.cf-option.cf-selected{background:#eff6ff;color:#1d4ed8;font-weight:500}.cf-option:focus-visible{outline:2px solid #3b82f6;outline-offset:-2px}.cf-checkbox{flex-shrink:0;width:16px;height:16px;border-radius:4px;border:1.5px solid #7c8ba1;display:flex;align-items:center;justify-content:center;background:#fff;transition:background .12s,border-color .12s}.cf-checkbox.cf-checkbox--checked{background:#3b82f6;border-color:#3b82f6;color:#fff}.cf-count{margin-left:auto;font-size:.7rem;font-weight:600;line-height:1;background:#f1f5f9;color:#475569;border-radius:999px;padding:2px 7px;min-width:22px;text-align:center}.cf-option.cf-selected .cf-count{background:#dbeafe;color:#1d4ed8}.cf-range{display:flex;flex-direction:column;gap:12px;padding:12px 16px;min-width:220px}.cf-footer--range .cf-clear:disabled,.cf-footer--range .cf-apply:disabled{opacity:.5;cursor:not-allowed}.cf-footer{display:flex;gap:8px;padding:10px 12px 12px;border-top:1px solid #f1f5f9}.cf-clear{flex:1;padding:8px;border-radius:8px;border:1px solid #e2e8f0;background:#fff;font-size:.8125rem;color:#64748b;cursor:pointer;font-family:inherit;font-weight:500;transition:background .12s,color .12s}.cf-clear:hover{background:#f8fafc;color:#1e293b}.cf-apply{flex:1;padding:8px;border-radius:8px;border:none;background:#0f172a;color:#fff;font-size:.8125rem;cursor:pointer;font-family:inherit;font-weight:600;transition:background .12s}.cf-apply:hover{background:#1e293b}@keyframes cf-drop{0%{opacity:0;transform:translateY(-4px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}@media(max-width:1024px){.cf-trigger{padding:6px 8px}.cf-option{padding:11px 10px;min-height:40px}.cf-clear,.cf-apply{padding:10px}}@media(pointer:coarse),(max-width:640px){.cf-footer--range .cf-clear,.cf-footer--range .cf-apply{min-height:44px}}@media(max-width:640px){.cf-dropdown{min-width:200px;max-width:calc(100vw - 16px)}.cf-option{padding:12px 10px;min-height:44px}.cf-clear,.cf-apply{padding:11px}}@media(prefers-reduced-motion:reduce){.cf-dropdown{animation:none}}\n"]
576
+ styles: [":host{display:inline-block;position:relative}.cf-wrapper{position:relative}.cf-trigger{display:inline-flex;align-items:center;gap:4px;background:none;border:none;cursor:pointer;color:#94a3b8;padding:2px 4px;border-radius:4px;font-family:inherit;font-size:.75rem;transition:color .15s}.cf-trigger:hover{color:#1e293b}.cf-trigger.cf-active{color:#3b82f6}.cf-trigger:focus-visible{outline:2px solid #3b82f6;outline-offset:2px}@media(max-width:640px),(pointer:coarse){.cf-trigger{position:relative}.cf-trigger:after{content:\"\";position:absolute;top:50%;left:50%;width:44px;height:44px;transform:translate(-50%,-50%)}}.cf-active-label{font-size:.75rem;font-weight:500;color:#3b82f6}.cf-trigger--chip{min-height:44px;padding:0 14px;gap:6px;border:1px solid #e2e8f0;border-radius:999px;background:#fff;color:#334155;font-size:.8125rem;font-weight:500}.cf-trigger--chip.cf-active{border-color:#bfdbfe;background:#eff6ff}.cf-trigger--chip:after{display:none}.cf-chip-label{white-space:nowrap}.cf-dropdown{position:fixed;display:flex;flex-direction:column;max-height:min(420px,calc(100vh - 16px));z-index:9999;background:#fff;border:1px solid #e2e8f0;border-radius:12px;box-shadow:0 4px 6px #0000000a,0 12px 28px #0000001a;min-width:220px;animation:cf-drop .16s cubic-bezier(.16,1,.3,1)}.cf-header{display:flex;align-items:center;justify-content:space-between;padding:12px 12px 10px 16px;background:#f8fafc;border-bottom:1px solid #e2e8f0;border-radius:12px 12px 0 0;flex-shrink:0}.cf-header-label{font-size:.7rem;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:#64748b}.cf-close{display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:6px;background:none;border:none;cursor:pointer;color:#94a3b8;flex-shrink:0;transition:background .13s,color .13s}.cf-close:hover{background:#f1f5f9;color:#1e293b}@media(max-width:640px),(pointer:coarse){.cf-close{position:relative}.cf-close:after{content:\"\";position:absolute;inset:-10px}}.cf-options{padding:6px 8px;overflow-y:auto;min-height:0}.cf-option{display:flex;align-items:center;gap:10px;width:100%;padding:10px;background:none;border:none;border-bottom:1px solid #e2e8f0;cursor:pointer;font-size:.875rem;font-weight:400;color:#1e293b;font-family:inherit;text-align:left;border-radius:0;transition:background .12s}.cf-option:last-child{border-bottom:none}.cf-option:hover{background:#f8fafc}.cf-option.cf-selected{background:#eff6ff;color:#1d4ed8;font-weight:500}.cf-option:focus-visible{outline:2px solid #3b82f6;outline-offset:-2px}.cf-checkbox{flex-shrink:0;width:16px;height:16px;border-radius:4px;border:1.5px solid #7c8ba1;display:flex;align-items:center;justify-content:center;background:#fff;transition:background .12s,border-color .12s}.cf-checkbox.cf-checkbox--checked{background:#3b82f6;border-color:#3b82f6;color:#fff}.cf-count{margin-left:auto;font-size:.7rem;font-weight:600;line-height:1;background:#f1f5f9;color:#475569;border-radius:999px;padding:2px 7px;min-width:22px;text-align:center}.cf-option.cf-selected .cf-count{background:#dbeafe;color:#1d4ed8}.cf-range{display:flex;flex-direction:column;gap:12px;padding:12px 16px;min-width:220px}.cf-footer--range .cf-clear:disabled,.cf-footer--range .cf-apply:disabled{opacity:.5;cursor:not-allowed}.cf-footer{display:flex;gap:8px;padding:10px 12px 12px;background:#f8fafc;border-top:1px solid #e2e8f0;border-radius:0 0 12px 12px;flex-shrink:0}.cf-clear{flex:1;padding:8px;border-radius:8px;border:1px solid #e2e8f0;background:#fff;font-size:.8125rem;color:#64748b;cursor:pointer;font-family:inherit;font-weight:500;transition:background .12s,color .12s}.cf-clear:hover{background:#f8fafc;color:#1e293b}.cf-apply{flex:1;padding:8px;border-radius:8px;border:none;background:#0f172a;color:#fff;font-size:.8125rem;cursor:pointer;font-family:inherit;font-weight:600;transition:background .12s}.cf-apply:hover{background:#1e293b}@keyframes cf-drop{0%{opacity:0;transform:translateY(-4px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}@media(max-width:1024px){.cf-trigger{padding:6px 8px}.cf-option{padding:11px 10px;min-height:40px}.cf-clear,.cf-apply{padding:10px}}@media(pointer:coarse),(max-width:640px){.cf-footer--range .cf-clear,.cf-footer--range .cf-apply{min-height:44px}}@media(max-width:640px){.cf-dropdown{min-width:200px;max-width:calc(100vw - 16px)}.cf-option{padding:12px 10px;min-height:44px}.cf-clear,.cf-apply{padding:11px}}@media(prefers-reduced-motion:reduce){.cf-dropdown{animation:none}}\n"]
577
577
  }]
578
578
  }],
579
579
  ctorParameters: () => [],
@@ -1 +1 @@
1
- {"version":3,"file":"forgeroute-ui-column-filter.mjs","names":[],"sources":["../../../projects/forgeroute-ui/column-filter/src/lib/column-filter/column-filter.component.ts"],"sourcesContent":["import { Component, input, output, signal, computed, effect, afterNextRender, Injector, ChangeDetectionStrategy, inject, ElementRef, viewChildren } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { FilterOption, DROPDOWN_GROUP } from '@forgeroute/ui/table-types';\nimport { UiLabelsService } from '@forgeroute/ui/core';\nimport { TextInputComponent } from '@forgeroute/ui/text-input';\nimport { UiFieldValidity } from '@forgeroute/ui/core';\nimport { uiFormatCurrency, uiFormatNumber } from '@forgeroute/ui/core';\n\n/** What the column filter needs to render a numeric Min / Max popover (resolved from a table `RangeFilterConfig`). */\nexport interface ColumnRangeSpec {\n min: number;\n max?: number;\n step: number;\n format: 'number' | 'currency' | 'percent';\n unit?: string;\n}\n/** The applied (or pending) bounds of a range filter; null = no bound. */\nexport interface ColumnRangeValue { min: number | null; max: number | null; }\n\n@Component({\n selector: 'ui-column-filter',\n standalone: true,\n imports: [FormsModule, TextInputComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '(document:click)': 'onDocumentClick($event)',\n '(keydown.arrowdown)': 'onArrow($event, 1)',\n '(keydown.arrowup)': 'onArrow($event, -1)',\n },\n template: `\n <div class=\"cf-wrapper\">\n <button\n class=\"cf-trigger\"\n [class.cf-active]=\"_isActive()\"\n [class.cf-trigger--chip]=\"chip()\"\n [attr.aria-label]=\"range() && _isActive() ? labels.t('rangeFilter.filterByActive', { label: label(), range: activeLabelText() }) : labels.t('common.filterBy', { label: label() })\"\n [attr.aria-expanded]=\"open()\"\n (click)=\"toggle($event)\">\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\"\n [attr.stroke]=\"_isActive() ? '#3b82f6' : 'currentColor'\"\n stroke-width=\"2\" aria-hidden=\"true\">\n <path d=\"M22 3H2l8 9.46V19l4 2v-8.54L22 3z\"/>\n </svg>\n @if (chip()) {\n <span class=\"cf-chip-label\">{{ label() }}@if (range() && _isActive()) {:}</span>\n }\n @if (_isActive()) {\n <span class=\"cf-active-label\">{{ activeLabelText() }}</span>\n }\n </button>\n\n @if (open()) {\n <div class=\"cf-dropdown\" [attr.role]=\"range() ? 'dialog' : 'listbox'\" [attr.aria-label]=\"labels.t('common.filterOptions', { label: label() })\"\n [style.top.px]=\"_pos().top\" [style.left.px]=\"_pos().left\"\n (click)=\"$event.stopPropagation()\">\n <div class=\"cf-header\">\n <span class=\"cf-header-label\">{{ label() }}</span>\n <button class=\"cf-close\" type=\"button\" [attr.aria-label]=\"labels.t('common.closeFilter')\" (click)=\"open.set(false)\">\n <svg width=\"13\" height=\"13\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" aria-hidden=\"true\">\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\"/><line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\"/>\n </svg>\n </button>\n </div>\n @if (range(); as r) {\n <div class=\"cf-range\" role=\"group\" [attr.aria-label]=\"labels.t('rangeFilter.group', { label: label() })\" (keydown.enter)=\"onEnter($event)\" (input)=\"onRangeInput($event)\">\n <ui-text-input type=\"number\" valueType=\"number\" inputTestId=\"cf-range-min\"\n [label]=\"labels.t('rangeFilter.min')\" [ariaLabel]=\"labels.t('rangeFilter.minFor', { label: label() })\"\n [min]=\"r.min\" [max]=\"r.max\" [step]=\"r.step\" [maxDecimals]=\"_decimals()\" [error]=\"_minError()\" [showErrors]=\"!!_minError()\"\n [placeholder]=\"_formatBound(r.min)\"\n [ngModel]=\"pendingMin()\" (ngModelChange)=\"pendingMin.set($event)\" />\n <ui-text-input type=\"number\" valueType=\"number\" inputTestId=\"cf-range-max\"\n [label]=\"labels.t('rangeFilter.max')\" [ariaLabel]=\"labels.t('rangeFilter.maxFor', { label: label() })\"\n [min]=\"r.min\" [max]=\"r.max\" [step]=\"r.step\" [maxDecimals]=\"_decimals()\" [error]=\"_maxError()\" [showErrors]=\"_maxError() !== ''\"\n [placeholder]=\"r.max != null ? _formatBound(r.max) : ''\"\n [ngModel]=\"pendingMax()\" (ngModelChange)=\"pendingMax.set($event)\" />\n </div>\n <div class=\"cf-footer cf-footer--range\">\n <button class=\"cf-clear\" type=\"button\" data-testid=\"cf-range-clear\" [disabled]=\"!_isActive() && !_pendingHasRange()\" (click)=\"clear()\">{{ labels.t('common.clear') }}</button>\n <button class=\"cf-clear\" type=\"button\" data-testid=\"cf-range-cancel\" (click)=\"cancel()\">{{ labels.t('common.cancel') }}</button>\n <button class=\"cf-apply\" type=\"button\" data-testid=\"cf-range-apply\" [disabled]=\"_rangeInvalid()\" [attr.aria-disabled]=\"_rangeInvalid()\" (click)=\"apply()\">{{ labels.t('common.apply') }}</button>\n </div>\n } @else {\n <div class=\"cf-options\">\n @for (opt of _visibleOptions(); track opt.value) {\n <button\n class=\"cf-option\"\n role=\"option\"\n [class.cf-selected]=\"pendingValues().includes(opt.value)\"\n [attr.aria-selected]=\"pendingValues().includes(opt.value)\"\n (click)=\"select(opt.value)\">\n <span class=\"cf-checkbox\" [class.cf-checkbox--checked]=\"pendingValues().includes(opt.value)\" aria-hidden=\"true\">\n @if (pendingValues().includes(opt.value)) {\n <svg width=\"10\" height=\"10\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"3\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\n <polyline points=\"20 6 9 17 4 12\"/>\n </svg>\n }\n </span>\n {{ opt.label }}\n @if (opt.count != null) {\n <span class=\"cf-count\">{{ opt.count }}</span>\n }\n </button>\n }\n </div>\n <div class=\"cf-footer\">\n @if (pendingHasChanges()) {\n <button class=\"cf-clear\" (click)=\"clear()\">{{ labels.t('common.clear') }}</button>\n } @else {\n <button class=\"cf-clear\" (click)=\"cancel()\">{{ labels.t('common.cancel') }}</button>\n }\n <button class=\"cf-apply\" (click)=\"apply()\">{{ labels.t('common.apply') }}</button>\n </div>\n }\n </div>\n }\n </div>\n `,\n styles: [`\n :host { display: inline-block; position: relative; }\n .cf-wrapper { position: relative; }\n .cf-trigger {\n display: inline-flex; align-items: center; gap: 4px;\n background: none; border: none; cursor: pointer;\n color: #94a3b8; padding: 2px 4px; border-radius: 4px;\n font-family: inherit; font-size: 0.75rem;\n transition: color 0.15s;\n &:hover { color: #1e293b; }\n &.cf-active { color: #3b82f6; }\n &:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }\n }\n /* Touch: invisible 44px hit area around the funnel; header height is unchanged. */\n @media (max-width: 640px), (pointer: coarse) {\n .cf-trigger { position: relative; }\n .cf-trigger::after { content: ''; position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); }\n }\n .cf-active-label { font-size: 0.75rem; font-weight: 500; color: #3b82f6; }\n /* Phone filter chip (data-table control row): labelled pill, 44px tall. */\n .cf-trigger--chip {\n min-height: 44px; padding: 0 14px; gap: 6px;\n border: 1px solid #e2e8f0; border-radius: 999px; background: #fff;\n color: #334155; font-size: 0.8125rem; font-weight: 500;\n &.cf-active { border-color: #bfdbfe; background: #eff6ff; }\n }\n .cf-trigger--chip::after { display: none; }\n .cf-chip-label { white-space: nowrap; }\n /* position: fixed (top/left set from the trigger rect in TS) so the table's scroll container can't clip it. */\n .cf-dropdown {\n position: fixed;\n display: flex; flex-direction: column; max-height: calc(100vh - 16px);\n z-index: 9999;\n background: #fff;\n border: 1px solid #e2e8f0;\n border-radius: 12px;\n box-shadow: 0 4px 6px rgba(0,0,0,0.04), 0 12px 28px rgba(0,0,0,0.10);\n min-width: 220px;\n animation: cf-drop 160ms cubic-bezier(0.16, 1, 0.3, 1);\n }\n .cf-header {\n display: flex; align-items: center; justify-content: space-between;\n padding: 12px 12px 10px 16px;\n border-bottom: 1px solid #f1f5f9;\n }\n .cf-header-label {\n font-size: 0.7rem; font-weight: 700;\n text-transform: uppercase; letter-spacing: 0.07em; color: #64748b;\n }\n .cf-close {\n display: flex; align-items: center; justify-content: center;\n width: 24px; height: 24px; border-radius: 6px;\n background: none; border: none; cursor: pointer; color: #94a3b8;\n flex-shrink: 0; transition: background 130ms, color 130ms;\n &:hover { background: #f1f5f9; color: #1e293b; }\n }\n @media (max-width: 640px), (pointer: coarse) {\n .cf-close { position: relative; }\n .cf-close::after { content: ''; position: absolute; inset: -10px; }\n }\n .cf-options { padding: 6px 8px; overflow-y: auto; min-height: 0; }\n .cf-option {\n display: flex; align-items: center; gap: 10px; width: 100%;\n padding: 10px 10px; background: none; border: none; border-bottom: 1px solid #e2e8f0;\n cursor: pointer; font-size: 0.875rem; font-weight: 400; color: #1e293b; font-family: inherit; text-align: left; /* 400: the dropdown sits inside the bold table header and a reset that makes buttons inherit would make every option bold */\n border-radius: 0; transition: background 0.12s;\n &:last-child { border-bottom: none; }\n &:hover { background: #f8fafc; }\n &.cf-selected { background: #eff6ff; color: #1d4ed8; font-weight: 500; }\n &:focus-visible { outline: 2px solid #3b82f6; outline-offset: -2px; }\n }\n .cf-checkbox {\n flex-shrink: 0;\n width: 16px; height: 16px; border-radius: 4px;\n border: 1.5px solid #7c8ba1; /* 3:1 against the page: the box is the only thing that shows it is a checkbox */\n display: flex; align-items: center; justify-content: center;\n background: #fff; transition: background 0.12s, border-color 0.12s;\n &.cf-checkbox--checked { background: #3b82f6; border-color: #3b82f6; color: #fff; }\n }\n .cf-count {\n margin-left: auto; font-size: 0.7rem; font-weight: 600; line-height: 1;\n background: #f1f5f9; color: #475569; border-radius: 999px; /* 6.92:1 (was 4.34:1) */\n padding: 2px 7px; min-width: 22px; text-align: center;\n }\n .cf-option.cf-selected .cf-count { background: #dbeafe; color: #1d4ed8; } /* 5.49:1 (blue-600 was 4.24:1) */\n .cf-range { display: flex; flex-direction: column; gap: 12px; padding: 12px 16px; min-width: 220px; }\n .cf-footer--range .cf-clear:disabled, .cf-footer--range .cf-apply:disabled { opacity: 0.5; cursor: not-allowed; }\n .cf-footer {\n display: flex; gap: 8px; padding: 10px 12px 12px;\n border-top: 1px solid #f1f5f9;\n }\n .cf-clear {\n flex: 1; padding: 8px; border-radius: 8px; border: 1px solid #e2e8f0;\n background: #fff; font-size: 0.8125rem; color: #64748b; cursor: pointer;\n font-family: inherit; font-weight: 500; transition: background 0.12s, color 0.12s;\n &:hover { background: #f8fafc; color: #1e293b; }\n }\n .cf-apply {\n flex: 1; padding: 8px; border-radius: 8px; border: none;\n background: #0f172a; color: #fff; font-size: 0.8125rem;\n cursor: pointer; font-family: inherit; font-weight: 600;\n transition: background 0.12s;\n &:hover { background: #1e293b; }\n }\n @keyframes cf-drop {\n from { opacity: 0; transform: translateY(-4px) scale(0.98); }\n to { opacity: 1; transform: translateY(0) scale(1); }\n }\n /* ── iPad (≤1024px) — bigger funnel tap target + comfortable option height ─── */\n @media (max-width: 1024px) {\n .cf-trigger { padding: 6px 8px; }\n .cf-option { padding: 11px 10px; min-height: 40px; }\n .cf-clear, .cf-apply { padding: 10px; }\n }\n\n /* Range popover footer buttons: 44px hit height on touch / phones, like the library's touch-target rule. */\n @media (pointer: coarse), (max-width: 640px) {\n .cf-footer--range .cf-clear, .cf-footer--range .cf-apply { min-height: 44px; }\n }\n\n /* ── Phone (≤640px) — right-anchored dropdown, full touch targets ─── */\n @media (max-width: 640px) {\n .cf-dropdown { min-width: 200px; max-width: calc(100vw - 16px); }\n .cf-option { padding: 12px 10px; min-height: 44px; }\n .cf-clear, .cf-apply { padding: 11px; }\n }\n\n /* Reduced motion: no entrance / shimmer animation (a loading spinner stays, slower). */\n @media (prefers-reduced-motion: reduce) {\n .cf-dropdown { animation: none; }\n }\n `],\n})\nexport class ColumnFilterComponent {\n protected readonly labels = inject(UiLabelsService);\n readonly label = input.required<string>();\n readonly options = input<FilterOption[]>([]);\n /**\n * Numeric range mode (opt-in, set by the table for a `rangeFilters` column): the popover shows Min / Max number fields instead of the value list.\n * Unset = the value-list filter, unchanged.\n */\n readonly range = input<ColumnRangeSpec | null>(null);\n /** Range mode: the applied bounds. */\n readonly rangeValue = input<ColumnRangeValue>({ min: null, max: null });\n /** Range mode: emits the new bounds on Apply (both null = cleared). */\n readonly rangeChange = output<ColumnRangeValue>();\n /** Currently applied values — empty array means no filter active. */\n readonly activeValues = input<string[]>([]);\n /** Render the trigger as a labelled 44px chip (phone control row) instead of the bare funnel icon. */\n readonly chip = input(false);\n\n /** Emits the new selection on Apply. Empty array = filter cleared. */\n readonly filterChange = output<string[]>();\n\n protected readonly open = signal(false);\n protected readonly pendingValues = signal<string[]>([]);\n protected readonly pendingMin = signal<number | null>(null);\n protected readonly pendingMax = signal<number | null>(null);\n private readonly _fields = viewChildren(UiFieldValidity);\n protected readonly _isActive = computed(() => {\n if (this.range()) { const v = this.rangeValue(); return v.min != null || v.max != null; }\n return this.activeValues().length > 0;\n });\n protected readonly _pendingHasRange = computed(() => this.pendingMin() != null || this.pendingMax() != null);\n /** Decimals the step allows (step 0.01 = 2, a whole-number step = 0). */\n protected readonly _decimals = computed(() => {\n const step = this.range()?.step ?? 1;\n const frac = String(step).split('.')[1];\n return frac ? frac.length : 0;\n });\n protected readonly _crossError = computed(() => {\n const a = this.pendingMin(), b = this.pendingMax();\n return a != null && b != null && a > b ? this.labels.t('rangeFilter.minAboveMax') : '';\n });\n /** Firefox / Safari let text into a type=number box (the model becomes null while the box shows it): tracked per field from the native validity. */\n protected readonly badMin = signal(false);\n protected readonly badMax = signal(false);\n /**\n * The Min above Max message is shown ONCE, under Min (one role=\"alert\", announced once), and is revealed at once (no blur needed),\n * so it is visible whichever field was edited last. A non-number typed in a field shows its own message under that field.\n */\n protected readonly _minError = computed(() => this.badMin() ? this.labels.t('rangeFilter.badNumber') : this._crossError());\n protected readonly _maxError = computed(() => this.badMax() ? this.labels.t('rangeFilter.badNumber') : '');\n protected readonly _rangeInvalid = computed(() => this._crossError() !== '' || this.badMin() || this.badMax() || this._fields().some(f => f.invalid()));\n\n /** Hide options with count = 0, unless they are currently selected (so user can deselect). */\n protected readonly _visibleOptions = computed(() =>\n this.options().filter(o => o.count == null || o.count > 0 || this.activeValues().includes(o.value))\n );\n\n protected readonly pendingHasChanges = computed(() => {\n const p = this.pendingValues();\n const a = this.activeValues();\n return p.length !== a.length || p.some(v => !a.includes(v));\n });\n\n private readonly _el = inject(ElementRef);\n private readonly _group = inject(DROPDOWN_GROUP, { optional: true });\n private readonly _injector = inject(Injector);\n private readonly _id = Math.random().toString(36).slice(2);\n\n constructor() {\n const group = this._group;\n if (group) {\n effect(() => { if (group() !== this._id && this.open()) this.open.set(false); });\n }\n // While open, keep the fixed dropdown glued to its trigger on window resize and on any scroll\n // (capture phase, so the table's own scroll container and the page are both caught).\n effect((onCleanup) => {\n if (!this.open()) return;\n const reposition = () => this._reposition();\n window.addEventListener('resize', reposition);\n document.addEventListener('scroll', reposition, true);\n // Escape closes only this dropdown: taken in the capture phase while it is open, so a surrounding side panel / modal (which\n // listens on the document) never sees that key press and stays open. With the dropdown closed nothing is registered.\n const onKeydown = (event: KeyboardEvent) => { if (event.key === 'Escape') this.onEscape(event); };\n document.addEventListener('keydown', onKeydown, true);\n onCleanup(() => {\n document.removeEventListener('keydown', onKeydown, true);\n window.removeEventListener('resize', reposition);\n document.removeEventListener('scroll', reposition, true);\n });\n });\n }\n\n /** Viewport coordinates (px) of the fixed dropdown. */\n protected readonly _pos = signal<{ top: number; left: number }>({ top: 0, left: 0 });\n\n /** One bound as text: plain number (+ unit), US dollars or a percent, in the app's locale. */\n protected _formatBound(v: number): string {\n const r = this.range();\n const locale = this.labels.locale();\n const opts = { minimumFractionDigits: 0, maximumFractionDigits: this._decimals() };\n if (r?.format === 'currency') return uiFormatCurrency(v, 'USD', locale, { ...opts, minimumFractionDigits: this._decimals() });\n const n = uiFormatNumber(v, locale, opts);\n if (r?.format === 'percent') return this.labels.t('rangeFilter.percent', { value: n });\n return r?.unit ? this.labels.t('rangeFilter.withUnit', { value: n, unit: r.unit }) : n;\n }\n\n protected readonly activeLabelText = computed(() => {\n if (this.range()) {\n const { min, max } = this.rangeValue();\n if (min != null && max != null) return this.labels.t('rangeFilter.between', { min: this._formatBound(min), max: this._formatBound(max) });\n if (min != null) return this.labels.t('rangeFilter.atLeast', { min: this._formatBound(min) });\n if (max != null) return this.labels.t('rangeFilter.atMost', { max: this._formatBound(max) });\n return '';\n }\n const vals = this.activeValues();\n if (vals.length === 0) return '';\n if (vals.length === 1) return this.options().find(o => o.value === vals[0])?.label ?? vals[0];\n return this.labels.t('common.nSelected', { count: vals.length });\n });\n\n toggle(event: Event) {\n event.stopPropagation();\n if (!this.open()) {\n this._group?.set(this._id);\n this.pendingValues.set([...this.activeValues()]);\n this.pendingMin.set(this.rangeValue().min);\n this.pendingMax.set(this.rangeValue().max);\n this.badMin.set(false);\n this.badMax.set(false);\n this._reposition(); // estimate (dropdown not rendered yet)\n afterNextRender(() => this._reposition(), { injector: this._injector }); // exact, once it is measurable\n setTimeout(() => (this.range()\n ? this._el.nativeElement.querySelector('.cf-range input') as HTMLElement | null\n : this._optionEls()[0])?.focus(), 30);\n }\n this.open.update(v => !v);\n }\n\n select(value: string) {\n const cur = this.pendingValues();\n this.pendingValues.set(cur.includes(value) ? cur.filter(v => v !== value) : [...cur, value]);\n }\n\n apply() {\n if (this.range()) {\n if (this._rangeInvalid()) return;\n this.rangeChange.emit({ min: this.pendingMin(), max: this.pendingMax() });\n this.open.set(false);\n this._trigger()?.focus();\n return;\n }\n this.filterChange.emit(this.pendingValues());\n this.open.set(false);\n this._trigger()?.focus();\n }\n\n cancel() {\n this.open.set(false);\n this._trigger()?.focus();\n }\n\n clear() {\n if (this.range()) {\n this.pendingMin.set(null);\n this.pendingMax.set(null);\n this.badMin.set(false);\n this.badMax.set(false);\n this.rangeChange.emit({ min: null, max: null });\n this.open.set(false);\n this._trigger()?.focus();\n return;\n }\n this.pendingValues.set([]);\n this.filterChange.emit([]);\n this.open.set(false);\n this._trigger()?.focus();\n }\n\n /** Enter in Min / Max applies the range when it is valid; while invalid it does nothing (Apply is disabled too). */\n onEnter(event: Event) {\n if (!this.open() || !this.range()) return;\n event.preventDefault();\n event.stopPropagation(); // Enter never reaches a surrounding side panel / form Enter handler\n if (!this._rangeInvalid()) this.apply();\n }\n\n /** True when the browser holds text it could not turn into a number (`validity.badInput`). */\n protected _isBadInput(el: HTMLInputElement | null | undefined): boolean { return !!el && el.validity?.badInput === true; }\n\n /** Tracks `validity.badInput` of the Min / Max boxes on every keystroke (the ngModel value is null for such text). */\n onRangeInput(event: Event) {\n const el = event.target as HTMLInputElement | null;\n const id = el?.dataset?.['testid'];\n if (id === 'cf-range-min') this.badMin.set(this._isBadInput(el));\n else if (id === 'cf-range-max') this.badMax.set(this._isBadInput(el));\n }\n\n onDocumentClick(_event: Event) { if (this.open()) this.open.set(false); }\n\n onEscape(event?: Event) {\n if (!this.open()) return; // closed: Escape is left to a surrounding side panel / modal\n event?.stopPropagation();\n event?.preventDefault();\n this.open.set(false);\n this._trigger()?.focus();\n }\n\n onArrow(event: Event, dir: 1 | -1) {\n if (!this.open() || this.range()) return; // range mode: the arrows step the number fields\n event.preventDefault();\n const items = this._optionEls();\n if (!items.length) return;\n const idx = items.indexOf(document.activeElement as HTMLButtonElement);\n items[(idx === -1 ? 0 : (idx + dir + items.length) % items.length)].focus();\n }\n\n /**\n * Places the fixed dropdown from the trigger's viewport rect: centred under the trigger, clamped\n * 8px inside the viewport horizontally, flipped above the trigger when it doesn't fit below\n * (or pinned to the viewport's bottom margin when it fits in neither place).\n */\n private _reposition(): void {\n const trigger = this._trigger();\n if (!trigger) return;\n const MARGIN = 8, GAP = 8;\n const r = trigger.getBoundingClientRect();\n const dd = this._el.nativeElement.querySelector('.cf-dropdown') as HTMLElement | null;\n const w = dd?.offsetWidth || 220;\n const h = dd?.offsetHeight || 0;\n const vw = window.innerWidth, vh = window.innerHeight;\n const left = Math.min(Math.max(r.left + r.width / 2 - w / 2, MARGIN), Math.max(MARGIN, vw - w - MARGIN));\n let top = r.bottom + GAP;\n if (top + h > vh - MARGIN) {\n const above = r.top - GAP - h;\n top = above >= MARGIN ? above : Math.max(MARGIN, vh - MARGIN - h);\n }\n this._pos.set({ top, left });\n }\n\n private _optionEls(): HTMLButtonElement[] {\n return Array.from(this._el.nativeElement.querySelectorAll('.cf-option')) as HTMLButtonElement[];\n }\n\n private _trigger(): HTMLButtonElement | null {\n return this._el.nativeElement.querySelector('.cf-trigger') as HTMLButtonElement | null;\n }\n}\n"],"mappings":";;;;;;;AA0PA,IAAa,wBAAb,MAAa,sBAAqB;CAoEhC,cAAA;EAnEmB,KAAA,SAAS,OAAO,eAA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CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,YAAA,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,aAAA;EAAA,CAAA;EAAA,cAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,MAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,cAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,cAAA;EAAA,CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBAAA,eAAe,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
1
+ {"version":3,"file":"forgeroute-ui-column-filter.mjs","names":[],"sources":["../../../projects/forgeroute-ui/column-filter/src/lib/column-filter/column-filter.component.ts"],"sourcesContent":["import { Component, input, output, signal, computed, effect, afterNextRender, Injector, ChangeDetectionStrategy, inject, ElementRef, viewChildren } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { FilterOption, DROPDOWN_GROUP } from '@forgeroute/ui/table-types';\nimport { UiLabelsService } from '@forgeroute/ui/core';\nimport { TextInputComponent } from '@forgeroute/ui/text-input';\nimport { UiFieldValidity } from '@forgeroute/ui/core';\nimport { uiFormatCurrency, uiFormatNumber } from '@forgeroute/ui/core';\n\n/** What the column filter needs to render a numeric Min / Max popover (resolved from a table `RangeFilterConfig`). */\nexport interface ColumnRangeSpec {\n min: number;\n max?: number;\n step: number;\n format: 'number' | 'currency' | 'percent';\n unit?: string;\n}\n/** The applied (or pending) bounds of a range filter; null = no bound. */\nexport interface ColumnRangeValue { min: number | null; max: number | null; }\n\n@Component({\n selector: 'ui-column-filter',\n standalone: true,\n imports: [FormsModule, TextInputComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '(document:click)': 'onDocumentClick($event)',\n '(keydown.arrowdown)': 'onArrow($event, 1)',\n '(keydown.arrowup)': 'onArrow($event, -1)',\n },\n template: `\n <div class=\"cf-wrapper\">\n <button\n class=\"cf-trigger\"\n [class.cf-active]=\"_isActive()\"\n [class.cf-trigger--chip]=\"chip()\"\n [attr.aria-label]=\"range() && _isActive() ? labels.t('rangeFilter.filterByActive', { label: label(), range: activeLabelText() }) : labels.t('common.filterBy', { label: label() })\"\n [attr.aria-expanded]=\"open()\"\n (click)=\"toggle($event)\">\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\"\n [attr.stroke]=\"_isActive() ? '#3b82f6' : 'currentColor'\"\n stroke-width=\"2\" aria-hidden=\"true\">\n <path d=\"M22 3H2l8 9.46V19l4 2v-8.54L22 3z\"/>\n </svg>\n @if (chip()) {\n <span class=\"cf-chip-label\">{{ label() }}@if (range() && _isActive()) {:}</span>\n }\n @if (_isActive()) {\n <span class=\"cf-active-label\">{{ activeLabelText() }}</span>\n }\n </button>\n\n @if (open()) {\n <div class=\"cf-dropdown\" [attr.role]=\"range() ? 'dialog' : 'listbox'\" [attr.aria-label]=\"labels.t('common.filterOptions', { label: label() })\"\n [style.top.px]=\"_pos().top\" [style.left.px]=\"_pos().left\"\n (click)=\"$event.stopPropagation()\">\n <div class=\"cf-header\">\n <span class=\"cf-header-label\">{{ label() }}</span>\n <button class=\"cf-close\" type=\"button\" [attr.aria-label]=\"labels.t('common.closeFilter')\" (click)=\"open.set(false)\">\n <svg width=\"13\" height=\"13\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" aria-hidden=\"true\">\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\"/><line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\"/>\n </svg>\n </button>\n </div>\n @if (range(); as r) {\n <div class=\"cf-range\" role=\"group\" [attr.aria-label]=\"labels.t('rangeFilter.group', { label: label() })\" (keydown.enter)=\"onEnter($event)\" (input)=\"onRangeInput($event)\">\n <ui-text-input type=\"number\" valueType=\"number\" inputTestId=\"cf-range-min\"\n [label]=\"labels.t('rangeFilter.min')\" [ariaLabel]=\"labels.t('rangeFilter.minFor', { label: label() })\"\n [min]=\"r.min\" [max]=\"r.max\" [step]=\"r.step\" [maxDecimals]=\"_decimals()\" [error]=\"_minError()\" [showErrors]=\"!!_minError()\"\n [placeholder]=\"_formatBound(r.min)\"\n [ngModel]=\"pendingMin()\" (ngModelChange)=\"pendingMin.set($event)\" />\n <ui-text-input type=\"number\" valueType=\"number\" inputTestId=\"cf-range-max\"\n [label]=\"labels.t('rangeFilter.max')\" [ariaLabel]=\"labels.t('rangeFilter.maxFor', { label: label() })\"\n [min]=\"r.min\" [max]=\"r.max\" [step]=\"r.step\" [maxDecimals]=\"_decimals()\" [error]=\"_maxError()\" [showErrors]=\"_maxError() !== ''\"\n [placeholder]=\"r.max != null ? _formatBound(r.max) : ''\"\n [ngModel]=\"pendingMax()\" (ngModelChange)=\"pendingMax.set($event)\" />\n </div>\n <div class=\"cf-footer cf-footer--range\">\n <button class=\"cf-clear\" type=\"button\" data-testid=\"cf-range-clear\" [disabled]=\"!_isActive() && !_pendingHasRange()\" (click)=\"clear()\">{{ labels.t('common.clear') }}</button>\n <button class=\"cf-clear\" type=\"button\" data-testid=\"cf-range-cancel\" (click)=\"cancel()\">{{ labels.t('common.cancel') }}</button>\n <button class=\"cf-apply\" type=\"button\" data-testid=\"cf-range-apply\" [disabled]=\"_rangeInvalid()\" [attr.aria-disabled]=\"_rangeInvalid()\" (click)=\"apply()\">{{ labels.t('common.apply') }}</button>\n </div>\n } @else {\n <div class=\"cf-options\">\n @for (opt of _visibleOptions(); track opt.value) {\n <button\n class=\"cf-option\"\n role=\"option\"\n [class.cf-selected]=\"pendingValues().includes(opt.value)\"\n [attr.aria-selected]=\"pendingValues().includes(opt.value)\"\n (click)=\"select(opt.value)\">\n <span class=\"cf-checkbox\" [class.cf-checkbox--checked]=\"pendingValues().includes(opt.value)\" aria-hidden=\"true\">\n @if (pendingValues().includes(opt.value)) {\n <svg width=\"10\" height=\"10\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"3\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\n <polyline points=\"20 6 9 17 4 12\"/>\n </svg>\n }\n </span>\n {{ opt.label }}\n @if (opt.count != null) {\n <span class=\"cf-count\">{{ opt.count }}</span>\n }\n </button>\n }\n </div>\n <div class=\"cf-footer\">\n @if (pendingHasChanges()) {\n <button class=\"cf-clear\" (click)=\"clear()\">{{ labels.t('common.clear') }}</button>\n } @else {\n <button class=\"cf-clear\" (click)=\"cancel()\">{{ labels.t('common.cancel') }}</button>\n }\n <button class=\"cf-apply\" (click)=\"apply()\">{{ labels.t('common.apply') }}</button>\n </div>\n }\n </div>\n }\n </div>\n `,\n styles: [`\n :host { display: inline-block; position: relative; }\n .cf-wrapper { position: relative; }\n .cf-trigger {\n display: inline-flex; align-items: center; gap: 4px;\n background: none; border: none; cursor: pointer;\n color: #94a3b8; padding: 2px 4px; border-radius: 4px;\n font-family: inherit; font-size: 0.75rem;\n transition: color 0.15s;\n &:hover { color: #1e293b; }\n &.cf-active { color: #3b82f6; }\n &:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }\n }\n /* Touch: invisible 44px hit area around the funnel; header height is unchanged. */\n @media (max-width: 640px), (pointer: coarse) {\n .cf-trigger { position: relative; }\n .cf-trigger::after { content: ''; position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); }\n }\n .cf-active-label { font-size: 0.75rem; font-weight: 500; color: #3b82f6; }\n /* Phone filter chip (data-table control row): labelled pill, 44px tall. */\n .cf-trigger--chip {\n min-height: 44px; padding: 0 14px; gap: 6px;\n border: 1px solid #e2e8f0; border-radius: 999px; background: #fff;\n color: #334155; font-size: 0.8125rem; font-weight: 500;\n &.cf-active { border-color: #bfdbfe; background: #eff6ff; }\n }\n .cf-trigger--chip::after { display: none; }\n .cf-chip-label { white-space: nowrap; }\n /* position: fixed (top/left set from the trigger rect in TS) so the table's scroll container can't clip it. */\n .cf-dropdown {\n position: fixed;\n display: flex; flex-direction: column; max-height: min(420px, calc(100vh - 16px)); /* a long list scrolls inside (.cf-options) instead of making the dropdown as tall as the screen */\n z-index: 9999;\n background: #fff;\n border: 1px solid #e2e8f0;\n border-radius: 12px;\n box-shadow: 0 4px 6px rgba(0,0,0,0.04), 0 12px 28px rgba(0,0,0,0.10);\n min-width: 220px;\n animation: cf-drop 160ms cubic-bezier(0.16, 1, 0.3, 1);\n }\n .cf-header {\n display: flex; align-items: center; justify-content: space-between;\n padding: 12px 12px 10px 16px;\n background: #f8fafc; border-bottom: 1px solid #e2e8f0; border-radius: 12px 12px 0 0; /* light grey header */\n flex-shrink: 0;\n }\n .cf-header-label {\n font-size: 0.7rem; font-weight: 700;\n text-transform: uppercase; letter-spacing: 0.07em; color: #64748b;\n }\n .cf-close {\n display: flex; align-items: center; justify-content: center;\n width: 24px; height: 24px; border-radius: 6px;\n background: none; border: none; cursor: pointer; color: #94a3b8;\n flex-shrink: 0; transition: background 130ms, color 130ms;\n &:hover { background: #f1f5f9; color: #1e293b; }\n }\n @media (max-width: 640px), (pointer: coarse) {\n .cf-close { position: relative; }\n .cf-close::after { content: ''; position: absolute; inset: -10px; }\n }\n .cf-options { padding: 6px 8px; overflow-y: auto; min-height: 0; }\n .cf-option {\n display: flex; align-items: center; gap: 10px; width: 100%;\n padding: 10px 10px; background: none; border: none; border-bottom: 1px solid #e2e8f0;\n cursor: pointer; font-size: 0.875rem; font-weight: 400; color: #1e293b; font-family: inherit; text-align: left; /* 400: the dropdown sits inside the bold table header and a reset that makes buttons inherit would make every option bold */\n border-radius: 0; transition: background 0.12s;\n &:last-child { border-bottom: none; }\n &:hover { background: #f8fafc; }\n &.cf-selected { background: #eff6ff; color: #1d4ed8; font-weight: 500; }\n &:focus-visible { outline: 2px solid #3b82f6; outline-offset: -2px; }\n }\n .cf-checkbox {\n flex-shrink: 0;\n width: 16px; height: 16px; border-radius: 4px;\n border: 1.5px solid #7c8ba1; /* 3:1 against the page: the box is the only thing that shows it is a checkbox */\n display: flex; align-items: center; justify-content: center;\n background: #fff; transition: background 0.12s, border-color 0.12s;\n &.cf-checkbox--checked { background: #3b82f6; border-color: #3b82f6; color: #fff; }\n }\n .cf-count {\n margin-left: auto; font-size: 0.7rem; font-weight: 600; line-height: 1;\n background: #f1f5f9; color: #475569; border-radius: 999px; /* 6.92:1 (was 4.34:1) */\n padding: 2px 7px; min-width: 22px; text-align: center;\n }\n .cf-option.cf-selected .cf-count { background: #dbeafe; color: #1d4ed8; } /* 5.49:1 (blue-600 was 4.24:1) */\n .cf-range { display: flex; flex-direction: column; gap: 12px; padding: 12px 16px; min-width: 220px; }\n .cf-footer--range .cf-clear:disabled, .cf-footer--range .cf-apply:disabled { opacity: 0.5; cursor: not-allowed; }\n .cf-footer {\n display: flex; gap: 8px; padding: 10px 12px 12px;\n background: #f8fafc; border-top: 1px solid #e2e8f0; border-radius: 0 0 12px 12px; /* light grey footer */\n flex-shrink: 0;\n }\n .cf-clear {\n flex: 1; padding: 8px; border-radius: 8px; border: 1px solid #e2e8f0;\n background: #fff; font-size: 0.8125rem; color: #64748b; cursor: pointer;\n font-family: inherit; font-weight: 500; transition: background 0.12s, color 0.12s;\n &:hover { background: #f8fafc; color: #1e293b; }\n }\n .cf-apply {\n flex: 1; padding: 8px; border-radius: 8px; border: none;\n background: #0f172a; color: #fff; font-size: 0.8125rem;\n cursor: pointer; font-family: inherit; font-weight: 600;\n transition: background 0.12s;\n &:hover { background: #1e293b; }\n }\n @keyframes cf-drop {\n from { opacity: 0; transform: translateY(-4px) scale(0.98); }\n to { opacity: 1; transform: translateY(0) scale(1); }\n }\n /* ── iPad (≤1024px) — bigger funnel tap target + comfortable option height ─── */\n @media (max-width: 1024px) {\n .cf-trigger { padding: 6px 8px; }\n .cf-option { padding: 11px 10px; min-height: 40px; }\n .cf-clear, .cf-apply { padding: 10px; }\n }\n\n /* Range popover footer buttons: 44px hit height on touch / phones, like the library's touch-target rule. */\n @media (pointer: coarse), (max-width: 640px) {\n .cf-footer--range .cf-clear, .cf-footer--range .cf-apply { min-height: 44px; }\n }\n\n /* ── Phone (≤640px) — right-anchored dropdown, full touch targets ─── */\n @media (max-width: 640px) {\n .cf-dropdown { min-width: 200px; max-width: calc(100vw - 16px); }\n .cf-option { padding: 12px 10px; min-height: 44px; }\n .cf-clear, .cf-apply { padding: 11px; }\n }\n\n /* Reduced motion: no entrance / shimmer animation (a loading spinner stays, slower). */\n @media (prefers-reduced-motion: reduce) {\n .cf-dropdown { animation: none; }\n }\n `],\n})\nexport class ColumnFilterComponent {\n protected readonly labels = inject(UiLabelsService);\n readonly label = input.required<string>();\n readonly options = input<FilterOption[]>([]);\n /**\n * Numeric range mode (opt-in, set by the table for a `rangeFilters` column): the popover shows Min / Max number fields instead of the value list.\n * Unset = the value-list filter, unchanged.\n */\n readonly range = input<ColumnRangeSpec | null>(null);\n /** Range mode: the applied bounds. */\n readonly rangeValue = input<ColumnRangeValue>({ min: null, max: null });\n /** Range mode: emits the new bounds on Apply (both null = cleared). */\n readonly rangeChange = output<ColumnRangeValue>();\n /** Currently applied values — empty array means no filter active. */\n readonly activeValues = input<string[]>([]);\n /** Render the trigger as a labelled 44px chip (phone control row) instead of the bare funnel icon. */\n readonly chip = input(false);\n\n /** Emits the new selection on Apply. Empty array = filter cleared. */\n readonly filterChange = output<string[]>();\n\n protected readonly open = signal(false);\n protected readonly pendingValues = signal<string[]>([]);\n protected readonly pendingMin = signal<number | null>(null);\n protected readonly pendingMax = signal<number | null>(null);\n private readonly _fields = viewChildren(UiFieldValidity);\n protected readonly _isActive = computed(() => {\n if (this.range()) { const v = this.rangeValue(); return v.min != null || v.max != null; }\n return this.activeValues().length > 0;\n });\n protected readonly _pendingHasRange = computed(() => this.pendingMin() != null || this.pendingMax() != null);\n /** Decimals the step allows (step 0.01 = 2, a whole-number step = 0). */\n protected readonly _decimals = computed(() => {\n const step = this.range()?.step ?? 1;\n const frac = String(step).split('.')[1];\n return frac ? frac.length : 0;\n });\n protected readonly _crossError = computed(() => {\n const a = this.pendingMin(), b = this.pendingMax();\n return a != null && b != null && a > b ? this.labels.t('rangeFilter.minAboveMax') : '';\n });\n /** Firefox / Safari let text into a type=number box (the model becomes null while the box shows it): tracked per field from the native validity. */\n protected readonly badMin = signal(false);\n protected readonly badMax = signal(false);\n /**\n * The Min above Max message is shown ONCE, under Min (one role=\"alert\", announced once), and is revealed at once (no blur needed),\n * so it is visible whichever field was edited last. A non-number typed in a field shows its own message under that field.\n */\n protected readonly _minError = computed(() => this.badMin() ? this.labels.t('rangeFilter.badNumber') : this._crossError());\n protected readonly _maxError = computed(() => this.badMax() ? this.labels.t('rangeFilter.badNumber') : '');\n protected readonly _rangeInvalid = computed(() => this._crossError() !== '' || this.badMin() || this.badMax() || this._fields().some(f => f.invalid()));\n\n /** Hide options with count = 0, unless they are currently selected (so user can deselect). */\n protected readonly _visibleOptions = computed(() =>\n this.options().filter(o => o.count == null || o.count > 0 || this.activeValues().includes(o.value))\n );\n\n protected readonly pendingHasChanges = computed(() => {\n const p = this.pendingValues();\n const a = this.activeValues();\n return p.length !== a.length || p.some(v => !a.includes(v));\n });\n\n private readonly _el = inject(ElementRef);\n private readonly _group = inject(DROPDOWN_GROUP, { optional: true });\n private readonly _injector = inject(Injector);\n private readonly _id = Math.random().toString(36).slice(2);\n\n constructor() {\n const group = this._group;\n if (group) {\n effect(() => { if (group() !== this._id && this.open()) this.open.set(false); });\n }\n // While open, keep the fixed dropdown glued to its trigger on window resize and on any scroll\n // (capture phase, so the table's own scroll container and the page are both caught).\n effect((onCleanup) => {\n if (!this.open()) return;\n const reposition = () => this._reposition();\n window.addEventListener('resize', reposition);\n document.addEventListener('scroll', reposition, true);\n // Escape closes only this dropdown: taken in the capture phase while it is open, so a surrounding side panel / modal (which\n // listens on the document) never sees that key press and stays open. With the dropdown closed nothing is registered.\n const onKeydown = (event: KeyboardEvent) => { if (event.key === 'Escape') this.onEscape(event); };\n document.addEventListener('keydown', onKeydown, true);\n onCleanup(() => {\n document.removeEventListener('keydown', onKeydown, true);\n window.removeEventListener('resize', reposition);\n document.removeEventListener('scroll', reposition, true);\n });\n });\n }\n\n /** Viewport coordinates (px) of the fixed dropdown. */\n protected readonly _pos = signal<{ top: number; left: number }>({ top: 0, left: 0 });\n\n /** One bound as text: plain number (+ unit), US dollars or a percent, in the app's locale. */\n protected _formatBound(v: number): string {\n const r = this.range();\n const locale = this.labels.locale();\n const opts = { minimumFractionDigits: 0, maximumFractionDigits: this._decimals() };\n if (r?.format === 'currency') return uiFormatCurrency(v, 'USD', locale, { ...opts, minimumFractionDigits: this._decimals() });\n const n = uiFormatNumber(v, locale, opts);\n if (r?.format === 'percent') return this.labels.t('rangeFilter.percent', { value: n });\n return r?.unit ? this.labels.t('rangeFilter.withUnit', { value: n, unit: r.unit }) : n;\n }\n\n protected readonly activeLabelText = computed(() => {\n if (this.range()) {\n const { min, max } = this.rangeValue();\n if (min != null && max != null) return this.labels.t('rangeFilter.between', { min: this._formatBound(min), max: this._formatBound(max) });\n if (min != null) return this.labels.t('rangeFilter.atLeast', { min: this._formatBound(min) });\n if (max != null) return this.labels.t('rangeFilter.atMost', { max: this._formatBound(max) });\n return '';\n }\n const vals = this.activeValues();\n if (vals.length === 0) return '';\n if (vals.length === 1) return this.options().find(o => o.value === vals[0])?.label ?? vals[0];\n return this.labels.t('common.nSelected', { count: vals.length });\n });\n\n toggle(event: Event) {\n event.stopPropagation();\n if (!this.open()) {\n this._group?.set(this._id);\n this.pendingValues.set([...this.activeValues()]);\n this.pendingMin.set(this.rangeValue().min);\n this.pendingMax.set(this.rangeValue().max);\n this.badMin.set(false);\n this.badMax.set(false);\n this._reposition(); // estimate (dropdown not rendered yet)\n afterNextRender(() => this._reposition(), { injector: this._injector }); // exact, once it is measurable\n setTimeout(() => (this.range()\n ? this._el.nativeElement.querySelector('.cf-range input') as HTMLElement | null\n : this._optionEls()[0])?.focus(), 30);\n }\n this.open.update(v => !v);\n }\n\n select(value: string) {\n const cur = this.pendingValues();\n this.pendingValues.set(cur.includes(value) ? cur.filter(v => v !== value) : [...cur, value]);\n }\n\n apply() {\n if (this.range()) {\n if (this._rangeInvalid()) return;\n this.rangeChange.emit({ min: this.pendingMin(), max: this.pendingMax() });\n this.open.set(false);\n this._trigger()?.focus();\n return;\n }\n this.filterChange.emit(this.pendingValues());\n this.open.set(false);\n this._trigger()?.focus();\n }\n\n cancel() {\n this.open.set(false);\n this._trigger()?.focus();\n }\n\n clear() {\n if (this.range()) {\n this.pendingMin.set(null);\n this.pendingMax.set(null);\n this.badMin.set(false);\n this.badMax.set(false);\n this.rangeChange.emit({ min: null, max: null });\n this.open.set(false);\n this._trigger()?.focus();\n return;\n }\n this.pendingValues.set([]);\n this.filterChange.emit([]);\n this.open.set(false);\n this._trigger()?.focus();\n }\n\n /** Enter in Min / Max applies the range when it is valid; while invalid it does nothing (Apply is disabled too). */\n onEnter(event: Event) {\n if (!this.open() || !this.range()) return;\n event.preventDefault();\n event.stopPropagation(); // Enter never reaches a surrounding side panel / form Enter handler\n if (!this._rangeInvalid()) this.apply();\n }\n\n /** True when the browser holds text it could not turn into a number (`validity.badInput`). */\n protected _isBadInput(el: HTMLInputElement | null | undefined): boolean { return !!el && el.validity?.badInput === true; }\n\n /** Tracks `validity.badInput` of the Min / Max boxes on every keystroke (the ngModel value is null for such text). */\n onRangeInput(event: Event) {\n const el = event.target as HTMLInputElement | null;\n const id = el?.dataset?.['testid'];\n if (id === 'cf-range-min') this.badMin.set(this._isBadInput(el));\n else if (id === 'cf-range-max') this.badMax.set(this._isBadInput(el));\n }\n\n onDocumentClick(_event: Event) { if (this.open()) this.open.set(false); }\n\n onEscape(event?: Event) {\n if (!this.open()) return; // closed: Escape is left to a surrounding side panel / modal\n event?.stopPropagation();\n event?.preventDefault();\n this.open.set(false);\n this._trigger()?.focus();\n }\n\n onArrow(event: Event, dir: 1 | -1) {\n if (!this.open() || this.range()) return; // range mode: the arrows step the number fields\n event.preventDefault();\n const items = this._optionEls();\n if (!items.length) return;\n const idx = items.indexOf(document.activeElement as HTMLButtonElement);\n items[(idx === -1 ? 0 : (idx + dir + items.length) % items.length)].focus();\n }\n\n /**\n * Places the fixed dropdown from the trigger's viewport rect: centred under the trigger, clamped\n * 8px inside the viewport horizontally, flipped above the trigger when it doesn't fit below\n * (or pinned to the viewport's bottom margin when it fits in neither place).\n */\n private _reposition(): void {\n const trigger = this._trigger();\n if (!trigger) return;\n const MARGIN = 8, GAP = 8;\n const r = trigger.getBoundingClientRect();\n const dd = this._el.nativeElement.querySelector('.cf-dropdown') as HTMLElement | null;\n const w = dd?.offsetWidth || 220;\n const h = dd?.offsetHeight || 0;\n const vw = window.innerWidth, vh = window.innerHeight;\n const left = Math.min(Math.max(r.left + r.width / 2 - w / 2, MARGIN), Math.max(MARGIN, vw - w - MARGIN));\n let top = r.bottom + GAP;\n if (top + h > vh - MARGIN) {\n const above = r.top - GAP - h;\n top = above >= MARGIN ? above : Math.max(MARGIN, vh - MARGIN - h);\n }\n this._pos.set({ top, left });\n }\n\n private _optionEls(): HTMLButtonElement[] {\n return Array.from(this._el.nativeElement.querySelectorAll('.cf-option')) as HTMLButtonElement[];\n }\n\n private _trigger(): HTMLButtonElement | null {\n return this._el.nativeElement.queryS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sBAAA,CAAA;CAAA,gBAAA;EAAA,OAAA,CAAA;GAAA,MAAA,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,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,YAAA,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,aAAA;EAAA,CAAA;EAAA,cAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,MAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,cAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,cAAA;EAAA,CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBAAA,eAAe,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
@@ -3115,7 +3115,7 @@ function readerErrorInfo(error) {
3115
3115
  message: pick(isString, body?.message, e?.message) ?? "",
3116
3116
  paymentId: pick(isString, e?.paymentId, body?.paymentId),
3117
3117
  terminal: pick(isObject, e?.terminal, body?.terminal),
3118
- ...pick(isString, e?.pairingCode, body?.pairingCode) ? { pairingCode: pick(isString, e?.pairingCode, body?.pairingCode) } : {},
3118
+ ...safePairingCode(pick(isString, e?.pairingCode, body?.pairingCode)) ? { pairingCode: safePairingCode(pick(isString, e?.pairingCode, body?.pairingCode)) } : {},
3119
3119
  ...cents("amountCents"),
3120
3120
  ...cents("feeCents"),
3121
3121
  ...cents("platformFeeCents"),
@@ -3255,6 +3255,11 @@ function isSafeReceiptUrl(url) {
3255
3255
  return false;
3256
3256
  }
3257
3257
  }
3258
+ function safePairingCode(value) {
3259
+ if (typeof value !== "string") return null;
3260
+ const code = value.trim();
3261
+ return /^[A-Za-z0-9-]{3,32}$/.test(code) ? code : null;
3262
+ }
3258
3263
  function formatElapsed(ms) {
3259
3264
  const total = Math.max(0, Math.floor((Number.isFinite(ms) ? ms : 0) / 1e3));
3260
3265
  const m = Math.floor(total / 60);
@@ -8326,7 +8331,7 @@ var SquareTerminalPairingComponent = class SquareTerminalPairingComponent {
8326
8331
  ...location ? { locationId: location } : {}
8327
8332
  }));
8328
8333
  if (this.destroyed || run !== this.run) return;
8329
- const code = typeof reader?.pairingCode === "string" ? reader.pairingCode.trim() : "";
8334
+ const code = safePairingCode(reader?.pairingCode) ?? "";
8330
8335
  if (!reader || typeof reader.id !== "string" || !code) throw Object.assign(/* @__PURE__ */ new Error("no pairing code"), { code: "no_pairing_code" });
8331
8336
  this.registered = {
8332
8337
  id: reader.id,