@forgeroute/ui 0.5.26 → 0.5.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/fesm2022/forgeroute-ui-card-list-item.mjs +30 -8
  2. package/fesm2022/forgeroute-ui-card-list-item.mjs.map +1 -1
  3. package/fesm2022/forgeroute-ui-checkbox.mjs +2 -2
  4. package/fesm2022/forgeroute-ui-checkbox.mjs.map +1 -1
  5. package/fesm2022/forgeroute-ui-color-input.mjs +2 -2
  6. package/fesm2022/forgeroute-ui-color-input.mjs.map +1 -1
  7. package/fesm2022/forgeroute-ui-combobox.mjs +2 -2
  8. package/fesm2022/forgeroute-ui-combobox.mjs.map +1 -1
  9. package/fesm2022/forgeroute-ui-contact-picker.mjs +4 -4
  10. package/fesm2022/forgeroute-ui-contact-picker.mjs.map +1 -1
  11. package/fesm2022/forgeroute-ui-conversations.mjs +2 -0
  12. package/fesm2022/forgeroute-ui-conversations.mjs.map +1 -1
  13. package/fesm2022/forgeroute-ui-data-table-core.mjs +2 -2
  14. package/fesm2022/forgeroute-ui-data-table-core.mjs.map +1 -1
  15. package/fesm2022/forgeroute-ui-date-input.mjs +2 -2
  16. package/fesm2022/forgeroute-ui-date-input.mjs.map +1 -1
  17. package/fesm2022/forgeroute-ui-datetime-input.mjs +2 -2
  18. package/fesm2022/forgeroute-ui-datetime-input.mjs.map +1 -1
  19. package/fesm2022/forgeroute-ui-detail-card.mjs +20 -4
  20. package/fesm2022/forgeroute-ui-detail-card.mjs.map +1 -1
  21. package/fesm2022/forgeroute-ui-dropdown.mjs +16 -2
  22. package/fesm2022/forgeroute-ui-dropdown.mjs.map +1 -1
  23. package/fesm2022/forgeroute-ui-file-input.mjs +7 -5
  24. package/fesm2022/forgeroute-ui-file-input.mjs.map +1 -1
  25. package/fesm2022/forgeroute-ui-icon-picker.mjs +2 -2
  26. package/fesm2022/forgeroute-ui-icon-picker.mjs.map +1 -1
  27. package/fesm2022/forgeroute-ui-media.mjs +67 -2
  28. package/fesm2022/forgeroute-ui-media.mjs.map +1 -1
  29. package/fesm2022/forgeroute-ui-messaging.mjs +3 -0
  30. package/fesm2022/forgeroute-ui-messaging.mjs.map +1 -1
  31. package/fesm2022/forgeroute-ui-multi-select.mjs +2 -2
  32. package/fesm2022/forgeroute-ui-multi-select.mjs.map +1 -1
  33. package/fesm2022/forgeroute-ui-notes.mjs +1 -0
  34. package/fesm2022/forgeroute-ui-notes.mjs.map +1 -1
  35. package/fesm2022/forgeroute-ui-option-card.mjs +1 -0
  36. package/fesm2022/forgeroute-ui-option-card.mjs.map +1 -1
  37. package/fesm2022/forgeroute-ui-payments.mjs +3 -0
  38. package/fesm2022/forgeroute-ui-payments.mjs.map +1 -1
  39. package/fesm2022/forgeroute-ui-pdf.mjs +1 -0
  40. package/fesm2022/forgeroute-ui-pdf.mjs.map +1 -1
  41. package/fesm2022/forgeroute-ui-quickbooks.mjs +1 -0
  42. package/fesm2022/forgeroute-ui-quickbooks.mjs.map +1 -1
  43. package/fesm2022/forgeroute-ui-radio-matrix.mjs +2 -2
  44. package/fesm2022/forgeroute-ui-radio-matrix.mjs.map +1 -1
  45. package/fesm2022/forgeroute-ui-radio.mjs +2 -2
  46. package/fesm2022/forgeroute-ui-radio.mjs.map +1 -1
  47. package/fesm2022/forgeroute-ui-select.mjs +2 -2
  48. package/fesm2022/forgeroute-ui-select.mjs.map +1 -1
  49. package/fesm2022/forgeroute-ui-setup.mjs +1 -0
  50. package/fesm2022/forgeroute-ui-setup.mjs.map +1 -1
  51. package/fesm2022/forgeroute-ui-square.mjs +1 -0
  52. package/fesm2022/forgeroute-ui-square.mjs.map +1 -1
  53. package/fesm2022/forgeroute-ui-star-rating.mjs +2 -2
  54. package/fesm2022/forgeroute-ui-star-rating.mjs.map +1 -1
  55. package/fesm2022/forgeroute-ui-stripe.mjs +1 -0
  56. package/fesm2022/forgeroute-ui-stripe.mjs.map +1 -1
  57. package/fesm2022/forgeroute-ui-swatch-picker.mjs +2 -2
  58. package/fesm2022/forgeroute-ui-swatch-picker.mjs.map +1 -1
  59. package/fesm2022/forgeroute-ui-table-toolbar.mjs +17 -5
  60. package/fesm2022/forgeroute-ui-table-toolbar.mjs.map +1 -1
  61. package/fesm2022/forgeroute-ui-text-input.mjs +2 -2
  62. package/fesm2022/forgeroute-ui-text-input.mjs.map +1 -1
  63. package/fesm2022/forgeroute-ui-textarea-input.mjs +23 -36
  64. package/fesm2022/forgeroute-ui-textarea-input.mjs.map +1 -1
  65. package/fesm2022/forgeroute-ui-time-input.mjs +2 -2
  66. package/fesm2022/forgeroute-ui-time-input.mjs.map +1 -1
  67. package/package.json +1 -1
  68. package/types/forgeroute-ui-card-list-item.d.ts +11 -3
  69. package/types/forgeroute-ui-detail-card.d.ts +7 -0
  70. package/types/forgeroute-ui-dropdown.d.ts +2 -0
  71. package/types/forgeroute-ui-media.d.ts +28 -0
  72. package/types/forgeroute-ui-messaging.d.ts +4 -4
  73. package/types/forgeroute-ui-payments.d.ts +1 -1
  74. package/types/forgeroute-ui-quickbooks.d.ts +1 -1
  75. package/types/forgeroute-ui-square.d.ts +4 -4
  76. package/types/forgeroute-ui-stripe.d.ts +4 -4
  77. package/types/forgeroute-ui-textarea-input.d.ts +9 -9
@@ -284,7 +284,7 @@ var MultiSelectComponent = class MultiSelectComponent {
284
284
  </div>
285
285
  `,
286
286
  isInline: true,
287
- styles: [":host{display:block}.ms-field{display:flex;flex-direction:column;gap:6px}.ms-label{font-size:.8125rem;font-weight:600;color:#374151;line-height:1}.ms-required{color:#dc2626;margin-left:2px}.ms-tags{display:flex;flex-wrap:wrap;gap:6px}.ms-wrap{position:relative}.ms-trigger{width:100%;box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;padding:9px 10px 9px 12px;font-size:.875rem;font-family:inherit;text-align:left;color:#1e293b;background:#fff;border:1px solid #7c8ba1;border-radius:8px;cursor:pointer;outline:none;transition:border-color .15s,box-shadow .15s}.ms-trigger:focus-visible,.ms-trigger.ms-open{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61f}.ms-has-error .ms-trigger{border-color:#ef4444}.ms-disabled .ms-trigger{opacity:.5;cursor:not-allowed}.ms-placeholder{color:#64748b}.ms-chevron{color:#64748b;flex-shrink:0;margin-left:8px;transition:transform .2s ease}.ms-chevron-open{transform:rotate(180deg)}.ms-dropdown{position:absolute;top:calc(100% + 4px);left:0;right:0;z-index:50;display:flex;flex-direction:column;max-height:260px;background:#fff;border:1px solid #e2e8f0;border-radius:8px;box-shadow:0 4px 16px #0f172a1a}.ms-search-wrap{padding:8px;border-bottom:1px solid #e2e8f0}.ms-search{width:100%;box-sizing:border-box;padding:7px 10px;font-size:.8125rem;font-family:inherit;color:#1e293b;border:1px solid #7c8ba1;border-radius:6px;outline:none}.ms-search::placeholder{color:#64748b;opacity:1}.ms-search:focus{border-color:#3b82f6}.ms-options{overflow-y:auto;padding:4px 0}.ms-option{padding:7px 12px;font-size:.8125rem}.ms-option:hover{background:#f8fafc}.ms-option-selected{background:#eff6ff}.ms-empty{padding:16px;text-align:center;color:#94a3b8;font-size:.8125rem}.ms-desc{margin:0;font-size:.75rem;line-height:1.4;color:#64748b}.ms-desc-error{color:#dc2626}@media(max-width:480px){.ms-trigger,.ms-search{font-size:1rem}}\n"],
287
+ styles: [":host{display:block}.ms-field{display:flex;flex-direction:column;gap:6px}.ms-label{font-size:.8125rem;font-weight:600;color:#374151;line-height:1}.ms-required{color:#dc2626;margin-left:2px}.ms-tags{display:flex;flex-wrap:wrap;gap:6px}.ms-wrap{position:relative}.ms-trigger{width:100%;box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;padding:9px 10px 9px 12px;font-size:.875rem;font-family:inherit;text-align:left;color:#1e293b;background:#fff;border:1px solid #7c8ba1;border-radius:8px;cursor:pointer;outline:none;transition:border-color .15s,box-shadow .15s}.ms-trigger:focus-visible,.ms-trigger.ms-open{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61f}.ms-has-error .ms-trigger{border-color:#ef4444}.ms-disabled .ms-trigger{opacity:.5;cursor:not-allowed}.ms-placeholder{color:#64748b}.ms-chevron{color:#64748b;flex-shrink:0;margin-left:8px;transition:transform .2s ease}.ms-chevron-open{transform:rotate(180deg)}.ms-dropdown{position:absolute;top:calc(100% + 4px);left:0;right:0;z-index:50;display:flex;flex-direction:column;max-height:260px;background:#fff;border:1px solid #e2e8f0;border-radius:8px;box-shadow:0 4px 16px #0f172a1a}.ms-search-wrap{padding:8px;border-bottom:1px solid #e2e8f0}.ms-search{width:100%;box-sizing:border-box;padding:7px 10px;font-size:.8125rem;font-family:inherit;color:#1e293b;border:1px solid #7c8ba1;border-radius:6px;outline:none}.ms-search::placeholder{color:#64748b;opacity:1}.ms-search:focus{border-color:#3b82f6}.ms-options{overflow-y:auto;padding:4px 0}.ms-option{padding:7px 12px;font-size:.8125rem}.ms-option:hover{background:#f8fafc}.ms-option-selected{background:#eff6ff}.ms-empty{padding:16px;text-align:center;color:#94a3b8;font-size:.8125rem}.ms-desc{margin:-6px 0 0;font-size:.75rem;line-height:1.4;color:#64748b}.ms-desc-error{color:#dc2626}@media(max-width:480px){.ms-trigger,.ms-search{font-size:1rem}}\n"],
288
288
  dependencies: [{
289
289
  kind: "component",
290
290
  type: ChipComponent,
@@ -423,7 +423,7 @@ i0.ɵɵngDeclareClassMetadata({
423
423
  }
424
424
  </div>
425
425
  `,
426
- styles: [":host{display:block}.ms-field{display:flex;flex-direction:column;gap:6px}.ms-label{font-size:.8125rem;font-weight:600;color:#374151;line-height:1}.ms-required{color:#dc2626;margin-left:2px}.ms-tags{display:flex;flex-wrap:wrap;gap:6px}.ms-wrap{position:relative}.ms-trigger{width:100%;box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;padding:9px 10px 9px 12px;font-size:.875rem;font-family:inherit;text-align:left;color:#1e293b;background:#fff;border:1px solid #7c8ba1;border-radius:8px;cursor:pointer;outline:none;transition:border-color .15s,box-shadow .15s}.ms-trigger:focus-visible,.ms-trigger.ms-open{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61f}.ms-has-error .ms-trigger{border-color:#ef4444}.ms-disabled .ms-trigger{opacity:.5;cursor:not-allowed}.ms-placeholder{color:#64748b}.ms-chevron{color:#64748b;flex-shrink:0;margin-left:8px;transition:transform .2s ease}.ms-chevron-open{transform:rotate(180deg)}.ms-dropdown{position:absolute;top:calc(100% + 4px);left:0;right:0;z-index:50;display:flex;flex-direction:column;max-height:260px;background:#fff;border:1px solid #e2e8f0;border-radius:8px;box-shadow:0 4px 16px #0f172a1a}.ms-search-wrap{padding:8px;border-bottom:1px solid #e2e8f0}.ms-search{width:100%;box-sizing:border-box;padding:7px 10px;font-size:.8125rem;font-family:inherit;color:#1e293b;border:1px solid #7c8ba1;border-radius:6px;outline:none}.ms-search::placeholder{color:#64748b;opacity:1}.ms-search:focus{border-color:#3b82f6}.ms-options{overflow-y:auto;padding:4px 0}.ms-option{padding:7px 12px;font-size:.8125rem}.ms-option:hover{background:#f8fafc}.ms-option-selected{background:#eff6ff}.ms-empty{padding:16px;text-align:center;color:#94a3b8;font-size:.8125rem}.ms-desc{margin:0;font-size:.75rem;line-height:1.4;color:#64748b}.ms-desc-error{color:#dc2626}@media(max-width:480px){.ms-trigger,.ms-search{font-size:1rem}}\n"]
426
+ styles: [":host{display:block}.ms-field{display:flex;flex-direction:column;gap:6px}.ms-label{font-size:.8125rem;font-weight:600;color:#374151;line-height:1}.ms-required{color:#dc2626;margin-left:2px}.ms-tags{display:flex;flex-wrap:wrap;gap:6px}.ms-wrap{position:relative}.ms-trigger{width:100%;box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;padding:9px 10px 9px 12px;font-size:.875rem;font-family:inherit;text-align:left;color:#1e293b;background:#fff;border:1px solid #7c8ba1;border-radius:8px;cursor:pointer;outline:none;transition:border-color .15s,box-shadow .15s}.ms-trigger:focus-visible,.ms-trigger.ms-open{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61f}.ms-has-error .ms-trigger{border-color:#ef4444}.ms-disabled .ms-trigger{opacity:.5;cursor:not-allowed}.ms-placeholder{color:#64748b}.ms-chevron{color:#64748b;flex-shrink:0;margin-left:8px;transition:transform .2s ease}.ms-chevron-open{transform:rotate(180deg)}.ms-dropdown{position:absolute;top:calc(100% + 4px);left:0;right:0;z-index:50;display:flex;flex-direction:column;max-height:260px;background:#fff;border:1px solid #e2e8f0;border-radius:8px;box-shadow:0 4px 16px #0f172a1a}.ms-search-wrap{padding:8px;border-bottom:1px solid #e2e8f0}.ms-search{width:100%;box-sizing:border-box;padding:7px 10px;font-size:.8125rem;font-family:inherit;color:#1e293b;border:1px solid #7c8ba1;border-radius:6px;outline:none}.ms-search::placeholder{color:#64748b;opacity:1}.ms-search:focus{border-color:#3b82f6}.ms-options{overflow-y:auto;padding:4px 0}.ms-option{padding:7px 12px;font-size:.8125rem}.ms-option:hover{background:#f8fafc}.ms-option-selected{background:#eff6ff}.ms-empty{padding:16px;text-align:center;color:#94a3b8;font-size:.8125rem}.ms-desc{margin:-6px 0 0;font-size:.75rem;line-height:1.4;color:#64748b}.ms-desc-error{color:#dc2626}@media(max-width:480px){.ms-trigger,.ms-search{font-size:1rem}}\n"]
427
427
  }]
428
428
  }],
429
429
  propDecorators: {
@@ -1 +1 @@
1
- {"version":3,"file":"forgeroute-ui-multi-select.mjs","names":[],"sources":["../../../projects/forgeroute-ui/multi-select/src/lib/multi-select/multi-select.component.ts"],"sourcesContent":["import {\n Component, ChangeDetectionStrategy, ElementRef, HostListener, input, model, signal, computed, forwardRef, inject,\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { ChipComponent } from '@forgeroute/ui/chip';\nimport { CheckboxComponent } from '@forgeroute/ui/checkbox';\nimport type { SelectOption } from '@forgeroute/ui/select';\nimport { UiLabelsService } from '@forgeroute/ui/core';\nimport { createFieldReveal } from '@forgeroute/ui/core';\n\n/**\n * Searchable multi-value dropdown. Selected values render as dismissible chips above the trigger.\n *\n * Bind with `[(selected)]` or `[(ngModel)]` — the value is an array of option `value`s.\n *\n * <ui-multi-select label=\"Job Types\" [options]=\"jobTypeOptions\" [(selected)]=\"jobTypeIds\" />\n */\n@Component({\n selector: 'ui-multi-select',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [ChipComponent, CheckboxComponent],\n providers: [{\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => MultiSelectComponent),\n multi: true,\n }],\n template: `\n <div class=\"ms-field\" [class.ms-has-error]=\"_shownError()\" [class.ms-disabled]=\"disabled()\">\n @if (label()) {\n <span class=\"ms-label\" [id]=\"_id + '-label'\">\n {{ label() }}\n @if (required()) { <span class=\"ms-required\" aria-hidden=\"true\">*</span> }\n </span>\n }\n\n @if (_selectedOptions().length) {\n <div class=\"ms-tags\">\n @for (opt of _selectedOptions(); track opt.value) {\n <ui-chip size=\"sm\" [label]=\"opt.label\" [active]=\"true\" [dismissible]=\"!disabled()\" (dismiss)=\"remove(opt.value)\" />\n }\n </div>\n }\n\n <div class=\"ms-wrap\">\n <button\n type=\"button\"\n class=\"ms-trigger\"\n [class.ms-open]=\"_open()\"\n [disabled]=\"disabled()\"\n aria-haspopup=\"true\"\n [attr.aria-expanded]=\"_open()\"\n [attr.aria-controls]=\"_open() ? _id + '-options' : null\"\n [attr.aria-labelledby]=\"label() ? _id + '-label' : null\"\n [attr.aria-describedby]=\"_shownError() ? _id + '-error' : (hint() ? _id + '-hint' : null)\"\n [attr.aria-invalid]=\"_shownError() ? 'true' : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n (click)=\"toggleOpen()\"\n (keydown.escape)=\"onEscape($event)\">\n <span class=\"ms-placeholder\">{{ _selectedSet().size ? labels.t(_selectedSet().size === 1 ? 'multiSelect.nSelected_one' : 'multiSelect.nSelected_other', { count: _selectedSet().size }) : placeholder() }}</span>\n <svg class=\"ms-chevron\" [class.ms-chevron-open]=\"_open()\" width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" aria-hidden=\"true\"><polyline points=\"6 9 12 15 18 9\"/></svg>\n </button>\n\n @if (_open()) {\n <div class=\"ms-dropdown\" [id]=\"_id + '-list'\" (keydown.escape)=\"onEscape($event)\">\n @if (searchable()) {\n <div class=\"ms-search-wrap\">\n <input\n class=\"ms-search\"\n type=\"text\"\n [placeholder]=\"searchPlaceholder()\"\n [attr.aria-label]=\"searchPlaceholder()\"\n [value]=\"_query()\"\n (input)=\"_query.set($any($event.target).value)\" />\n </div>\n }\n <div class=\"ms-options\" role=\"group\" [id]=\"_id + '-options'\" [attr.aria-labelledby]=\"label() ? _id + '-label' : null\">\n @for (opt of _filteredOptions(); track opt.value) {\n <div class=\"ms-option\" [class.ms-option-selected]=\"_selectedSet().has(opt.value)\">\n <ui-checkbox\n [label]=\"opt.label\"\n [checked]=\"_selectedSet().has(opt.value)\"\n [description]=\"opt.description ?? ''\"\n (checkedChange)=\"toggleValue(opt.value)\" />\n </div>\n } @empty {\n <div class=\"ms-empty\">{{ labels.t('multiSelect.noOptionsFound') }}</div>\n }\n </div>\n </div>\n }\n </div>\n\n @if (_shownError()) {\n <p class=\"ms-desc ms-desc-error\" [id]=\"_id + '-error'\" role=\"alert\">{{ _shownError() }}</p>\n } @else if (hint()) {\n <p class=\"ms-desc\" [id]=\"_id + '-hint'\">{{ hint() }}</p>\n }\n </div>\n `,\n styles: [`\n :host { display: block; }\n\n .ms-field { display: flex; flex-direction: column; gap: 6px; }\n\n .ms-label { font-size: 0.8125rem; font-weight: 600; color: #374151; line-height: 1; }\n .ms-required { color: #dc2626; margin-left: 2px; }\n\n .ms-tags { display: flex; flex-wrap: wrap; gap: 6px; }\n\n .ms-wrap { position: relative; }\n\n .ms-trigger {\n width: 100%; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between;\n padding: 9px 10px 9px 12px; font-size: 0.875rem; font-family: inherit; text-align: left;\n color: #1e293b; background: #fff; border: 1px solid #7c8ba1; border-radius: 8px;\n cursor: pointer; outline: none; transition: border-color 0.15s, box-shadow 0.15s;\n &:focus-visible, &.ms-open { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12); }\n }\n .ms-has-error .ms-trigger { border-color: #ef4444; }\n .ms-disabled .ms-trigger { opacity: 0.5; cursor: not-allowed; }\n\n .ms-placeholder { color: #64748b; }\n\n .ms-chevron { color: #64748b; flex-shrink: 0; margin-left: 8px; transition: transform 0.2s ease; }\n .ms-chevron-open { transform: rotate(180deg); }\n\n .ms-dropdown {\n position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 50;\n display: flex; flex-direction: column; max-height: 260px;\n background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;\n box-shadow: 0 4px 16px rgba(15, 23, 42, 0.1);\n }\n\n .ms-search-wrap { padding: 8px; border-bottom: 1px solid #e2e8f0; }\n .ms-search {\n width: 100%; box-sizing: border-box; padding: 7px 10px;\n font-size: 0.8125rem; font-family: inherit; color: #1e293b;\n border: 1px solid #7c8ba1; border-radius: 6px; outline: none;\n &::placeholder { color: #64748b; opacity: 1; }\n &:focus { border-color: #3b82f6; }\n }\n\n .ms-options { overflow-y: auto; padding: 4px 0; }\n .ms-option {\n padding: 7px 12px; font-size: 0.8125rem;\n &:hover { background: #f8fafc; }\n }\n .ms-option-selected { background: #eff6ff; }\n\n .ms-empty { padding: 16px; text-align: center; color: #94a3b8; font-size: 0.8125rem; }\n\n .ms-desc { margin: 0; font-size: 0.75rem; line-height: 1.4; color: #64748b; }\n .ms-desc-error { color: #dc2626; }\n\n @media (max-width: 480px) { .ms-trigger, .ms-search { font-size: 1rem; } }\n `],\n})\nexport class MultiSelectComponent implements ControlValueAccessor {\n protected readonly labels = inject(UiLabelsService);\n readonly label = input('');\n readonly placeholderInput = input<string | null>(null, { alias: 'placeholder' });\n readonly placeholder = computed(() => this.placeholderInput() ?? this.labels.t('multiSelect.placeholder'));\n readonly options = input<SelectOption[]>([]);\n readonly searchable = input(true);\n readonly searchPlaceholderInput = input<string | null>(null, { alias: 'searchPlaceholder' });\n readonly searchPlaceholder = computed(() => this.searchPlaceholderInput() ?? this.labels.t('multiSelect.searchPlaceholder'));\n readonly required = input(false);\n readonly hint = input('');\n readonly error = input('');\n /** Selected option values — two-way bindable as `[(selected)]`. */\n readonly selected = model<string[]>([]);\n\n readonly _disabledInput = input(false, { alias: 'disabled' });\n private readonly _cvaDisabled = signal(false);\n protected readonly disabled = computed(() => this._disabledInput() || this._cvaDisabled());\n\n private readonly el = inject(ElementRef);\n protected readonly _id = `ms-${Math.random().toString(36).slice(2, 8)}`;\n protected readonly _open = signal(false);\n protected readonly _query = signal('');\n\n protected readonly _selectedSet = computed(() => new Set(this.selected()));\n protected readonly _selectedOptions = computed(() => this.options().filter(o => this._selectedSet().has(o.value)));\n protected readonly _filteredOptions = computed(() => {\n const fold = (v: string) => v.normalize('NFD').replace(/[\\u0300-\\u036f]/g, '').toLowerCase();\n const q = fold(this._query().trim());\n return q ? this.options().filter(o => fold(o.label).includes(q)) : this.options();\n });\n\n private _onChange = (_: string[]) => {};\n /** The host's \"tried to submit\" flag (e.g. after a failed Save click): `true` shows the host `error` at once, even before the user touched the field; otherwise it shows once the user closed the list or moved focus out of the control (Tab away) even if the list stayed open; true -> false forgets the interaction (closing the form leaves no red field). */\n readonly showErrors = input(false);\n private readonly _reveal = createFieldReveal(this.showErrors);\n private readonly _touched = this._reveal.touched;\n protected readonly _shownError = computed(() => this._reveal.revealed() ? this.error() : '');\n /** Forgets that the user interacted (call it when the host resets its form): a host `error` is hidden again until the list is closed or focus leaves. Same method on ui-signature-pad and ui-rich-text-editor. */\n resetTouched(): void { this._touched.set(false); }\n private _onTouched = () => {};\n\n writeValue(val: string[] | null) { this.selected.set(val ?? []); }\n registerOnChange(fn: (v: string[]) => void) { this._onChange = fn; }\n registerOnTouched(fn: () => void) { this._onTouched = fn; }\n setDisabledState(d: boolean) { this._cvaDisabled.set(d); }\n\n @HostListener('document:click', ['$event'])\n protected onDocumentClick(event: Event) {\n if (this._open() && !this.el.nativeElement.contains(event.target)) this.close();\n }\n\n /** Focus moved to another element outside the control (Tab away): the field counts as touched even when the list stayed open. */\n @HostListener('focusout', ['$event'])\n protected onFocusOut(event: FocusEvent) {\n const next = event.relatedTarget as Node | null;\n if (!next || this.el.nativeElement.contains(next)) return;\n this._touched.set(true);\n this._onTouched();\n }\n\n /** Escape with the list open closes ONLY the list (focus back on the trigger) and is not passed on, so a surrounding side panel / modal stays open. */\n protected onEscape(event: Event) {\n if (!this._open()) return;\n event.preventDefault();\n event.stopPropagation();\n this.close();\n (this.el.nativeElement as HTMLElement).querySelector<HTMLElement>('.ms-trigger')?.focus();\n }\n\n protected toggleOpen() {\n if (this.disabled()) return;\n if (this._open()) this.close(); else this._open.set(true);\n }\n\n protected toggleValue(value: string) {\n const set = new Set(this.selected());\n if (set.has(value)) set.delete(value); else set.add(value);\n this._set(Array.from(set));\n }\n\n protected remove(value: string) {\n this._set(this.selected().filter(v => v !== value));\n }\n\n private close() {\n this._open.set(false);\n this._query.set('');\n this._touched.set(true);\n this._onTouched();\n }\n\n private _set(values: string[]) {\n this.selected.set(values);\n this._onChange(values);\n }\n}\n"],"mappings":";;;;;;AA8JA,IAAa,uBAAb,MAAa,qBAAoB;CA7IjC,cAAA;EA8IqB,KAAA,SAAS,OAAO,eAAe;EACzC,KAAA,QAAoB,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;EAC7B,KAAA,mBAAmB,MAAqB,MAAI;GAAA,GAAA,YAAA,EAAA,WAAA,mBAAA,+BAAA,CAAA;GAAI,OAAO;EAAa,CAAA;EACpE,KAAA,cAAc,eAAe,KAAK,iBAAgB,KAAM,KAAK,OAAO,EAAE,yBAAyB,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;EACjG,KAAA,UAAoB,MAAsB,CAAA,GAAG,GA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0GA,MAAA;GAAa,MAAA,CAAA,kBAAkB,CAAC,QAAQ,CAAC;;;GAMzC,MAAA;GAAa,MAAA,CAAA,YAAY,CAAC,QAAQ,CAAC"}
1
+ {"version":3,"file":"forgeroute-ui-multi-select.mjs","names":[],"sources":["../../../projects/forgeroute-ui/multi-select/src/lib/multi-select/multi-select.component.ts"],"sourcesContent":["import {\n Component, ChangeDetectionStrategy, ElementRef, HostListener, input, model, signal, computed, forwardRef, inject,\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { ChipComponent } from '@forgeroute/ui/chip';\nimport { CheckboxComponent } from '@forgeroute/ui/checkbox';\nimport type { SelectOption } from '@forgeroute/ui/select';\nimport { UiLabelsService } from '@forgeroute/ui/core';\nimport { createFieldReveal } from '@forgeroute/ui/core';\n\n/**\n * Searchable multi-value dropdown. Selected values render as dismissible chips above the trigger.\n *\n * Bind with `[(selected)]` or `[(ngModel)]` — the value is an array of option `value`s.\n *\n * <ui-multi-select label=\"Job Types\" [options]=\"jobTypeOptions\" [(selected)]=\"jobTypeIds\" />\n */\n@Component({\n selector: 'ui-multi-select',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [ChipComponent, CheckboxComponent],\n providers: [{\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => MultiSelectComponent),\n multi: true,\n }],\n template: `\n <div class=\"ms-field\" [class.ms-has-error]=\"_shownError()\" [class.ms-disabled]=\"disabled()\">\n @if (label()) {\n <span class=\"ms-label\" [id]=\"_id + '-label'\">\n {{ label() }}\n @if (required()) { <span class=\"ms-required\" aria-hidden=\"true\">*</span> }\n </span>\n }\n\n @if (_selectedOptions().length) {\n <div class=\"ms-tags\">\n @for (opt of _selectedOptions(); track opt.value) {\n <ui-chip size=\"sm\" [label]=\"opt.label\" [active]=\"true\" [dismissible]=\"!disabled()\" (dismiss)=\"remove(opt.value)\" />\n }\n </div>\n }\n\n <div class=\"ms-wrap\">\n <button\n type=\"button\"\n class=\"ms-trigger\"\n [class.ms-open]=\"_open()\"\n [disabled]=\"disabled()\"\n aria-haspopup=\"true\"\n [attr.aria-expanded]=\"_open()\"\n [attr.aria-controls]=\"_open() ? _id + '-options' : null\"\n [attr.aria-labelledby]=\"label() ? _id + '-label' : null\"\n [attr.aria-describedby]=\"_shownError() ? _id + '-error' : (hint() ? _id + '-hint' : null)\"\n [attr.aria-invalid]=\"_shownError() ? 'true' : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n (click)=\"toggleOpen()\"\n (keydown.escape)=\"onEscape($event)\">\n <span class=\"ms-placeholder\">{{ _selectedSet().size ? labels.t(_selectedSet().size === 1 ? 'multiSelect.nSelected_one' : 'multiSelect.nSelected_other', { count: _selectedSet().size }) : placeholder() }}</span>\n <svg class=\"ms-chevron\" [class.ms-chevron-open]=\"_open()\" width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" aria-hidden=\"true\"><polyline points=\"6 9 12 15 18 9\"/></svg>\n </button>\n\n @if (_open()) {\n <div class=\"ms-dropdown\" [id]=\"_id + '-list'\" (keydown.escape)=\"onEscape($event)\">\n @if (searchable()) {\n <div class=\"ms-search-wrap\">\n <input\n class=\"ms-search\"\n type=\"text\"\n [placeholder]=\"searchPlaceholder()\"\n [attr.aria-label]=\"searchPlaceholder()\"\n [value]=\"_query()\"\n (input)=\"_query.set($any($event.target).value)\" />\n </div>\n }\n <div class=\"ms-options\" role=\"group\" [id]=\"_id + '-options'\" [attr.aria-labelledby]=\"label() ? _id + '-label' : null\">\n @for (opt of _filteredOptions(); track opt.value) {\n <div class=\"ms-option\" [class.ms-option-selected]=\"_selectedSet().has(opt.value)\">\n <ui-checkbox\n [label]=\"opt.label\"\n [checked]=\"_selectedSet().has(opt.value)\"\n [description]=\"opt.description ?? ''\"\n (checkedChange)=\"toggleValue(opt.value)\" />\n </div>\n } @empty {\n <div class=\"ms-empty\">{{ labels.t('multiSelect.noOptionsFound') }}</div>\n }\n </div>\n </div>\n }\n </div>\n\n @if (_shownError()) {\n <p class=\"ms-desc ms-desc-error\" [id]=\"_id + '-error'\" role=\"alert\">{{ _shownError() }}</p>\n } @else if (hint()) {\n <p class=\"ms-desc\" [id]=\"_id + '-hint'\">{{ hint() }}</p>\n }\n </div>\n `,\n styles: [`\n :host { display: block; }\n\n .ms-field { display: flex; flex-direction: column; gap: 6px; }\n\n .ms-label { font-size: 0.8125rem; font-weight: 600; color: #374151; line-height: 1; }\n .ms-required { color: #dc2626; margin-left: 2px; }\n\n .ms-tags { display: flex; flex-wrap: wrap; gap: 6px; }\n\n .ms-wrap { position: relative; }\n\n .ms-trigger {\n width: 100%; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between;\n padding: 9px 10px 9px 12px; font-size: 0.875rem; font-family: inherit; text-align: left;\n color: #1e293b; background: #fff; border: 1px solid #7c8ba1; border-radius: 8px;\n cursor: pointer; outline: none; transition: border-color 0.15s, box-shadow 0.15s;\n &:focus-visible, &.ms-open { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12); }\n }\n .ms-has-error .ms-trigger { border-color: #ef4444; }\n .ms-disabled .ms-trigger { opacity: 0.5; cursor: not-allowed; }\n\n .ms-placeholder { color: #64748b; }\n\n .ms-chevron { color: #64748b; flex-shrink: 0; margin-left: 8px; transition: transform 0.2s ease; }\n .ms-chevron-open { transform: rotate(180deg); }\n\n .ms-dropdown {\n position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 50;\n display: flex; flex-direction: column; max-height: 260px;\n background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;\n box-shadow: 0 4px 16px rgba(15, 23, 42, 0.1);\n }\n\n .ms-search-wrap { padding: 8px; border-bottom: 1px solid #e2e8f0; }\n .ms-search {\n width: 100%; box-sizing: border-box; padding: 7px 10px;\n font-size: 0.8125rem; font-family: inherit; color: #1e293b;\n border: 1px solid #7c8ba1; border-radius: 6px; outline: none;\n &::placeholder { color: #64748b; opacity: 1; }\n &:focus { border-color: #3b82f6; }\n }\n\n .ms-options { overflow-y: auto; padding: 4px 0; }\n .ms-option {\n padding: 7px 12px; font-size: 0.8125rem;\n &:hover { background: #f8fafc; }\n }\n .ms-option-selected { background: #eff6ff; }\n\n .ms-empty { padding: 16px; text-align: center; color: #94a3b8; font-size: 0.8125rem; }\n\n .ms-desc { margin: -6px 0 0; font-size: 0.75rem; line-height: 1.4; color: #64748b; }\n .ms-desc-error { color: #dc2626; }\n\n @media (max-width: 480px) { .ms-trigger, .ms-search { font-size: 1rem; } }\n `],\n})\nexport class MultiSelectComponent implements ControlValueAccessor {\n protected readonly labels = inject(UiLabelsService);\n readonly label = input('');\n readonly placeholderInput = input<string | null>(null, { alias: 'placeholder' });\n readonly placeholder = computed(() => this.placeholderInput() ?? this.labels.t('multiSelect.placeholder'));\n readonly options = input<SelectOption[]>([]);\n readonly searchable = input(true);\n readonly searchPlaceholderInput = input<string | null>(null, { alias: 'searchPlaceholder' });\n readonly searchPlaceholder = computed(() => this.searchPlaceholderInput() ?? this.labels.t('multiSelect.searchPlaceholder'));\n readonly required = input(false);\n readonly hint = input('');\n readonly error = input('');\n /** Selected option values — two-way bindable as `[(selected)]`. */\n readonly selected = model<string[]>([]);\n\n readonly _disabledInput = input(false, { alias: 'disabled' });\n private readonly _cvaDisabled = signal(false);\n protected readonly disabled = computed(() => this._disabledInput() || this._cvaDisabled());\n\n private readonly el = inject(ElementRef);\n protected readonly _id = `ms-${Math.random().toString(36).slice(2, 8)}`;\n protected readonly _open = signal(false);\n protected readonly _query = signal('');\n\n protected readonly _selectedSet = computed(() => new Set(this.selected()));\n protected readonly _selectedOptions = computed(() => this.options().filter(o => this._selectedSet().has(o.value)));\n protected readonly _filteredOptions = computed(() => {\n const fold = (v: string) => v.normalize('NFD').replace(/[\\u0300-\\u036f]/g, '').toLowerCase();\n const q = fold(this._query().trim());\n return q ? this.options().filter(o => fold(o.label).includes(q)) : this.options();\n });\n\n private _onChange = (_: string[]) => {};\n /** The host's \"tried to submit\" flag (e.g. after a failed Save click): `true` shows the host `error` at once, even before the user touched the field; otherwise it shows once the user closed the list or moved focus out of the control (Tab away) even if the list stayed open; true -> false forgets the interaction (closing the form leaves no red field). */\n readonly showErrors = input(false);\n private readonly _reveal = createFieldReveal(this.showErrors);\n private readonly _touched = this._reveal.touched;\n protected readonly _shownError = computed(() => this._reveal.revealed() ? this.error() : '');\n /** Forgets that the user interacted (call it when the host resets its form): a host `error` is hidden again until the list is closed or focus leaves. Same method on ui-signature-pad and ui-rich-text-editor. */\n resetTouched(): void { this._touched.set(false); }\n private _onTouched = () => {};\n\n writeValue(val: string[] | null) { this.selected.set(val ?? []); }\n registerOnChange(fn: (v: string[]) => void) { this._onChange = fn; }\n registerOnTouched(fn: () => void) { this._onTouched = fn; }\n setDisabledState(d: boolean) { this._cvaDisabled.set(d); }\n\n @HostListener('document:click', ['$event'])\n protected onDocumentClick(event: Event) {\n if (this._open() && !this.el.nativeElement.contains(event.target)) this.close();\n }\n\n /** Focus moved to another element outside the control (Tab away): the field counts as touched even when the list stayed open. */\n @HostListener('focusout', ['$event'])\n protected onFocusOut(event: FocusEvent) {\n const next = event.relatedTarget as Node | null;\n if (!next || this.el.nativeElement.contains(next)) return;\n this._touched.set(true);\n this._onTouched();\n }\n\n /** Escape with the list open closes ONLY the list (focus back on the trigger) and is not passed on, so a surrounding side panel / modal stays open. */\n protected onEscape(event: Event) {\n if (!this._open()) return;\n event.preventDefault();\n event.stopPropagation();\n this.close();\n (this.el.nativeElement as HTMLElement).querySelector<HTMLElement>('.ms-trigger')?.focus();\n }\n\n protected toggleOpen() {\n if (this.disabled()) return;\n if (this._open()) this.close(); else this._open.set(true);\n }\n\n protected toggleValue(value: string) {\n const set = new Set(this.selected());\n if (set.has(value)) set.delete(value); else set.add(value);\n this._set(Array.from(set));\n }\n\n protected remove(value: string) {\n this._set(this.selected().filter(v => v !== value));\n }\n\n private close() {\n this._open.set(false);\n this._query.set('');\n this._touched.set(true);\n this._onTouched();\n }\n\n private _set(values: string[]) {\n this.selected.set(values);\n this._onChange(values);\n }\n}\n"],"mappings":";;;;;;AA8JA,IAAa,uBAAb,MAAa,qBAAoB;CA7IjC,cAAA;EA8IqB,KAAA,SAAS,OAAO,eAAe;EACzC,KAAA,QAAoB,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;EAC7B,KAAA,mBAAmB,MAAqB,MAAI;GAAA,GAAA,YAAA,EAAA,WAAA,mBAAA,+BAAA,CAAA;GAAI,OAAO;EAAa,CAAA;EACpE,KAAA,cAAc,eAAe,KAAK,iBAAgB,KAAM,KAAK,OAAO,EAAE,yBAAyB,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;EACjG,KAAA,UAAoB,MAAsB,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;EAC7C,KAAA,aAAoB,MAAM,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,aAAA,CAAA,+BAAA,CAAA,CAAA;EAC/B,KAAA,yBAAyB,MAAqB,MAAI;GAAA,GAAA,YAAA,EAAA,WAAA,yBAAA,+BAAA,CAAA;GAAI,OAAO;EAAmB,CAAA;EAChF,KAAA,oBAAoB,eAAe,KAAK,uBAAsB,KAAM,KAAK,OAAO,EAAE,+BAA+B,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,oBAAA,CAAA,+BAAA,CAAA,CAAA;EACnH,KAAA,WAAoB,MAAM,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;EAChC,KAAA,OAAoB,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;EAC7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AAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;IAAA;IAAA,SAAA;KAAA;KAAA;KAAA;IAAA;GAAA,CAAA;GAAA,iBAAA,GAAA,wBAAA;EAAA,CAAA;CAAA;;AAyI/B,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAoB,YAAA,CAAA;EA7IhC,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAiB,YACf;GAAI,iBACC,wBAAwB;GAAM,SACtC,CAAC,eAAe,iBAAiB;GAAC,WAChC,CAAC;IACV,SAAS;IACT,aAAa,iBAAgB,oBAAqB;IAClD,OAAO;GACR,CAAA;GAAC,UACQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwET,QAAA,CAAA,u2DAAA;EAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0GA,MAAA;GAAa,MAAA,CAAA,kBAAkB,CAAC,QAAQ,CAAC;;;GAMzC,MAAA;GAAa,MAAA,CAAA,YAAY,CAAC,QAAQ,CAAC"}
@@ -552,6 +552,7 @@ var NotesComponent = class NotesComponent {
552
552
  "hint",
553
553
  "ariaDescribedBy",
554
554
  "hintAsDescription",
555
+ "hintBelow",
555
556
  "error",
556
557
  "monospace",
557
558
  "showErrors",
@@ -1 +1 @@
1
- {"version":3,"file":"forgeroute-ui-notes.mjs","names":[],"sources":["../../../projects/forgeroute-ui/notes/src/lib/notes/notes.component.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, DestroyRef, computed, inject, input, output, signal, effect, untracked } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { HttpClient } from '@angular/common/http';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { ButtonComponent } from '@forgeroute/ui/core';\nimport { ModalComponent } from '@forgeroute/ui/core';\nimport { EmptyStateComponent } from '@forgeroute/ui/empty-state';\nimport { PaginationComponent } from '@forgeroute/ui/pagination';\nimport { AvatarComponent } from '@forgeroute/ui/avatar';\nimport { TextareaInputComponent } from '@forgeroute/ui/textarea-input';\nimport { IconComponent } from '@forgeroute/ui/icon';\nimport { ToastService } from '@forgeroute/ui/core';\nimport { getErrorMessage } from '@forgeroute/ui/core';\nimport { FORGEROUTE_CONFIG } from '@forgeroute/ui/core';\nimport { UiLabelsService } from '@forgeroute/ui/core';\nimport { LiveRegionComponent } from '@forgeroute/ui/live-region';\nimport { QueuedNote, UI_NOTES_QUEUE } from '@forgeroute/ui/core';\n\n/** A note as the notes API returns it. */\nexport interface NoteItem {\n id: string;\n body: string;\n createdByName: string;\n createdAt: string;\n updatedAt: string;\n}\n\n/** A note as listed: a server note, or one saved on the device (`queued`) that the server does not have yet / has a pending change for. */\ninterface NoteView extends NoteItem {\n queued?: { kind: QueuedNote['kind']; state: QueuedNote['state'] };\n}\n\ninterface NotePage {\n content: NoteItem[];\n totalElements: number;\n totalPages: number;\n page?: number;\n /** Spring's name for the page index; used when `page` is absent. */\n number?: number;\n size: number;\n}\n\n/**\n * Longest note body, in characters, counted AFTER trimming. Matches the backend `NoteController` cap (10000 after trim; the server trims first,\n * so leading / trailing spaces never count). The add box and the edit box block Add Note / Save above it and show \"Too long (max 10000 characters).\".\n */\nexport const NOTES_MAX_LENGTH = 10000;\n\n/** Which state is the \"worst\" when several saved changes belong to one note. */\nconst STATE_RANK: Record<QueuedNote['state'], number> = { waiting: 1, sending: 2, failed: 3, conflict: 4 };\n\n/** Notes shown per page (the size sent as `?size=`). */\nconst NOTES_PAGE_SIZE = 5;\n\n/**\n * Notes for one record: a soft \"Add a note\" panel, then one clean card per note (author avatar, name, date, edit / delete icons, the text),\n * inline edit and a delete confirmation. Notes are listed 5 per page in the server's order. It talks to the notes API itself, so a page only names the record:\n *\n * <ui-notes resourceType=\"contact\" [resourceId]=\"contactId\" [readOnly]=\"!canEdit()\" (totalChange)=\"notesTotal.set($event)\" />\n *\n * API (under `FORGEROUTE_CONFIG.baseUrl`, default `/api`):\n * - `GET /notes/{resourceType}/{resourceId}?page=<0-based>&size=5` -> `{ content: NoteItem[], totalElements, totalPages, page, size }`\n * - `POST /notes/{resourceType}/{resourceId}` `{ body }` -> the new note\n * - `PUT /notes/{noteId}` `{ body }` -> the updated note\n * - `DELETE /notes/{noteId}`\n *\n * `readOnly` lists the notes only (no box, no edit / delete). `totalChange` emits the total after every load. Failures show a\n * library toast with the server's message. Put it in a `ui-detail-card`: the card's body padding is the only outer inset.\n * A note may hold at most `NOTES_MAX_LENGTH` (10000) characters after trimming; longer text (typed or pasted) shows the field's\n * \"Too long\" message at once and Add Note / Save stay disabled, so no request is sent.\n * Pagination is the library `ui-pagination` (shown only above one page). Cmd/Ctrl+Enter in the add box adds the note.\n *\n * Offline (optional): when an offline layer provides `UI_NOTES_QUEUE` (`provideOfflineSupport` from `@forgeroute/ui/offline` does), a note added, edited\n * or deleted while offline is shown at once with \"Waiting to send\" (text in the card, announced in a live region), replaced by the real note after the\n * layer delivered it, and marked \"Not sent\" when the change failed or conflicted (it disappears if the user discards it). A note that is waiting has no\n * edit / delete icons. Without a provider nothing of this exists. See `docs/notes-offline.md`.\n */\n@Component({\n selector: 'ui-notes',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FormsModule, ButtonComponent, ModalComponent, EmptyStateComponent, PaginationComponent, TextareaInputComponent, IconComponent, AvatarComponent, LiveRegionComponent],\n template: `\n @if (!readOnly()) {\n <div class=\"note-add\">\n <ui-textarea-input [ariaLabel]=\"labels.t('notes.addANote')\" [placeholder]=\"labels.t('notes.addANote2')\" [rows]=\"3\" [maxlength]=\"maxLength()\" [showErrors]=\"tooLong(newBody)\" [disabled]=\"saving()\" [(ngModel)]=\"newBody\"\n (keydown.meta.enter)=\"addNote()\" (keydown.control.enter)=\"addNote()\" />\n <div class=\"note-add-footer\">\n <ui-button variant=\"primary\" size=\"sm\" data-testid=\"note-add-btn\" [loading]=\"saving()\" [disabled]=\"!validBody(newBody)\" (click)=\"addNote()\">{{ labels.t('notes.addNote') }}</ui-button>\n </div>\n </div>\n }\n\n @if (queue) {\n <ui-live-region [message]=\"announcement()\" />\n }\n\n @if (offlineLoadFailed() && shown().length > 0) {\n <p class=\"note-offline-hint\" data-testid=\"note-offline-hint\">{{ labels.t('notes.queued.offlineSome') }}</p>\n }\n\n @if (loading() && shown().length === 0) {\n <div class=\"note-loading\" role=\"status\">{{ labels.t('notes.loadingNotes') }}</div>\n } @else if (shown().length === 0 && offlineLoadFailed()) {\n <p class=\"note-offline-hint\" data-testid=\"note-offline-hint\">{{ labels.t('notes.queued.offlineNone') }}</p>\n } @else if (shown().length === 0) {\n <ui-empty-state iconType=\"person\" [title]=\"labels.t('notes.noNotesYet')\" [message]=\"readOnly() ? labels.t('notes.noNotesAdded') : labels.t('notes.addFirstNote')\" />\n } @else {\n <ul class=\"note-list\" [attr.aria-label]=\"labels.t('notes.notes')\">\n @for (note of shown(); track note.id) {\n <li class=\"note-item\" [class.editing]=\"editingId() === note.id\">\n <ui-avatar class=\"note-avatar\" [initials]=\"initials(note.createdByName)\" [name]=\"note.createdByName || labels.t('notes.you')\" [size]=\"32\" />\n <div class=\"note-main\">\n <div class=\"note-head\">\n <span class=\"note-author\">{{ note.createdByName || labels.t('notes.you') }}</span>\n <span class=\"note-dot\" aria-hidden=\"true\">·</span>\n <time class=\"note-date\" [attr.datetime]=\"note.createdAt\">{{ labels.formatDate(note.createdAt, 'MMM d, yyyy h:mm a') }}</time>\n @if (note.updatedAt !== note.createdAt) {\n <span class=\"note-edited\">{{ labels.t('notes.edited') }}</span>\n }\n @if (note.queued; as q) {\n <span class=\"note-queued\" [class.note-queued-bad]=\"q.state === 'failed' || q.state === 'conflict'\" data-testid=\"note-queued\">{{ queuedText(q) }}</span>\n }\n @if (!readOnly() && editingId() !== note.id && !note.queued) {\n <div class=\"note-actions\">\n @if (editable()) {\n <ui-icon name=\"edit\" [size]=\"14\" [tooltip]=\"labels.t('notes.editNote')\" (iconClick)=\"startEdit(note)\" />\n }\n <ui-icon name=\"delete\" variant=\"danger\" [size]=\"14\" [tooltip]=\"labels.t('notes.deleteNote')\" (iconClick)=\"confirmDelete(note.id)\" />\n </div>\n }\n </div>\n @if (editingId() === note.id) {\n <ui-textarea-input [ariaLabel]=\"labels.t('notes.editNote')\" [rows]=\"3\" [maxlength]=\"maxLength()\" [showErrors]=\"tooLong(editBody)\" [disabled]=\"saving()\" [(ngModel)]=\"editBody\" />\n <div class=\"note-item-footer\">\n <ui-button variant=\"secondary\" size=\"sm\" (click)=\"cancelEdit()\">{{ labels.t('common.cancel') }}</ui-button>\n <ui-button variant=\"primary\" size=\"sm\" [loading]=\"saving()\" [disabled]=\"!validBody(editBody)\" (click)=\"saveEdit(note.id)\">{{ labels.t('common.save') }}</ui-button>\n </div>\n } @else {\n <p class=\"note-body\">{{ note.body }}</p>\n }\n </div>\n </li>\n }\n </ul>\n <ui-pagination [page]=\"page() + 1\" [pageSize]=\"pageSize\" [totalItems]=\"totalElements()\" (pageChange)=\"loadPage($event - 1)\" />\n }\n\n <ui-modal [open]=\"!!deletingId()\" [title]=\"labels.t('notes.deleteNote2')\" maxWidth=\"420px\" dialogTestId=\"delete-note-modal\" describedBy=\"ui-note-delete-msg\" (close)=\"deletingId.set(null)\">\n <p class=\"note-delete-msg\" id=\"ui-note-delete-msg\" data-testid=\"delete-note-message\">{{ labels.t('notes.deleteThisNoteItIs') }}</p>\n <ui-button modal-footer-left variant=\"secondary\" size=\"sm\" data-testid=\"delete-note-cancel\" (click)=\"deletingId.set(null)\">{{ labels.t('common.cancel') }}</ui-button>\n <ui-button modal-footer-right variant=\"danger\" size=\"sm\" data-testid=\"delete-note-confirm\" [loading]=\"saving()\" (click)=\"deleteNote()\">{{ labels.t('notes.deleteNote2') }}</ui-button>\n </ui-modal>\n `,\n styles: [`\n :host { display: block; }\n /* Add box: a soft panel above the list */\n .note-add { padding: 14px; margin-bottom: 18px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; }\n .note-add-footer { display: flex; justify-content: flex-end; margin-top: 10px; }\n .note-offline-hint { margin: 0 0 12px; font-size: 0.875rem; color: #475569; }\n .note-loading { padding: 24px 0; font-size: 0.875rem; color: #64748b; text-align: center; }\n /* One soft card per note: avatar, then author / date / actions over the text */\n .note-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }\n .note-item { display: flex; gap: 12px; padding: 14px; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; transition: border-color 0.15s, box-shadow 0.15s; }\n @media (hover: hover) { .note-item:hover { border-color: #cbd5e1; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06); } }\n .note-item.editing { background: #f8fafc; border-color: #bfdbfe; }\n @media (prefers-reduced-motion: reduce) { .note-item { transition: none; } }\n .note-avatar { flex-shrink: 0; }\n .note-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }\n .note-head { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 6px; min-height: 28px; }\n .note-author { font-size: 0.875rem; font-weight: 600; color: #0f172a; }\n .note-dot { color: #94a3b8; font-size: 0.75rem; }\n .note-date { font-size: 0.75rem; color: #64748b; } /* 4.76:1 on white (WCAG AA) */\n .note-edited { font-size: 0.75rem; font-style: italic; color: #64748b; }\n /* Saved on this device, not delivered yet: a text pill (never colour alone); the \"not sent\" states add a bold weight and a border */\n .note-queued { font-size: 0.75rem; font-weight: 500; color: #475569; background: #f1f5f9; border: 1px dashed #94a3b8; border-radius: 999px; padding: 1px 8px; }\n .note-queued-bad { color: #991b1b; background: #fef2f2; border: 1px solid #b91c1c; font-weight: 700; }\n .note-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; }\n .note-body { margin: 0; font-size: 0.9375rem; line-height: 1.6; color: #1e293b; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; } /* word-break: Safari < 15.4 has no overflow-wrap: anywhere */\n .note-item-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }\n .note-delete-msg { margin: 0; font-size: 0.9375rem; line-height: 1.5; color: #334155; }\n @media (max-width: 480px) { .note-item { padding: 12px; gap: 10px; } .note-add { padding: 12px; } }\n `],\n})\nexport class NotesComponent {\n protected readonly labels = inject(UiLabelsService);\n /** What the notes belong to, as the API names it: `contact`, `transaction`, `property`, `task`, ... */\n readonly resourceType = input('');\n readonly resourceId = input('');\n /**\n * Resource-specific notes API (optional). When set (e.g. `/permits/42/notes`, relative to `FORGEROUTE_CONFIG.baseUrl`), the component uses it instead of\n * the generic `/notes/{resourceType}/{resourceId}` API and `resourceType` / `resourceId` are not needed:\n * - `GET {basePath}?page=<0-based>&size=5` -> `{ content, totalElements, ... }` (`page` or Spring's `number` is accepted for the page index)\n * - `POST {basePath}` `{ content }` -> the new note\n * - `PUT {basePath}/{noteId}` `{ content }` (only when `editable` is true)\n * - `DELETE {basePath}/{noteId}`\n * A note's text may come as `body` or `content`; a missing `updatedAt` counts as `createdAt` (no \"edited\" tag). Empty (default) = the generic API.\n */\n readonly basePath = input('');\n /** True: list only, no add box, edit or delete. */\n readonly readOnly = input(false);\n /** False hides the edit icon (for APIs without an update endpoint). Default true. */\n readonly editable = input(true);\n /** Longest note, in characters after trimming (default `NOTES_MAX_LENGTH`, 10000). Set it to the API's column size, e.g. 255 for customer notes. */\n readonly maxLength = input(NOTES_MAX_LENGTH);\n /** Total number of notes after every load / add / delete. */\n readonly totalChange = output<number>();\n\n private readonly http = inject(HttpClient);\n private readonly toast = inject(ToastService);\n private readonly destroyRef = inject(DestroyRef);\n private readonly apiBase = inject(FORGEROUTE_CONFIG, { optional: true })?.baseUrl ?? '/api';\n\n readonly pageSize = NOTES_PAGE_SIZE;\n readonly notes = signal<NoteItem[]>([]);\n readonly loading = signal(false);\n readonly saving = signal(false);\n /** 0-based page index, as the server numbers it. */\n readonly page = signal(0);\n readonly totalElements = signal(0);\n readonly editingId = signal<string | null>(null);\n readonly deletingId = signal<string | null>(null);\n\n /** Optional offline layer (see `UI_NOTES_QUEUE`). Absent = every queue-related behaviour below is off. */\n protected readonly queue = inject(UI_NOTES_QUEUE, { optional: true });\n protected readonly announcement = signal('');\n\n /** Saved changes that just left the queue (delivered) and are still shown until the reload that fetches the real data has answered. Each knows its list. */\n private readonly settling = signal<readonly (QueuedNote & { list: string })[]>([]);\n /** Overlay clean-ups waiting for the NEWEST load to answer (an older, superseded load never runs them). */\n private afters: (() => void)[] = [];\n /** Number of the newest load; an answer from an older load is ignored. */\n private loadSeq = 0;\n /** True when the last load failed while the offline layer says we are offline (the list then shows only what is saved on this device). */\n readonly offlineLoadFailed = signal(false);\n\n /**\n * What the list shows: with an offline layer, notes saved on this device are shown right away - new notes first on page 1 (newest first, like the\n * server's order), and a note with a saved edit / delete keeps its place, marked as waiting. Without one it is exactly `notes()`.\n */\n readonly shown = computed((): NoteView[] => {\n const server = this.notes();\n const queue = this.queue;\n if (!queue || !this.ready) return server;\n const list = this.listUrl;\n const settling = this.settling().filter(q => q.list === list).map((q): QueuedNote => ({ ...q, state: 'sending' }));\n const queued = [...queue.queuedFor(this.listUrl, this.itemPrefix), ...settling];\n if (queued.length === 0) return server;\n // Queued adds are shown ABOVE the server page: they do not count in the page size or the pagination total.\n const added: NoteView[] = queued.filter(q => q.kind === 'add' && this.page() === 0)\n .sort((a, b) => b.createdAt - a.createdAt)\n .map(q => ({\n id: `queued-${q.rowId}`, body: q.text, createdByName: '', createdAt: new Date(q.createdAt).toISOString(), updatedAt: new Date(q.createdAt).toISOString(),\n queued: { kind: 'add', state: q.state },\n }));\n // Per loaded note: a delete wins over edits, the latest edit text wins, and the WORST state of its changes is shown.\n const byNote = new Map<string, QueuedNote[]>();\n for (const q of queued) if (q.kind !== 'add') byNote.set(q.noteId, [...(byNote.get(q.noteId) ?? []), q]);\n const existing = server.map((n): NoteView => {\n const changes = byNote.get(n.id);\n if (!changes) return n;\n const del = changes.some(c => c.kind === 'delete');\n const lastEdit = [...changes].reverse().find(c => c.kind === 'edit');\n const state = changes.reduce((worst, c) => (STATE_RANK[c.state] > STATE_RANK[worst] ? c.state : worst), changes[0].state);\n return { ...n, body: del || !lastEdit ? n.body : lastEdit.text, queued: { kind: del ? 'delete' : 'edit', state } };\n });\n return [...added, ...existing];\n });\n\n newBody = '';\n editBody = '';\n\n /** Up to two initials of the author's name for the avatar (\"Ana Lopez\" -> \"AL\"); \"Y\" for the current user's own unnamed notes. */\n protected initials(name: string): string {\n const parts = (name || this.labels.t('notes.you')).trim().split(/\\s+/).filter(Boolean);\n return ((parts[0]?.[0] ?? '') + (parts.length > 1 ? parts[parts.length - 1][0] : '')).toUpperCase();\n }\n\n /** True when the trimmed text is longer than the limit. */\n protected tooLong(text: string): boolean { return text.trim().length > this.maxLength(); }\n\n /** True when the trimmed text is not empty and within the limit. */\n protected validBody(text: string): boolean { const n = text.trim().length; return n > 0 && n <= this.maxLength(); }\n\n private get listUrl() { return this.basePath() ? `${this.apiBase}${this.basePath()}` : `${this.apiBase}/notes/${this.resourceType()}/${this.resourceId()}`; }\n private noteUrl(id: string) { const e = encodeURIComponent(id); return this.basePath() ? `${this.apiBase}${this.basePath()}/${e}` : `${this.apiBase}/notes/${e}`; }\n /** The URL of one note up to its id (`.../notes/` or `<basePath>/`). */\n private get itemPrefix() { return this.basePath() ? `${this.apiBase}${this.basePath()}/` : `${this.apiBase}/notes/`; }\n private get ready() { return !!this.basePath() || (!!this.resourceType() && !!this.resourceId()); }\n /** Request body for create / update: `{ content }` for a `basePath` API, `{ body }` for the generic one. */\n private payload(text: string) { return this.basePath() ? { content: text.trim() } : { body: text.trim() }; }\n /** Accepts `body` or `content` as the text and a missing `updatedAt`. */\n private normalize(n: NoteItem & { content?: string }): NoteItem {\n return { ...n, body: n.body ?? n.content ?? '', updatedAt: n.updatedAt ?? n.createdAt };\n }\n\n constructor() {\n const queue = this.queue;\n if (queue) {\n // A saved change left the queue. If the user discarded it, it just disappears. Otherwise it was delivered: reload at once and keep showing it\n // (as \"Sending…\") until that load has answered, so it neither flashes away, shows old text, nor appears twice.\n let known = new Map<string, QueuedNote>();\n let knownList = '';\n effect(() => {\n if (!this.ready) return;\n const list = this.listUrl;\n const now = new Map(queue.queuedFor(list, this.itemPrefix).map(q => [q.rowId, q] as const));\n const before = known;\n const sameList = list === knownList;\n known = now;\n knownList = list;\n if (!sameList) {\n // Another list: nothing of the old one may be shown, and its pending clean-ups are void (the new load replaces it).\n untracked(() => { this.settling.set([]); this.afters = []; });\n return;\n }\n const gone = [...before.values()].filter(q => !now.has(q.rowId) && !queue.wasDiscarded(q.rowId));\n if (gone.length === 0) return;\n untracked(() => {\n this.settling.update(s => [...s, ...gone.map(g => ({ ...g, list }))]);\n const ids = new Set(gone.map(g => g.rowId));\n this.loadPage(this.page(), () => this.settling.update(s => s.filter(q => !ids.has(q.rowId))));\n });\n });\n // A saved change that could not be sent is announced once per state it enters (a row that is retried and fails again is announced again).\n const flagged = new Set<string>();\n effect(() => {\n const bad = this.ready ? queue.queuedFor(this.listUrl, this.itemPrefix).filter(q => q.state === 'failed' || q.state === 'conflict') : [];\n const keys = new Set(bad.map(q => `${q.rowId}:${q.state}`));\n for (const k of [...flagged]) if (!keys.has(k)) flagged.delete(k);\n const fresh = [...keys].filter(k => !flagged.has(k));\n for (const k of keys) flagged.add(k);\n if (fresh.length > 0) untracked(() => this.announce(this.labels.t('notes.queued.problemAnnounce')));\n });\n }\n effect(() => {\n const id = this.resourceId();\n const type = this.resourceType();\n const base = this.basePath();\n if (base || (id && type)) untracked(() => this.loadPage(0));\n else untracked(() => {\n // The record went away (inputs emptied) while a load may be in flight: that answer belongs to the old list and must be ignored.\n this.loadSeq++; this.settling.set([]); this.afters = []; this.loading.set(false);\n });\n });\n }\n\n /** The label under a queued note: what is waiting and why it may be stuck (text, not colour alone). */\n protected queuedText(q: { kind: QueuedNote['kind']; state: QueuedNote['state'] }): string {\n if (q.state === 'failed') return this.labels.t('notes.queued.failed');\n if (q.state === 'conflict') return this.labels.t('notes.queued.conflict');\n if (q.kind === 'delete') return this.labels.t(q.state === 'sending' ? 'notes.queued.deleteSending' : 'notes.queued.deleteWaiting');\n return this.labels.t(q.state === 'sending' ? 'notes.queued.sending' : 'notes.queued.waiting');\n }\n\n /** Says it in the live region; clears first so the same words twice in a row are read twice. */\n private announce(message: string) {\n this.announcement.set('');\n queueMicrotask(() => this.announcement.set(message));\n }\n\n /** True when the answer is the offline layer's \"saved on this device\" reply (and an offline layer is present). */\n private savedOffline(res: unknown): boolean {\n return !!this.queue && !!res && typeof res === 'object' && (res as { _offline?: unknown })._offline === true;\n }\n\n /**\n * Loads one page. Only the NEWEST load's answer is applied (an older answer arriving late is ignored, so stale data never overwrites newer data and\n * `loading` stays true until the latest answer). `after` (overlay clean-up of delivered changes) runs when the newest load has answered - also when\n * a later load superseded the one it was given to, so the overlay drops in the same render the replacing data arrives.\n */\n loadPage(p: number, after?: () => void) {\n if (!this.ready) return;\n const seq = ++this.loadSeq;\n if (after) this.afters.push(after);\n this.loading.set(true);\n const finish = () => { const run = this.afters; this.afters = []; run.forEach(fn => fn()); };\n this.http.get<NotePage>(`${this.listUrl}?page=${p}&size=${this.pageSize}`).pipe(takeUntilDestroyed(this.destroyRef)).subscribe({\n next: (res) => {\n if (seq !== this.loadSeq) return;\n this.notes.set(res.content.map(n => this.normalize(n)));\n this.page.set(res.page ?? res.number ?? p);\n this.totalElements.set(res.totalElements);\n this.loading.set(false);\n this.offlineLoadFailed.set(false);\n this.totalChange.emit(res.totalElements);\n finish();\n },\n error: (err) => {\n if (seq !== this.loadSeq) return;\n this.loading.set(false);\n const offline = !!this.queue?.offline();\n this.offlineLoadFailed.set(offline);\n // A reload that follows a delivery also fails quietly when the user was signed out meanwhile (401 / 403): the sign-in flow takes over.\n const afterDelivery = this.afters.length > 0 && [401, 403].includes((err as { status?: number })?.status ?? 0);\n if (!offline && !afterDelivery) this.toast.error(getErrorMessage(err, 'notes'));\n finish();\n },\n });\n }\n\n addNote() {\n if (this.readOnly() || !this.validBody(this.newBody) || this.saving()) return;\n this.saving.set(true);\n this.http.post<NoteItem>(this.listUrl, this.payload(this.newBody)).pipe(takeUntilDestroyed(this.destroyRef)).subscribe({\n next: (res) => {\n this.newBody = ''; this.saving.set(false);\n if (this.savedOffline(res)) { this.announce(this.labels.t('notes.queued.addedAnnounce')); return; }\n this.loadPage(0);\n },\n error: (err) => { this.saving.set(false); this.toast.error(getErrorMessage(err, 'note', 'create')); },\n });\n }\n\n startEdit(note: NoteItem) {\n if (this.readOnly() || !this.editable()) return;\n this.editingId.set(note.id);\n this.editBody = note.body;\n }\n\n cancelEdit() {\n this.editingId.set(null);\n this.editBody = '';\n }\n\n saveEdit(noteId: string) {\n if (this.readOnly() || !this.editable() || !this.validBody(this.editBody) || this.saving()) return;\n this.saving.set(true);\n this.http.put<NoteItem>(this.noteUrl(noteId), this.payload(this.editBody)).pipe(takeUntilDestroyed(this.destroyRef)).subscribe({\n next: (updated) => {\n if (this.savedOffline(updated)) {\n this.editingId.set(null);\n this.saving.set(false);\n this.announce(this.labels.t('notes.queued.editedAnnounce'));\n return;\n }\n this.notes.update(arr => arr.map(n => (n.id === noteId ? this.normalize(updated) : n)));\n this.editingId.set(null);\n this.saving.set(false);\n },\n error: (err) => { this.saving.set(false); this.toast.error(getErrorMessage(err, 'note', 'update')); },\n });\n }\n\n confirmDelete(id: string) {\n if (this.readOnly()) return;\n this.deletingId.set(id);\n }\n\n deleteNote() {\n const id = this.deletingId();\n if (this.readOnly() || !id || this.saving()) return;\n this.saving.set(true);\n this.http.delete(this.noteUrl(id)).pipe(takeUntilDestroyed(this.destroyRef)).subscribe({\n next: (res) => {\n this.deletingId.set(null);\n this.saving.set(false);\n if (this.savedOffline(res)) { this.announce(this.labels.t('notes.queued.deletedAnnounce')); return; }\n this.loadPage(this.notes().length === 1 && this.page() > 0 ? this.page() - 1 : this.page());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M,SACtC;IAAC;IAAa;IAAiB;IAAgB;IAAqB;IAAqB;IAAwB;IAAe;IAAiB;GAAmB;GAAC,UACpK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuET,QAAA,CAAA,20DAAA;EAAA,CAAA"}
1
+ {"version":3,"file":"forgeroute-ui-notes.mjs","names":[],"sources":["../../../projects/forgeroute-ui/notes/src/lib/notes/notes.component.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, DestroyRef, computed, inject, input, output, signal, effect, untracked } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { HttpClient } from '@angular/common/http';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { ButtonComponent } from '@forgeroute/ui/core';\nimport { ModalComponent } from '@forgeroute/ui/core';\nimport { EmptyStateComponent } from '@forgeroute/ui/empty-state';\nimport { PaginationComponent } from '@forgeroute/ui/pagination';\nimport { AvatarComponent } from '@forgeroute/ui/avatar';\nimport { TextareaInputComponent } from '@forgeroute/ui/textarea-input';\nimport { IconComponent } from '@forgeroute/ui/icon';\nimport { ToastService } from '@forgeroute/ui/core';\nimport { getErrorMessage } from '@forgeroute/ui/core';\nimport { FORGEROUTE_CONFIG } from '@forgeroute/ui/core';\nimport { UiLabelsService } from '@forgeroute/ui/core';\nimport { LiveRegionComponent } from '@forgeroute/ui/live-region';\nimport { QueuedNote, UI_NOTES_QUEUE } from '@forgeroute/ui/core';\n\n/** A note as the notes API returns it. */\nexport interface NoteItem {\n id: string;\n body: string;\n createdByName: string;\n createdAt: string;\n updatedAt: string;\n}\n\n/** A note as listed: a server note, or one saved on the device (`queued`) that the server does not have yet / has a pending change for. */\ninterface NoteView extends NoteItem {\n queued?: { kind: QueuedNote['kind']; state: QueuedNote['state'] };\n}\n\ninterface NotePage {\n content: NoteItem[];\n totalElements: number;\n totalPages: number;\n page?: number;\n /** Spring's name for the page index; used when `page` is absent. */\n number?: number;\n size: number;\n}\n\n/**\n * Longest note body, in characters, counted AFTER trimming. Matches the backend `NoteController` cap (10000 after trim; the server trims first,\n * so leading / trailing spaces never count). The add box and the edit box block Add Note / Save above it and show \"Too long (max 10000 characters).\".\n */\nexport const NOTES_MAX_LENGTH = 10000;\n\n/** Which state is the \"worst\" when several saved changes belong to one note. */\nconst STATE_RANK: Record<QueuedNote['state'], number> = { waiting: 1, sending: 2, failed: 3, conflict: 4 };\n\n/** Notes shown per page (the size sent as `?size=`). */\nconst NOTES_PAGE_SIZE = 5;\n\n/**\n * Notes for one record: a soft \"Add a note\" panel, then one clean card per note (author avatar, name, date, edit / delete icons, the text),\n * inline edit and a delete confirmation. Notes are listed 5 per page in the server's order. It talks to the notes API itself, so a page only names the record:\n *\n * <ui-notes resourceType=\"contact\" [resourceId]=\"contactId\" [readOnly]=\"!canEdit()\" (totalChange)=\"notesTotal.set($event)\" />\n *\n * API (under `FORGEROUTE_CONFIG.baseUrl`, default `/api`):\n * - `GET /notes/{resourceType}/{resourceId}?page=<0-based>&size=5` -> `{ content: NoteItem[], totalElements, totalPages, page, size }`\n * - `POST /notes/{resourceType}/{resourceId}` `{ body }` -> the new note\n * - `PUT /notes/{noteId}` `{ body }` -> the updated note\n * - `DELETE /notes/{noteId}`\n *\n * `readOnly` lists the notes only (no box, no edit / delete). `totalChange` emits the total after every load. Failures show a\n * library toast with the server's message. Put it in a `ui-detail-card`: the card's body padding is the only outer inset.\n * A note may hold at most `NOTES_MAX_LENGTH` (10000) characters after trimming; longer text (typed or pasted) shows the field's\n * \"Too long\" message at once and Add Note / Save stay disabled, so no request is sent.\n * Pagination is the library `ui-pagination` (shown only above one page). Cmd/Ctrl+Enter in the add box adds the note.\n *\n * Offline (optional): when an offline layer provides `UI_NOTES_QUEUE` (`provideOfflineSupport` from `@forgeroute/ui/offline` does), a note added, edited\n * or deleted while offline is shown at once with \"Waiting to send\" (text in the card, announced in a live region), replaced by the real note after the\n * layer delivered it, and marked \"Not sent\" when the change failed or conflicted (it disappears if the user discards it). A note that is waiting has no\n * edit / delete icons. Without a provider nothing of this exists. See `docs/notes-offline.md`.\n */\n@Component({\n selector: 'ui-notes',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FormsModule, ButtonComponent, ModalComponent, EmptyStateComponent, PaginationComponent, TextareaInputComponent, IconComponent, AvatarComponent, LiveRegionComponent],\n template: `\n @if (!readOnly()) {\n <div class=\"note-add\">\n <ui-textarea-input [ariaLabel]=\"labels.t('notes.addANote')\" [placeholder]=\"labels.t('notes.addANote2')\" [rows]=\"3\" [maxlength]=\"maxLength()\" [showErrors]=\"tooLong(newBody)\" [disabled]=\"saving()\" [(ngModel)]=\"newBody\"\n (keydown.meta.enter)=\"addNote()\" (keydown.control.enter)=\"addNote()\" />\n <div class=\"note-add-footer\">\n <ui-button variant=\"primary\" size=\"sm\" data-testid=\"note-add-btn\" [loading]=\"saving()\" [disabled]=\"!validBody(newBody)\" (click)=\"addNote()\">{{ labels.t('notes.addNote') }}</ui-button>\n </div>\n </div>\n }\n\n @if (queue) {\n <ui-live-region [message]=\"announcement()\" />\n }\n\n @if (offlineLoadFailed() && shown().length > 0) {\n <p class=\"note-offline-hint\" data-testid=\"note-offline-hint\">{{ labels.t('notes.queued.offlineSome') }}</p>\n }\n\n @if (loading() && shown().length === 0) {\n <div class=\"note-loading\" role=\"status\">{{ labels.t('notes.loadingNotes') }}</div>\n } @else if (shown().length === 0 && offlineLoadFailed()) {\n <p class=\"note-offline-hint\" data-testid=\"note-offline-hint\">{{ labels.t('notes.queued.offlineNone') }}</p>\n } @else if (shown().length === 0) {\n <ui-empty-state iconType=\"person\" [title]=\"labels.t('notes.noNotesYet')\" [message]=\"readOnly() ? labels.t('notes.noNotesAdded') : labels.t('notes.addFirstNote')\" />\n } @else {\n <ul class=\"note-list\" [attr.aria-label]=\"labels.t('notes.notes')\">\n @for (note of shown(); track note.id) {\n <li class=\"note-item\" [class.editing]=\"editingId() === note.id\">\n <ui-avatar class=\"note-avatar\" [initials]=\"initials(note.createdByName)\" [name]=\"note.createdByName || labels.t('notes.you')\" [size]=\"32\" />\n <div class=\"note-main\">\n <div class=\"note-head\">\n <span class=\"note-author\">{{ note.createdByName || labels.t('notes.you') }}</span>\n <span class=\"note-dot\" aria-hidden=\"true\">·</span>\n <time class=\"note-date\" [attr.datetime]=\"note.createdAt\">{{ labels.formatDate(note.createdAt, 'MMM d, yyyy h:mm a') }}</time>\n @if (note.updatedAt !== note.createdAt) {\n <span class=\"note-edited\">{{ labels.t('notes.edited') }}</span>\n }\n @if (note.queued; as q) {\n <span class=\"note-queued\" [class.note-queued-bad]=\"q.state === 'failed' || q.state === 'conflict'\" data-testid=\"note-queued\">{{ queuedText(q) }}</span>\n }\n @if (!readOnly() && editingId() !== note.id && !note.queued) {\n <div class=\"note-actions\">\n @if (editable()) {\n <ui-icon name=\"edit\" [size]=\"14\" [tooltip]=\"labels.t('notes.editNote')\" (iconClick)=\"startEdit(note)\" />\n }\n <ui-icon name=\"delete\" variant=\"danger\" [size]=\"14\" [tooltip]=\"labels.t('notes.deleteNote')\" (iconClick)=\"confirmDelete(note.id)\" />\n </div>\n }\n </div>\n @if (editingId() === note.id) {\n <ui-textarea-input [ariaLabel]=\"labels.t('notes.editNote')\" [rows]=\"3\" [maxlength]=\"maxLength()\" [showErrors]=\"tooLong(editBody)\" [disabled]=\"saving()\" [(ngModel)]=\"editBody\" />\n <div class=\"note-item-footer\">\n <ui-button variant=\"secondary\" size=\"sm\" (click)=\"cancelEdit()\">{{ labels.t('common.cancel') }}</ui-button>\n <ui-button variant=\"primary\" size=\"sm\" [loading]=\"saving()\" [disabled]=\"!validBody(editBody)\" (click)=\"saveEdit(note.id)\">{{ labels.t('common.save') }}</ui-button>\n </div>\n } @else {\n <p class=\"note-body\">{{ note.body }}</p>\n }\n </div>\n </li>\n }\n </ul>\n <ui-pagination [page]=\"page() + 1\" [pageSize]=\"pageSize\" [totalItems]=\"totalElements()\" (pageChange)=\"loadPage($event - 1)\" />\n }\n\n <ui-modal [open]=\"!!deletingId()\" [title]=\"labels.t('notes.deleteNote2')\" maxWidth=\"420px\" dialogTestId=\"delete-note-modal\" describedBy=\"ui-note-delete-msg\" (close)=\"deletingId.set(null)\">\n <p class=\"note-delete-msg\" id=\"ui-note-delete-msg\" data-testid=\"delete-note-message\">{{ labels.t('notes.deleteThisNoteItIs') }}</p>\n <ui-button modal-footer-left variant=\"secondary\" size=\"sm\" data-testid=\"delete-note-cancel\" (click)=\"deletingId.set(null)\">{{ labels.t('common.cancel') }}</ui-button>\n <ui-button modal-footer-right variant=\"danger\" size=\"sm\" data-testid=\"delete-note-confirm\" [loading]=\"saving()\" (click)=\"deleteNote()\">{{ labels.t('notes.deleteNote2') }}</ui-button>\n </ui-modal>\n `,\n styles: [`\n :host { display: block; }\n /* Add box: a soft panel above the list */\n .note-add { padding: 14px; margin-bottom: 18px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; }\n .note-add-footer { display: flex; justify-content: flex-end; margin-top: 10px; }\n .note-offline-hint { margin: 0 0 12px; font-size: 0.875rem; color: #475569; }\n .note-loading { padding: 24px 0; font-size: 0.875rem; color: #64748b; text-align: center; }\n /* One soft card per note: avatar, then author / date / actions over the text */\n .note-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }\n .note-item { display: flex; gap: 12px; padding: 14px; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; transition: border-color 0.15s, box-shadow 0.15s; }\n @media (hover: hover) { .note-item:hover { border-color: #cbd5e1; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06); } }\n .note-item.editing { background: #f8fafc; border-color: #bfdbfe; }\n @media (prefers-reduced-motion: reduce) { .note-item { transition: none; } }\n .note-avatar { flex-shrink: 0; }\n .note-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }\n .note-head { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 6px; min-height: 28px; }\n .note-author { font-size: 0.875rem; font-weight: 600; color: #0f172a; }\n .note-dot { color: #94a3b8; font-size: 0.75rem; }\n .note-date { font-size: 0.75rem; color: #64748b; } /* 4.76:1 on white (WCAG AA) */\n .note-edited { font-size: 0.75rem; font-style: italic; color: #64748b; }\n /* Saved on this device, not delivered yet: a text pill (never colour alone); the \"not sent\" states add a bold weight and a border */\n .note-queued { font-size: 0.75rem; font-weight: 500; color: #475569; background: #f1f5f9; border: 1px dashed #94a3b8; border-radius: 999px; padding: 1px 8px; }\n .note-queued-bad { color: #991b1b; background: #fef2f2; border: 1px solid #b91c1c; font-weight: 700; }\n .note-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; }\n .note-body { margin: 0; font-size: 0.9375rem; line-height: 1.6; color: #1e293b; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; } /* word-break: Safari < 15.4 has no overflow-wrap: anywhere */\n .note-item-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }\n .note-delete-msg { margin: 0; font-size: 0.9375rem; line-height: 1.5; color: #334155; }\n @media (max-width: 480px) { .note-item { padding: 12px; gap: 10px; } .note-add { padding: 12px; } }\n `],\n})\nexport class NotesComponent {\n protected readonly labels = inject(UiLabelsService);\n /** What the notes belong to, as the API names it: `contact`, `transaction`, `property`, `task`, ... */\n readonly resourceType = input('');\n readonly resourceId = input('');\n /**\n * Resource-specific notes API (optional). When set (e.g. `/permits/42/notes`, relative to `FORGEROUTE_CONFIG.baseUrl`), the component uses it instead of\n * the generic `/notes/{resourceType}/{resourceId}` API and `resourceType` / `resourceId` are not needed:\n * - `GET {basePath}?page=<0-based>&size=5` -> `{ content, totalElements, ... }` (`page` or Spring's `number` is accepted for the page index)\n * - `POST {basePath}` `{ content }` -> the new note\n * - `PUT {basePath}/{noteId}` `{ content }` (only when `editable` is true)\n * - `DELETE {basePath}/{noteId}`\n * A note's text may come as `body` or `content`; a missing `updatedAt` counts as `createdAt` (no \"edited\" tag). Empty (default) = the generic API.\n */\n readonly basePath = input('');\n /** True: list only, no add box, edit or delete. */\n readonly readOnly = input(false);\n /** False hides the edit icon (for APIs without an update endpoint). Default true. */\n readonly editable = input(true);\n /** Longest note, in characters after trimming (default `NOTES_MAX_LENGTH`, 10000). Set it to the API's column size, e.g. 255 for customer notes. */\n readonly maxLength = input(NOTES_MAX_LENGTH);\n /** Total number of notes after every load / add / delete. */\n readonly totalChange = output<number>();\n\n private readonly http = inject(HttpClient);\n private readonly toast = inject(ToastService);\n private readonly destroyRef = inject(DestroyRef);\n private readonly apiBase = inject(FORGEROUTE_CONFIG, { optional: true })?.baseUrl ?? '/api';\n\n readonly pageSize = NOTES_PAGE_SIZE;\n readonly notes = signal<NoteItem[]>([]);\n readonly loading = signal(false);\n readonly saving = signal(false);\n /** 0-based page index, as the server numbers it. */\n readonly page = signal(0);\n readonly totalElements = signal(0);\n readonly editingId = signal<string | null>(null);\n readonly deletingId = signal<string | null>(null);\n\n /** Optional offline layer (see `UI_NOTES_QUEUE`). Absent = every queue-related behaviour below is off. */\n protected readonly queue = inject(UI_NOTES_QUEUE, { optional: true });\n protected readonly announcement = signal('');\n\n /** Saved changes that just left the queue (delivered) and are still shown until the reload that fetches the real data has answered. Each knows its list. */\n private readonly settling = signal<readonly (QueuedNote & { list: string })[]>([]);\n /** Overlay clean-ups waiting for the NEWEST load to answer (an older, superseded load never runs them). */\n private afters: (() => void)[] = [];\n /** Number of the newest load; an answer from an older load is ignored. */\n private loadSeq = 0;\n /** True when the last load failed while the offline layer says we are offline (the list then shows only what is saved on this device). */\n readonly offlineLoadFailed = signal(false);\n\n /**\n * What the list shows: with an offline layer, notes saved on this device are shown right away - new notes first on page 1 (newest first, like the\n * server's order), and a note with a saved edit / delete keeps its place, marked as waiting. Without one it is exactly `notes()`.\n */\n readonly shown = computed((): NoteView[] => {\n const server = this.notes();\n const queue = this.queue;\n if (!queue || !this.ready) return server;\n const list = this.listUrl;\n const settling = this.settling().filter(q => q.list === list).map((q): QueuedNote => ({ ...q, state: 'sending' }));\n const queued = [...queue.queuedFor(this.listUrl, this.itemPrefix), ...settling];\n if (queued.length === 0) return server;\n // Queued adds are shown ABOVE the server page: they do not count in the page size or the pagination total.\n const added: NoteView[] = queued.filter(q => q.kind === 'add' && this.page() === 0)\n .sort((a, b) => b.createdAt - a.createdAt)\n .map(q => ({\n id: `queued-${q.rowId}`, body: q.text, createdByName: '', createdAt: new Date(q.createdAt).toISOString(), updatedAt: new Date(q.createdAt).toISOString(),\n queued: { kind: 'add', state: q.state },\n }));\n // Per loaded note: a delete wins over edits, the latest edit text wins, and the WORST state of its changes is shown.\n const byNote = new Map<string, QueuedNote[]>();\n for (const q of queued) if (q.kind !== 'add') byNote.set(q.noteId, [...(byNote.get(q.noteId) ?? []), q]);\n const existing = server.map((n): NoteView => {\n const changes = byNote.get(n.id);\n if (!changes) return n;\n const del = changes.some(c => c.kind === 'delete');\n const lastEdit = [...changes].reverse().find(c => c.kind === 'edit');\n const state = changes.reduce((worst, c) => (STATE_RANK[c.state] > STATE_RANK[worst] ? c.state : worst), changes[0].state);\n return { ...n, body: del || !lastEdit ? n.body : lastEdit.text, queued: { kind: del ? 'delete' : 'edit', state } };\n });\n return [...added, ...existing];\n });\n\n newBody = '';\n editBody = '';\n\n /** Up to two initials of the author's name for the avatar (\"Ana Lopez\" -> \"AL\"); \"Y\" for the current user's own unnamed notes. */\n protected initials(name: string): string {\n const parts = (name || this.labels.t('notes.you')).trim().split(/\\s+/).filter(Boolean);\n return ((parts[0]?.[0] ?? '') + (parts.length > 1 ? parts[parts.length - 1][0] : '')).toUpperCase();\n }\n\n /** True when the trimmed text is longer than the limit. */\n protected tooLong(text: string): boolean { return text.trim().length > this.maxLength(); }\n\n /** True when the trimmed text is not empty and within the limit. */\n protected validBody(text: string): boolean { const n = text.trim().length; return n > 0 && n <= this.maxLength(); }\n\n private get listUrl() { return this.basePath() ? `${this.apiBase}${this.basePath()}` : `${this.apiBase}/notes/${this.resourceType()}/${this.resourceId()}`; }\n private noteUrl(id: string) { const e = encodeURIComponent(id); return this.basePath() ? `${this.apiBase}${this.basePath()}/${e}` : `${this.apiBase}/notes/${e}`; }\n /** The URL of one note up to its id (`.../notes/` or `<basePath>/`). */\n private get itemPrefix() { return this.basePath() ? `${this.apiBase}${this.basePath()}/` : `${this.apiBase}/notes/`; }\n private get ready() { return !!this.basePath() || (!!this.resourceType() && !!this.resourceId()); }\n /** Request body for create / update: `{ content }` for a `basePath` API, `{ body }` for the generic one. */\n private payload(text: string) { return this.basePath() ? { content: text.trim() } : { body: text.trim() }; }\n /** Accepts `body` or `content` as the text and a missing `updatedAt`. */\n private normalize(n: NoteItem & { content?: string }): NoteItem {\n return { ...n, body: n.body ?? n.content ?? '', updatedAt: n.updatedAt ?? n.createdAt };\n }\n\n constructor() {\n const queue = this.queue;\n if (queue) {\n // A saved change left the queue. If the user discarded it, it just disappears. Otherwise it was delivered: reload at once and keep showing it\n // (as \"Sending…\") until that load has answered, so it neither flashes away, shows old text, nor appears twice.\n let known = new Map<string, QueuedNote>();\n let knownList = '';\n effect(() => {\n if (!this.ready) return;\n const list = this.listUrl;\n const now = new Map(queue.queuedFor(list, this.itemPrefix).map(q => [q.rowId, q] as const));\n const before = known;\n const sameList = list === knownList;\n known = now;\n knownList = list;\n if (!sameList) {\n // Another list: nothing of the old one may be shown, and its pending clean-ups are void (the new load replaces it).\n untracked(() => { this.settling.set([]); this.afters = []; });\n return;\n }\n const gone = [...before.values()].filter(q => !now.has(q.rowId) && !queue.wasDiscarded(q.rowId));\n if (gone.length === 0) return;\n untracked(() => {\n this.settling.update(s => [...s, ...gone.map(g => ({ ...g, list }))]);\n const ids = new Set(gone.map(g => g.rowId));\n this.loadPage(this.page(), () => this.settling.update(s => s.filter(q => !ids.has(q.rowId))));\n });\n });\n // A saved change that could not be sent is announced once per state it enters (a row that is retried and fails again is announced again).\n const flagged = new Set<string>();\n effect(() => {\n const bad = this.ready ? queue.queuedFor(this.listUrl, this.itemPrefix).filter(q => q.state === 'failed' || q.state === 'conflict') : [];\n const keys = new Set(bad.map(q => `${q.rowId}:${q.state}`));\n for (const k of [...flagged]) if (!keys.has(k)) flagged.delete(k);\n const fresh = [...keys].filter(k => !flagged.has(k));\n for (const k of keys) flagged.add(k);\n if (fresh.length > 0) untracked(() => this.announce(this.labels.t('notes.queued.problemAnnounce')));\n });\n }\n effect(() => {\n const id = this.resourceId();\n const type = this.resourceType();\n const base = this.basePath();\n if (base || (id && type)) untracked(() => this.loadPage(0));\n else untracked(() => {\n // The record went away (inputs emptied) while a load may be in flight: that answer belongs to the old list and must be ignored.\n this.loadSeq++; this.settling.set([]); this.afters = []; this.loading.set(false);\n });\n });\n }\n\n /** The label under a queued note: what is waiting and why it may be stuck (text, not colour alone). */\n protected queuedText(q: { kind: QueuedNote['kind']; state: QueuedNote['state'] }): string {\n if (q.state === 'failed') return this.labels.t('notes.queued.failed');\n if (q.state === 'conflict') return this.labels.t('notes.queued.conflict');\n if (q.kind === 'delete') return this.labels.t(q.state === 'sending' ? 'notes.queued.deleteSending' : 'notes.queued.deleteWaiting');\n return this.labels.t(q.state === 'sending' ? 'notes.queued.sending' : 'notes.queued.waiting');\n }\n\n /** Says it in the live region; clears first so the same words twice in a row are read twice. */\n private announce(message: string) {\n this.announcement.set('');\n queueMicrotask(() => this.announcement.set(message));\n }\n\n /** True when the answer is the offline layer's \"saved on this device\" reply (and an offline layer is present). */\n private savedOffline(res: unknown): boolean {\n return !!this.queue && !!res && typeof res === 'object' && (res as { _offline?: unknown })._offline === true;\n }\n\n /**\n * Loads one page. Only the NEWEST load's answer is applied (an older answer arriving late is ignored, so stale data never overwrites newer data and\n * `loading` stays true until the latest answer). `after` (overlay clean-up of delivered changes) runs when the newest load has answered - also when\n * a later load superseded the one it was given to, so the overlay drops in the same render the replacing data arrives.\n */\n loadPage(p: number, after?: () => void) {\n if (!this.ready) return;\n const seq = ++this.loadSeq;\n if (after) this.afters.push(after);\n this.loading.set(true);\n const finish = () => { const run = this.afters; this.afters = []; run.forEach(fn => fn()); };\n this.http.get<NotePage>(`${this.listUrl}?page=${p}&size=${this.pageSize}`).pipe(takeUntilDestroyed(this.destroyRef)).subscribe({\n next: (res) => {\n if (seq !== this.loadSeq) return;\n this.notes.set(res.content.map(n => this.normalize(n)));\n this.page.set(res.page ?? res.number ?? p);\n this.totalElements.set(res.totalElements);\n this.loading.set(false);\n this.offlineLoadFailed.set(false);\n this.totalChange.emit(res.totalElements);\n finish();\n },\n error: (err) => {\n if (seq !== this.loadSeq) return;\n this.loading.set(false);\n const offline = !!this.queue?.offline();\n this.offlineLoadFailed.set(offline);\n // A reload that follows a delivery also fails quietly when the user was signed out meanwhile (401 / 403): the sign-in flow takes over.\n const afterDelivery = this.afters.length > 0 && [401, 403].includes((err as { status?: number })?.status ?? 0);\n if (!offline && !afterDelivery) this.toast.error(getErrorMessage(err, 'notes'));\n finish();\n },\n });\n }\n\n addNote() {\n if (this.readOnly() || !this.validBody(this.newBody) || this.saving()) return;\n this.saving.set(true);\n this.http.post<NoteItem>(this.listUrl, this.payload(this.newBody)).pipe(takeUntilDestroyed(this.destroyRef)).subscribe({\n next: (res) => {\n this.newBody = ''; this.saving.set(false);\n if (this.savedOffline(res)) { this.announce(this.labels.t('notes.queued.addedAnnounce')); return; }\n this.loadPage(0);\n },\n error: (err) => { this.saving.set(false); this.toast.error(getErrorMessage(err, 'note', 'create')); },\n });\n }\n\n startEdit(note: NoteItem) {\n if (this.readOnly() || !this.editable()) return;\n this.editingId.set(note.id);\n this.editBody = note.body;\n }\n\n cancelEdit() {\n this.editingId.set(null);\n this.editBody = '';\n }\n\n saveEdit(noteId: string) {\n if (this.readOnly() || !this.editable() || !this.validBody(this.editBody) || this.saving()) return;\n this.saving.set(true);\n this.http.put<NoteItem>(this.noteUrl(noteId), this.payload(this.editBody)).pipe(takeUntilDestroyed(this.destroyRef)).subscribe({\n next: (updated) => {\n if (this.savedOffline(updated)) {\n this.editingId.set(null);\n this.saving.set(false);\n this.announce(this.labels.t('notes.queued.editedAnnounce'));\n return;\n }\n this.notes.update(arr => arr.map(n => (n.id === noteId ? this.normalize(updated) : n)));\n this.editingId.set(null);\n this.saving.set(false);\n },\n error: (err) => { this.saving.set(false); this.toast.error(getErrorMessage(err, 'note', 'update')); },\n });\n }\n\n confirmDelete(id: string) {\n if (this.readOnly()) return;\n this.deletingId.set(id);\n }\n\n deleteNote() {\n const id = this.deletingId();\n if (this.readOnly() || !id || this.saving()) return;\n this.saving.set(true);\n this.http.delete(this.noteUrl(id)).pipe(takeUntilDestroyed(this.destroyRef)).subscribe({\n next: (res) => {\n this.deletingId.set(null);\n this.saving.set(false);\n if (this.savedOffline(res)) { this.announce(this.labels.t('notes.queued.deletedAnnounce')); return; }\n this.loadPage(this.notes().length === 1 && this.page() > 0 ? this.page() - 1 : this.page());\n },\n error: (err) => { this.deletingId.set(null); this.saving.set(false); this.toast.error(getErrorMessage(err, 'note', 'delete')); },\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;AA8CA,MAAa,mBAAmB;AAGhC,MAAM,aAAkD;CAAE,SAAS;CAAG,SAAS;CAAG,QAAQ;CAAG,UAAU;AAAC;AAGxG,MAAM,kBAAkB;AAoIxB,IAAa,iBAAb,MAAa,eAAc;CAyFf,SAAS,MAAY;EAC7B,MAAM,SAAS,QAAQ,KAAK,OAAO,EAAE,WAAW,EAAA,CAAG,KAAI,CAAE,CAAC,MAAM,KAAK,CAAC,CAAC,OAAO,OAAO;EACrF,SAAS,MAAM,EAAE,GAAG,MAAM,OAAO,MAAM,SAAS,IAAI,MAAM,MAAM,SAAS,EAAE,CAAC,KAAK,IAAA,CAAK,YAAW;CACnG;CAGU,QAAQ,MAAY;EAAa,OAAO,KAAK,KAAI,CAAE,CAAC,SAAS,KAAK,UAAS;CAAI;CAG/E,UAAU,MAAY;EAAa,MAAM,IAAI,KAAK,KAAI,CAAE,CAAC;EAAQ,OAAO,IAAI,KAAK,KAAK,KAAK,UAAS;CAAI;CAElH,IAAY,UAAO;EAAK,OAAO,KAAK,SAAQ,IAAK,GAAG,KA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SAAA,CAAA,WAAA;IAAA;IAAA;KAAA,MAAA;KAAA,MAAE;KAAe,UAAA;KAAA,QAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;KAAA;KAAA,SAAA,CAAA,aAAA,YAAA;IAAA;IAAA;KAAA,MAAA;KAAA,MAAE;KAAmB,UAAA;KAAA,QAAA;MAAA;MAAA;MAAA;MAAA;KAAA;IAAA;GAAA;GAAA,iBAAA,GAAA,wBAAA;EAAA,CAAA;CAAA;;AAuGlK,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAc,YAAA,CAAA;EA3G1B,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAU,YACR;GAAI,iBACC,wBAAwB;GAAM,SACtC;IAAC;IAAa;IAAiB;IAAgB;IAAqB;IAAqB;IAAwB;IAAe;IAAiB;GAAmB;GAAC,UACpK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuET,QAAA,CAAA,20DAAA;EAAA,CAAA"}
@@ -213,6 +213,7 @@ var OptionCardComponent = class OptionCardComponent {
213
213
  "fill",
214
214
  "noPadding",
215
215
  "maxBodyHeight",
216
+ "overflowVisible",
216
217
  "selectable",
217
218
  "selected",
218
219
  "selectedColor",
@@ -1 +1 @@
1
- {"version":3,"file":"forgeroute-ui-option-card.mjs","names":[],"sources":["../../../projects/forgeroute-ui/option-card/src/lib/option-card/option-card.component.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, ViewEncapsulation, inject, input, output } from '@angular/core';\nimport { ButtonComponent } from '@forgeroute/ui/core';\nimport { DetailCardComponent } from '@forgeroute/ui/detail-card';\nimport { iconPath } from '@forgeroute/ui/icon';\nimport { UiLabelsService } from '@forgeroute/ui/core';\n\n/**\n * One option the user can pick or connect: a coloured tile (a letter, or a library icon), a title, a short description and a small action button.\n * The same card is used for the source cards of an import step, the provider cards of the setup wizard (calendar, email, tools) and a CRM\n * live-sync option, so they all look and behave alike. Anything inside the tag is shown under the row (an expanding form, a result).\n *\n * <ui-option-card title=\"Gmail\" letter=\"G\" color=\"#ea4335\" description=\"Connect your Google account\" actionLabel=\"Connect\" (action)=\"connect()\" />\n * <ui-option-card title=\"Follow Up Boss\" letter=\"F\" actionLabel=\"Sync live\" (action)=\"open()\"> <form>…</form> </ui-option-card>\n *\n * Inputs: `title` (required), `description`, `letter` (one character in the tile) or `icon` (a library icon name, used when there is no letter),\n * `color` (tile background, default slate), `actionLabel` (no label = no button), `actionVariant` (default secondary), `actionAriaLabel`,\n * `actionTestId`, `actionLoading`, `disabled`, `selected`. Output: `action`.\n *\n * `selected` (default false = the card as before) marks the card as the chosen one: a blue 2px border, a check mark at the end of the row and the text\n * \"Selected\" for screen readers (`data-selected=\"true\"` on the host). The state is shown by the border AND the check, so colour is never the only signal. The\n * card does not toggle by itself: the app owns the state.\n *\n * A brand logo goes in the tile: `<img option-card-logo src=\"stripe.svg\" alt=\"\" />` (decorative, the title names the card; leave out `letter` and `icon`, set\n * `color` to the logo's background, e.g. `#fff`). The element is limited to the tile (36 x 36 px). Without it nothing changes.\n */\n@Component({\n selector: 'ui-option-card',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [ButtonComponent, DetailCardComponent],\n host: { '[attr.data-selected]': 'selected() ? \"true\" : null' },\n template: `\n <ui-detail-card class=\"oc\" [class.oc--selected]=\"selected()\" [showHeader]=\"false\" [ariaLabel]=\"title()\">\n <div class=\"oc-row\">\n <span class=\"oc-tile\" [style.background]=\"color()\" aria-hidden=\"true\">\n @if (letter()) { {{ letter() }} } @else if (iconD(); as d) { <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" focusable=\"false\"><path [attr.d]=\"d\" /></svg> }\n <ng-content select=\"[option-card-logo]\" />\n </span>\n <span class=\"oc-text\">\n <span class=\"oc-title\">{{ title() }}</span>\n @if (description()) { <span class=\"oc-desc\">{{ description() }}</span> }\n </span>\n @if (selected()) {\n <span class=\"oc-selected\" data-testid=\"option-card-selected\">\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\" focusable=\"false\"><path [attr.d]=\"checkD\" /></svg>\n <span class=\"oc-sr\">{{ labels.t('optionCard.selected') }}</span>\n </span>\n }\n @if (actionLabel()) {\n <ui-button size=\"xs\" [variant]=\"actionVariant()\" [disabled]=\"disabled()\" [loading]=\"actionLoading()\" [attr.data-testid]=\"actionTestId() || null\"\n [ariaLabel]=\"actionAriaLabel() || (actionLabel() + ' ' + title())\" (click)=\"action.emit()\">{{ actionLabel() }}</ui-button>\n }\n </div>\n <ng-content />\n </ui-detail-card>\n `,\n styles: [`\n ui-option-card { display: block; }\n ui-option-card .oc { margin-bottom: 0; }\n .oc-row { display: flex; align-items: center; gap: 12px; }\n .oc-tile { width: 36px; height: 36px; border-radius: 8px; color: #fff; font-size: 1rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }\n .oc-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }\n .oc-title { font-size: 0.8125rem; font-weight: 600; color: #1e293b; line-height: 1.2; }\n .oc-desc { font-size: 0.75rem; color: #64748b; overflow-wrap: anywhere; }\n /* option-card-logo: the logo stays inside the 36px tile */\n .oc-tile [option-card-logo] { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }\n /* selected: a 2px blue border (the card's 1px border plus a 1px ring), and a check mark; the text for screen readers sits next to it */\n ui-option-card .oc--selected .dc { border-color: #2563eb; box-shadow: 0 0 0 1px #2563eb; }\n .oc-selected { display: inline-flex; flex-shrink: 0; color: #2563eb; }\n .oc-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }\n `],\n})\nexport class OptionCardComponent {\n readonly title = input.required<string>();\n readonly description = input('');\n readonly letter = input('');\n readonly icon = input('');\n readonly color = input('#64748b');\n readonly actionLabel = input('');\n readonly actionVariant = input<'primary' | 'secondary'>('secondary');\n readonly actionAriaLabel = input('');\n readonly actionTestId = input('');\n readonly actionLoading = input(false);\n readonly disabled = input(false);\n /** `true`: the card is the chosen one (blue border, a check mark, \"Selected\" for screen readers). Default false: the card as before. */\n readonly selected = input(false);\n /** The action button was pressed. */\n readonly action = output<void>();\n\n protected readonly labels = inject(UiLabelsService);\n protected readonly checkD = iconPath('check')!;\n\n protected iconD(): string | null { return this.icon() ? iconPath(this.icon()) ?? null : null; }\n}\n"],"mappings":";;;;;AAyEA,IAAa,sBAAb,MAAa,oBAAmB;CAhDhC,cAAA;EAiDW,KAAA,QAAQ,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;EAChC,KAAA,cAAc,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;EACvB,KAAA,SAAS,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;EAClB,KAAA,OAAO,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;EAChB,KAAA,QAAQ,MAAM,WAAU,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;EACxB,KAAA,cAAc,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;EACvB,KAAA,gBAAgB,MAA+B,aAAY,GAAA,YAAA,CAAA,EAAA,WAAA,gBAAA,CAAA,+BAAA,CAAA,CAAA;EAC3D,KAAA,kBAAkB,MAAM,IAA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AAA,SAAA;KAAA;KAAA;KAAA;IAAA;GAAA,CAAA;GAAA,iBAAA,GAAA,wBAAA;GAAA,eAAA,GAAA,kBAAA;EAAA,CAAA;CAAA;;AA2CnC,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAmB,YAAA,CAAA;EAhD/B,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAgB,YACd;GAAI,iBACC,wBAAwB;GAAM,eAChC,kBAAkB;GAAI,SAC5B,CAAC,iBAAiB,mBAAmB;GAAC,MACzC,EAAE,wBAAwB,+BAA4B;GAAE,UACpD;;;;;;;;;;;;;;;;;;;;;;;;;GAwBT,QAAA,CAAA,s1BAAA;EAAA,CAAA"}
1
+ {"version":3,"file":"forgeroute-ui-option-card.mjs","names":[],"sources":["../../../projects/forgeroute-ui/option-card/src/lib/option-card/option-card.component.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, ViewEncapsulation, inject, input, output } from '@angular/core';\nimport { ButtonComponent } from '@forgeroute/ui/core';\nimport { DetailCardComponent } from '@forgeroute/ui/detail-card';\nimport { iconPath } from '@forgeroute/ui/icon';\nimport { UiLabelsService } from '@forgeroute/ui/core';\n\n/**\n * One option the user can pick or connect: a coloured tile (a letter, or a library icon), a title, a short description and a small action button.\n * The same card is used for the source cards of an import step, the provider cards of the setup wizard (calendar, email, tools) and a CRM\n * live-sync option, so they all look and behave alike. Anything inside the tag is shown under the row (an expanding form, a result).\n *\n * <ui-option-card title=\"Gmail\" letter=\"G\" color=\"#ea4335\" description=\"Connect your Google account\" actionLabel=\"Connect\" (action)=\"connect()\" />\n * <ui-option-card title=\"Follow Up Boss\" letter=\"F\" actionLabel=\"Sync live\" (action)=\"open()\"> <form>…</form> </ui-option-card>\n *\n * Inputs: `title` (required), `description`, `letter` (one character in the tile) or `icon` (a library icon name, used when there is no letter),\n * `color` (tile background, default slate), `actionLabel` (no label = no button), `actionVariant` (default secondary), `actionAriaLabel`,\n * `actionTestId`, `actionLoading`, `disabled`, `selected`. Output: `action`.\n *\n * `selected` (default false = the card as before) marks the card as the chosen one: a blue 2px border, a check mark at the end of the row and the text\n * \"Selected\" for screen readers (`data-selected=\"true\"` on the host). The state is shown by the border AND the check, so colour is never the only signal. The\n * card does not toggle by itself: the app owns the state.\n *\n * A brand logo goes in the tile: `<img option-card-logo src=\"stripe.svg\" alt=\"\" />` (decorative, the title names the card; leave out `letter` and `icon`, set\n * `color` to the logo's background, e.g. `#fff`). The element is limited to the tile (36 x 36 px). Without it nothing changes.\n */\n@Component({\n selector: 'ui-option-card',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [ButtonComponent, DetailCardComponent],\n host: { '[attr.data-selected]': 'selected() ? \"true\" : null' },\n template: `\n <ui-detail-card class=\"oc\" [class.oc--selected]=\"selected()\" [showHeader]=\"false\" [ariaLabel]=\"title()\">\n <div class=\"oc-row\">\n <span class=\"oc-tile\" [style.background]=\"color()\" aria-hidden=\"true\">\n @if (letter()) { {{ letter() }} } @else if (iconD(); as d) { <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" focusable=\"false\"><path [attr.d]=\"d\" /></svg> }\n <ng-content select=\"[option-card-logo]\" />\n </span>\n <span class=\"oc-text\">\n <span class=\"oc-title\">{{ title() }}</span>\n @if (description()) { <span class=\"oc-desc\">{{ description() }}</span> }\n </span>\n @if (selected()) {\n <span class=\"oc-selected\" data-testid=\"option-card-selected\">\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\" focusable=\"false\"><path [attr.d]=\"checkD\" /></svg>\n <span class=\"oc-sr\">{{ labels.t('optionCard.selected') }}</span>\n </span>\n }\n @if (actionLabel()) {\n <ui-button size=\"xs\" [variant]=\"actionVariant()\" [disabled]=\"disabled()\" [loading]=\"actionLoading()\" [attr.data-testid]=\"actionTestId() || null\"\n [ariaLabel]=\"actionAriaLabel() || (actionLabel() + ' ' + title())\" (click)=\"action.emit()\">{{ actionLabel() }}</ui-button>\n }\n </div>\n <ng-content />\n </ui-detail-card>\n `,\n styles: [`\n ui-option-card { display: block; }\n ui-option-card .oc { margin-bottom: 0; }\n .oc-row { display: flex; align-items: center; gap: 12px; }\n .oc-tile { width: 36px; height: 36px; border-radius: 8px; color: #fff; font-size: 1rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }\n .oc-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }\n .oc-title { font-size: 0.8125rem; font-weight: 600; color: #1e293b; line-height: 1.2; }\n .oc-desc { font-size: 0.75rem; color: #64748b; overflow-wrap: anywhere; }\n /* option-card-logo: the logo stays inside the 36px tile */\n .oc-tile [option-card-logo] { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }\n /* selected: a 2px blue border (the card's 1px border plus a 1px ring), and a check mark; the text for screen readers sits next to it */\n ui-option-card .oc--selected .dc { border-color: #2563eb; box-shadow: 0 0 0 1px #2563eb; }\n .oc-selected { display: inline-flex; flex-shrink: 0; color: #2563eb; }\n .oc-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }\n `],\n})\nexport class OptionCardComponent {\n readonly title = input.required<string>();\n readonly description = input('');\n readonly letter = input('');\n readonly icon = input('');\n readonly color = input('#64748b');\n readonly actionLabel = input('');\n readonly actionVariant = input<'primary' | 'secondary'>('secondary');\n readonly actionAriaLabel = input('');\n readonly actionTestId = input('');\n readonly actionLoading = input(false);\n readonly disabled = input(false);\n /** `true`: the card is the chosen one (blue border, a check mark, \"Selected\" for screen readers). Default false: the card as before. */\n readonly selected = input(false);\n /** The action button was pressed. */\n readonly action = output<void>();\n\n protected readonly labels = inject(UiLabelsService);\n protected readonly checkD = iconPath('check')!;\n\n protected iconD(): string | null { return this.icon() ? iconPath(this.icon()) ?? null : null; }\n}\n"],"mappings":";;;;;AAyEA,IAAa,sBAAb,MAAa,oBAAmB;CAhDhC,cAAA;EAiDW,KAAA,QAAQ,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;EAChC,KAAA,cAAc,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;EACvB,KAAA,SAAS,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;EAClB,KAAA,OAAO,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;EAChB,KAAA,QAAQ,MAAM,WAAU,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;EACxB,KAAA,cAAc,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;EACvB,KAAA,gBAAgB,MAA+B,aAAY,GAAA,YAAA,CAAA,EAAA,WAAA,gBAAA,CAAA,+BAAA,CAAA,CAAA;EAC3D,KAAA,kBAAkB,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,kBAAA,CAAA,+BAAA,CAAA,CAAA;EAC3B,KAAA,eAAe,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,eAAA,CAAA,+BAAA,CAAA,CAAA;EACxB,KAAA,gBAAgB,MAAM,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,gBAAA,CAAA,+BAAA,CAAA,CAAA;EAC5B,KAAA,WAAW,MAAM,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;EAEvB,KAAA,WAAW,MAAM,OAAM,GAAA,YAAA,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pD;;;;;;;;;;;;;;;;;;;;;;;;;GAwBT,QAAA,CAAA,s1BAAA;EAAA,CAAA"}
@@ -3146,6 +3146,7 @@ var PaymentSidePanelComponent = class PaymentSidePanelComponent {
3146
3146
  "hint",
3147
3147
  "ariaDescribedBy",
3148
3148
  "hintAsDescription",
3149
+ "hintBelow",
3149
3150
  "error",
3150
3151
  "monospace",
3151
3152
  "showErrors",
@@ -5941,6 +5942,7 @@ var ChargeFormComponent = class ChargeFormComponent {
5941
5942
  "hint",
5942
5943
  "ariaDescribedBy",
5943
5944
  "hintAsDescription",
5945
+ "hintBelow",
5944
5946
  "error",
5945
5947
  "monospace",
5946
5948
  "showErrors",
@@ -6811,6 +6813,7 @@ var RefundPanelComponent = class RefundPanelComponent {
6811
6813
  "hint",
6812
6814
  "ariaDescribedBy",
6813
6815
  "hintAsDescription",
6816
+ "hintBelow",
6814
6817
  "error",
6815
6818
  "monospace",
6816
6819
  "showErrors",