@forgeroute/ui 0.5.28 → 0.5.30

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 (40) hide show
  1. package/fesm2022/forgeroute-ui-calendar.mjs +103 -4
  2. package/fesm2022/forgeroute-ui-calendar.mjs.map +1 -1
  3. package/fesm2022/forgeroute-ui-card-list-item.mjs +165 -16
  4. package/fesm2022/forgeroute-ui-card-list-item.mjs.map +1 -1
  5. package/fesm2022/forgeroute-ui-contact-picker.mjs +2 -2
  6. package/fesm2022/forgeroute-ui-contact-picker.mjs.map +1 -1
  7. package/fesm2022/{forgeroute-ui-core-ui-labels.es-Dzvm992V.mjs → forgeroute-ui-core-ui-labels.es-BViJSCO-.mjs} +4 -1
  8. package/fesm2022/{forgeroute-ui-core-ui-labels.es-Dzvm992V.mjs.map → forgeroute-ui-core-ui-labels.es-BViJSCO-.mjs.map} +1 -1
  9. package/fesm2022/forgeroute-ui-core.mjs +38 -5
  10. package/fesm2022/forgeroute-ui-core.mjs.map +1 -1
  11. package/fesm2022/forgeroute-ui-data-table-core.mjs +59 -28
  12. package/fesm2022/forgeroute-ui-data-table-core.mjs.map +1 -1
  13. package/fesm2022/forgeroute-ui-icon.mjs +7 -6
  14. package/fesm2022/forgeroute-ui-icon.mjs.map +1 -1
  15. package/fesm2022/forgeroute-ui-kpi-card.mjs +2 -2
  16. package/fesm2022/forgeroute-ui-kpi-card.mjs.map +1 -1
  17. package/fesm2022/forgeroute-ui-notes.mjs +20 -22
  18. package/fesm2022/forgeroute-ui-notes.mjs.map +1 -1
  19. package/fesm2022/forgeroute-ui-panel-info-list.mjs +26 -4
  20. package/fesm2022/forgeroute-ui-panel-info-list.mjs.map +1 -1
  21. package/fesm2022/forgeroute-ui-payments.mjs +2 -1
  22. package/fesm2022/forgeroute-ui-payments.mjs.map +1 -1
  23. package/fesm2022/forgeroute-ui-setup.mjs +2 -1
  24. package/fesm2022/forgeroute-ui-setup.mjs.map +1 -1
  25. package/fesm2022/forgeroute-ui-stripe.mjs +78 -6
  26. package/fesm2022/forgeroute-ui-stripe.mjs.map +1 -1
  27. package/fesm2022/forgeroute-ui-table-types.mjs.map +1 -1
  28. package/package.json +1 -1
  29. package/types/forgeroute-ui-calendar.d.ts +28 -1
  30. package/types/forgeroute-ui-card-list-item.d.ts +32 -1
  31. package/types/forgeroute-ui-core.d.ts +13 -5
  32. package/types/forgeroute-ui-data-table-core.d.ts +10 -1
  33. package/types/forgeroute-ui-icon.d.ts +2 -0
  34. package/types/forgeroute-ui-messaging.d.ts +6 -5
  35. package/types/forgeroute-ui-panel-info-list.d.ts +11 -0
  36. package/types/forgeroute-ui-payments.d.ts +1 -1
  37. package/types/forgeroute-ui-quickbooks.d.ts +1 -1
  38. package/types/forgeroute-ui-square.d.ts +3 -3
  39. package/types/forgeroute-ui-stripe.d.ts +31 -1
  40. package/types/forgeroute-ui-table-types.d.ts +5 -0
@@ -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());\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,O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AAA;MAAA;MAAA;MAAA;MAAA;MAAA;KAAA;KAAA,SAAA,CAAA,YAAA;IAAA;IAAA;KAAA,MAAA;KAAA,MAAE;KAAsB,UAAA;KAAA,QAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;KAAA;KAAA,SAAA;MAAA;MAAA;MAAA;KAAA;IAAA;IAAA;KAAA,MAAA;KAAA,MAAE;KAAa,UAAA;KAAA,QAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;KAAA;KAAA,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"}
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 { TooltipDirective } from '@forgeroute/ui/tooltip';\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, TooltipDirective, 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 <button class=\"note-icon-btn note-icon-btn--edit\" type=\"button\" [attr.aria-label]=\"labels.t('notes.editNote')\" [uiTooltip]=\"labels.t('notes.editNote')\" (click)=\"startEdit(note)\">\n <svg width=\"13\" height=\"13\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7 M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\" /></svg>\n </button>\n }\n <button class=\"note-icon-btn note-icon-btn--delete\" type=\"button\" [attr.aria-label]=\"labels.t('notes.deleteNote')\" [uiTooltip]=\"labels.t('notes.deleteNote')\" (click)=\"confirmDelete(note.id)\">\n <svg width=\"13\" height=\"13\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M3 6h18 M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2 M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6 M10 11v6 M14 11v6\" /></svg>\n </button>\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: 6px; margin-left: auto; }\n /* Same bordered icon buttons as ui-card-list-item's Edit / Delete (26px, 44px touch target). */\n .note-icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; width: 26px; height: 26px; padding: 0; line-height: 1; background: none; cursor: pointer; border-radius: 6px; transition: background 0.15s, color 0.15s, border-color 0.15s; }\n .note-icon-btn::after { content: ''; position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); }\n .note-icon-btn--edit { color: #64748b; border: 1px solid #e2e8f0; }\n .note-icon-btn--edit:hover { background: #f1f5f9; color: #1e293b; }\n .note-icon-btn--delete { color: #b91c1c; border: 1px solid #fecaca; }\n .note-icon-btn--delete:hover { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }\n .note-icon-btn:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }\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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AqB;IAAqB;IAAwB;IAAkB;IAAiB;GAAmB;GAAC,UACvK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2ET,QAAA,CAAA,siFAAA;EAAA,CAAA"}
@@ -14,6 +14,7 @@ var PanelInfoListComponent = class PanelInfoListComponent {
14
14
  this.showEmptyState = input(false, ...ngDevMode ? [{ debugName: "showEmptyState" }] : /* istanbul ignore next */ []);
15
15
  this.labelColon = input(false, ...ngDevMode ? [{ debugName: "labelColon" }] : /* istanbul ignore next */ []);
16
16
  this.fill = input(false, ...ngDevMode ? [{ debugName: "fill" }] : /* istanbul ignore next */ []);
17
+ this.flat = input(false, ...ngDevMode ? [{ debugName: "flat" }] : /* istanbul ignore next */ []);
17
18
  this.displaySections = computed(() => this.showEmptyState() ? this.sections() : this.sections().filter((s) => s.items.some((i) => !i.hidden)), ...ngDevMode ? [{ debugName: "displaySections" }] : /* istanbul ignore next */ []);
18
19
  }
19
20
  hrefOf(item) {
@@ -100,9 +101,19 @@ var PanelInfoListComponent = class PanelInfoListComponent {
100
101
  isSignal: true,
101
102
  isRequired: false,
102
103
  transformFunction: null
104
+ },
105
+ flat: {
106
+ classPropertyName: "flat",
107
+ publicName: "flat",
108
+ isSignal: true,
109
+ isRequired: false,
110
+ transformFunction: null
103
111
  }
104
112
  },
105
- host: { properties: { "class.pil-fill": "fill()" } },
113
+ host: { properties: {
114
+ "class.pil-fill": "fill()",
115
+ "class.pil-flat": "flat()"
116
+ } },
106
117
  ngImport: i0,
107
118
  template: `
108
119
  @for (section of displaySections(); track $index) {
@@ -181,7 +192,7 @@ var PanelInfoListComponent = class PanelInfoListComponent {
181
192
  </ng-template>
182
193
  `,
183
194
  isInline: true,
184
- styles: [":host{display:flex;flex-direction:column;gap:12px}:host(.pil-fill){flex:1;min-height:0}:host(.pil-fill) .pil-section{flex:1}.pil-section{border:1px solid #e2e8f0;border-radius:8px;overflow:hidden}.pil-section-label{display:flex;justify-content:space-between;align-items:center;font-size:.6875rem;font-weight:700;letter-spacing:.07em;color:#64748b;text-transform:uppercase;padding:8px 14px;background:#f8fafc;border-bottom:1px solid #e2e8f0}.pil-header-action{text-transform:none;letter-spacing:0;margin:-4px 0;flex-shrink:0}.pil-header-action-icon{margin-right:6px;vertical-align:-2px;flex-shrink:0}.pil-status{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:20px;height:20px;margin:-2px 8px -2px 0;border-radius:50%}.pil-status+span{margin-right:auto}.pil-header-link{font-size:.75rem;font-weight:500;color:#2563eb;text-decoration:none;text-transform:none;letter-spacing:0}.pil-header-link:hover{text-decoration:underline}.pil-row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:9px 14px;border-bottom:1px solid #f1f5f9}.pil-row:last-child{border-bottom:none}.pil-row--inline{justify-content:flex-start}.pil-row--inline .pil-value{text-align:left;justify-content:flex-start;flex-wrap:wrap;min-width:0;overflow-wrap:anywhere;word-break:break-word}.pil-label{font-size:.8125rem;color:#64748b;flex-shrink:0}.pil-value{font-size:.875rem;font-weight:500;color:#1e293b;text-align:right;display:flex;align-items:center;justify-content:flex-end;min-width:0;overflow-wrap:anywhere;word-break:break-word}.pil-multiline{white-space:pre-line;overflow-wrap:anywhere;word-break:break-word}.pil-strong .pil-label,.pil-strong .pil-value,.pil-strong .pil-muted{font-weight:700;color:#0f172a}.pil-badges{display:flex;align-items:center;gap:4px;flex-wrap:wrap;justify-content:flex-end}.pil-edit-btn{margin-left:4px;flex-shrink:0}ui-empty-state{padding:12px 0}.pil-muted{color:#1e293b;font-weight:400}.pil-danger{color:#dc2626;font-weight:600}.pil-link{font-size:.875rem;font-weight:500;color:#2563eb;text-decoration:none}.pil-link:hover{text-decoration:underline}.pil-link,.pil-link-icon,.pil-header-link{position:relative}@media(pointer:coarse),(max-width:480px){.pil-link:after,.pil-link-icon:after,.pil-header-link:after{content:\"\";position:absolute;inset:-14px -4px}}.pil-link--href{overflow-wrap:anywhere;word-break:break-word}.pil-link:focus-visible,.pil-link-icon:focus-visible,.pil-header-link:focus-visible{outline:2px solid #3b82f6;outline-offset:2px;border-radius:2px}.pil-link-icon{display:inline-flex;align-items:center;gap:5px;font-size:.875rem;font-weight:500;color:#1e293b;text-decoration:none}.pil-link-icon svg{color:#94a3b8;flex-shrink:0}.pil-grid-2{display:grid;grid-template-columns:1fr 1fr}.pil-grid-cell{display:flex;flex-direction:column;gap:3px;padding:10px 14px;min-width:0;border-right:1px solid #f1f5f9}.pil-grid-cell:last-child{border-right:none}.pil-grid-cell:nth-child(2n){border-right:none}@media(max-width:480px){.pil-grid-2{grid-template-columns:1fr}.pil-grid-cell{border-right:none;border-bottom:1px solid #f1f5f9}.pil-grid-cell:last-child{border-bottom:none}}.pil-value--block{text-align:left;justify-content:flex-start}\n"],
195
+ styles: [":host{display:flex;flex-direction:column;gap:12px}:host(.pil-fill){flex:1;min-height:0}:host(.pil-fill) .pil-section{flex:1}:host(.pil-flat) .pil-section{border:none;border-radius:0}:host(.pil-flat) .pil-row,:host(.pil-flat) .pil-grid-cell{flex-direction:column;align-items:stretch;justify-content:flex-start;gap:3px;padding:10px 0}:host(.pil-flat) .pil-section>:first-child .pil-row:first-child,:host(.pil-flat) .pil-row:first-child{padding-top:0}:host(.pil-flat) .pil-label{font-size:.6875rem;font-weight:700;letter-spacing:.07em;text-transform:uppercase;color:#64748b}:host(.pil-flat) .pil-value{font-size:.875rem;font-weight:600;color:#1e293b;text-align:left;justify-content:flex-start}:host(.pil-flat) .pil-badges{justify-content:flex-start}.pil-section{border:1px solid #e2e8f0;border-radius:8px;overflow:hidden}.pil-section-label{display:flex;justify-content:space-between;align-items:center;font-size:.6875rem;font-weight:700;letter-spacing:.07em;color:#64748b;text-transform:uppercase;padding:8px 14px;background:#f8fafc;border-bottom:1px solid #e2e8f0}.pil-header-action{text-transform:none;letter-spacing:0;margin:-4px 0;flex-shrink:0}.pil-header-action-icon{margin-right:6px;vertical-align:-2px;flex-shrink:0}.pil-status{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:20px;height:20px;margin:-2px 8px -2px 0;border-radius:50%}.pil-status+span{margin-right:auto}.pil-header-link{font-size:.75rem;font-weight:500;color:#2563eb;text-decoration:none;text-transform:none;letter-spacing:0}.pil-header-link:hover{text-decoration:underline}.pil-row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:9px 14px;border-bottom:1px solid #f1f5f9}.pil-row:last-child{border-bottom:none}.pil-row--inline{justify-content:flex-start}.pil-row--inline .pil-value{text-align:left;justify-content:flex-start;flex-wrap:wrap;min-width:0;overflow-wrap:anywhere;word-break:break-word}.pil-label{font-size:.8125rem;color:#64748b;flex-shrink:0}.pil-value{font-size:.875rem;font-weight:500;color:#1e293b;text-align:right;display:flex;align-items:center;justify-content:flex-end;min-width:0;overflow-wrap:anywhere;word-break:break-word}.pil-multiline{white-space:pre-line;overflow-wrap:anywhere;word-break:break-word}.pil-strong .pil-label,.pil-strong .pil-value,.pil-strong .pil-muted{font-weight:700;color:#0f172a}.pil-badges{display:flex;align-items:center;gap:4px;flex-wrap:wrap;justify-content:flex-end}.pil-edit-btn{margin-left:4px;flex-shrink:0}ui-empty-state{padding:12px 0}.pil-muted{color:#1e293b;font-weight:400}.pil-danger{color:#dc2626;font-weight:600}.pil-link{font-size:.875rem;font-weight:500;color:#2563eb;text-decoration:none}.pil-link:hover{text-decoration:underline}.pil-link,.pil-link-icon,.pil-header-link{position:relative}@media(pointer:coarse),(max-width:480px){.pil-link:after,.pil-link-icon:after,.pil-header-link:after{content:\"\";position:absolute;inset:-14px -4px}}.pil-link--href{overflow-wrap:anywhere;word-break:break-word}.pil-link:focus-visible,.pil-link-icon:focus-visible,.pil-header-link:focus-visible{outline:2px solid #3b82f6;outline-offset:2px;border-radius:2px}.pil-link-icon{display:inline-flex;align-items:center;gap:5px;font-size:.875rem;font-weight:500;color:#1e293b;text-decoration:none}.pil-link-icon svg{color:#94a3b8;flex-shrink:0}.pil-grid-2{display:grid;grid-template-columns:1fr 1fr}.pil-grid-cell{display:flex;flex-direction:column;gap:3px;padding:10px 14px;min-width:0;border-right:1px solid #f1f5f9}.pil-grid-cell:last-child{border-right:none}.pil-grid-cell:nth-child(2n){border-right:none}@media(max-width:480px){.pil-grid-2{grid-template-columns:1fr}.pil-grid-cell{border-right:none;border-bottom:1px solid #f1f5f9}.pil-grid-cell:last-child{border-bottom:none}}.pil-value--block{text-align:left;justify-content:flex-start}\n"],
185
196
  dependencies: [
186
197
  {
187
198
  kind: "directive",
@@ -302,7 +313,10 @@ i0.ɵɵngDeclareClassMetadata({
302
313
  EmptyStateComponent,
303
314
  IconComponent
304
315
  ],
305
- host: { "[class.pil-fill]": "fill()" },
316
+ host: {
317
+ "[class.pil-fill]": "fill()",
318
+ "[class.pil-flat]": "flat()"
319
+ },
306
320
  template: `
307
321
  @for (section of displaySections(); track $index) {
308
322
  <div class="pil-section">
@@ -379,7 +393,7 @@ i0.ɵɵngDeclareClassMetadata({
379
393
  }
380
394
  </ng-template>
381
395
  `,
382
- styles: [":host{display:flex;flex-direction:column;gap:12px}:host(.pil-fill){flex:1;min-height:0}:host(.pil-fill) .pil-section{flex:1}.pil-section{border:1px solid #e2e8f0;border-radius:8px;overflow:hidden}.pil-section-label{display:flex;justify-content:space-between;align-items:center;font-size:.6875rem;font-weight:700;letter-spacing:.07em;color:#64748b;text-transform:uppercase;padding:8px 14px;background:#f8fafc;border-bottom:1px solid #e2e8f0}.pil-header-action{text-transform:none;letter-spacing:0;margin:-4px 0;flex-shrink:0}.pil-header-action-icon{margin-right:6px;vertical-align:-2px;flex-shrink:0}.pil-status{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:20px;height:20px;margin:-2px 8px -2px 0;border-radius:50%}.pil-status+span{margin-right:auto}.pil-header-link{font-size:.75rem;font-weight:500;color:#2563eb;text-decoration:none;text-transform:none;letter-spacing:0}.pil-header-link:hover{text-decoration:underline}.pil-row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:9px 14px;border-bottom:1px solid #f1f5f9}.pil-row:last-child{border-bottom:none}.pil-row--inline{justify-content:flex-start}.pil-row--inline .pil-value{text-align:left;justify-content:flex-start;flex-wrap:wrap;min-width:0;overflow-wrap:anywhere;word-break:break-word}.pil-label{font-size:.8125rem;color:#64748b;flex-shrink:0}.pil-value{font-size:.875rem;font-weight:500;color:#1e293b;text-align:right;display:flex;align-items:center;justify-content:flex-end;min-width:0;overflow-wrap:anywhere;word-break:break-word}.pil-multiline{white-space:pre-line;overflow-wrap:anywhere;word-break:break-word}.pil-strong .pil-label,.pil-strong .pil-value,.pil-strong .pil-muted{font-weight:700;color:#0f172a}.pil-badges{display:flex;align-items:center;gap:4px;flex-wrap:wrap;justify-content:flex-end}.pil-edit-btn{margin-left:4px;flex-shrink:0}ui-empty-state{padding:12px 0}.pil-muted{color:#1e293b;font-weight:400}.pil-danger{color:#dc2626;font-weight:600}.pil-link{font-size:.875rem;font-weight:500;color:#2563eb;text-decoration:none}.pil-link:hover{text-decoration:underline}.pil-link,.pil-link-icon,.pil-header-link{position:relative}@media(pointer:coarse),(max-width:480px){.pil-link:after,.pil-link-icon:after,.pil-header-link:after{content:\"\";position:absolute;inset:-14px -4px}}.pil-link--href{overflow-wrap:anywhere;word-break:break-word}.pil-link:focus-visible,.pil-link-icon:focus-visible,.pil-header-link:focus-visible{outline:2px solid #3b82f6;outline-offset:2px;border-radius:2px}.pil-link-icon{display:inline-flex;align-items:center;gap:5px;font-size:.875rem;font-weight:500;color:#1e293b;text-decoration:none}.pil-link-icon svg{color:#94a3b8;flex-shrink:0}.pil-grid-2{display:grid;grid-template-columns:1fr 1fr}.pil-grid-cell{display:flex;flex-direction:column;gap:3px;padding:10px 14px;min-width:0;border-right:1px solid #f1f5f9}.pil-grid-cell:last-child{border-right:none}.pil-grid-cell:nth-child(2n){border-right:none}@media(max-width:480px){.pil-grid-2{grid-template-columns:1fr}.pil-grid-cell{border-right:none;border-bottom:1px solid #f1f5f9}.pil-grid-cell:last-child{border-bottom:none}}.pil-value--block{text-align:left;justify-content:flex-start}\n"]
396
+ styles: [":host{display:flex;flex-direction:column;gap:12px}:host(.pil-fill){flex:1;min-height:0}:host(.pil-fill) .pil-section{flex:1}:host(.pil-flat) .pil-section{border:none;border-radius:0}:host(.pil-flat) .pil-row,:host(.pil-flat) .pil-grid-cell{flex-direction:column;align-items:stretch;justify-content:flex-start;gap:3px;padding:10px 0}:host(.pil-flat) .pil-section>:first-child .pil-row:first-child,:host(.pil-flat) .pil-row:first-child{padding-top:0}:host(.pil-flat) .pil-label{font-size:.6875rem;font-weight:700;letter-spacing:.07em;text-transform:uppercase;color:#64748b}:host(.pil-flat) .pil-value{font-size:.875rem;font-weight:600;color:#1e293b;text-align:left;justify-content:flex-start}:host(.pil-flat) .pil-badges{justify-content:flex-start}.pil-section{border:1px solid #e2e8f0;border-radius:8px;overflow:hidden}.pil-section-label{display:flex;justify-content:space-between;align-items:center;font-size:.6875rem;font-weight:700;letter-spacing:.07em;color:#64748b;text-transform:uppercase;padding:8px 14px;background:#f8fafc;border-bottom:1px solid #e2e8f0}.pil-header-action{text-transform:none;letter-spacing:0;margin:-4px 0;flex-shrink:0}.pil-header-action-icon{margin-right:6px;vertical-align:-2px;flex-shrink:0}.pil-status{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:20px;height:20px;margin:-2px 8px -2px 0;border-radius:50%}.pil-status+span{margin-right:auto}.pil-header-link{font-size:.75rem;font-weight:500;color:#2563eb;text-decoration:none;text-transform:none;letter-spacing:0}.pil-header-link:hover{text-decoration:underline}.pil-row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:9px 14px;border-bottom:1px solid #f1f5f9}.pil-row:last-child{border-bottom:none}.pil-row--inline{justify-content:flex-start}.pil-row--inline .pil-value{text-align:left;justify-content:flex-start;flex-wrap:wrap;min-width:0;overflow-wrap:anywhere;word-break:break-word}.pil-label{font-size:.8125rem;color:#64748b;flex-shrink:0}.pil-value{font-size:.875rem;font-weight:500;color:#1e293b;text-align:right;display:flex;align-items:center;justify-content:flex-end;min-width:0;overflow-wrap:anywhere;word-break:break-word}.pil-multiline{white-space:pre-line;overflow-wrap:anywhere;word-break:break-word}.pil-strong .pil-label,.pil-strong .pil-value,.pil-strong .pil-muted{font-weight:700;color:#0f172a}.pil-badges{display:flex;align-items:center;gap:4px;flex-wrap:wrap;justify-content:flex-end}.pil-edit-btn{margin-left:4px;flex-shrink:0}ui-empty-state{padding:12px 0}.pil-muted{color:#1e293b;font-weight:400}.pil-danger{color:#dc2626;font-weight:600}.pil-link{font-size:.875rem;font-weight:500;color:#2563eb;text-decoration:none}.pil-link:hover{text-decoration:underline}.pil-link,.pil-link-icon,.pil-header-link{position:relative}@media(pointer:coarse),(max-width:480px){.pil-link:after,.pil-link-icon:after,.pil-header-link:after{content:\"\";position:absolute;inset:-14px -4px}}.pil-link--href{overflow-wrap:anywhere;word-break:break-word}.pil-link:focus-visible,.pil-link-icon:focus-visible,.pil-header-link:focus-visible{outline:2px solid #3b82f6;outline-offset:2px;border-radius:2px}.pil-link-icon{display:inline-flex;align-items:center;gap:5px;font-size:.875rem;font-weight:500;color:#1e293b;text-decoration:none}.pil-link-icon svg{color:#94a3b8;flex-shrink:0}.pil-grid-2{display:grid;grid-template-columns:1fr 1fr}.pil-grid-cell{display:flex;flex-direction:column;gap:3px;padding:10px 14px;min-width:0;border-right:1px solid #f1f5f9}.pil-grid-cell:last-child{border-right:none}.pil-grid-cell:nth-child(2n){border-right:none}@media(max-width:480px){.pil-grid-2{grid-template-columns:1fr}.pil-grid-cell{border-right:none;border-bottom:1px solid #f1f5f9}.pil-grid-cell:last-child{border-bottom:none}}.pil-value--block{text-align:left;justify-content:flex-start}\n"]
383
397
  }]
384
398
  }],
385
399
  propDecorators: {
@@ -414,6 +428,14 @@ i0.ɵɵngDeclareClassMetadata({
414
428
  alias: "fill",
415
429
  required: false
416
430
  }]
431
+ }],
432
+ flat: [{
433
+ type: i0.Input,
434
+ args: [{
435
+ isSignal: true,
436
+ alias: "flat",
437
+ required: false
438
+ }]
417
439
  }]
418
440
  }
419
441
  });
@@ -1 +1 @@
1
- {"version":3,"file":"forgeroute-ui-panel-info-list.mjs","names":[],"sources":["../../../projects/forgeroute-ui/panel-info-list/src/lib/panel-info-list/panel-info-list.component.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, input, computed, inject } from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { RouterLink } from '@angular/router';\nimport { BadgeComponent } from '@forgeroute/ui/badge';\nimport { ButtonComponent } from '@forgeroute/ui/core';\nimport { EmptyStateComponent } from '@forgeroute/ui/empty-state';\nimport { IconComponent, iconPath } from '@forgeroute/ui/icon';\nimport { BADGE_VARIANT_STYLES, BadgeVariant } from '@forgeroute/ui/table-types';\nimport { UiLabelsService } from '@forgeroute/ui/core';\n\nexport interface PanelInfoItem {\n label: string;\n value?: string | null;\n badge?: { label: string; variant: BadgeVariant };\n badges?: Array<{ label: string; variant: BadgeVariant }>;\n /** Router link for the value. */\n link?: string;\n /**\n * A real `<a href>` for the value (the visible `value` is the link text). Only `mailto:`, `tel:`, `http:` and `https:` are\n * allowed; any other scheme (`javascript:`, `data:` ...) renders the value as plain text. `http(s)` links open in a new tab with\n * `rel=\"noopener noreferrer\"`. Wins over `email` / `phone` / `link`.\n */\n href?: string;\n /** Shortcut: the value becomes a `mailto:` link to this address (the value defaults to the address). */\n email?: string;\n /** Shortcut: the value becomes a `tel:` link to this number (digits and a leading + are kept; the value defaults to the number as written). */\n phone?: string;\n /** Show the value with an \"open\" icon instead of blue link styling. */\n linkIcon?: boolean;\n /** Renders a small edit (pencil) `ui-icon` button after the value; `editTooltip` is its tooltip and accessible name (default \"Edit\"). */\n editAction?: () => void;\n editTooltip?: string;\n /** Renders a small delete (bin) `ui-icon` button after the edit pencil; the host asks for confirmation and does the deleting. `deleteTooltip` is its tooltip and accessible name (default \"Delete\"). */\n deleteAction?: () => void;\n deleteTooltip?: string;\n muted?: boolean;\n danger?: boolean;\n hidden?: boolean;\n /** Keep the line breaks of `value` (an address, a note); long lines still wrap. Plain values only. */\n multiline?: boolean;\n /** Bold row: the label and the value in the strong text colour and weight (a total, a balance due). */\n emphasis?: boolean;\n}\n\nexport interface PanelInfoSection {\n title?: string;\n headerLink?: { label: string; url: string };\n /**\n * A small secondary button at the end of the section's header bar (e.g. \"Add item\" for a list of line items). `action` runs on\n * click; `ariaLabel` is the accessible name when the visible label is not enough (default: the label). The header bar is shown\n * for a section with a `headerAction` even when it has no `title`. Not rendered for a section with no visible items unless\n * `showEmptyState` keeps the section. `icon` is an optional SVG path (the `d` value, 24x24 grid, same convention as a toolbar action's\n * `icon`) drawn before the label; it is decorative, so the accessible name stays the label / `ariaLabel`.\n */\n headerAction?: { label: string; action: () => void; ariaLabel?: string; disabled?: boolean; icon?: string };\n items: PanelInfoItem[];\n columns?: 2;\n /**\n * A state mark drawn before the section's title in the header bar: a round tile in the colours of the badge `variant` holding a check (`icon: 'check'`)\n * or a cross (`icon: 'close'`). `label` (\"Done\", \"Not done\") is the mark's accessible name (the tile has no visible text; the shape tells check from cross,\n * so the colour is never the only signal) and its hover tooltip. The header bar is shown for a section with a `status` even without a `title`.\n * Absent: the header bar is as before.\n */\n status?: { icon: 'check' | 'close'; label: string; variant: BadgeVariant };\n}\n\n/**\n * Read-only label/value list for side panels and detail views, grouped into bordered\n * sections. Items with `hidden: true` are skipped; sections with no visible items are\n * dropped unless `showEmptyState` is set (then they show an empty-state message).\n *\n * Usage:\n * <ui-panel-info-list [sections]=\"[{ title: 'DETAILS', items: [\n * { label: 'Status', badge: { label: 'Pending', variant: 'yellow' } },\n * { label: 'Notes', value: notes, hidden: !notes },\n * ] }]\" />\n */\n@Component({\n selector: 'ui-panel-info-list',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgTemplateOutlet, BadgeComponent, ButtonComponent, RouterLink, EmptyStateComponent, IconComponent],\n host: { '[class.pil-fill]': 'fill()' },\n template: `\n @for (section of displaySections(); track $index) {\n <div class=\"pil-section\">\n @if (section.title || section.headerAction || section.headerLink || section.status) {\n <div class=\"pil-section-label\">\n @if (section.status; as st) {\n <span class=\"pil-status\" role=\"img\" [attr.aria-label]=\"st.label\" [attr.title]=\"st.label\" [attr.data-status]=\"st.icon\" [style.background]=\"statusStyle(st.variant).bg\" [style.color]=\"statusStyle(st.variant).color\">\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"3\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\" focusable=\"false\"><path [attr.d]=\"statusPath(st.icon)\" /></svg>\n </span>\n }\n <span>{{ section.title }}</span>\n @if (section.headerLink) {\n <a class=\"pil-header-link\" [routerLink]=\"section.headerLink.url\">{{ section.headerLink.label }}</a>\n }\n @if (section.headerAction; as ha) {\n <ui-button class=\"pil-header-action\" variant=\"secondary\" size=\"xs\" [disabled]=\"!!ha.disabled\" [ariaLabel]=\"ha.ariaLabel ?? ha.label\" (click)=\"runHeaderAction(ha)\">\n @if (ha.icon) {\n <svg class=\"pil-header-action-icon\" width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\" focusable=\"false\"><path [attr.d]=\"ha.icon\"/></svg>\n }{{ ha.label }}</ui-button>\n }\n </div>\n }\n @if (visibleItems(section).length === 0) {\n <ui-empty-state [message]=\"labels.t('panelInfoList.noInformationAvailable')\" />\n } @else if (section.columns === 2) {\n <div class=\"pil-grid-2\">\n @for (item of visibleItems(section); track $index) {\n <div class=\"pil-grid-cell\" [class.pil-strong]=\"item.emphasis\">\n <span class=\"pil-label\">{{ item.label }}{{ labelColon() ? ':' : '' }}</span>{{ labelColon() ? ' ' : '' }}\n <span class=\"pil-value pil-value--block\">\n <ng-container *ngTemplateOutlet=\"valueTpl; context: { $implicit: item }\" />\n </span>\n </div>\n }\n </div>\n } @else {\n @for (item of visibleItems(section); track $index) {\n <div class=\"pil-row\" [class.pil-row--inline]=\"labelColon()\" [class.pil-strong]=\"item.emphasis\">\n <span class=\"pil-label\">{{ item.label }}{{ labelColon() ? ':' : '' }}</span>{{ labelColon() ? ' ' : '' }}\n <span class=\"pil-value\">\n <ng-container *ngTemplateOutlet=\"valueTpl; context: { $implicit: item }\" />\n </span>\n </div>\n }\n }\n </div>\n }\n <ng-template #valueTpl let-item>\n @if (item.badges) {\n <span class=\"pil-badges\">\n @for (b of item.badges; track $index) {\n <ui-badge [label]=\"b.label\" [variant]=\"b.variant\" />\n }\n </span>\n } @else if (item.badge) {\n <ui-badge [label]=\"item.badge.label\" [variant]=\"item.badge.variant\" />\n } @else if (hrefOf(item); as h) {\n <a class=\"pil-link pil-link--href\" [attr.href]=\"h\" [attr.target]=\"isWeb(h) ? '_blank' : null\" [attr.rel]=\"isWeb(h) ? 'noopener noreferrer' : null\">{{ textOf(item) }}</a>\n } @else if (item.link && item.value && item.linkIcon) {\n <a class=\"pil-link-icon\" [routerLink]=\"item.link\">\n {{ item.value }}\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\"/><polyline points=\"15 3 21 3 21 9\"/><line x1=\"10\" y1=\"14\" x2=\"21\" y2=\"3\"/></svg>\n </a>\n } @else if (item.link && item.value) {\n <a class=\"pil-link\" [routerLink]=\"item.link\">{{ item.value }}</a>\n } @else {\n <span [class.pil-muted]=\"item.muted\" [class.pil-danger]=\"item.danger\" [class.pil-multiline]=\"item.multiline\">{{ valueOf(item) }}</span>\n }\n @if (item.editAction) {\n <ui-icon class=\"pil-edit-btn\" name=\"edit\" [size]=\"14\" [tooltip]=\"item.editTooltip ?? labels.t('common.edit')\" (iconClick)=\"item.editAction()\" />\n }\n @if (item.deleteAction) {\n <ui-icon class=\"pil-edit-btn\" name=\"delete\" variant=\"danger\" [size]=\"14\" [tooltip]=\"item.deleteTooltip ?? labels.t('common.delete')\" (iconClick)=\"item.deleteAction()\" />\n }\n </ng-template>\n `,\n styles: [`\n :host { display: flex; flex-direction: column; gap: 12px; }\n /* fill: the list grows to the height of its container (a grid cell / flex item) and its section's box stretches with it */\n :host(.pil-fill) { flex: 1; min-height: 0; }\n :host(.pil-fill) .pil-section { flex: 1; }\n\n .pil-section {\n border: 1px solid #e2e8f0;\n border-radius: 8px;\n overflow: hidden;\n }\n\n .pil-section-label {\n display: flex;\n justify-content: space-between;\n align-items: center;\n font-size: 0.6875rem;\n font-weight: 700;\n letter-spacing: 0.07em;\n color: #64748b; /* slate-500: 4.55:1 on #f8fafc (slate-400 was 2.45:1) */\n text-transform: uppercase;\n padding: 8px 14px;\n background: #f8fafc;\n border-bottom: 1px solid #e2e8f0;\n }\n\n /* the header action sits at the end of the bar; the bar keeps its height with a button in it */\n .pil-header-action { text-transform: none; letter-spacing: 0; margin: -4px 0; flex-shrink: 0; }\n .pil-header-action-icon { margin-right: 6px; vertical-align: -2px; flex-shrink: 0; }\n\n /* status: the mark sits next to the title (the title takes the free space, so a link or action still ends the bar) */\n .pil-status { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 20px; height: 20px; margin: -2px 8px -2px 0; border-radius: 50%; }\n .pil-status + span { margin-right: auto; }\n\n .pil-header-link {\n font-size: 0.75rem;\n font-weight: 500;\n color: #2563eb;\n text-decoration: none;\n text-transform: none;\n letter-spacing: 0;\n &:hover { text-decoration: underline; }\n }\n\n .pil-row {\n display: flex;\n justify-content: space-between;\n align-items: center;\n gap: 12px;\n padding: 9px 14px;\n border-bottom: 1px solid #f1f5f9;\n &:last-child { border-bottom: none; }\n }\n\n /* labelColon: \"Label: value\" on one line, value next to the label */\n .pil-row--inline { justify-content: flex-start; }\n .pil-row--inline .pil-value { text-align: left; justify-content: flex-start; flex-wrap: wrap; min-width: 0; overflow-wrap: anywhere; word-break: break-word; }\n\n .pil-label {\n font-size: 0.8125rem;\n color: #64748b;\n flex-shrink: 0;\n }\n\n .pil-value {\n font-size: 0.875rem;\n font-weight: 500;\n color: #1e293b;\n text-align: right;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n min-width: 0; /* a long unbroken value wraps instead of pushing the row wider than the panel */\n overflow-wrap: anywhere;\n word-break: break-word;\n }\n\n /* multiline: keep the line breaks of the value; strong: a bold row */\n .pil-multiline { white-space: pre-line; overflow-wrap: anywhere; word-break: break-word; }\n .pil-strong .pil-label { font-weight: 700; color: #0f172a; }\n .pil-strong .pil-value, .pil-strong .pil-muted { font-weight: 700; color: #0f172a; }\n .pil-badges { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }\n\n .pil-edit-btn { margin-left: 4px; flex-shrink: 0; }\n\n ui-empty-state { padding: 12px 0; }\n .pil-muted { color: #1e293b; font-weight: 400; }\n .pil-danger { color: #dc2626; font-weight: 600; } /* #dc2626 on white = 4.83:1 (the old #ef4444 was 3.76:1, below WCAG AA 4.5:1) */\n\n .pil-link {\n font-size: 0.875rem;\n font-weight: 500;\n color: #2563eb;\n text-decoration: none;\n &:hover { text-decoration: underline; }\n }\n\n /* Touch targets: the value links (phone, email, web, record link) and the section header link get a >= 44px tall hit area through an invisible ::after\n (the visible text stays as it is, desktop unchanged). position: relative is set at every width so the ::after has its containing block. */\n .pil-link, .pil-link-icon, .pil-header-link { position: relative; }\n @media (pointer: coarse), (max-width: 480px) {\n .pil-link::after, .pil-link-icon::after, .pil-header-link::after { content: ''; position: absolute; inset: -14px -4px; }\n }\n\n .pil-link--href { overflow-wrap: anywhere; word-break: break-word; } /* word-break: Safari < 15.4 has no overflow-wrap: anywhere */\n .pil-link:focus-visible, .pil-link-icon:focus-visible, .pil-header-link:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; border-radius: 2px; }\n\n .pil-link-icon {\n display: inline-flex;\n align-items: center;\n gap: 5px;\n font-size: 0.875rem;\n font-weight: 500;\n color: #1e293b;\n text-decoration: none;\n svg { color: #94a3b8; flex-shrink: 0; }\n }\n\n .pil-grid-2 {\n display: grid;\n grid-template-columns: 1fr 1fr;\n }\n\n .pil-grid-cell {\n display: flex;\n flex-direction: column;\n gap: 3px;\n padding: 10px 14px;\n min-width: 0;\n border-right: 1px solid #f1f5f9;\n &:last-child { border-right: none; }\n &:nth-child(even) { border-right: none; }\n }\n\n /* phones: one column, so two long values never squeeze each other */\n @media (max-width: 480px) {\n .pil-grid-2 { grid-template-columns: 1fr; }\n .pil-grid-cell { border-right: none; border-bottom: 1px solid #f1f5f9; &:last-child { border-bottom: none; } }\n }\n\n .pil-value--block {\n text-align: left;\n justify-content: flex-start;\n }\n `],\n})\nexport class PanelInfoListComponent {\n protected readonly labels = inject(UiLabelsService);\n readonly sections = input<PanelInfoSection[]>([]);\n readonly showEmptyState = input(false);\n /**\n * true = each row reads \"Label: value\" (a colon after the label and a real space, so `textContent` is \"Label: value\") with the value\n * next to the label instead of pushed to the right edge. Works with plain values, links (href / email / phone / link) and badges.\n * Default false = the label and value as before.\n */\n readonly labelColon = input(false);\n /**\n * The list stretches to the height of its container (a grid cell or flex item with a definite height), so lists side by side in\n * one grid row end at the same height; with one section, that section's box fills the height. Default false = as tall as its content.\n */\n readonly fill = input(false);\n\n readonly displaySections = computed(() =>\n this.showEmptyState()\n ? this.sections()\n : this.sections().filter(s => s.items.some(i => !i.hidden))\n );\n\n /**\n * The safe href of an item, or null: `href` first, else `mailto:`/`tel:` built from `email`/`phone`. Only mailto, tel, http and https\n * are allowed (the scheme is checked after removing control characters and spaces, like browsers do).\n */\n hrefOf(item: PanelInfoItem): string | null {\n // control characters (tab, newline ...) are dropped, as browsers do, so the sanitised href and the scheme check see the same text\n let raw = item.href?.replace(/[\\u0000-\\u001F]/g, '').trim() ?? '';\n if (!raw && item.email?.trim()) {\n // encode what would start a mailto: header (?bcc=..., &body=...) or break the URL\n raw = 'mailto:' + item.email.trim().replace(/[?#&%\\s<>\"]/g, c => encodeURIComponent(c));\n }\n if (!raw && item.phone?.trim()) {\n // \"555-0100 ext 12\" / \"x12\" / \"#12\": the extension is its own ;ext= part, never glued onto the number\n const m = /^(.*?)(?:\\s*(?:ext\\.?|x|#)\\s*(\\d+))?\\s*$/i.exec(item.phone.trim())!;\n const num = m[1];\n const digits = num.replace(/\\D/g, '');\n if (digits) raw = 'tel:' + (num.trim().startsWith('+') ? '+' : '') + digits + (m[2] ? ';ext=' + m[2] : '');\n }\n if (!raw) return null;\n const scheme = /^([a-z][a-z0-9+.\\-]*):/i.exec(raw.replace(/[\\u0000-\\u0020]/g, ''));\n return scheme && ['mailto', 'tel', 'http', 'https'].includes(scheme[1].toLowerCase()) ? raw : null;\n }\n isWeb(href: string): boolean { return /^https?:/i.test(href.replace(/[\\u0000-\\u0020]/g, '')); }\n /** Link text: the value, else the email / phone as written. */\n textOf(item: PanelInfoItem): string { return item.value || item.email || item.phone || item.href || ''; }\n\n /** Plain value, or the dash for an empty / blank one. */\n valueOf(item: PanelInfoItem): string { return item.value?.trim() ? item.value : '—'; }\n\n /** Colours of a section's `status` mark: the badge colours of its variant (an unknown variant falls back to gray, like the badge). */\n statusStyle(variant: BadgeVariant): { bg: string; color: string } { return BADGE_VARIANT_STYLES[variant] ?? BADGE_VARIANT_STYLES['gray']; }\n\n /** SVG path of a section's `status` icon (the library's own check and close icons). */\n statusPath(icon: 'check' | 'close'): string { return iconPath(icon)!; }\n\n /** A disabled header action never runs, even when the click reaches the host element. */\n runHeaderAction(ha: NonNullable<PanelInfoSection['headerAction']>): void { if (!ha.disabled) ha.action(); }\n\n visibleItems(section: PanelInfoSection): PanelInfoItem[] {\n return section.items.filter(i => !i.hidden);\n }\n}\n"],"mappings":";;;;;;;;;AAiTA,IAAa,yBAAb,MAAa,uBAAsB;CApOnC,cAAA;EAqOqB,KAAA,SAAS,OAAO,eAAe;EACzC,KAAA,WAAiB,MAA0B,C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UAC5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2ET,QAAA,CAAA,yoGAAA;EAAA,CAAA"}
1
+ {"version":3,"file":"forgeroute-ui-panel-info-list.mjs","names":[],"sources":["../../../projects/forgeroute-ui/panel-info-list/src/lib/panel-info-list/panel-info-list.component.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, input, computed, inject } from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { RouterLink } from '@angular/router';\nimport { BadgeComponent } from '@forgeroute/ui/badge';\nimport { ButtonComponent } from '@forgeroute/ui/core';\nimport { EmptyStateComponent } from '@forgeroute/ui/empty-state';\nimport { IconComponent, iconPath } from '@forgeroute/ui/icon';\nimport { BADGE_VARIANT_STYLES, BadgeVariant } from '@forgeroute/ui/table-types';\nimport { UiLabelsService } from '@forgeroute/ui/core';\n\nexport interface PanelInfoItem {\n label: string;\n value?: string | null;\n badge?: { label: string; variant: BadgeVariant };\n badges?: Array<{ label: string; variant: BadgeVariant }>;\n /** Router link for the value. */\n link?: string;\n /**\n * A real `<a href>` for the value (the visible `value` is the link text). Only `mailto:`, `tel:`, `http:` and `https:` are\n * allowed; any other scheme (`javascript:`, `data:` ...) renders the value as plain text. `http(s)` links open in a new tab with\n * `rel=\"noopener noreferrer\"`. Wins over `email` / `phone` / `link`.\n */\n href?: string;\n /** Shortcut: the value becomes a `mailto:` link to this address (the value defaults to the address). */\n email?: string;\n /** Shortcut: the value becomes a `tel:` link to this number (digits and a leading + are kept; the value defaults to the number as written). */\n phone?: string;\n /** Show the value with an \"open\" icon instead of blue link styling. */\n linkIcon?: boolean;\n /** Renders a small edit (pencil) `ui-icon` button after the value; `editTooltip` is its tooltip and accessible name (default \"Edit\"). */\n editAction?: () => void;\n editTooltip?: string;\n /** Renders a small delete (bin) `ui-icon` button after the edit pencil; the host asks for confirmation and does the deleting. `deleteTooltip` is its tooltip and accessible name (default \"Delete\"). */\n deleteAction?: () => void;\n deleteTooltip?: string;\n muted?: boolean;\n danger?: boolean;\n hidden?: boolean;\n /** Keep the line breaks of `value` (an address, a note); long lines still wrap. Plain values only. */\n multiline?: boolean;\n /** Bold row: the label and the value in the strong text colour and weight (a total, a balance due). */\n emphasis?: boolean;\n}\n\nexport interface PanelInfoSection {\n title?: string;\n headerLink?: { label: string; url: string };\n /**\n * A small secondary button at the end of the section's header bar (e.g. \"Add item\" for a list of line items). `action` runs on\n * click; `ariaLabel` is the accessible name when the visible label is not enough (default: the label). The header bar is shown\n * for a section with a `headerAction` even when it has no `title`. Not rendered for a section with no visible items unless\n * `showEmptyState` keeps the section. `icon` is an optional SVG path (the `d` value, 24x24 grid, same convention as a toolbar action's\n * `icon`) drawn before the label; it is decorative, so the accessible name stays the label / `ariaLabel`.\n */\n headerAction?: { label: string; action: () => void; ariaLabel?: string; disabled?: boolean; icon?: string };\n items: PanelInfoItem[];\n columns?: 2;\n /**\n * A state mark drawn before the section's title in the header bar: a round tile in the colours of the badge `variant` holding a check (`icon: 'check'`)\n * or a cross (`icon: 'close'`). `label` (\"Done\", \"Not done\") is the mark's accessible name (the tile has no visible text; the shape tells check from cross,\n * so the colour is never the only signal) and its hover tooltip. The header bar is shown for a section with a `status` even without a `title`.\n * Absent: the header bar is as before.\n */\n status?: { icon: 'check' | 'close'; label: string; variant: BadgeVariant };\n}\n\n/**\n * Read-only label/value list for side panels and detail views, grouped into bordered\n * sections. Items with `hidden: true` are skipped; sections with no visible items are\n * dropped unless `showEmptyState` is set (then they show an empty-state message).\n *\n * Usage:\n * <ui-panel-info-list [sections]=\"[{ title: 'DETAILS', items: [\n * { label: 'Status', badge: { label: 'Pending', variant: 'yellow' } },\n * { label: 'Notes', value: notes, hidden: !notes },\n * ] }]\" />\n */\n@Component({\n selector: 'ui-panel-info-list',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgTemplateOutlet, BadgeComponent, ButtonComponent, RouterLink, EmptyStateComponent, IconComponent],\n host: { '[class.pil-fill]': 'fill()', '[class.pil-flat]': 'flat()' },\n template: `\n @for (section of displaySections(); track $index) {\n <div class=\"pil-section\">\n @if (section.title || section.headerAction || section.headerLink || section.status) {\n <div class=\"pil-section-label\">\n @if (section.status; as st) {\n <span class=\"pil-status\" role=\"img\" [attr.aria-label]=\"st.label\" [attr.title]=\"st.label\" [attr.data-status]=\"st.icon\" [style.background]=\"statusStyle(st.variant).bg\" [style.color]=\"statusStyle(st.variant).color\">\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"3\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\" focusable=\"false\"><path [attr.d]=\"statusPath(st.icon)\" /></svg>\n </span>\n }\n <span>{{ section.title }}</span>\n @if (section.headerLink) {\n <a class=\"pil-header-link\" [routerLink]=\"section.headerLink.url\">{{ section.headerLink.label }}</a>\n }\n @if (section.headerAction; as ha) {\n <ui-button class=\"pil-header-action\" variant=\"secondary\" size=\"xs\" [disabled]=\"!!ha.disabled\" [ariaLabel]=\"ha.ariaLabel ?? ha.label\" (click)=\"runHeaderAction(ha)\">\n @if (ha.icon) {\n <svg class=\"pil-header-action-icon\" width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\" focusable=\"false\"><path [attr.d]=\"ha.icon\"/></svg>\n }{{ ha.label }}</ui-button>\n }\n </div>\n }\n @if (visibleItems(section).length === 0) {\n <ui-empty-state [message]=\"labels.t('panelInfoList.noInformationAvailable')\" />\n } @else if (section.columns === 2) {\n <div class=\"pil-grid-2\">\n @for (item of visibleItems(section); track $index) {\n <div class=\"pil-grid-cell\" [class.pil-strong]=\"item.emphasis\">\n <span class=\"pil-label\">{{ item.label }}{{ labelColon() ? ':' : '' }}</span>{{ labelColon() ? ' ' : '' }}\n <span class=\"pil-value pil-value--block\">\n <ng-container *ngTemplateOutlet=\"valueTpl; context: { $implicit: item }\" />\n </span>\n </div>\n }\n </div>\n } @else {\n @for (item of visibleItems(section); track $index) {\n <div class=\"pil-row\" [class.pil-row--inline]=\"labelColon()\" [class.pil-strong]=\"item.emphasis\">\n <span class=\"pil-label\">{{ item.label }}{{ labelColon() ? ':' : '' }}</span>{{ labelColon() ? ' ' : '' }}\n <span class=\"pil-value\">\n <ng-container *ngTemplateOutlet=\"valueTpl; context: { $implicit: item }\" />\n </span>\n </div>\n }\n }\n </div>\n }\n <ng-template #valueTpl let-item>\n @if (item.badges) {\n <span class=\"pil-badges\">\n @for (b of item.badges; track $index) {\n <ui-badge [label]=\"b.label\" [variant]=\"b.variant\" />\n }\n </span>\n } @else if (item.badge) {\n <ui-badge [label]=\"item.badge.label\" [variant]=\"item.badge.variant\" />\n } @else if (hrefOf(item); as h) {\n <a class=\"pil-link pil-link--href\" [attr.href]=\"h\" [attr.target]=\"isWeb(h) ? '_blank' : null\" [attr.rel]=\"isWeb(h) ? 'noopener noreferrer' : null\">{{ textOf(item) }}</a>\n } @else if (item.link && item.value && item.linkIcon) {\n <a class=\"pil-link-icon\" [routerLink]=\"item.link\">\n {{ item.value }}\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\"/><polyline points=\"15 3 21 3 21 9\"/><line x1=\"10\" y1=\"14\" x2=\"21\" y2=\"3\"/></svg>\n </a>\n } @else if (item.link && item.value) {\n <a class=\"pil-link\" [routerLink]=\"item.link\">{{ item.value }}</a>\n } @else {\n <span [class.pil-muted]=\"item.muted\" [class.pil-danger]=\"item.danger\" [class.pil-multiline]=\"item.multiline\">{{ valueOf(item) }}</span>\n }\n @if (item.editAction) {\n <ui-icon class=\"pil-edit-btn\" name=\"edit\" [size]=\"14\" [tooltip]=\"item.editTooltip ?? labels.t('common.edit')\" (iconClick)=\"item.editAction()\" />\n }\n @if (item.deleteAction) {\n <ui-icon class=\"pil-edit-btn\" name=\"delete\" variant=\"danger\" [size]=\"14\" [tooltip]=\"item.deleteTooltip ?? labels.t('common.delete')\" (iconClick)=\"item.deleteAction()\" />\n }\n </ng-template>\n `,\n styles: [`\n :host { display: flex; flex-direction: column; gap: 12px; }\n /* fill: the list grows to the height of its container (a grid cell / flex item) and its section's box stretches with it */\n :host(.pil-fill) { flex: 1; min-height: 0; }\n :host(.pil-fill) .pil-section { flex: 1; }\n /* flat: for a list inside a card that already has a box (no card within a card): no border or radius, and each row reads\n as a small capital label ABOVE a bold value with a thin divider between rows (the Contact Info look). */\n :host(.pil-flat) .pil-section { border: none; border-radius: 0; }\n :host(.pil-flat) .pil-row, :host(.pil-flat) .pil-grid-cell {\n flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 3px; padding: 10px 0;\n }\n :host(.pil-flat) .pil-section > :first-child .pil-row:first-child, :host(.pil-flat) .pil-row:first-child { padding-top: 0; }\n :host(.pil-flat) .pil-label { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: #64748b; }\n :host(.pil-flat) .pil-value { font-size: 0.875rem; font-weight: 600; color: #1e293b; text-align: left; justify-content: flex-start; }\n :host(.pil-flat) .pil-badges { justify-content: flex-start; }\n\n .pil-section {\n border: 1px solid #e2e8f0;\n border-radius: 8px;\n overflow: hidden;\n }\n\n .pil-section-label {\n display: flex;\n justify-content: space-between;\n align-items: center;\n font-size: 0.6875rem;\n font-weight: 700;\n letter-spacing: 0.07em;\n color: #64748b; /* slate-500: 4.55:1 on #f8fafc (slate-400 was 2.45:1) */\n text-transform: uppercase;\n padding: 8px 14px;\n background: #f8fafc;\n border-bottom: 1px solid #e2e8f0;\n }\n\n /* the header action sits at the end of the bar; the bar keeps its height with a button in it */\n .pil-header-action { text-transform: none; letter-spacing: 0; margin: -4px 0; flex-shrink: 0; }\n .pil-header-action-icon { margin-right: 6px; vertical-align: -2px; flex-shrink: 0; }\n\n /* status: the mark sits next to the title (the title takes the free space, so a link or action still ends the bar) */\n .pil-status { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 20px; height: 20px; margin: -2px 8px -2px 0; border-radius: 50%; }\n .pil-status + span { margin-right: auto; }\n\n .pil-header-link {\n font-size: 0.75rem;\n font-weight: 500;\n color: #2563eb;\n text-decoration: none;\n text-transform: none;\n letter-spacing: 0;\n &:hover { text-decoration: underline; }\n }\n\n .pil-row {\n display: flex;\n justify-content: space-between;\n align-items: center;\n gap: 12px;\n padding: 9px 14px;\n border-bottom: 1px solid #f1f5f9;\n &:last-child { border-bottom: none; }\n }\n\n /* labelColon: \"Label: value\" on one line, value next to the label */\n .pil-row--inline { justify-content: flex-start; }\n .pil-row--inline .pil-value { text-align: left; justify-content: flex-start; flex-wrap: wrap; min-width: 0; overflow-wrap: anywhere; word-break: break-word; }\n\n .pil-label {\n font-size: 0.8125rem;\n color: #64748b;\n flex-shrink: 0;\n }\n\n .pil-value {\n font-size: 0.875rem;\n font-weight: 500;\n color: #1e293b;\n text-align: right;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n min-width: 0; /* a long unbroken value wraps instead of pushing the row wider than the panel */\n overflow-wrap: anywhere;\n word-break: break-word;\n }\n\n /* multiline: keep the line breaks of the value; strong: a bold row */\n .pil-multiline { white-space: pre-line; overflow-wrap: anywhere; word-break: break-word; }\n .pil-strong .pil-label { font-weight: 700; color: #0f172a; }\n .pil-strong .pil-value, .pil-strong .pil-muted { font-weight: 700; color: #0f172a; }\n .pil-badges { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }\n\n .pil-edit-btn { margin-left: 4px; flex-shrink: 0; }\n\n ui-empty-state { padding: 12px 0; }\n .pil-muted { color: #1e293b; font-weight: 400; }\n .pil-danger { color: #dc2626; font-weight: 600; } /* #dc2626 on white = 4.83:1 (the old #ef4444 was 3.76:1, below WCAG AA 4.5:1) */\n\n .pil-link {\n font-size: 0.875rem;\n font-weight: 500;\n color: #2563eb;\n text-decoration: none;\n &:hover { text-decoration: underline; }\n }\n\n /* Touch targets: the value links (phone, email, web, record link) and the section header link get a >= 44px tall hit area through an invisible ::after\n (the visible text stays as it is, desktop unchanged). position: relative is set at every width so the ::after has its containing block. */\n .pil-link, .pil-link-icon, .pil-header-link { position: relative; }\n @media (pointer: coarse), (max-width: 480px) {\n .pil-link::after, .pil-link-icon::after, .pil-header-link::after { content: ''; position: absolute; inset: -14px -4px; }\n }\n\n .pil-link--href { overflow-wrap: anywhere; word-break: break-word; } /* word-break: Safari < 15.4 has no overflow-wrap: anywhere */\n .pil-link:focus-visible, .pil-link-icon:focus-visible, .pil-header-link:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; border-radius: 2px; }\n\n .pil-link-icon {\n display: inline-flex;\n align-items: center;\n gap: 5px;\n font-size: 0.875rem;\n font-weight: 500;\n color: #1e293b;\n text-decoration: none;\n svg { color: #94a3b8; flex-shrink: 0; }\n }\n\n .pil-grid-2 {\n display: grid;\n grid-template-columns: 1fr 1fr;\n }\n\n .pil-grid-cell {\n display: flex;\n flex-direction: column;\n gap: 3px;\n padding: 10px 14px;\n min-width: 0;\n border-right: 1px solid #f1f5f9;\n &:last-child { border-right: none; }\n &:nth-child(even) { border-right: none; }\n }\n\n /* phones: one column, so two long values never squeeze each other */\n @media (max-width: 480px) {\n .pil-grid-2 { grid-template-columns: 1fr; }\n .pil-grid-cell { border-right: none; border-bottom: 1px solid #f1f5f9; &:last-child { border-bottom: none; } }\n }\n\n .pil-value--block {\n text-align: left;\n justify-content: flex-start;\n }\n `],\n})\nexport class PanelInfoListComponent {\n protected readonly labels = inject(UiLabelsService);\n readonly sections = input<PanelInfoSection[]>([]);\n readonly showEmptyState = input(false);\n /**\n * true = each row reads \"Label: value\" (a colon after the label and a real space, so `textContent` is \"Label: value\") with the value\n * next to the label instead of pushed to the right edge. Works with plain values, links (href / email / phone / link) and badges.\n * Default false = the label and value as before.\n */\n readonly labelColon = input(false);\n /**\n * The list stretches to the height of its container (a grid cell or flex item with a definite height), so lists side by side in\n * one grid row end at the same height; with one section, that section's box fills the height. Default false = as tall as its content.\n */\n readonly fill = input(false);\n /**\n * For a list placed inside a card (`ui-detail-card`, a side panel) that already has a box: no card within a card. Draws the list\n * without its own border and rounded box, and each row as a small capital label above a bold value with a thin divider between rows.\n * Default false = the bordered box with the label left and the value right, as before.\n */\n readonly flat = input(false);\n\n readonly displaySections = computed(() =>\n this.showEmptyState()\n ? this.sections()\n : this.sections().filter(s => s.items.some(i => !i.hidden))\n );\n\n /**\n * The safe href of an item, or null: `href` first, else `mailto:`/`tel:` built from `email`/`phone`. Only mailto, tel, http and https\n * are allowed (the scheme is checked after removing control characters and spaces, like browsers do).\n */\n hrefOf(item: PanelInfoItem): string | null {\n // control characters (tab, newline ...) are dropped, as browsers do, so the sanitised href and the scheme check see the same text\n let raw = item.href?.replace(/[\\u0000-\\u001F]/g, '').trim() ?? '';\n if (!raw && item.email?.trim()) {\n // encode what would start a mailto: header (?bcc=..., &body=...) or break the URL\n raw = 'mailto:' + item.email.trim().replace(/[?#&%\\s<>\"]/g, c => encodeURIComponent(c));\n }\n if (!raw && item.phone?.trim()) {\n // \"555-0100 ext 12\" / \"x12\" / \"#12\": the extension is its own ;ext= part, never glued onto the number\n const m = /^(.*?)(?:\\s*(?:ext\\.?|x|#)\\s*(\\d+))?\\s*$/i.exec(item.phone.trim())!;\n const num = m[1];\n const digits = num.replace(/\\D/g, '');\n if (digits) raw = 'tel:' + (num.trim().startsWith('+') ? '+' : '') + digits + (m[2] ? ';ext=' + m[2] : '');\n }\n if (!raw) return null;\n const scheme = /^([a-z][a-z0-9+.\\-]*):/i.exec(raw.replace(/[\\u0000-\\u0020]/g, ''));\n return scheme && ['mailto', 'tel', 'http', 'https'].includes(scheme[1].toLowerCase()) ? raw : null;\n }\n isWeb(href: string): boolean { return /^https?:/i.test(href.replace(/[\\u0000-\\u0020]/g, '')); }\n /** Link text: the value, else the email / phone as written. */\n textOf(item: PanelInfoItem): string { return item.value || item.email || item.phone || item.href || ''; }\n\n /** Plain value, or the dash for an empty / blank one. */\n valueOf(item: PanelInfoItem): string { return item.value?.trim() ? item.value : '—'; }\n\n /** Colours of a section's `status` mark: the badge colours of its variant (an unknown variant falls back to gray, like the badge). */\n statusStyle(variant: BadgeVariant): { bg: string; color: string } { return BADGE_VARIANT_STYLES[variant] ?? BADGE_VARIANT_STYLES['gray']; }\n\n /** SVG path of a section's `status` icon (the library's own check and close icons). */\n statusPath(icon: 'check' | 'close'): string { return iconPath(icon)!; }\n\n /** A disabled header action never runs, even when the click reaches the host element. */\n runHeaderAction(ha: NonNullable<PanelInfoSection['headerAction']>): void { if (!ha.disabled) ha.action(); }\n\n visibleItems(section: PanelInfoSection): PanelInfoItem[] {\n return section.items.filter(i => !i.hidden);\n }\n}\n"],"mappings":";;;;;;;;;AA2TA,IAAa,yBAAb,MAAa,uBAAsB;CA9OnC,cAAA;EA+OqB,KAAA,SAAS,OAAO,eAAe;EACzC,KAAA,WAAiB,MAA0B,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;EAC9C,KAAA,iBAAiB,MAAM,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,iBAAA,CAAA,+BAAA,CAAA,CAAA;EAM7B,KAAA,aAAiB,MAAM,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,aAAA,CAAA,+BAAA,CAAA,CAAA;EAK7B,KAAA,OAAiB,MAAM,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;EAM7B,KAAA,OAAiB,MAAM,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;EAE7B,KAAA,kBAAkB,eACzB,KAAK,eAAc,IACf,KAAK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,QAAA;MAAA;MAAA;MAAA;KAAA;IAAA;IAAA;KAAA,MAAA;KAAA,MAAE;KAAe,UAAA;KAAA,QAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;KAAA;IAAA;IAAA;KAAA,MAAA;KAAA,MAAE;KAAU,UAAA;KAAA,QAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;KAAA;IAAA;IAAA;KAAA,MAAA;KAAA,MAAE;KAAmB,UAAA;KAAA,QAAA;MAAA;MAAA;MAAA;KAAA;IAAA;IAAA;KAAA,MAAA;KAAA,MAAE;KAAa,UAAA;KAAA,QAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;MAAA;KAAA;KAAA,SAAA,CAAA,WAAA;IAAA;GAAA;GAAA,iBAAA,GAAA,wBAAA;EAAA,CAAA;CAAA;;AA0OhG,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAsB,YAAA,CAAA;EA9OlC,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAoB,YAClB;GAAI,iBACC,wBAAwB;GAAM,SACtC;IAAC;IAAkB;IAAgB;IAAiB;IAAY;IAAqB;GAAa;GAAC,MACtG;IAAE,oBAAoB;IAAU,oBAAoB;GAAQ;GAAE,UAC1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2ET,QAAA,CAAA,uvHAAA;EAAA,CAAA"}
@@ -6692,7 +6692,8 @@ var RefundPanelComponent = class RefundPanelComponent {
6692
6692
  "sections",
6693
6693
  "showEmptyState",
6694
6694
  "labelColon",
6695
- "fill"
6695
+ "fill",
6696
+ "flat"
6696
6697
  ]
6697
6698
  },
6698
6699
  {