@forgeroute/ui 0.5.25 → 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 +40 -6
  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-color-input.d.ts +7 -0
  70. package/types/forgeroute-ui-detail-card.d.ts +7 -0
  71. package/types/forgeroute-ui-dropdown.d.ts +2 -0
  72. package/types/forgeroute-ui-media.d.ts +28 -0
  73. package/types/forgeroute-ui-messaging.d.ts +1 -1
  74. package/types/forgeroute-ui-quickbooks.d.ts +1 -1
  75. package/types/forgeroute-ui-square.d.ts +2 -2
  76. package/types/forgeroute-ui-stripe.d.ts +1 -1
  77. package/types/forgeroute-ui-textarea-input.d.ts +9 -9
@@ -23,6 +23,7 @@ var ColorInputComponent = class ColorInputComponent {
23
23
  this.error = input("", ...ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []);
24
24
  this.showErrors = input(false, ...ngDevMode ? [{ debugName: "showErrors" }] : /* istanbul ignore next */ []);
25
25
  this.allowAlpha = input(false, ...ngDevMode ? [{ debugName: "allowAlpha" }] : /* istanbul ignore next */ []);
26
+ this.showText = input(true, ...ngDevMode ? [{ debugName: "showText" }] : /* istanbul ignore next */ []);
26
27
  this.presets = input([], ...ngDevMode ? [{ debugName: "presets" }] : /* istanbul ignore next */ []);
27
28
  this.invalidChange = output();
28
29
  this._disabledInput = input(false, {
@@ -207,6 +208,13 @@ var ColorInputComponent = class ColorInputComponent {
207
208
  isRequired: false,
208
209
  transformFunction: null
209
210
  },
211
+ showText: {
212
+ classPropertyName: "showText",
213
+ publicName: "showText",
214
+ isSignal: true,
215
+ isRequired: false,
216
+ transformFunction: null
217
+ },
210
218
  presets: {
211
219
  classPropertyName: "presets",
212
220
  publicName: "presets",
@@ -244,14 +252,19 @@ var ColorInputComponent = class ColorInputComponent {
244
252
  template: `
245
253
  <div class="co-field" [class.co-error]="_activeError()" [class.co-disabled]="disabled()">
246
254
  @if (label()) {
247
- <label class="co-label" [for]="_textId">
255
+ <label class="co-label" [for]="showText() ? _textId : _nativeId">
248
256
  {{ label() }}
249
257
  @if (required()) { <span class="co-required" aria-hidden="true">*</span> }
250
258
  </label>
251
259
  }
252
260
  <div class="co-row">
253
- <span class="co-swatch">
261
+ <span class="co-swatch" [class.co-swatch-wide]="!showText()">
254
262
  <span class="co-preview" [style.background-color]="_swatchColor()" aria-hidden="true"></span>
263
+ @if (!showText()) {
264
+ <span class="co-chip" aria-hidden="true" data-testid="color-input-chip">
265
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 3a9 9 0 1 0 0 18c1.1 0 2-.9 2-2 0-.5-.2-1-.5-1.3-.3-.4-.5-.8-.5-1.3 0-1.1.9-2 2-2h2.4a3.6 3.6 0 0 0 3.6-3.6C21 6.8 17 3 12 3z"/><circle cx="7.5" cy="11.5" r="1"/><circle cx="10.5" cy="7.5" r="1"/><circle cx="15.5" cy="7.5" r="1"/></svg>
266
+ </span>
267
+ }
255
268
  <input
256
269
  class="co-native"
257
270
  type="color"
@@ -259,9 +272,12 @@ var ColorInputComponent = class ColorInputComponent {
259
272
  [value]="_nativeValue()"
260
273
  [disabled]="disabled()"
261
274
  [attr.aria-label]="labels.t('colorInput.picker', { label: label() || ariaLabel() || labels.t('colorInput.colour') })"
275
+ [attr.aria-describedby]="!showText() && (_activeError() || hint()) ? _descId : null"
276
+ [attr.aria-invalid]="!showText() && _activeError() ? 'true' : null"
262
277
  (input)="onNativeInput($event)"
263
278
  (blur)="onNativeBlur()" />
264
279
  </span>
280
+ @if (showText()) {
265
281
  <input
266
282
  class="co-text"
267
283
  type="text"
@@ -279,6 +295,7 @@ var ColorInputComponent = class ColorInputComponent {
279
295
  [attr.aria-describedby]="(_activeError() || hint()) ? _descId : null"
280
296
  (input)="onTextInput($event)"
281
297
  (blur)="onTextBlur()" />
298
+ }
282
299
  </div>
283
300
  @if (presets().length) {
284
301
  <div class="co-presets" role="group" [attr.aria-label]="labels.t('colorInput.presets', { label: label() || ariaLabel() || labels.t('colorInput.colour') })">
@@ -303,7 +320,7 @@ var ColorInputComponent = class ColorInputComponent {
303
320
  </div>
304
321
  `,
305
322
  isInline: true,
306
- styles: [":host{display:block}.co-field{display:flex;flex-direction:column;gap:6px}.co-label{font-size:.8125rem;font-weight:600;color:#374151;line-height:1}.co-required{color:#dc2626;margin-left:2px}.co-row{display:flex;align-items:center;gap:8px}.co-swatch{position:relative;flex-shrink:0;width:38px;height:38px;box-sizing:border-box;border:1px solid #7c8ba1;border-radius:8px;overflow:hidden;background:#fff;transition:border-color .15s,box-shadow .15s}.co-swatch:focus-within{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61f}.co-preview{position:absolute;inset:0;display:block}.co-native{position:absolute;inset:0;width:100%;height:100%;margin:0;padding:0;border:0;opacity:0;cursor:pointer;-webkit-appearance:none;appearance:none;background:transparent}.co-native::-webkit-color-swatch-wrapper{padding:0}.co-native::-webkit-color-swatch{border:0;border-radius:0}.co-native::-moz-color-swatch{border:0;border-radius:0}.co-text{flex:1;min-width:0;box-sizing:border-box;padding:9px 12px;font-size:.875rem;font-family:inherit;color:#1e293b;background:#fff;border:1px solid #7c8ba1;border-radius:8px;outline:none;transition:border-color .15s,box-shadow .15s}.co-text::placeholder{color:#64748b;opacity:1}.co-text:focus{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61f}.co-presets{display:flex;flex-wrap:wrap;gap:8px}.co-preset{width:28px;height:28px;padding:0;box-sizing:border-box;cursor:pointer;border:1px solid #7c8ba1;border-radius:50%}.co-preset-selected{box-shadow:0 0 0 2px #fff,0 0 0 4px #3b82f6}.co-preset:focus{outline:2px solid #3b82f6;outline-offset:2px}.co-preset:focus:not(:focus-visible){outline:none}.co-error .co-text,.co-error .co-swatch{border-color:#ef4444}.co-error .co-text:focus{box-shadow:0 0 0 3px #ef44441f}.co-disabled .co-text,.co-disabled .co-swatch,.co-disabled .co-preset{opacity:.5;cursor:not-allowed}.co-disabled .co-native{cursor:not-allowed}.co-desc{margin:0;font-size:.75rem;line-height:1.4;color:#64748b}.co-desc-error{color:#dc2626}@media(max-width:480px){.co-text{font-size:1rem}}@media(pointer:coarse),(max-width:480px){.co-text{min-height:44px}.co-swatch,.co-preset{width:44px;height:44px}}\n"],
323
+ styles: [":host{display:block}.co-field{display:flex;flex-direction:column;gap:6px}.co-label{font-size:.8125rem;font-weight:600;color:#374151;line-height:1}.co-required{color:#dc2626;margin-left:2px}.co-row{display:flex;align-items:center;gap:8px}.co-swatch{position:relative;flex-shrink:0;width:38px;height:38px;box-sizing:border-box;border:1px solid #7c8ba1;border-radius:8px;overflow:hidden;background:#fff;transition:border-color .15s,box-shadow .15s}.co-swatch-wide{flex:1;width:auto;min-width:0;height:40px;cursor:pointer}.co-swatch-wide:hover{border-color:#475569}.co-chip{position:absolute;top:50%;right:8px;transform:translateY(-50%);display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:6px;background:#fff;color:#334155;border:1px solid #94a3b8;pointer-events:none}.co-swatch:focus-within{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61f}.co-preview{position:absolute;inset:0;display:block}.co-native{position:absolute;inset:0;width:100%;height:100%;margin:0;padding:0;border:0;opacity:0;cursor:pointer;-webkit-appearance:none;appearance:none;background:transparent}.co-native::-webkit-color-swatch-wrapper{padding:0}.co-native::-webkit-color-swatch{border:0;border-radius:0}.co-native::-moz-color-swatch{border:0;border-radius:0}.co-text{flex:1;min-width:0;box-sizing:border-box;padding:9px 12px;font-size:.875rem;font-family:inherit;color:#1e293b;background:#fff;border:1px solid #7c8ba1;border-radius:8px;outline:none;transition:border-color .15s,box-shadow .15s}.co-text::placeholder{color:#64748b;opacity:1}.co-text:focus{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61f}.co-presets{display:flex;flex-wrap:wrap;gap:8px}.co-preset{width:28px;height:28px;padding:0;box-sizing:border-box;cursor:pointer;border:1px solid #7c8ba1;border-radius:50%}.co-preset-selected{box-shadow:0 0 0 2px #fff,0 0 0 4px #3b82f6}.co-preset:focus{outline:2px solid #3b82f6;outline-offset:2px}.co-preset:focus:not(:focus-visible){outline:none}.co-error .co-text,.co-error .co-swatch{border-color:#ef4444}.co-error .co-text:focus{box-shadow:0 0 0 3px #ef44441f}.co-disabled .co-text,.co-disabled .co-swatch,.co-disabled .co-preset{opacity:.5;cursor:not-allowed}.co-disabled .co-native{cursor:not-allowed}.co-desc{margin:-6px 0 0;font-size:.75rem;line-height:1.4;color:#64748b}.co-desc-error{color:#dc2626}@media(max-width:480px){.co-text{font-size:1rem}}@media(pointer:coarse),(max-width:480px){.co-text{min-height:44px}.co-swatch{width:44px;height:44px}.co-swatch-wide{width:auto;height:44px}.co-preset{width:44px;height:44px}}\n"],
307
324
  changeDetection: i0.ChangeDetectionStrategy.OnPush
308
325
  });
309
326
  }
@@ -338,14 +355,19 @@ i0.ɵɵngDeclareClassMetadata({
338
355
  template: `
339
356
  <div class="co-field" [class.co-error]="_activeError()" [class.co-disabled]="disabled()">
340
357
  @if (label()) {
341
- <label class="co-label" [for]="_textId">
358
+ <label class="co-label" [for]="showText() ? _textId : _nativeId">
342
359
  {{ label() }}
343
360
  @if (required()) { <span class="co-required" aria-hidden="true">*</span> }
344
361
  </label>
345
362
  }
346
363
  <div class="co-row">
347
- <span class="co-swatch">
364
+ <span class="co-swatch" [class.co-swatch-wide]="!showText()">
348
365
  <span class="co-preview" [style.background-color]="_swatchColor()" aria-hidden="true"></span>
366
+ @if (!showText()) {
367
+ <span class="co-chip" aria-hidden="true" data-testid="color-input-chip">
368
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 3a9 9 0 1 0 0 18c1.1 0 2-.9 2-2 0-.5-.2-1-.5-1.3-.3-.4-.5-.8-.5-1.3 0-1.1.9-2 2-2h2.4a3.6 3.6 0 0 0 3.6-3.6C21 6.8 17 3 12 3z"/><circle cx="7.5" cy="11.5" r="1"/><circle cx="10.5" cy="7.5" r="1"/><circle cx="15.5" cy="7.5" r="1"/></svg>
369
+ </span>
370
+ }
349
371
  <input
350
372
  class="co-native"
351
373
  type="color"
@@ -353,9 +375,12 @@ i0.ɵɵngDeclareClassMetadata({
353
375
  [value]="_nativeValue()"
354
376
  [disabled]="disabled()"
355
377
  [attr.aria-label]="labels.t('colorInput.picker', { label: label() || ariaLabel() || labels.t('colorInput.colour') })"
378
+ [attr.aria-describedby]="!showText() && (_activeError() || hint()) ? _descId : null"
379
+ [attr.aria-invalid]="!showText() && _activeError() ? 'true' : null"
356
380
  (input)="onNativeInput($event)"
357
381
  (blur)="onNativeBlur()" />
358
382
  </span>
383
+ @if (showText()) {
359
384
  <input
360
385
  class="co-text"
361
386
  type="text"
@@ -373,6 +398,7 @@ i0.ɵɵngDeclareClassMetadata({
373
398
  [attr.aria-describedby]="(_activeError() || hint()) ? _descId : null"
374
399
  (input)="onTextInput($event)"
375
400
  (blur)="onTextBlur()" />
401
+ }
376
402
  </div>
377
403
  @if (presets().length) {
378
404
  <div class="co-presets" role="group" [attr.aria-label]="labels.t('colorInput.presets', { label: label() || ariaLabel() || labels.t('colorInput.colour') })">
@@ -396,7 +422,7 @@ i0.ɵɵngDeclareClassMetadata({
396
422
  }
397
423
  </div>
398
424
  `,
399
- styles: [":host{display:block}.co-field{display:flex;flex-direction:column;gap:6px}.co-label{font-size:.8125rem;font-weight:600;color:#374151;line-height:1}.co-required{color:#dc2626;margin-left:2px}.co-row{display:flex;align-items:center;gap:8px}.co-swatch{position:relative;flex-shrink:0;width:38px;height:38px;box-sizing:border-box;border:1px solid #7c8ba1;border-radius:8px;overflow:hidden;background:#fff;transition:border-color .15s,box-shadow .15s}.co-swatch:focus-within{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61f}.co-preview{position:absolute;inset:0;display:block}.co-native{position:absolute;inset:0;width:100%;height:100%;margin:0;padding:0;border:0;opacity:0;cursor:pointer;-webkit-appearance:none;appearance:none;background:transparent}.co-native::-webkit-color-swatch-wrapper{padding:0}.co-native::-webkit-color-swatch{border:0;border-radius:0}.co-native::-moz-color-swatch{border:0;border-radius:0}.co-text{flex:1;min-width:0;box-sizing:border-box;padding:9px 12px;font-size:.875rem;font-family:inherit;color:#1e293b;background:#fff;border:1px solid #7c8ba1;border-radius:8px;outline:none;transition:border-color .15s,box-shadow .15s}.co-text::placeholder{color:#64748b;opacity:1}.co-text:focus{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61f}.co-presets{display:flex;flex-wrap:wrap;gap:8px}.co-preset{width:28px;height:28px;padding:0;box-sizing:border-box;cursor:pointer;border:1px solid #7c8ba1;border-radius:50%}.co-preset-selected{box-shadow:0 0 0 2px #fff,0 0 0 4px #3b82f6}.co-preset:focus{outline:2px solid #3b82f6;outline-offset:2px}.co-preset:focus:not(:focus-visible){outline:none}.co-error .co-text,.co-error .co-swatch{border-color:#ef4444}.co-error .co-text:focus{box-shadow:0 0 0 3px #ef44441f}.co-disabled .co-text,.co-disabled .co-swatch,.co-disabled .co-preset{opacity:.5;cursor:not-allowed}.co-disabled .co-native{cursor:not-allowed}.co-desc{margin:0;font-size:.75rem;line-height:1.4;color:#64748b}.co-desc-error{color:#dc2626}@media(max-width:480px){.co-text{font-size:1rem}}@media(pointer:coarse),(max-width:480px){.co-text{min-height:44px}.co-swatch,.co-preset{width:44px;height:44px}}\n"]
425
+ styles: [":host{display:block}.co-field{display:flex;flex-direction:column;gap:6px}.co-label{font-size:.8125rem;font-weight:600;color:#374151;line-height:1}.co-required{color:#dc2626;margin-left:2px}.co-row{display:flex;align-items:center;gap:8px}.co-swatch{position:relative;flex-shrink:0;width:38px;height:38px;box-sizing:border-box;border:1px solid #7c8ba1;border-radius:8px;overflow:hidden;background:#fff;transition:border-color .15s,box-shadow .15s}.co-swatch-wide{flex:1;width:auto;min-width:0;height:40px;cursor:pointer}.co-swatch-wide:hover{border-color:#475569}.co-chip{position:absolute;top:50%;right:8px;transform:translateY(-50%);display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:6px;background:#fff;color:#334155;border:1px solid #94a3b8;pointer-events:none}.co-swatch:focus-within{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61f}.co-preview{position:absolute;inset:0;display:block}.co-native{position:absolute;inset:0;width:100%;height:100%;margin:0;padding:0;border:0;opacity:0;cursor:pointer;-webkit-appearance:none;appearance:none;background:transparent}.co-native::-webkit-color-swatch-wrapper{padding:0}.co-native::-webkit-color-swatch{border:0;border-radius:0}.co-native::-moz-color-swatch{border:0;border-radius:0}.co-text{flex:1;min-width:0;box-sizing:border-box;padding:9px 12px;font-size:.875rem;font-family:inherit;color:#1e293b;background:#fff;border:1px solid #7c8ba1;border-radius:8px;outline:none;transition:border-color .15s,box-shadow .15s}.co-text::placeholder{color:#64748b;opacity:1}.co-text:focus{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61f}.co-presets{display:flex;flex-wrap:wrap;gap:8px}.co-preset{width:28px;height:28px;padding:0;box-sizing:border-box;cursor:pointer;border:1px solid #7c8ba1;border-radius:50%}.co-preset-selected{box-shadow:0 0 0 2px #fff,0 0 0 4px #3b82f6}.co-preset:focus{outline:2px solid #3b82f6;outline-offset:2px}.co-preset:focus:not(:focus-visible){outline:none}.co-error .co-text,.co-error .co-swatch{border-color:#ef4444}.co-error .co-text:focus{box-shadow:0 0 0 3px #ef44441f}.co-disabled .co-text,.co-disabled .co-swatch,.co-disabled .co-preset{opacity:.5;cursor:not-allowed}.co-disabled .co-native{cursor:not-allowed}.co-desc{margin:-6px 0 0;font-size:.75rem;line-height:1.4;color:#64748b}.co-desc-error{color:#dc2626}@media(max-width:480px){.co-text{font-size:1rem}}@media(pointer:coarse),(max-width:480px){.co-text{min-height:44px}.co-swatch{width:44px;height:44px}.co-swatch-wide{width:auto;height:44px}.co-preset{width:44px;height:44px}}\n"]
400
426
  }]
401
427
  }],
402
428
  ctorParameters: () => [],
@@ -465,6 +491,14 @@ i0.ɵɵngDeclareClassMetadata({
465
491
  required: false
466
492
  }]
467
493
  }],
494
+ showText: [{
495
+ type: i0.Input,
496
+ args: [{
497
+ isSignal: true,
498
+ alias: "showText",
499
+ required: false
500
+ }]
501
+ }],
468
502
  presets: [{
469
503
  type: i0.Input,
470
504
  args: [{
@@ -1 +1 @@
1
- {"version":3,"file":"forgeroute-ui-color-input.mjs","names":[],"sources":["../../../projects/forgeroute-ui/color-input/src/lib/color-input/color-input.component.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, effect, forwardRef, input, output, signal, inject } from '@angular/core';\nimport { AbstractControl, ControlValueAccessor, NG_VALIDATORS, NG_VALUE_ACCESSOR, ValidationErrors, Validator } from '@angular/forms';\nimport { FieldIssue, UiFieldValidity, createFieldReveal, issueToErrors, requiredIssue } from '@forgeroute/ui/core';\nimport { UiLabelsService } from '@forgeroute/ui/core';\n\nlet nextColorId = 0;\n\n/** A preset swatch offered under the field. `label` is its accessible name. */\nexport interface ColorPreset { value: string; label: string; }\n\n/**\n * Normalises a CSS hex colour: `#fff` / `FFF` -> `#ffffff`, `#RRGGBB` -> lower case. With `allowAlpha`, `#rrggbbaa`\n * is accepted and kept at 8 digits (shorthand `#rgba` is never accepted). Returns null for anything else\n * (named colours, `rgb()`, wrong lengths, non-hex digits). The leading `#` is optional on input.\n */\nexport function normalizeHexColor(value: string | null | undefined, allowAlpha = false): string | null {\n if (typeof value !== 'string') return null;\n const m = /^#?([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(value.trim());\n if (!m) return null;\n let hex = m[1].toLowerCase();\n if (hex.length === 8 && !allowAlpha) return null;\n if (hex.length === 3) hex = hex.split('').map(c => c + c).join('');\n return '#' + hex;\n}\n\n/**\n * Colour input: ControlValueAccessor over a string holding a CSS hex colour. A swatch opens the operating system's\n * colour picker (native `<input type=\"color\">`) and a text field next to it shows / edits the hex; both stay in sync.\n *\n * <ui-color-input label=\"Brand colour\" [(ngModel)]=\"brand\" />\n * <ui-color-input label=\"Accent\" [presets]=\"presets\" [allowAlpha]=\"true\" [formControl]=\"accent\" />\n *\n * Value contract\n * - A valid colour is emitted normalised to lower-case `#rrggbb` (`#FFF` -> `#ffffff`; 8-digit `#rrggbbaa` only with\n * `allowAlpha`, kept at 8 digits). The user may type with or without the leading `#`; the control prepends it.\n * - Text the user typed that is not a valid colour is emitted as typed (with `#` prepended, `''` when cleared) so the host\n * sees what the user entered; the control is then invalid (the `colorInput.invalidHex` text, \"Enter a hex colour like #3b82f6.\" in English) and the form control gets\n * the `color` error. While typing, the text is not rewritten (`#fff` is emitted as `#ffffff` but stays `#fff` on screen)\n * and is normalised on blur.\n * - A value WRITTEN BY THE HOST (`writeValue` / `[ngModel]` / `[formControl]`) is never flagged as an invalid colour, even\n * when it is not a hex (`red`, `#fff8`, a legacy value), until the user changes it, so legacy data never blocks Save.\n * (Required is still checked for an empty value.) The native picker gets `#000000` for a non-hex value so it never throws.\n * - Picking in the native picker with an 8-digit value and `allowAlpha` keeps the existing alpha digits.\n *\n * Validity API (same as the other ui inputs): `Validator` (error keys `required`, `color`), signals `invalid` /\n * `errorMessage`, `invalidChange` output, `UiFieldValidity` token. Messages (built-in and a host `[error]`) show only after the user left the field; `[showErrors]=\"true\"` also reveals it on an untouched field. Disabled controls are never invalid.\n *\n * Cross-browser: the native swatch is styled with `-webkit-appearance` and the `::-webkit-color-swatch` / `::-moz-color-swatch`\n * pseudo-elements and sits invisibly over our own preview square, so it looks the same in Chrome, Edge, Firefox and Safari.\n * Preset swatches are real `<button>`s (Enter / Space work natively, `aria-pressed` marks the selected one).\n */\n@Component({\n selector: 'ui-color-input',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => ColorInputComponent), multi: true },\n { provide: NG_VALIDATORS, useExisting: forwardRef(() => ColorInputComponent), multi: true },\n { provide: UiFieldValidity, useExisting: forwardRef(() => ColorInputComponent) },\n ],\n template: `\n <div class=\"co-field\" [class.co-error]=\"_activeError()\" [class.co-disabled]=\"disabled()\">\n @if (label()) {\n <label class=\"co-label\" [for]=\"_textId\">\n {{ label() }}\n @if (required()) { <span class=\"co-required\" aria-hidden=\"true\">*</span> }\n </label>\n }\n <div class=\"co-row\">\n <span class=\"co-swatch\">\n <span class=\"co-preview\" [style.background-color]=\"_swatchColor()\" aria-hidden=\"true\"></span>\n <input\n class=\"co-native\"\n type=\"color\"\n [id]=\"_nativeId\"\n [value]=\"_nativeValue()\"\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"labels.t('colorInput.picker', { label: label() || ariaLabel() || labels.t('colorInput.colour') })\"\n (input)=\"onNativeInput($event)\"\n (blur)=\"onNativeBlur()\" />\n </span>\n <input\n class=\"co-text\"\n type=\"text\"\n [id]=\"_textId\"\n [value]=\"_text()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [attr.maxlength]=\"allowAlpha() ? 9 : 7\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [attr.required]=\"required() || null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-label]=\"label() ? null : (ariaLabel() || null)\"\n [attr.aria-invalid]=\"_activeError() ? 'true' : null\"\n [attr.aria-describedby]=\"(_activeError() || hint()) ? _descId : null\"\n (input)=\"onTextInput($event)\"\n (blur)=\"onTextBlur()\" />\n </div>\n @if (presets().length) {\n <div class=\"co-presets\" role=\"group\" [attr.aria-label]=\"labels.t('colorInput.presets', { label: label() || ariaLabel() || labels.t('colorInput.colour') })\">\n @for (p of presets(); track $index) {\n <button\n type=\"button\"\n class=\"co-preset\"\n [class.co-preset-selected]=\"_isSelected(p)\"\n [style.background-color]=\"_presetColor(p)\"\n [attr.aria-label]=\"p.label\"\n [attr.aria-pressed]=\"_isSelected(p) ? 'true' : 'false'\"\n [disabled]=\"disabled()\"\n (click)=\"selectPreset(p)\"></button>\n }\n </div>\n }\n @if (_activeError()) {\n <p class=\"co-desc co-desc-error\" [id]=\"_descId\" role=\"alert\">{{ _activeError() }}</p>\n } @else if (hint()) {\n <p class=\"co-desc\" [id]=\"_descId\">{{ hint() }}</p>\n }\n </div>\n `,\n styles: [`\n :host { display: block; }\n .co-field { display: flex; flex-direction: column; gap: 6px; }\n .co-label { font-size: 0.8125rem; font-weight: 600; color: #374151; line-height: 1; }\n .co-required { color: #dc2626; margin-left: 2px; }\n .co-row { display: flex; align-items: center; gap: 8px; }\n\n .co-swatch {\n position: relative; flex-shrink: 0; width: 38px; height: 38px; box-sizing: border-box;\n border: 1px solid #7c8ba1; border-radius: 8px; overflow: hidden; background: #fff;\n transition: border-color 0.15s, box-shadow 0.15s;\n }\n .co-swatch:focus-within { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12); }\n .co-preview { position: absolute; inset: 0; display: block; }\n /* The real colour input sits invisibly over the preview so clicks and keyboard land on it. */\n .co-native {\n position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0;\n opacity: 0; cursor: pointer; -webkit-appearance: none; appearance: none; background: transparent;\n }\n .co-native::-webkit-color-swatch-wrapper { padding: 0; }\n .co-native::-webkit-color-swatch { border: 0; border-radius: 0; }\n .co-native::-moz-color-swatch { border: 0; border-radius: 0; }\n\n .co-text {\n flex: 1; min-width: 0; box-sizing: border-box;\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; transition: border-color 0.15s, box-shadow 0.15s;\n }\n .co-text::placeholder { color: #64748b; opacity: 1; }\n .co-text:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12); }\n\n .co-presets { display: flex; flex-wrap: wrap; gap: 8px; }\n .co-preset {\n width: 28px; height: 28px; padding: 0; box-sizing: border-box; cursor: pointer;\n border: 1px solid #7c8ba1; border-radius: 50%;\n }\n .co-preset-selected { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #3b82f6; }\n .co-preset:focus { outline: 2px solid #3b82f6; outline-offset: 2px; }\n .co-preset:focus:not(:focus-visible) { outline: none; }\n\n .co-error .co-text, .co-error .co-swatch { border-color: #ef4444; }\n .co-error .co-text:focus { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12); }\n\n .co-disabled .co-text, .co-disabled .co-swatch, .co-disabled .co-preset { opacity: 0.5; cursor: not-allowed; }\n .co-disabled .co-native { cursor: not-allowed; }\n\n .co-desc { margin: 0; font-size: 0.75rem; line-height: 1.4; color: #64748b; }\n .co-desc-error { color: #dc2626; }\n\n @media (max-width: 480px) { .co-text { font-size: 1rem; } }\n @media (pointer: coarse), (max-width: 480px) {\n .co-text { min-height: 44px; }\n .co-swatch { width: 44px; height: 44px; }\n .co-preset { width: 44px; height: 44px; }\n }\n `],\n})\nexport class ColorInputComponent 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 placeholder = input('#3b82f6');\n readonly required = input(false);\n readonly hint = input('');\n /** Host error message; always wins over the built-in message. */\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 /** Accept (and keep) 8-digit `#rrggbbaa` values. */\n readonly allowAlpha = input(false);\n /** Optional row of preset swatches. */\n readonly presets = input<ColorPreset[]>([]);\n\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 /** Current model value (what the form control holds). */\n private readonly _model = signal('');\n /** Text shown in the text field. */\n protected readonly _text = signal('');\n /** True once the user changed the value; host-written values are not format-checked before that. */\n private readonly _edited = signal(false);\n\n private readonly _reveal = createFieldReveal(this.showErrors);\n private readonly _issue = computed(() => this._check(this._model(), this._edited()));\n readonly invalid = computed(() => !!this.error() || !!this._issue());\n readonly errorMessage = computed(() => this._issue()?.message ?? '');\n protected readonly _activeError = computed(() => this._reveal.revealed() ? (this.error() || this.errorMessage()) : '');\n\n private readonly _valid = computed(() => normalizeHexColor(this._model(), this.allowAlpha()));\n /** Colour of the preview square: the value when it is a usable hex, otherwise transparent. */\n protected readonly _swatchColor = computed(() => this._valid() ?? 'transparent');\n /** Value for the native picker: always `#rrggbb`. */\n protected readonly _nativeValue = computed(() => (this._valid() ?? '#000000').slice(0, 7));\n\n private readonly _uid = nextColorId++;\n protected readonly _textId = `co-text-${this._uid}`;\n protected readonly _nativeId = `co-native-${this._uid}`;\n protected readonly _descId = `co-desc-${this._uid}`;\n\n private _onChange = (_: string) => {};\n private _onTouched = () => {};\n private _onValidatorChange = () => {};\n\n constructor() {\n effect(() => { this.invalidChange.emit(this.invalid()); });\n }\n\n /** Re-run the form control's validation when a rule input (required, allowAlpha, ...) changes. */\n ngOnChanges() { this._onValidatorChange(); }\n\n writeValue(val: string | null) {\n const text = val == null ? '' : String(val);\n this._model.set(text);\n this._text.set(text);\n this._edited.set(false);\n }\n registerOnChange(fn: (v: string) => void) { this._onChange = fn; }\n registerOnTouched(fn: () => void) { this._onTouched = fn; }\n registerOnValidatorChange(fn: () => void) { this._onValidatorChange = fn; }\n setDisabledState(d: boolean) { this._cvaDisabled.set(d); }\n\n validate(control: AbstractControl): ValidationErrors | null {\n const v = control.value;\n return issueToErrors(this._check(v == null ? '' : String(v), this._edited()));\n }\n\n protected onTextInput(event: Event) {\n const el = event.target as HTMLInputElement;\n let raw = el.value.trim();\n if (raw && !raw.startsWith('#')) raw = '#' + raw;\n if (raw === '#') raw = '';\n if (el.value !== raw) el.value = raw;\n this._text.set(raw);\n this._commit(normalizeHexColor(raw, this.allowAlpha()) ?? raw);\n }\n\n protected onNativeInput(event: Event) {\n const picked = (event.target as HTMLInputElement).value.toLowerCase();\n const current = this._valid();\n // Keep the alpha digits of an 8-digit value when the user only changes the colour.\n const next = this.allowAlpha() && current && current.length === 9 ? picked + current.slice(7) : picked;\n this._text.set(next);\n this._commit(next);\n }\n\n protected selectPreset(p: ColorPreset) {\n const next = normalizeHexColor(p.value, this.allowAlpha()) ?? p.value;\n this._text.set(next);\n this._commit(next);\n }\n\n protected _isSelected(p: ColorPreset): boolean {\n const a = normalizeHexColor(p.value, this.allowAlpha());\n return !!a && a === this._valid();\n }\n protected _presetColor(p: ColorPreset): string {\n return normalizeHexColor(p.value, this.allowAlpha()) ?? 'transparent';\n }\n\n protected onTextBlur() {\n const v = this._valid();\n if (this._edited() && v && this._text() !== v) this._text.set(v);\n this._touch();\n }\n /** Blur of the native picker only marks the field touched; it never rewrites the text. */\n protected onNativeBlur() { this._touch(); }\n\n private _touch() {\n this._onTouched();\n this._reveal.touched.set(true);\n }\n\n private _commit(value: string) {\n this._edited.set(true);\n this._model.set(value);\n this._onChange(value);\n }\n\n private _check(value: string, edited: boolean): FieldIssue | null {\n if (this.disabled()) return null;\n const text = value.trim();\n if (!text) return this.required() ? requiredIssue(this.label()) : null;\n if (!edited) return null;\n return normalizeHexColor(text, this.allowAlpha()) ? null : { key: 'color', message: this.labels.t('colorInput.invalidHex') };\n }\n}\n"],"mappings":";;;;AAKA,IAAI,cAAc;AAUlB,SAAgB,kBAAkB,OAAkC,aAAa,OAAK;CACpF,IA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/color-input/color-input.component.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, effect, forwardRef, input, output, signal, inject } from '@angular/core';\nimport { AbstractControl, ControlValueAccessor, NG_VALIDATORS, NG_VALUE_ACCESSOR, ValidationErrors, Validator } from '@angular/forms';\nimport { FieldIssue, UiFieldValidity, createFieldReveal, issueToErrors, requiredIssue } from '@forgeroute/ui/core';\nimport { UiLabelsService } from '@forgeroute/ui/core';\n\nlet nextColorId = 0;\n\n/** A preset swatch offered under the field. `label` is its accessible name. */\nexport interface ColorPreset { value: string; label: string; }\n\n/**\n * Normalises a CSS hex colour: `#fff` / `FFF` -> `#ffffff`, `#RRGGBB` -> lower case. With `allowAlpha`, `#rrggbbaa`\n * is accepted and kept at 8 digits (shorthand `#rgba` is never accepted). Returns null for anything else\n * (named colours, `rgb()`, wrong lengths, non-hex digits). The leading `#` is optional on input.\n */\nexport function normalizeHexColor(value: string | null | undefined, allowAlpha = false): string | null {\n if (typeof value !== 'string') return null;\n const m = /^#?([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(value.trim());\n if (!m) return null;\n let hex = m[1].toLowerCase();\n if (hex.length === 8 && !allowAlpha) return null;\n if (hex.length === 3) hex = hex.split('').map(c => c + c).join('');\n return '#' + hex;\n}\n\n/**\n * Colour input: ControlValueAccessor over a string holding a CSS hex colour. A swatch opens the operating system's\n * colour picker (native `<input type=\"color\">`) and a text field next to it shows / edits the hex; both stay in sync.\n *\n * <ui-color-input label=\"Brand colour\" [(ngModel)]=\"brand\" />\n * <ui-color-input label=\"Accent\" [presets]=\"presets\" [allowAlpha]=\"true\" [formControl]=\"accent\" />\n *\n * Value contract\n * - A valid colour is emitted normalised to lower-case `#rrggbb` (`#FFF` -> `#ffffff`; 8-digit `#rrggbbaa` only with\n * `allowAlpha`, kept at 8 digits). The user may type with or without the leading `#`; the control prepends it.\n * - Text the user typed that is not a valid colour is emitted as typed (with `#` prepended, `''` when cleared) so the host\n * sees what the user entered; the control is then invalid (the `colorInput.invalidHex` text, \"Enter a hex colour like #3b82f6.\" in English) and the form control gets\n * the `color` error. While typing, the text is not rewritten (`#fff` is emitted as `#ffffff` but stays `#fff` on screen)\n * and is normalised on blur.\n * - A value WRITTEN BY THE HOST (`writeValue` / `[ngModel]` / `[formControl]`) is never flagged as an invalid colour, even\n * when it is not a hex (`red`, `#fff8`, a legacy value), until the user changes it, so legacy data never blocks Save.\n * (Required is still checked for an empty value.) The native picker gets `#000000` for a non-hex value so it never throws.\n * - Picking in the native picker with an 8-digit value and `allowAlpha` keeps the existing alpha digits.\n *\n * Validity API (same as the other ui inputs): `Validator` (error keys `required`, `color`), signals `invalid` /\n * `errorMessage`, `invalidChange` output, `UiFieldValidity` token. Messages (built-in and a host `[error]`) show only after the user left the field; `[showErrors]=\"true\"` also reveals it on an untouched field. Disabled controls are never invalid.\n *\n * Cross-browser: the native swatch is styled with `-webkit-appearance` and the `::-webkit-color-swatch` / `::-moz-color-swatch`\n * pseudo-elements and sits invisibly over our own preview square, so it looks the same in Chrome, Edge, Firefox and Safari.\n * Preset swatches are real `<button>`s (Enter / Space work natively, `aria-pressed` marks the selected one).\n */\n@Component({\n selector: 'ui-color-input',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => ColorInputComponent), multi: true },\n { provide: NG_VALIDATORS, useExisting: forwardRef(() => ColorInputComponent), multi: true },\n { provide: UiFieldValidity, useExisting: forwardRef(() => ColorInputComponent) },\n ],\n template: `\n <div class=\"co-field\" [class.co-error]=\"_activeError()\" [class.co-disabled]=\"disabled()\">\n @if (label()) {\n <label class=\"co-label\" [for]=\"showText() ? _textId : _nativeId\">\n {{ label() }}\n @if (required()) { <span class=\"co-required\" aria-hidden=\"true\">*</span> }\n </label>\n }\n <div class=\"co-row\">\n <span class=\"co-swatch\" [class.co-swatch-wide]=\"!showText()\">\n <span class=\"co-preview\" [style.background-color]=\"_swatchColor()\" aria-hidden=\"true\"></span>\n @if (!showText()) {\n <span class=\"co-chip\" aria-hidden=\"true\" data-testid=\"color-input-chip\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 3a9 9 0 1 0 0 18c1.1 0 2-.9 2-2 0-.5-.2-1-.5-1.3-.3-.4-.5-.8-.5-1.3 0-1.1.9-2 2-2h2.4a3.6 3.6 0 0 0 3.6-3.6C21 6.8 17 3 12 3z\"/><circle cx=\"7.5\" cy=\"11.5\" r=\"1\"/><circle cx=\"10.5\" cy=\"7.5\" r=\"1\"/><circle cx=\"15.5\" cy=\"7.5\" r=\"1\"/></svg>\n </span>\n }\n <input\n class=\"co-native\"\n type=\"color\"\n [id]=\"_nativeId\"\n [value]=\"_nativeValue()\"\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"labels.t('colorInput.picker', { label: label() || ariaLabel() || labels.t('colorInput.colour') })\"\n [attr.aria-describedby]=\"!showText() && (_activeError() || hint()) ? _descId : null\"\n [attr.aria-invalid]=\"!showText() && _activeError() ? 'true' : null\"\n (input)=\"onNativeInput($event)\"\n (blur)=\"onNativeBlur()\" />\n </span>\n @if (showText()) {\n <input\n class=\"co-text\"\n type=\"text\"\n [id]=\"_textId\"\n [value]=\"_text()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [attr.maxlength]=\"allowAlpha() ? 9 : 7\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [attr.required]=\"required() || null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-label]=\"label() ? null : (ariaLabel() || null)\"\n [attr.aria-invalid]=\"_activeError() ? 'true' : null\"\n [attr.aria-describedby]=\"(_activeError() || hint()) ? _descId : null\"\n (input)=\"onTextInput($event)\"\n (blur)=\"onTextBlur()\" />\n }\n </div>\n @if (presets().length) {\n <div class=\"co-presets\" role=\"group\" [attr.aria-label]=\"labels.t('colorInput.presets', { label: label() || ariaLabel() || labels.t('colorInput.colour') })\">\n @for (p of presets(); track $index) {\n <button\n type=\"button\"\n class=\"co-preset\"\n [class.co-preset-selected]=\"_isSelected(p)\"\n [style.background-color]=\"_presetColor(p)\"\n [attr.aria-label]=\"p.label\"\n [attr.aria-pressed]=\"_isSelected(p) ? 'true' : 'false'\"\n [disabled]=\"disabled()\"\n (click)=\"selectPreset(p)\"></button>\n }\n </div>\n }\n @if (_activeError()) {\n <p class=\"co-desc co-desc-error\" [id]=\"_descId\" role=\"alert\">{{ _activeError() }}</p>\n } @else if (hint()) {\n <p class=\"co-desc\" [id]=\"_descId\">{{ hint() }}</p>\n }\n </div>\n `,\n styles: [`\n :host { display: block; }\n .co-field { display: flex; flex-direction: column; gap: 6px; }\n .co-label { font-size: 0.8125rem; font-weight: 600; color: #374151; line-height: 1; }\n .co-required { color: #dc2626; margin-left: 2px; }\n .co-row { display: flex; align-items: center; gap: 8px; }\n\n .co-swatch {\n position: relative; flex-shrink: 0; width: 38px; height: 38px; box-sizing: border-box;\n border: 1px solid #7c8ba1; border-radius: 8px; overflow: hidden; background: #fff;\n transition: border-color 0.15s, box-shadow 0.15s;\n }\n .co-swatch-wide { flex: 1; width: auto; min-width: 0; height: 40px; cursor: pointer; }\n .co-swatch-wide:hover { border-color: #475569; }\n .co-chip { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center;\n width: 28px; height: 28px; border-radius: 6px; background: #fff; color: #334155; border: 1px solid #94a3b8; pointer-events: none; }\n .co-swatch:focus-within { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12); }\n .co-preview { position: absolute; inset: 0; display: block; }\n /* The real colour input sits invisibly over the preview so clicks and keyboard land on it. */\n .co-native {\n position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0;\n opacity: 0; cursor: pointer; -webkit-appearance: none; appearance: none; background: transparent;\n }\n .co-native::-webkit-color-swatch-wrapper { padding: 0; }\n .co-native::-webkit-color-swatch { border: 0; border-radius: 0; }\n .co-native::-moz-color-swatch { border: 0; border-radius: 0; }\n\n .co-text {\n flex: 1; min-width: 0; box-sizing: border-box;\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; transition: border-color 0.15s, box-shadow 0.15s;\n }\n .co-text::placeholder { color: #64748b; opacity: 1; }\n .co-text:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12); }\n\n .co-presets { display: flex; flex-wrap: wrap; gap: 8px; }\n .co-preset {\n width: 28px; height: 28px; padding: 0; box-sizing: border-box; cursor: pointer;\n border: 1px solid #7c8ba1; border-radius: 50%;\n }\n .co-preset-selected { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #3b82f6; }\n .co-preset:focus { outline: 2px solid #3b82f6; outline-offset: 2px; }\n .co-preset:focus:not(:focus-visible) { outline: none; }\n\n .co-error .co-text, .co-error .co-swatch { border-color: #ef4444; }\n .co-error .co-text:focus { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12); }\n\n .co-disabled .co-text, .co-disabled .co-swatch, .co-disabled .co-preset { opacity: 0.5; cursor: not-allowed; }\n .co-disabled .co-native { cursor: not-allowed; }\n\n .co-desc { margin: -6px 0 0; font-size: 0.75rem; line-height: 1.4; color: #64748b; }\n .co-desc-error { color: #dc2626; }\n\n @media (max-width: 480px) { .co-text { font-size: 1rem; } }\n @media (pointer: coarse), (max-width: 480px) {\n .co-text { min-height: 44px; }\n .co-swatch { width: 44px; height: 44px; }\n .co-swatch-wide { width: auto; height: 44px; }\n .co-preset { width: 44px; height: 44px; }\n }\n `],\n})\nexport class ColorInputComponent 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 placeholder = input('#3b82f6');\n readonly required = input(false);\n readonly hint = input('');\n /** Host error message; always wins over the built-in message. */\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 /** Accept (and keep) 8-digit `#rrggbbaa` values. */\n readonly allowAlpha = input(false);\n /** Show the hex text box next to the swatch (default). `false` = the swatch alone, stretched to a full-width colour field with a palette icon: the user only clicks it and picks. */\n readonly showText = input(true);\n /** Optional row of preset swatches. */\n readonly presets = input<ColorPreset[]>([]);\n\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 /** Current model value (what the form control holds). */\n private readonly _model = signal('');\n /** Text shown in the text field. */\n protected readonly _text = signal('');\n /** True once the user changed the value; host-written values are not format-checked before that. */\n private readonly _edited = signal(false);\n\n private readonly _reveal = createFieldReveal(this.showErrors);\n private readonly _issue = computed(() => this._check(this._model(), this._edited()));\n readonly invalid = computed(() => !!this.error() || !!this._issue());\n readonly errorMessage = computed(() => this._issue()?.message ?? '');\n protected readonly _activeError = computed(() => this._reveal.revealed() ? (this.error() || this.errorMessage()) : '');\n\n private readonly _valid = computed(() => normalizeHexColor(this._model(), this.allowAlpha()));\n /** Colour of the preview square: the value when it is a usable hex, otherwise transparent. */\n protected readonly _swatchColor = computed(() => this._valid() ?? 'transparent');\n /** Value for the native picker: always `#rrggbb`. */\n protected readonly _nativeValue = computed(() => (this._valid() ?? '#000000').slice(0, 7));\n\n private readonly _uid = nextColorId++;\n protected readonly _textId = `co-text-${this._uid}`;\n protected readonly _nativeId = `co-native-${this._uid}`;\n protected readonly _descId = `co-desc-${this._uid}`;\n\n private _onChange = (_: string) => {};\n private _onTouched = () => {};\n private _onValidatorChange = () => {};\n\n constructor() {\n effect(() => { this.invalidChange.emit(this.invalid()); });\n }\n\n /** Re-run the form control's validation when a rule input (required, allowAlpha, ...) changes. */\n ngOnChanges() { this._onValidatorChange(); }\n\n writeValue(val: string | null) {\n const text = val == null ? '' : String(val);\n this._model.set(text);\n this._text.set(text);\n this._edited.set(false);\n }\n registerOnChange(fn: (v: string) => void) { this._onChange = fn; }\n registerOnTouched(fn: () => void) { this._onTouched = fn; }\n registerOnValidatorChange(fn: () => void) { this._onValidatorChange = fn; }\n setDisabledState(d: boolean) { this._cvaDisabled.set(d); }\n\n validate(control: AbstractControl): ValidationErrors | null {\n const v = control.value;\n return issueToErrors(this._check(v == null ? '' : String(v), this._edited()));\n }\n\n protected onTextInput(event: Event) {\n const el = event.target as HTMLInputElement;\n let raw = el.value.trim();\n if (raw && !raw.startsWith('#')) raw = '#' + raw;\n if (raw === '#') raw = '';\n if (el.value !== raw) el.value = raw;\n this._text.set(raw);\n this._commit(normalizeHexColor(raw, this.allowAlpha()) ?? raw);\n }\n\n protected onNativeInput(event: Event) {\n const picked = (event.target as HTMLInputElement).value.toLowerCase();\n const current = this._valid();\n // Keep the alpha digits of an 8-digit value when the user only changes the colour.\n const next = this.allowAlpha() && current && current.length === 9 ? picked + current.slice(7) : picked;\n this._text.set(next);\n this._commit(next);\n }\n\n protected selectPreset(p: ColorPreset) {\n const next = normalizeHexColor(p.value, this.allowAlpha()) ?? p.value;\n this._text.set(next);\n this._commit(next);\n }\n\n protected _isSelected(p: ColorPreset): boolean {\n const a = normalizeHexColor(p.value, this.allowAlpha());\n return !!a && a === this._valid();\n }\n protected _presetColor(p: ColorPreset): string {\n return normalizeHexColor(p.value, this.allowAlpha()) ?? 'transparent';\n }\n\n protected onTextBlur() {\n const v = this._valid();\n if (this._edited() && v && this._text() !== v) this._text.set(v);\n this._touch();\n }\n /** Blur of the native picker only marks the field touched; it never rewrites the text. */\n protected onNativeBlur() { this._touch(); }\n\n private _touch() {\n this._onTouched();\n this._reveal.touched.set(true);\n }\n\n private _commit(value: string) {\n this._edited.set(true);\n this._model.set(value);\n this._onChange(value);\n }\n\n private _check(value: string, edited: boolean): FieldIssue | null {\n if (this.disabled()) return null;\n const text = value.trim();\n if (!text) return this.required() ? requiredIssue(this.label()) : null;\n if (!edited) return null;\n return normalizeHexColor(text, this.allowAlpha()) ? null : { key: 'color', message: this.labels.t('colorInput.invalidHex') };\n }\n}\n"],"mappings":";;;;AAKA,IAAI,cAAc;AAUlB,SAAgB,kBAAkB,OAAkC,aAAa,OAAK;CACpF,IAAI,OAAO,UAAU,UAAU,OAAO;CACtC,MAAM,IAAI,6CAA6C,KAAK,MAAM,KAAI,CAAE;CACxE,IAAI,CAAC,GAAG,OAAO;CACf,IAAI,MAAM,EAAE,EAAE,CAAC,YAAW;CAC1B,IAAI,IAAI,WAAW,KAAK,CAAC,YAAY,OAAO;CAC5C,IAAI,IAAI,WAAW,GAAG,MAAM,IAAI,MAAM,EAAE,CAAC,CAAC,KAAI,MAAK,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE;CACjE,OAAO,MAAM;AACf;AA2KA,IAAa,sBAAb,MAAa,oBAAmB;CAsD9B,cAAA;EArDmB,KAAA,SAAS,OAAO,eAAe;EACzC,KAAA,QAAc,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;EAEvB,KAAA,YAAc,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;EACvB,KAAA,cAAc,MAAM,WAAU,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;EAC9B,KAAA,WAAc,MAAM,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;EAC1B,KAAA,OAAc,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;EAEvB,KAAA,QAAc,MAAM,IAAG,GA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;CAAmB,YAAA,CAAA;EA/I/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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqET,QAAA,CAAA,ogFAAA;EAAA,CAAA"}
@@ -514,7 +514,7 @@ var ComboboxComponent = class ComboboxComponent {
514
514
  </div>
515
515
  `,
516
516
  isInline: true,
517
- styles: [":host{display:block}.cb-field{display:flex;flex-direction:column;gap:6px}.cb-label{font-size:.8125rem;font-weight:600;color:#374151;line-height:1}.cb-required{color:#dc2626;margin-left:2px}.cb-control{position:relative}.cb-input{width:100%;box-sizing:border-box;padding:9px 12px;font-size:.875rem;font-family:inherit;color:#1e293b;background:#fff;border:1px solid #7c8ba1;border-radius:8px;outline:none;transition:border-color .15s,box-shadow .15s}.cb-input::placeholder{color:#64748b;opacity:1}.cb-input:focus{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61f}.cb-has-clear{padding-right:40px}.cb-warning .cb-input{border-color:#f59e0b;background:#fffbeb}.cb-error .cb-input{border-color:#ef4444}.cb-error .cb-input:focus{box-shadow:0 0 0 3px #ef44441f}.cb-disabled .cb-input{opacity:.5;cursor:not-allowed}.cb-clear{position:absolute;top:50%;right:4px;transform:translateY(-50%);border:0;background:transparent;cursor:pointer;color:#64748b;font-size:1.25rem;line-height:1;min-width:32px;min-height:32px;padding:0 8px;border-radius:6px}.cb-clear:hover{color:#0f172a}.cb-clear:focus-visible{outline:2px solid #3b82f6}.cb-popup{position:absolute;z-index:30;left:0;right:0;top:100%;margin-top:4px;box-sizing:border-box;max-width:100%;max-height:min(260px,40vh);overflow-y:auto;overscroll-behavior:contain;background:#fff;border:1px solid #e2e8f0;border-radius:8px;box-shadow:0 8px 24px #0f172a1f}.cb-list:empty{display:none}.cb-status{padding:12px;font-size:.875rem;color:#64748b}.cb-option{display:flex;flex-direction:column;gap:2px;padding:8px 12px;min-height:40px;justify-content:center;box-sizing:border-box;cursor:pointer}.cb-option-active{background:#eff6ff}.cb-option-selected .cb-option-label{font-weight:600}.cb-option-disabled{opacity:.5;cursor:not-allowed}.cb-option-label{font-size:.875rem;color:#0f172a;overflow-wrap:anywhere}.cb-option-desc{font-size:.75rem;color:#64748b;overflow-wrap:anywhere}.cb-desc{margin:0;font-size:.75rem;line-height:1.4;color:#64748b}.cb-desc-error{color:#dc2626}.cb-live{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}@media(prefers-reduced-motion:reduce){.cb-input{transition:none}}@media(forced-colors:active){.cb-input:focus{outline:2px solid Highlight;outline-offset:1px}.cb-option-active{outline:2px solid Highlight;outline-offset:-2px}}@media(pointer:coarse),(max-width:480px){.cb-input{min-height:44px}.cb-clear{min-width:44px;min-height:44px}}@media(pointer:coarse){.cb-option{min-height:44px}}@media(max-width:480px){.cb-input{font-size:1rem}.cb-option{min-height:44px}}\n"],
517
+ styles: [":host{display:block}.cb-field{display:flex;flex-direction:column;gap:6px}.cb-label{font-size:.8125rem;font-weight:600;color:#374151;line-height:1}.cb-required{color:#dc2626;margin-left:2px}.cb-control{position:relative}.cb-input{width:100%;box-sizing:border-box;padding:9px 12px;font-size:.875rem;font-family:inherit;color:#1e293b;background:#fff;border:1px solid #7c8ba1;border-radius:8px;outline:none;transition:border-color .15s,box-shadow .15s}.cb-input::placeholder{color:#64748b;opacity:1}.cb-input:focus{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61f}.cb-has-clear{padding-right:40px}.cb-warning .cb-input{border-color:#f59e0b;background:#fffbeb}.cb-error .cb-input{border-color:#ef4444}.cb-error .cb-input:focus{box-shadow:0 0 0 3px #ef44441f}.cb-disabled .cb-input{opacity:.5;cursor:not-allowed}.cb-clear{position:absolute;top:50%;right:4px;transform:translateY(-50%);border:0;background:transparent;cursor:pointer;color:#64748b;font-size:1.25rem;line-height:1;min-width:32px;min-height:32px;padding:0 8px;border-radius:6px}.cb-clear:hover{color:#0f172a}.cb-clear:focus-visible{outline:2px solid #3b82f6}.cb-popup{position:absolute;z-index:30;left:0;right:0;top:100%;margin-top:4px;box-sizing:border-box;max-width:100%;max-height:min(260px,40vh);overflow-y:auto;overscroll-behavior:contain;background:#fff;border:1px solid #e2e8f0;border-radius:8px;box-shadow:0 8px 24px #0f172a1f}.cb-list:empty{display:none}.cb-status{padding:12px;font-size:.875rem;color:#64748b}.cb-option{display:flex;flex-direction:column;gap:2px;padding:8px 12px;min-height:40px;justify-content:center;box-sizing:border-box;cursor:pointer}.cb-option-active{background:#eff6ff}.cb-option-selected .cb-option-label{font-weight:600}.cb-option-disabled{opacity:.5;cursor:not-allowed}.cb-option-label{font-size:.875rem;color:#0f172a;overflow-wrap:anywhere}.cb-option-desc{font-size:.75rem;color:#64748b;overflow-wrap:anywhere}.cb-desc{margin:-6px 0 0;font-size:.75rem;line-height:1.4;color:#64748b}.cb-desc-error{color:#dc2626}.cb-live{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}@media(prefers-reduced-motion:reduce){.cb-input{transition:none}}@media(forced-colors:active){.cb-input:focus{outline:2px solid Highlight;outline-offset:1px}.cb-option-active{outline:2px solid Highlight;outline-offset:-2px}}@media(pointer:coarse),(max-width:480px){.cb-input{min-height:44px}.cb-clear{min-width:44px;min-height:44px}}@media(pointer:coarse){.cb-option{min-height:44px}}@media(max-width:480px){.cb-input{font-size:1rem}.cb-option{min-height:44px}}\n"],
518
518
  changeDetection: i0.ChangeDetectionStrategy.OnPush
519
519
  });
520
520
  }
@@ -618,7 +618,7 @@ i0.ɵɵngDeclareClassMetadata({
618
618
  }
619
619
  </div>
620
620
  `,
621
- styles: [":host{display:block}.cb-field{display:flex;flex-direction:column;gap:6px}.cb-label{font-size:.8125rem;font-weight:600;color:#374151;line-height:1}.cb-required{color:#dc2626;margin-left:2px}.cb-control{position:relative}.cb-input{width:100%;box-sizing:border-box;padding:9px 12px;font-size:.875rem;font-family:inherit;color:#1e293b;background:#fff;border:1px solid #7c8ba1;border-radius:8px;outline:none;transition:border-color .15s,box-shadow .15s}.cb-input::placeholder{color:#64748b;opacity:1}.cb-input:focus{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61f}.cb-has-clear{padding-right:40px}.cb-warning .cb-input{border-color:#f59e0b;background:#fffbeb}.cb-error .cb-input{border-color:#ef4444}.cb-error .cb-input:focus{box-shadow:0 0 0 3px #ef44441f}.cb-disabled .cb-input{opacity:.5;cursor:not-allowed}.cb-clear{position:absolute;top:50%;right:4px;transform:translateY(-50%);border:0;background:transparent;cursor:pointer;color:#64748b;font-size:1.25rem;line-height:1;min-width:32px;min-height:32px;padding:0 8px;border-radius:6px}.cb-clear:hover{color:#0f172a}.cb-clear:focus-visible{outline:2px solid #3b82f6}.cb-popup{position:absolute;z-index:30;left:0;right:0;top:100%;margin-top:4px;box-sizing:border-box;max-width:100%;max-height:min(260px,40vh);overflow-y:auto;overscroll-behavior:contain;background:#fff;border:1px solid #e2e8f0;border-radius:8px;box-shadow:0 8px 24px #0f172a1f}.cb-list:empty{display:none}.cb-status{padding:12px;font-size:.875rem;color:#64748b}.cb-option{display:flex;flex-direction:column;gap:2px;padding:8px 12px;min-height:40px;justify-content:center;box-sizing:border-box;cursor:pointer}.cb-option-active{background:#eff6ff}.cb-option-selected .cb-option-label{font-weight:600}.cb-option-disabled{opacity:.5;cursor:not-allowed}.cb-option-label{font-size:.875rem;color:#0f172a;overflow-wrap:anywhere}.cb-option-desc{font-size:.75rem;color:#64748b;overflow-wrap:anywhere}.cb-desc{margin:0;font-size:.75rem;line-height:1.4;color:#64748b}.cb-desc-error{color:#dc2626}.cb-live{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}@media(prefers-reduced-motion:reduce){.cb-input{transition:none}}@media(forced-colors:active){.cb-input:focus{outline:2px solid Highlight;outline-offset:1px}.cb-option-active{outline:2px solid Highlight;outline-offset:-2px}}@media(pointer:coarse),(max-width:480px){.cb-input{min-height:44px}.cb-clear{min-width:44px;min-height:44px}}@media(pointer:coarse){.cb-option{min-height:44px}}@media(max-width:480px){.cb-input{font-size:1rem}.cb-option{min-height:44px}}\n"]
621
+ styles: [":host{display:block}.cb-field{display:flex;flex-direction:column;gap:6px}.cb-label{font-size:.8125rem;font-weight:600;color:#374151;line-height:1}.cb-required{color:#dc2626;margin-left:2px}.cb-control{position:relative}.cb-input{width:100%;box-sizing:border-box;padding:9px 12px;font-size:.875rem;font-family:inherit;color:#1e293b;background:#fff;border:1px solid #7c8ba1;border-radius:8px;outline:none;transition:border-color .15s,box-shadow .15s}.cb-input::placeholder{color:#64748b;opacity:1}.cb-input:focus{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61f}.cb-has-clear{padding-right:40px}.cb-warning .cb-input{border-color:#f59e0b;background:#fffbeb}.cb-error .cb-input{border-color:#ef4444}.cb-error .cb-input:focus{box-shadow:0 0 0 3px #ef44441f}.cb-disabled .cb-input{opacity:.5;cursor:not-allowed}.cb-clear{position:absolute;top:50%;right:4px;transform:translateY(-50%);border:0;background:transparent;cursor:pointer;color:#64748b;font-size:1.25rem;line-height:1;min-width:32px;min-height:32px;padding:0 8px;border-radius:6px}.cb-clear:hover{color:#0f172a}.cb-clear:focus-visible{outline:2px solid #3b82f6}.cb-popup{position:absolute;z-index:30;left:0;right:0;top:100%;margin-top:4px;box-sizing:border-box;max-width:100%;max-height:min(260px,40vh);overflow-y:auto;overscroll-behavior:contain;background:#fff;border:1px solid #e2e8f0;border-radius:8px;box-shadow:0 8px 24px #0f172a1f}.cb-list:empty{display:none}.cb-status{padding:12px;font-size:.875rem;color:#64748b}.cb-option{display:flex;flex-direction:column;gap:2px;padding:8px 12px;min-height:40px;justify-content:center;box-sizing:border-box;cursor:pointer}.cb-option-active{background:#eff6ff}.cb-option-selected .cb-option-label{font-weight:600}.cb-option-disabled{opacity:.5;cursor:not-allowed}.cb-option-label{font-size:.875rem;color:#0f172a;overflow-wrap:anywhere}.cb-option-desc{font-size:.75rem;color:#64748b;overflow-wrap:anywhere}.cb-desc{margin:-6px 0 0;font-size:.75rem;line-height:1.4;color:#64748b}.cb-desc-error{color:#dc2626}.cb-live{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}@media(prefers-reduced-motion:reduce){.cb-input{transition:none}}@media(forced-colors:active){.cb-input:focus{outline:2px solid Highlight;outline-offset:1px}.cb-option-active{outline:2px solid Highlight;outline-offset:-2px}}@media(pointer:coarse),(max-width:480px){.cb-input{min-height:44px}.cb-clear{min-width:44px;min-height:44px}}@media(pointer:coarse){.cb-option{min-height:44px}}@media(max-width:480px){.cb-input{font-size:1rem}.cb-option{min-height:44px}}\n"]
622
622
  }]
623
623
  }],
624
624
  ctorParameters: () => [],
@@ -1 +1 @@
1
- {"version":3,"file":"forgeroute-ui-combobox.mjs","names":[],"sources":["../../../projects/forgeroute-ui/combobox/src/lib/combobox/combobox.component.ts"],"sourcesContent":["import {\n Component, ChangeDetectionStrategy, DestroyRef, ElementRef, Injector, afterNextRender, computed, effect, forwardRef,\n inject, input, linkedSignal, output, signal, untracked, viewChild,\n} from '@angular/core';\nimport { AbstractControl, ControlValueAccessor, NG_VALIDATORS, NG_VALUE_ACCESSOR, ValidationErrors, Validator } from '@angular/forms';\nimport { FieldIssue, UiFieldValidity, createFieldReveal, issueToErrors, requiredIssue } from '@forgeroute/ui/core';\nimport { UiLabelsService } from '@forgeroute/ui/core';\n\n/** One selectable row. `data` carries any host payload (a typed record, an id, ...) back through `(valueChange)`. */\nexport interface ComboboxOption<T = unknown> {\n value: string;\n label: string;\n /** Secondary line under the label (trade, customer name, ...). */\n description?: string;\n disabled?: boolean;\n data?: T;\n}\n\n/** The selected value: what `[value]` and `ngModel` / `FormControl` hold. */\nexport interface ComboboxSelection { value: string; label: string }\n\nlet nextComboboxId = 0;\n\n/**\n * Search-as-you-type single select (WAI-ARIA 1.2 combobox with listbox popup). The HOST fetches: the combobox emits\n * `(searchChange)` with the typed term (debounced) and renders whatever `[options]` currently is, so a host using\n * `switchMap` is race-safe and a stale array never \"sticks\" (the active option is re-validated on every change).\n *\n * ## API\n * - `[options]` `ComboboxOption[]` current results (`{ value, label, description?, disabled?, data? }`).\n * - `[value]` `{ value, label } | null` the selection. Also what `ngModel` / `formControl` hold (same shape).\n * - `[displayText]` text shown in the field instead of the selected label — use it for legacy / orphaned links:\n * `displayText=\"Not linked: Legacy Co\"` (with `[value]=\"null\"`) or `displayText=\"Acme (no longer exists)\"`.\n * Pair it with `[displayWarning]=\"true\"` for the amber \"needs attention\" style. A `displayText` with no `value` is\n * shown and has a clear button, but counts as EMPTY for `required`.\n * - `[loading]` shows \"Searching…\" and announces it. `[noResultsText]` (default \"No results found\").\n * - `[minChars]` (default 0): below it nothing is searched or listed (\"Type at least N characters\"). 0 = the list opens\n * on focus and `(searchChange)` fires with '' so the host can show its initial results.\n * - `[hideMinCharsHint]` (default false, added 2026-11-22): with a `minChars` above 0, do not open the dropdown at all until the minimum is typed, so no \"Type at least N characters\" line shows (a picker that must\n * list nothing up front). Searching and listing are unchanged; only the empty dropdown with that prompt is not drawn. Default = the prompt shows as before.\n * - `[debounce]` ms between the last keystroke and `(searchChange)` (default 250). Focus / ArrowDown-open emit immediately.\n * - `[label] [ariaLabel] [placeholder] [required] [hint] [error] [disabled] [showErrors]` like `ui-text-input`\n * (host `[error]` wins over the built-in \"<label> is required.\"; messages (built-in and host) show only after the user left the field, `showErrors` also reveals it on an untouched field).\n * - `(searchChange)` string, `(valueChange)` `ComboboxOption | null` (the full chosen option, null when cleared),\n * `(invalidChange)` boolean, `(focused)`, `(blurred)`. Validity: `UiFieldValidity` token + Angular `Validator`.\n *\n * ## Behaviour\n * - The field shows the selected label. Focusing it selects that text; typing starts a NEW search and the old value is\n * kept until another option is picked or the clear (x) button is pressed. Leaving the field (blur / Tab / Escape)\n * discards the typed text and shows the selection again.\n * - Escape: if the list is open it closes the list ONLY (stopPropagation, so a surrounding side panel / modal stays\n * open). If the list is already closed and text was typed, it discards the text (also stopped). Otherwise the key\n * passes through to the panel.\n * - Tab never selects: it closes the list and moves on.\n *\n * ## Keyboard\n * ArrowDown / ArrowUp open the list and move the active option (wraps, skips disabled). Home / End jump to the first /\n * last option while the list is open. Enter picks the active option (and does not submit a surrounding form while open).\n * Escape / Tab as above. Typing opens the list. Mouse: options are picked on mousedown so blur does not swallow it.\n *\n * ## ARIA\n * The inner `<input>` is `role=\"combobox\"` with `aria-expanded`, `aria-controls` (the listbox, while open),\n * `aria-autocomplete=\"list\"`, `aria-activedescendant`, `aria-invalid`, `aria-required`, `aria-describedby` (hint / error);\n * the `<label for>` names it. The popup is `role=\"listbox\"` of `role=\"option\"` rows (`aria-selected` = active row,\n * stable ids). A polite `role=\"status\"` region announces \"Searching\", \"N results available\" or the no-results text.\n *\n * ## Example\n * ```html\n * <ui-combobox label=\"Subcontractor\" [required]=\"true\" [options]=\"opts()\" [loading]=\"loading()\"\n * [value]=\"sub()\" [displayText]=\"legacyName() ? 'Not linked: ' + legacyName() : ''\" [error]=\"err()\"\n * (searchChange)=\"search$.next($event)\" (valueChange)=\"onPick($event)\" />\n * ```\n */\n@Component({\n selector: 'ui-combobox',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [{\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => ComboboxComponent),\n multi: true,\n }, {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => ComboboxComponent),\n multi: true,\n }, {\n provide: UiFieldValidity,\n useExisting: forwardRef(() => ComboboxComponent),\n }],\n template: `\n <div class=\"cb-field\" [class.cb-error]=\"_activeError()\" [class.cb-disabled]=\"disabled()\" [class.cb-warning]=\"displayWarning()\">\n @if (label()) {\n <label class=\"cb-label\" [for]=\"_inputId\">\n {{ label() }}\n @if (required()) { <span class=\"cb-required\" aria-hidden=\"true\">*</span> }\n </label>\n }\n <div class=\"cb-control\">\n <input\n #field\n class=\"cb-input\"\n type=\"text\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n autocomplete=\"off\"\n [id]=\"_inputId\"\n [class.cb-has-clear]=\"_showClear()\"\n [placeholder]=\"placeholder()\"\n [value]=\"_inputText()\"\n [disabled]=\"disabled()\"\n [attr.aria-disabled]=\"disabled() ? 'true' : null\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-expanded]=\"_popupVisible() ? 'true' : 'false'\"\n [attr.aria-controls]=\"_popupVisible() ? _listId : null\"\n [attr.aria-activedescendant]=\"_activeDescendant()\"\n [attr.aria-invalid]=\"_activeError() ? 'true' : null\"\n [attr.aria-required]=\"required() || null\"\n [attr.aria-describedby]=\"(_activeError() || hint()) ? _descId : null\"\n (input)=\"onInput($event)\"\n (focus)=\"onFocus($event)\"\n (click)=\"onClick()\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeydown($event)\"\n />\n @if (_showClear()) {\n <button type=\"button\" class=\"cb-clear\" data-testid=\"combobox-clear\" [attr.aria-label]=\"labels.t('combobox.clearNamed', { name: label() || ariaLabel() || labels.t('combobox.selection') })\"\n (mousedown)=\"$event.preventDefault()\" (click)=\"clear()\">&times;</button>\n }\n @if (_popupVisible()) {\n <div class=\"cb-popup\" (mousedown)=\"$event.preventDefault()\">\n <div class=\"cb-list\" role=\"listbox\" [id]=\"_listId\" [attr.aria-label]=\"label() || ariaLabel() || null\">\n @if (_belowMin() === false) {\n @for (o of options(); track o.value; let i = $index) {\n <div class=\"cb-option\" role=\"option\" [id]=\"_optionId(i)\"\n [class.cb-option-active]=\"i === _activeIndex()\"\n [class.cb-option-disabled]=\"o.disabled\"\n [class.cb-option-selected]=\"o.value === _selected()?.value\"\n [attr.aria-selected]=\"i === _activeIndex() ? 'true' : 'false'\"\n [attr.aria-disabled]=\"o.disabled ? 'true' : null\"\n (mousedown)=\"onOptionMouseDown($event, o)\"\n (mousemove)=\"onOptionHover(i, o)\">\n <span class=\"cb-option-label\">{{ o.label }}</span>\n @if (o.description) { <span class=\"cb-option-desc\">{{ o.description }}</span> }\n </div>\n }\n }\n </div>\n @if (_statusText(); as status) {\n <div class=\"cb-status\" data-testid=\"combobox-status\">{{ status }}</div>\n }\n </div>\n }\n </div>\n <span class=\"cb-live\" role=\"status\" aria-live=\"polite\">{{ _liveText() }}</span>\n @if (_activeError()) {\n <p class=\"cb-desc cb-desc-error\" [id]=\"_descId\" role=\"alert\">{{ _activeError() }}</p>\n } @else if (hint()) {\n <p class=\"cb-desc\" [id]=\"_descId\">{{ hint() }}</p>\n }\n </div>\n `,\n styles: [`\n :host { display: block; }\n\n .cb-field { display: flex; flex-direction: column; gap: 6px; }\n .cb-label { font-size: 0.8125rem; font-weight: 600; color: #374151; line-height: 1; }\n .cb-required { color: #dc2626; margin-left: 2px; }\n\n .cb-control { position: relative; }\n .cb-input {\n width: 100%; box-sizing: border-box;\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; transition: border-color 0.15s, box-shadow 0.15s;\n &::placeholder { color: #64748b; opacity: 1; }\n &:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12); }\n }\n .cb-has-clear { padding-right: 40px; }\n\n .cb-warning .cb-input { border-color: #f59e0b; background: #fffbeb; }\n .cb-error .cb-input {\n border-color: #ef4444;\n &:focus { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12); }\n }\n .cb-disabled .cb-input { opacity: 0.5; cursor: not-allowed; }\n\n .cb-clear {\n position: absolute; top: 50%; right: 4px; transform: translateY(-50%);\n border: 0; background: transparent; cursor: pointer; color: #64748b;\n font-size: 1.25rem; line-height: 1; min-width: 32px; min-height: 32px; padding: 0 8px; border-radius: 6px;\n &:hover { color: #0f172a; }\n &:focus-visible { outline: 2px solid #3b82f6; }\n }\n\n .cb-popup {\n position: absolute; z-index: 30; left: 0; right: 0; top: 100%; margin-top: 4px; box-sizing: border-box;\n max-width: 100%; max-height: min(260px, 40vh); overflow-y: auto; overscroll-behavior: contain;\n background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);\n }\n .cb-list:empty { display: none; }\n .cb-status { padding: 12px; font-size: 0.875rem; color: #64748b; }\n .cb-option {\n display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; min-height: 40px; justify-content: center;\n box-sizing: border-box; cursor: pointer;\n }\n .cb-option-active { background: #eff6ff; }\n .cb-option-selected .cb-option-label { font-weight: 600; }\n .cb-option-disabled { opacity: 0.5; cursor: not-allowed; }\n .cb-option-label { font-size: 0.875rem; color: #0f172a; overflow-wrap: anywhere; }\n .cb-option-desc { font-size: 0.75rem; color: #64748b; overflow-wrap: anywhere; }\n\n .cb-desc { margin: 0; font-size: 0.75rem; line-height: 1.4; color: #64748b; }\n .cb-desc-error { color: #dc2626; }\n\n .cb-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }\n\n /* Reduced motion: no transition on the field. Forced colors (Windows high contrast) drop box-shadow, so the focus\n ring and the active option fall back to real outlines. */\n @media (prefers-reduced-motion: reduce) { .cb-input { transition: none; } }\n @media (forced-colors: active) {\n .cb-input:focus { outline: 2px solid Highlight; outline-offset: 1px; }\n .cb-option-active { outline: 2px solid Highlight; outline-offset: -2px; }\n }\n\n /* Touch targets: the field and its clear (x) button are at least 44px on touch devices and phones. */\n @media (pointer: coarse), (max-width: 480px) {\n .cb-input { min-height: 44px; }\n .cb-clear { min-width: 44px; min-height: 44px; }\n }\n @media (pointer: coarse) { .cb-option { min-height: 44px; } }\n @media (max-width: 480px) {\n .cb-input { font-size: 1rem; }\n .cb-option { min-height: 44px; }\n }\n `],\n})\nexport class ComboboxComponent<T = unknown> 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 placeholder = input('');\n readonly required = input(false);\n readonly hint = input('');\n /** Host error message; always wins over the built-in message. */\n readonly error = input('');\n readonly showErrors = input(false);\n /** Current results (host-owned). */\n readonly options = input<ComboboxOption<T>[]>([]);\n readonly loading = input(false);\n readonly noResultsTextInput = input<string | null>(null, { alias: 'noResultsText' });\n readonly noResultsText = computed(() => this.noResultsTextInput() ?? this.labels.t('combobox.noResultsText'));\n /** Characters needed before searching / listing. 0 = open on focus. */\n readonly minChars = input(0);\n readonly hideMinCharsHint = input(false);\n /** Milliseconds between the last keystroke and `(searchChange)`. */\n readonly debounce = input(250);\n /** The selection. */\n readonly value = input<ComboboxSelection | null>(null);\n /** Text shown instead of the selected label (legacy / orphaned links). */\n readonly displayText = input('');\n /** Amber style for a legacy / orphaned `displayText`. */\n readonly displayWarning = input(false);\n\n /** Typed term, debounced (immediate on focus / open). */\n readonly searchChange = output<string>();\n /** The chosen option, or null when cleared. */\n readonly valueChange = output<ComboboxOption<T> | null>();\n readonly invalidChange = output<boolean>();\n readonly focused = output<void>();\n readonly blurred = output<void>();\n\n /** Disables the field (`[disabled]=\"x()\"`). Public so templates compile; ngModel / FormControl `disable()` still works (effective disabled = this OR the forms API). */\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 _field = viewChild<ElementRef<HTMLInputElement>>('field');\n private readonly _host = inject(ElementRef) as ElementRef<HTMLElement>;\n private readonly _injector = inject(Injector);\n private readonly _destroyRef = inject(DestroyRef);\n\n /** Follows `[value]`; ngModel / formControl writes and user picks override it until `[value]` changes. */\n protected readonly _selected = linkedSignal<ComboboxSelection | null>(() => this.value());\n private readonly _text = signal('');\n private readonly _editing = signal(false);\n protected readonly _open = signal(false);\n /** Reset to the first enabled option whenever `[options]` changes, so a stale index never survives new results. */\n protected readonly _activeIndex = linkedSignal<ComboboxOption<T>[], number>({\n source: this.options,\n computation: opts => this._firstEnabled(opts),\n });\n\n protected readonly _uid = ++nextComboboxId;\n protected readonly _inputId = `cb-${this._uid}`;\n protected readonly _listId = `cb-list-${this._uid}`;\n protected readonly _descId = `cb-desc-${this._uid}`;\n\n private readonly _reveal = createFieldReveal(this.showErrors);\n private readonly _issue = computed(() => this._check(this._selected()));\n readonly invalid = computed(() => !!this.error() || !!this._issue());\n readonly errorMessage = computed(() => this._issue()?.message ?? '');\n protected readonly _activeError = computed(() => this._reveal.revealed() ? (this.error() || this.errorMessage()) : '');\n\n protected readonly _inputText = computed(() =>\n this._editing() ? this._text() : (this.displayText() || this._selected()?.label || ''));\n protected readonly _showClear = computed(() => !this.disabled() && !this._editing() && !!(this._selected() || this.displayText()));\n protected readonly _belowMin = computed(() => this._term().length < this.minChars());\n /** The dropdown is drawn: open, except below the minimum when the host asked not to show the \"Type at least N characters\" prompt. */\n protected readonly _popupVisible = computed(() => this._open() && !(this.hideMinCharsHint() && this._belowMin()));\n protected readonly _statusText = computed(() => {\n if (this._belowMin()) return this.labels.t(this.minChars() === 1 ? 'combobox.typeAtLeast_one' : 'combobox.typeAtLeast_other', { count: this.minChars() });\n if (this.loading()) return this.labels.t('search.searching') + '…';\n return this.options().length === 0 ? this.noResultsText() : '';\n });\n protected readonly _liveText = computed(() => {\n if (!this._open() || this._belowMin()) return '';\n if (this.loading()) return this.labels.t('search.searching');\n const n = this.options().length;\n if (n === 0) return this.noResultsText();\n return this.labels.t(n === 1 ? 'combobox.resultsAvailable_one' : 'combobox.resultsAvailable_other', { count: n });\n });\n protected readonly _activeDescendant = computed(() => {\n const i = this._activeIndex();\n return this._open() && !this._belowMin() && i >= 0 && i < this.options().length ? this._optionId(i) : null;\n });\n\n private _debounceTimer: ReturnType<typeof setTimeout> | null = null;\n private _onChange = (_: ComboboxSelection | null) => {};\n private _onTouched = () => {};\n private _onValidatorChange = () => {};\n\n constructor() {\n effect(() => { this.invalidChange.emit(this.invalid()); });\n // Becoming disabled closes an open list, drops a pending search and discards typed text.\n effect(() => { if (this.disabled()) untracked(() => { this._cancelTimer(); this._open.set(false); this._editing.set(false); this._text.set(''); }); });\n this._destroyRef.onDestroy(() => this._cancelTimer());\n }\n\n ngOnChanges() { this._onValidatorChange(); }\n\n // ── CVA / Validator ───────────────────────────────────────────────\n writeValue(val: ComboboxSelection | null) { this._selected.set(val ?? null); }\n validate(control: AbstractControl): ValidationErrors | null {\n return issueToErrors(this._check((control.value as ComboboxSelection | null) ?? null));\n }\n registerOnValidatorChange(fn: () => void) { this._onValidatorChange = fn; }\n registerOnChange(fn: (v: ComboboxSelection | null) => void) { this._onChange = fn; }\n registerOnTouched(fn: () => void) { this._onTouched = fn; }\n setDisabledState(d: boolean) { this._cvaDisabled.set(d); }\n\n private _check(sel: ComboboxSelection | null): FieldIssue | null {\n if (this.disabled()) return null;\n return !sel && this.required() ? requiredIssue(this.label()) : null;\n }\n\n // ── Helpers ───────────────────────────────────────────────────────\n /** What the user typed (trimmed); '' while not editing. */\n private _term(): string { return this._editing() ? this._text().trim() : ''; }\n protected _optionId(i: number) { return `${this._listId}-opt-${i}`; }\n private _firstEnabled(opts: ComboboxOption<T>[]) { return opts.findIndex(o => !o.disabled); }\n\n private _emitSearch() { this._cancelTimer(); if (!this._belowMin()) this.searchChange.emit(this._term()); }\n private _cancelTimer() { if (this._debounceTimer != null) { clearTimeout(this._debounceTimer); this._debounceTimer = null; } }\n\n private _revert() { this._cancelTimer(); this._editing.set(false); this._text.set(''); }\n\n private _openList() {\n if (this.disabled()) return;\n if (!this._open()) { this._open.set(true); this._emitSearch(); }\n }\n\n private _move(dir: 1 | -1) {\n const opts = this.options();\n if (!opts.length || opts.every(o => o.disabled)) return;\n let i = this._activeIndex();\n for (let step = 0; step < opts.length; step++) {\n i = ((i < 0 ? (dir === 1 ? -1 : 0) : i) + dir + opts.length) % opts.length;\n if (!opts[i].disabled) break;\n }\n this._setActive(i);\n }\n\n private _setActive(i: number) {\n this._activeIndex.set(i);\n afterNextRender(() => {\n const el = this._host.nativeElement.querySelector(`#${this._optionId(i)}`) as HTMLElement | null;\n if (el && typeof el.scrollIntoView === 'function') el.scrollIntoView({ block: 'nearest' });\n }, { injector: this._injector });\n }\n\n // ── Events ────────────────────────────────────────────────────────\n protected onInput(event: Event) {\n if (this.disabled()) return;\n this._text.set((event.target as HTMLInputElement).value);\n this._editing.set(true);\n this._open.set(true);\n this._cancelTimer();\n if (this._belowMin()) return;\n this._debounceTimer = setTimeout(() => { this._debounceTimer = null; this._emitSearch(); }, this.debounce());\n }\n\n protected onFocus(event: FocusEvent) {\n this.focused.emit();\n const el = event.target as HTMLInputElement;\n if (this._selected() || this.displayText()) el.select?.();\n this._openList();\n }\n\n protected onClick() { this._openList(); }\n\n protected onBlur() {\n this._open.set(false);\n this._revert();\n this._onTouched();\n this.blurred.emit();\n this._reveal.touched.set(true);\n }\n\n protected onKeydown(e: KeyboardEvent) {\n const opts = this.options();\n const listing = this._open() && !this._belowMin();\n switch (e.key) {\n case 'ArrowDown':\n case 'ArrowUp':\n if (this._open() && !this._popupVisible()) return;\n e.preventDefault();\n if (!this._open()) { this._openList(); return; }\n this._move(e.key === 'ArrowDown' ? 1 : -1);\n return;\n case 'Home':\n case 'End':\n if (listing && opts.length) {\n e.preventDefault();\n const idx = e.key === 'Home' ? opts.findIndex(o => !o.disabled) : opts.map(o => !o.disabled).lastIndexOf(true);\n if (idx >= 0) this._setActive(idx);\n }\n return;\n case 'Enter':\n if (this._popupVisible()) {\n e.preventDefault();\n const i = this._activeIndex();\n if (listing && i >= 0 && i < opts.length && !opts[i].disabled) this.choose(opts[i]);\n }\n return;\n case 'Escape':\n if (this._popupVisible()) { e.preventDefault(); e.stopPropagation(); this._cancelTimer(); this._open.set(false); }\n else if (this._editing()) { e.preventDefault(); e.stopPropagation(); this._revert(); }\n return;\n case 'Tab':\n this._open.set(false);\n return;\n }\n }\n\n protected onOptionMouseDown(e: MouseEvent, o: ComboboxOption<T>) {\n e.preventDefault();\n if (!o.disabled) this.choose(o);\n }\n\n protected onOptionHover(i: number, o: ComboboxOption<T>) {\n if (!o.disabled && i !== this._activeIndex()) this._activeIndex.set(i);\n }\n\n /** Select `o` (also callable by a host through a template ref). */\n choose(o: ComboboxOption<T>) {\n if (this.disabled()) return;\n const sel = { value: o.value, label: o.label };\n this._selected.set(sel);\n this._revert();\n this._open.set(false);\n this._onChange(sel);\n this.valueChange.emit(o);\n }\n\n /** Clear the selection (the x button). */\n clear() {\n if (this.disabled()) return;\n this._selected.set(null);\n this._revert();\n this._open.set(false);\n this._onChange(null);\n this.valueChange.emit(null);\n afterNextRender(() => this._field()?.nativeElement.focus(), { injector: this._injector });\n }\n}\n"],"mappings":";;;;AAqBA,IAAI,iBAAiB;AAwNrB,IAAa,oBAAb,MAAa,kBAAiB;CAgG5B,cAAA;EA/FmB,KAAA,SAAS,OAAO,eAAe;EACzC,KAAA,QAAkB,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;EAE3B,KAAA,YAAkB,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;EAC3B,KAAA,cAAkB,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;EAC3B,KAAA,WAAkB,MAAM,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;EAC9B,KAAA,OAAkB,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;EAE3B,KAAA,QAAkB,MAAM,IAAG,GAAA,YAAA,CAAA,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AA,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,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,gBAAA,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,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,aAAA;EAAA,CAAA;EAAA,eAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,eAAA;EAAA,CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,SAAA;EAAA,CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,SAAA;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,SAAO,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
1
+ {"version":3,"file":"forgeroute-ui-combobox.mjs","names":[],"sources":["../../../projects/forgeroute-ui/combobox/src/lib/combobox/combobox.component.ts"],"sourcesContent":["import {\n Component, ChangeDetectionStrategy, DestroyRef, ElementRef, Injector, afterNextRender, computed, effect, forwardRef,\n inject, input, linkedSignal, output, signal, untracked, viewChild,\n} from '@angular/core';\nimport { AbstractControl, ControlValueAccessor, NG_VALIDATORS, NG_VALUE_ACCESSOR, ValidationErrors, Validator } from '@angular/forms';\nimport { FieldIssue, UiFieldValidity, createFieldReveal, issueToErrors, requiredIssue } from '@forgeroute/ui/core';\nimport { UiLabelsService } from '@forgeroute/ui/core';\n\n/** One selectable row. `data` carries any host payload (a typed record, an id, ...) back through `(valueChange)`. */\nexport interface ComboboxOption<T = unknown> {\n value: string;\n label: string;\n /** Secondary line under the label (trade, customer name, ...). */\n description?: string;\n disabled?: boolean;\n data?: T;\n}\n\n/** The selected value: what `[value]` and `ngModel` / `FormControl` hold. */\nexport interface ComboboxSelection { value: string; label: string }\n\nlet nextComboboxId = 0;\n\n/**\n * Search-as-you-type single select (WAI-ARIA 1.2 combobox with listbox popup). The HOST fetches: the combobox emits\n * `(searchChange)` with the typed term (debounced) and renders whatever `[options]` currently is, so a host using\n * `switchMap` is race-safe and a stale array never \"sticks\" (the active option is re-validated on every change).\n *\n * ## API\n * - `[options]` `ComboboxOption[]` current results (`{ value, label, description?, disabled?, data? }`).\n * - `[value]` `{ value, label } | null` the selection. Also what `ngModel` / `formControl` hold (same shape).\n * - `[displayText]` text shown in the field instead of the selected label — use it for legacy / orphaned links:\n * `displayText=\"Not linked: Legacy Co\"` (with `[value]=\"null\"`) or `displayText=\"Acme (no longer exists)\"`.\n * Pair it with `[displayWarning]=\"true\"` for the amber \"needs attention\" style. A `displayText` with no `value` is\n * shown and has a clear button, but counts as EMPTY for `required`.\n * - `[loading]` shows \"Searching…\" and announces it. `[noResultsText]` (default \"No results found\").\n * - `[minChars]` (default 0): below it nothing is searched or listed (\"Type at least N characters\"). 0 = the list opens\n * on focus and `(searchChange)` fires with '' so the host can show its initial results.\n * - `[hideMinCharsHint]` (default false, added 2026-11-22): with a `minChars` above 0, do not open the dropdown at all until the minimum is typed, so no \"Type at least N characters\" line shows (a picker that must\n * list nothing up front). Searching and listing are unchanged; only the empty dropdown with that prompt is not drawn. Default = the prompt shows as before.\n * - `[debounce]` ms between the last keystroke and `(searchChange)` (default 250). Focus / ArrowDown-open emit immediately.\n * - `[label] [ariaLabel] [placeholder] [required] [hint] [error] [disabled] [showErrors]` like `ui-text-input`\n * (host `[error]` wins over the built-in \"<label> is required.\"; messages (built-in and host) show only after the user left the field, `showErrors` also reveals it on an untouched field).\n * - `(searchChange)` string, `(valueChange)` `ComboboxOption | null` (the full chosen option, null when cleared),\n * `(invalidChange)` boolean, `(focused)`, `(blurred)`. Validity: `UiFieldValidity` token + Angular `Validator`.\n *\n * ## Behaviour\n * - The field shows the selected label. Focusing it selects that text; typing starts a NEW search and the old value is\n * kept until another option is picked or the clear (x) button is pressed. Leaving the field (blur / Tab / Escape)\n * discards the typed text and shows the selection again.\n * - Escape: if the list is open it closes the list ONLY (stopPropagation, so a surrounding side panel / modal stays\n * open). If the list is already closed and text was typed, it discards the text (also stopped). Otherwise the key\n * passes through to the panel.\n * - Tab never selects: it closes the list and moves on.\n *\n * ## Keyboard\n * ArrowDown / ArrowUp open the list and move the active option (wraps, skips disabled). Home / End jump to the first /\n * last option while the list is open. Enter picks the active option (and does not submit a surrounding form while open).\n * Escape / Tab as above. Typing opens the list. Mouse: options are picked on mousedown so blur does not swallow it.\n *\n * ## ARIA\n * The inner `<input>` is `role=\"combobox\"` with `aria-expanded`, `aria-controls` (the listbox, while open),\n * `aria-autocomplete=\"list\"`, `aria-activedescendant`, `aria-invalid`, `aria-required`, `aria-describedby` (hint / error);\n * the `<label for>` names it. The popup is `role=\"listbox\"` of `role=\"option\"` rows (`aria-selected` = active row,\n * stable ids). A polite `role=\"status\"` region announces \"Searching\", \"N results available\" or the no-results text.\n *\n * ## Example\n * ```html\n * <ui-combobox label=\"Subcontractor\" [required]=\"true\" [options]=\"opts()\" [loading]=\"loading()\"\n * [value]=\"sub()\" [displayText]=\"legacyName() ? 'Not linked: ' + legacyName() : ''\" [error]=\"err()\"\n * (searchChange)=\"search$.next($event)\" (valueChange)=\"onPick($event)\" />\n * ```\n */\n@Component({\n selector: 'ui-combobox',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [{\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => ComboboxComponent),\n multi: true,\n }, {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => ComboboxComponent),\n multi: true,\n }, {\n provide: UiFieldValidity,\n useExisting: forwardRef(() => ComboboxComponent),\n }],\n template: `\n <div class=\"cb-field\" [class.cb-error]=\"_activeError()\" [class.cb-disabled]=\"disabled()\" [class.cb-warning]=\"displayWarning()\">\n @if (label()) {\n <label class=\"cb-label\" [for]=\"_inputId\">\n {{ label() }}\n @if (required()) { <span class=\"cb-required\" aria-hidden=\"true\">*</span> }\n </label>\n }\n <div class=\"cb-control\">\n <input\n #field\n class=\"cb-input\"\n type=\"text\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n autocomplete=\"off\"\n [id]=\"_inputId\"\n [class.cb-has-clear]=\"_showClear()\"\n [placeholder]=\"placeholder()\"\n [value]=\"_inputText()\"\n [disabled]=\"disabled()\"\n [attr.aria-disabled]=\"disabled() ? 'true' : null\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-expanded]=\"_popupVisible() ? 'true' : 'false'\"\n [attr.aria-controls]=\"_popupVisible() ? _listId : null\"\n [attr.aria-activedescendant]=\"_activeDescendant()\"\n [attr.aria-invalid]=\"_activeError() ? 'true' : null\"\n [attr.aria-required]=\"required() || null\"\n [attr.aria-describedby]=\"(_activeError() || hint()) ? _descId : null\"\n (input)=\"onInput($event)\"\n (focus)=\"onFocus($event)\"\n (click)=\"onClick()\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeydown($event)\"\n />\n @if (_showClear()) {\n <button type=\"button\" class=\"cb-clear\" data-testid=\"combobox-clear\" [attr.aria-label]=\"labels.t('combobox.clearNamed', { name: label() || ariaLabel() || labels.t('combobox.selection') })\"\n (mousedown)=\"$event.preventDefault()\" (click)=\"clear()\">&times;</button>\n }\n @if (_popupVisible()) {\n <div class=\"cb-popup\" (mousedown)=\"$event.preventDefault()\">\n <div class=\"cb-list\" role=\"listbox\" [id]=\"_listId\" [attr.aria-label]=\"label() || ariaLabel() || null\">\n @if (_belowMin() === false) {\n @for (o of options(); track o.value; let i = $index) {\n <div class=\"cb-option\" role=\"option\" [id]=\"_optionId(i)\"\n [class.cb-option-active]=\"i === _activeIndex()\"\n [class.cb-option-disabled]=\"o.disabled\"\n [class.cb-option-selected]=\"o.value === _selected()?.value\"\n [attr.aria-selected]=\"i === _activeIndex() ? 'true' : 'false'\"\n [attr.aria-disabled]=\"o.disabled ? 'true' : null\"\n (mousedown)=\"onOptionMouseDown($event, o)\"\n (mousemove)=\"onOptionHover(i, o)\">\n <span class=\"cb-option-label\">{{ o.label }}</span>\n @if (o.description) { <span class=\"cb-option-desc\">{{ o.description }}</span> }\n </div>\n }\n }\n </div>\n @if (_statusText(); as status) {\n <div class=\"cb-status\" data-testid=\"combobox-status\">{{ status }}</div>\n }\n </div>\n }\n </div>\n <span class=\"cb-live\" role=\"status\" aria-live=\"polite\">{{ _liveText() }}</span>\n @if (_activeError()) {\n <p class=\"cb-desc cb-desc-error\" [id]=\"_descId\" role=\"alert\">{{ _activeError() }}</p>\n } @else if (hint()) {\n <p class=\"cb-desc\" [id]=\"_descId\">{{ hint() }}</p>\n }\n </div>\n `,\n styles: [`\n :host { display: block; }\n\n .cb-field { display: flex; flex-direction: column; gap: 6px; }\n .cb-label { font-size: 0.8125rem; font-weight: 600; color: #374151; line-height: 1; }\n .cb-required { color: #dc2626; margin-left: 2px; }\n\n .cb-control { position: relative; }\n .cb-input {\n width: 100%; box-sizing: border-box;\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; transition: border-color 0.15s, box-shadow 0.15s;\n &::placeholder { color: #64748b; opacity: 1; }\n &:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12); }\n }\n .cb-has-clear { padding-right: 40px; }\n\n .cb-warning .cb-input { border-color: #f59e0b; background: #fffbeb; }\n .cb-error .cb-input {\n border-color: #ef4444;\n &:focus { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12); }\n }\n .cb-disabled .cb-input { opacity: 0.5; cursor: not-allowed; }\n\n .cb-clear {\n position: absolute; top: 50%; right: 4px; transform: translateY(-50%);\n border: 0; background: transparent; cursor: pointer; color: #64748b;\n font-size: 1.25rem; line-height: 1; min-width: 32px; min-height: 32px; padding: 0 8px; border-radius: 6px;\n &:hover { color: #0f172a; }\n &:focus-visible { outline: 2px solid #3b82f6; }\n }\n\n .cb-popup {\n position: absolute; z-index: 30; left: 0; right: 0; top: 100%; margin-top: 4px; box-sizing: border-box;\n max-width: 100%; max-height: min(260px, 40vh); overflow-y: auto; overscroll-behavior: contain;\n background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);\n }\n .cb-list:empty { display: none; }\n .cb-status { padding: 12px; font-size: 0.875rem; color: #64748b; }\n .cb-option {\n display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; min-height: 40px; justify-content: center;\n box-sizing: border-box; cursor: pointer;\n }\n .cb-option-active { background: #eff6ff; }\n .cb-option-selected .cb-option-label { font-weight: 600; }\n .cb-option-disabled { opacity: 0.5; cursor: not-allowed; }\n .cb-option-label { font-size: 0.875rem; color: #0f172a; overflow-wrap: anywhere; }\n .cb-option-desc { font-size: 0.75rem; color: #64748b; overflow-wrap: anywhere; }\n\n .cb-desc { margin: -6px 0 0; font-size: 0.75rem; line-height: 1.4; color: #64748b; }\n .cb-desc-error { color: #dc2626; }\n\n .cb-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }\n\n /* Reduced motion: no transition on the field. Forced colors (Windows high contrast) drop box-shadow, so the focus\n ring and the active option fall back to real outlines. */\n @media (prefers-reduced-motion: reduce) { .cb-input { transition: none; } }\n @media (forced-colors: active) {\n .cb-input:focus { outline: 2px solid Highlight; outline-offset: 1px; }\n .cb-option-active { outline: 2px solid Highlight; outline-offset: -2px; }\n }\n\n /* Touch targets: the field and its clear (x) button are at least 44px on touch devices and phones. */\n @media (pointer: coarse), (max-width: 480px) {\n .cb-input { min-height: 44px; }\n .cb-clear { min-width: 44px; min-height: 44px; }\n }\n @media (pointer: coarse) { .cb-option { min-height: 44px; } }\n @media (max-width: 480px) {\n .cb-input { font-size: 1rem; }\n .cb-option { min-height: 44px; }\n }\n `],\n})\nexport class ComboboxComponent<T = unknown> 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 placeholder = input('');\n readonly required = input(false);\n readonly hint = input('');\n /** Host error message; always wins over the built-in message. */\n readonly error = input('');\n readonly showErrors = input(false);\n /** Current results (host-owned). */\n readonly options = input<ComboboxOption<T>[]>([]);\n readonly loading = input(false);\n readonly noResultsTextInput = input<string | null>(null, { alias: 'noResultsText' });\n readonly noResultsText = computed(() => this.noResultsTextInput() ?? this.labels.t('combobox.noResultsText'));\n /** Characters needed before searching / listing. 0 = open on focus. */\n readonly minChars = input(0);\n readonly hideMinCharsHint = input(false);\n /** Milliseconds between the last keystroke and `(searchChange)`. */\n readonly debounce = input(250);\n /** The selection. */\n readonly value = input<ComboboxSelection | null>(null);\n /** Text shown instead of the selected label (legacy / orphaned links). */\n readonly displayText = input('');\n /** Amber style for a legacy / orphaned `displayText`. */\n readonly displayWarning = input(false);\n\n /** Typed term, debounced (immediate on focus / open). */\n readonly searchChange = output<string>();\n /** The chosen option, or null when cleared. */\n readonly valueChange = output<ComboboxOption<T> | null>();\n readonly invalidChange = output<boolean>();\n readonly focused = output<void>();\n readonly blurred = output<void>();\n\n /** Disables the field (`[disabled]=\"x()\"`). Public so templates compile; ngModel / FormControl `disable()` still works (effective disabled = this OR the forms API). */\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 _field = viewChild<ElementRef<HTMLInputElement>>('field');\n private readonly _host = inject(ElementRef) as ElementRef<HTMLElement>;\n private readonly _injector = inject(Injector);\n private readonly _destroyRef = inject(DestroyRef);\n\n /** Follows `[value]`; ngModel / formControl writes and user picks override it until `[value]` changes. */\n protected readonly _selected = linkedSignal<ComboboxSelection | null>(() => this.value());\n private readonly _text = signal('');\n private readonly _editing = signal(false);\n protected readonly _open = signal(false);\n /** Reset to the first enabled option whenever `[options]` changes, so a stale index never survives new results. */\n protected readonly _activeIndex = linkedSignal<ComboboxOption<T>[], number>({\n source: this.options,\n computation: opts => this._firstEnabled(opts),\n });\n\n protected readonly _uid = ++nextComboboxId;\n protected readonly _inputId = `cb-${this._uid}`;\n protected readonly _listId = `cb-list-${this._uid}`;\n protected readonly _descId = `cb-desc-${this._uid}`;\n\n private readonly _reveal = createFieldReveal(this.showErrors);\n private readonly _issue = computed(() => this._check(this._selected()));\n readonly invalid = computed(() => !!this.error() || !!this._issue());\n readonly errorMessage = computed(() => this._issue()?.message ?? '');\n protected readonly _activeError = computed(() => this._reveal.revealed() ? (this.error() || this.errorMessage()) : '');\n\n protected readonly _inputText = computed(() =>\n this._editing() ? this._text() : (this.displayText() || this._selected()?.label || ''));\n protected readonly _showClear = computed(() => !this.disabled() && !this._editing() && !!(this._selected() || this.displayText()));\n protected readonly _belowMin = computed(() => this._term().length < this.minChars());\n /** The dropdown is drawn: open, except below the minimum when the host asked not to show the \"Type at least N characters\" prompt. */\n protected readonly _popupVisible = computed(() => this._open() && !(this.hideMinCharsHint() && this._belowMin()));\n protected readonly _statusText = computed(() => {\n if (this._belowMin()) return this.labels.t(this.minChars() === 1 ? 'combobox.typeAtLeast_one' : 'combobox.typeAtLeast_other', { count: this.minChars() });\n if (this.loading()) return this.labels.t('search.searching') + '…';\n return this.options().length === 0 ? this.noResultsText() : '';\n });\n protected readonly _liveText = computed(() => {\n if (!this._open() || this._belowMin()) return '';\n if (this.loading()) return this.labels.t('search.searching');\n const n = this.options().length;\n if (n === 0) return this.noResultsText();\n return this.labels.t(n === 1 ? 'combobox.resultsAvailable_one' : 'combobox.resultsAvailable_other', { count: n });\n });\n protected readonly _activeDescendant = computed(() => {\n const i = this._activeIndex();\n return this._open() && !this._belowMin() && i >= 0 && i < this.options().length ? this._optionId(i) : null;\n });\n\n private _debounceTimer: ReturnType<typeof setTimeout> | null = null;\n private _onChange = (_: ComboboxSelection | null) => {};\n private _onTouched = () => {};\n private _onValidatorChange = () => {};\n\n constructor() {\n effect(() => { this.invalidChange.emit(this.invalid()); });\n // Becoming disabled closes an open list, drops a pending search and discards typed text.\n effect(() => { if (this.disabled()) untracked(() => { this._cancelTimer(); this._open.set(false); this._editing.set(false); this._text.set(''); }); });\n this._destroyRef.onDestroy(() => this._cancelTimer());\n }\n\n ngOnChanges() { this._onValidatorChange(); }\n\n // ── CVA / Validator ───────────────────────────────────────────────\n writeValue(val: ComboboxSelection | null) { this._selected.set(val ?? null); }\n validate(control: AbstractControl): ValidationErrors | null {\n return issueToErrors(this._check((control.value as ComboboxSelection | null) ?? null));\n }\n registerOnValidatorChange(fn: () => void) { this._onValidatorChange = fn; }\n registerOnChange(fn: (v: ComboboxSelection | null) => void) { this._onChange = fn; }\n registerOnTouched(fn: () => void) { this._onTouched = fn; }\n setDisabledState(d: boolean) { this._cvaDisabled.set(d); }\n\n private _check(sel: ComboboxSelection | null): FieldIssue | null {\n if (this.disabled()) return null;\n return !sel && this.required() ? requiredIssue(this.label()) : null;\n }\n\n // ── Helpers ───────────────────────────────────────────────────────\n /** What the user typed (trimmed); '' while not editing. */\n private _term(): string { return this._editing() ? this._text().trim() : ''; }\n protected _optionId(i: number) { return `${this._listId}-opt-${i}`; }\n private _firstEnabled(opts: ComboboxOption<T>[]) { return opts.findIndex(o => !o.disabled); }\n\n private _emitSearch() { this._cancelTimer(); if (!this._belowMin()) this.searchChange.emit(this._term()); }\n private _cancelTimer() { if (this._debounceTimer != null) { clearTimeout(this._debounceTimer); this._debounceTimer = null; } }\n\n private _revert() { this._cancelTimer(); this._editing.set(false); this._text.set(''); }\n\n private _openList() {\n if (this.disabled()) return;\n if (!this._open()) { this._open.set(true); this._emitSearch(); }\n }\n\n private _move(dir: 1 | -1) {\n const opts = this.options();\n if (!opts.length || opts.every(o => o.disabled)) return;\n let i = this._activeIndex();\n for (let step = 0; step < opts.length; step++) {\n i = ((i < 0 ? (dir === 1 ? -1 : 0) : i) + dir + opts.length) % opts.length;\n if (!opts[i].disabled) break;\n }\n this._setActive(i);\n }\n\n private _setActive(i: number) {\n this._activeIndex.set(i);\n afterNextRender(() => {\n const el = this._host.nativeElement.querySelector(`#${this._optionId(i)}`) as HTMLElement | null;\n if (el && typeof el.scrollIntoView === 'function') el.scrollIntoView({ block: 'nearest' });\n }, { injector: this._injector });\n }\n\n // ── Events ────────────────────────────────────────────────────────\n protected onInput(event: Event) {\n if (this.disabled()) return;\n this._text.set((event.target as HTMLInputElement).value);\n this._editing.set(true);\n this._open.set(true);\n this._cancelTimer();\n if (this._belowMin()) return;\n this._debounceTimer = setTimeout(() => { this._debounceTimer = null; this._emitSearch(); }, this.debounce());\n }\n\n protected onFocus(event: FocusEvent) {\n this.focused.emit();\n const el = event.target as HTMLInputElement;\n if (this._selected() || this.displayText()) el.select?.();\n this._openList();\n }\n\n protected onClick() { this._openList(); }\n\n protected onBlur() {\n this._open.set(false);\n this._revert();\n this._onTouched();\n this.blurred.emit();\n this._reveal.touched.set(true);\n }\n\n protected onKeydown(e: KeyboardEvent) {\n const opts = this.options();\n const listing = this._open() && !this._belowMin();\n switch (e.key) {\n case 'ArrowDown':\n case 'ArrowUp':\n if (this._open() && !this._popupVisible()) return;\n e.preventDefault();\n if (!this._open()) { this._openList(); return; }\n this._move(e.key === 'ArrowDown' ? 1 : -1);\n return;\n case 'Home':\n case 'End':\n if (listing && opts.length) {\n e.preventDefault();\n const idx = e.key === 'Home' ? opts.findIndex(o => !o.disabled) : opts.map(o => !o.disabled).lastIndexOf(true);\n if (idx >= 0) this._setActive(idx);\n }\n return;\n case 'Enter':\n if (this._popupVisible()) {\n e.preventDefault();\n const i = this._activeIndex();\n if (listing && i >= 0 && i < opts.length && !opts[i].disabled) this.choose(opts[i]);\n }\n return;\n case 'Escape':\n if (this._popupVisible()) { e.preventDefault(); e.stopPropagation(); this._cancelTimer(); this._open.set(false); }\n else if (this._editing()) { e.preventDefault(); e.stopPropagation(); this._revert(); }\n return;\n case 'Tab':\n this._open.set(false);\n return;\n }\n }\n\n protected onOptionMouseDown(e: MouseEvent, o: ComboboxOption<T>) {\n e.preventDefault();\n if (!o.disabled) this.choose(o);\n }\n\n protected onOptionHover(i: number, o: ComboboxOption<T>) {\n if (!o.disabled && i !== this._activeIndex()) this._activeIndex.set(i);\n }\n\n /** Select `o` (also callable by a host through a template ref). */\n choose(o: ComboboxOption<T>) {\n if (this.disabled()) return;\n const sel = { value: o.value, label: o.label };\n this._selected.set(sel);\n this._revert();\n this._open.set(false);\n this._onChange(sel);\n this.valueChange.emit(o);\n }\n\n /** Clear the selection (the x button). */\n clear() {\n if (this.disabled()) return;\n this._selected.set(null);\n this._revert();\n this._open.set(false);\n this._onChange(null);\n this.valueChange.emit(null);\n afterNextRender(() => this._field()?.nativeElement.focus(), { injector: this._injector });\n }\n}\n"],"mappings":";;;;AAqBA,IAAI,iBAAiB;AAwNrB,IAAa,oBAAb,MAAa,kBAAiB;CAgG5B,cAAA;EA/FmB,KAAA,SAAS,OAAO,eAAe;EACzC,KAAA,QAAkB,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;EAE3B,KAAA,YAAkB,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;EAC3B,KAAA,cAAkB,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CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,SAAO,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
@@ -389,7 +389,7 @@ var ContactPickerComponent = class ContactPickerComponent {
389
389
  [attr.aria-expanded]="showResults()"
390
390
  [attr.aria-controls]="showResults() ? listboxId : null"
391
391
  [attr.aria-activedescendant]="activeDescendant()"
392
- [(ngModel)]="query"
392
+ [(ngModel)]="query" [ngModelOptions]="{ standalone: true }"
393
393
  autocomplete="off"
394
394
  (input)="onInput()"
395
395
  (focus)="onFocus()"
@@ -470,7 +470,7 @@ var ContactPickerComponent = class ContactPickerComponent {
470
470
  [attr.aria-expanded]="showResults()"
471
471
  [attr.aria-controls]="showResults() ? listboxId : null"
472
472
  [attr.aria-activedescendant]="activeDescendant()"
473
- [(ngModel)]="query"
473
+ [(ngModel)]="query" [ngModelOptions]="{ standalone: true }"
474
474
  autocomplete="off"
475
475
  (input)="onInput()"
476
476
  (focus)="onFocus()"
@@ -632,7 +632,7 @@ i0.ɵɵngDeclareClassMetadata({
632
632
  [attr.aria-expanded]="showResults()"
633
633
  [attr.aria-controls]="showResults() ? listboxId : null"
634
634
  [attr.aria-activedescendant]="activeDescendant()"
635
- [(ngModel)]="query"
635
+ [(ngModel)]="query" [ngModelOptions]="{ standalone: true }"
636
636
  autocomplete="off"
637
637
  (input)="onInput()"
638
638
  (focus)="onFocus()"
@@ -713,7 +713,7 @@ i0.ɵɵngDeclareClassMetadata({
713
713
  [attr.aria-expanded]="showResults()"
714
714
  [attr.aria-controls]="showResults() ? listboxId : null"
715
715
  [attr.aria-activedescendant]="activeDescendant()"
716
- [(ngModel)]="query"
716
+ [(ngModel)]="query" [ngModelOptions]="{ standalone: true }"
717
717
  autocomplete="off"
718
718
  (input)="onInput()"
719
719
  (focus)="onFocus()"