@forgeroute/ui 0.5.27 → 0.5.29

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 (36) 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 +191 -43
  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 +4 -1
  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-kpi-card.mjs +2 -2
  14. package/fesm2022/forgeroute-ui-kpi-card.mjs.map +1 -1
  15. package/fesm2022/forgeroute-ui-notes.mjs +20 -22
  16. package/fesm2022/forgeroute-ui-notes.mjs.map +1 -1
  17. package/fesm2022/forgeroute-ui-panel-info-list.mjs +26 -4
  18. package/fesm2022/forgeroute-ui-panel-info-list.mjs.map +1 -1
  19. package/fesm2022/forgeroute-ui-payments.mjs +2 -1
  20. package/fesm2022/forgeroute-ui-payments.mjs.map +1 -1
  21. package/fesm2022/forgeroute-ui-setup.mjs +2 -1
  22. package/fesm2022/forgeroute-ui-setup.mjs.map +1 -1
  23. package/fesm2022/forgeroute-ui-stripe.mjs +78 -6
  24. package/fesm2022/forgeroute-ui-stripe.mjs.map +1 -1
  25. package/fesm2022/forgeroute-ui-table-types.mjs.map +1 -1
  26. package/package.json +1 -1
  27. package/types/forgeroute-ui-calendar.d.ts +28 -1
  28. package/types/forgeroute-ui-card-list-item.d.ts +37 -11
  29. package/types/forgeroute-ui-core.d.ts +3 -0
  30. package/types/forgeroute-ui-data-table-core.d.ts +10 -1
  31. package/types/forgeroute-ui-messaging.d.ts +1 -1
  32. package/types/forgeroute-ui-panel-info-list.d.ts +11 -0
  33. package/types/forgeroute-ui-quickbooks.d.ts +1 -1
  34. package/types/forgeroute-ui-square.d.ts +3 -3
  35. package/types/forgeroute-ui-stripe.d.ts +31 -1
  36. package/types/forgeroute-ui-table-types.d.ts +5 -0
@@ -234,7 +234,7 @@ var KpiCardComponent = class KpiCardComponent {
234
234
  </div>
235
235
  `,
236
236
  isInline: true,
237
- styles: [":host{display:block;height:100%}.kpi-card{position:relative;background:#fff;border:1px solid #e2e8f0;border-radius:10px;padding:16px;display:flex;flex-direction:column;gap:4px;min-width:0;height:100%;box-sizing:border-box;transition:border-color .15s ease,box-shadow .15s ease}:host(:focus){outline:none}:host(:focus-visible) .kpi-card{outline:2px solid #3b82f6;outline-offset:2px}.kpi-card.clickable{cursor:pointer}.kpi-card.clickable:hover{border-color:#93c5fd;box-shadow:0 2px 8px #3b82f614}.kpi-card.clickable:hover .kpi-arrow{color:#3b82f6;transform:translate(2px)}.kpi-arrow{position:absolute;bottom:14px;right:14px;color:#94a3b8;transition:color .15s ease,transform .15s ease}.kpi-icon{flex-shrink:0;width:36px;height:36px;border-radius:8px;display:flex;align-items:center;justify-content:center;margin-bottom:8px}.green-icon{background:#dcfce7;color:#16a34a}.blue-icon{background:#dbeafe;color:#2563eb}.amber-icon{background:#fef3c7;color:#d97706}.orange-icon{background:#ffedd5;color:#c2410c}.red-icon{background:#fee2e2;color:#dc2626}.slate-icon{background:#f1f5f9;color:#475569}.kpi-label{font-size:.75rem;font-weight:600;color:#64748b;text-transform:uppercase;letter-spacing:.04em}.kpi-top{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;min-height:36px;margin-bottom:4px}.kpi-ring{flex-shrink:0}.kpi-card.ring-corner .kpi-top{display:contents}.kpi-card.ring-corner .kpi-ring{position:absolute;top:12px;right:12px}.kpi-value{font-size:1.5rem;font-weight:700;color:#111827;line-height:1.1}.kpi-value.green-value{color:#16a34a}.kpi-value.blue-value{color:#3b82f6}.kpi-value.red-value{color:#dc2626}.kpi-subtitle{font-size:.75rem;color:#64748b;margin-top:2px}.kpi-value--loading{display:flex;align-items:center;height:1.65rem}.kpi-bar{display:block;width:60%;max-width:8rem;height:1.1rem;border-radius:6px;background:#e2e8f0;animation:kpi-pulse 1.4s ease-in-out infinite}.kpi-subtitle--loading{align-self:flex-start;max-width:100%;border-radius:4px;background:#e2e8f0;color:transparent;-webkit-user-select:none;user-select:none;animation:kpi-pulse 1.4s ease-in-out infinite}.kpi-loading-text{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@keyframes kpi-pulse{50%{opacity:.55}}@media(prefers-reduced-motion:reduce){.kpi-bar,.kpi-subtitle--loading{animation:none}}\n"],
237
+ styles: [":host{display:block;height:100%}.kpi-card{position:relative;background:#fff;border:1px solid #e2e8f0;border-radius:10px;padding:16px;display:flex;flex-direction:column;gap:4px;min-width:0;height:100%;box-sizing:border-box;transition:border-color .15s ease,box-shadow .15s ease}:host(:focus){outline:none}:host(:focus-visible) .kpi-card{outline:2px solid #3b82f6;outline-offset:2px}.kpi-card.clickable{cursor:pointer}.kpi-card.clickable:hover{border-color:#93c5fd;box-shadow:0 2px 8px #3b82f614}.kpi-card.clickable:hover .kpi-arrow{color:#3b82f6;transform:translateY(-50%) translate(2px)}.kpi-arrow{position:absolute;top:50%;right:16px;transform:translateY(-50%);color:#94a3b8;transition:color .15s ease,transform .15s ease}.kpi-icon{flex-shrink:0;width:36px;height:36px;border-radius:8px;display:flex;align-items:center;justify-content:center;margin-bottom:8px}.green-icon{background:#dcfce7;color:#16a34a}.blue-icon{background:#dbeafe;color:#2563eb}.amber-icon{background:#fef3c7;color:#d97706}.orange-icon{background:#ffedd5;color:#c2410c}.red-icon{background:#fee2e2;color:#dc2626}.slate-icon{background:#f1f5f9;color:#475569}.kpi-label{font-size:.75rem;font-weight:600;color:#64748b;text-transform:uppercase;letter-spacing:.04em}.kpi-top{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;min-height:36px;margin-bottom:4px}.kpi-ring{flex-shrink:0}.kpi-card.ring-corner .kpi-top{display:contents}.kpi-card.ring-corner .kpi-ring{position:absolute;top:12px;right:12px}.kpi-value{font-size:1.5rem;font-weight:700;color:#111827;line-height:1.1}.kpi-value.green-value{color:#16a34a}.kpi-value.blue-value{color:#3b82f6}.kpi-value.red-value{color:#dc2626}.kpi-subtitle{font-size:.75rem;color:#64748b;margin-top:2px}.kpi-value--loading{display:flex;align-items:center;height:1.65rem}.kpi-bar{display:block;width:60%;max-width:8rem;height:1.1rem;border-radius:6px;background:#e2e8f0;animation:kpi-pulse 1.4s ease-in-out infinite}.kpi-subtitle--loading{align-self:flex-start;max-width:100%;border-radius:4px;background:#e2e8f0;color:transparent;-webkit-user-select:none;user-select:none;animation:kpi-pulse 1.4s ease-in-out infinite}.kpi-loading-text{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@keyframes kpi-pulse{50%{opacity:.55}}@media(prefers-reduced-motion:reduce){.kpi-bar,.kpi-subtitle--loading{animation:none}}\n"],
238
238
  dependencies: [{
239
239
  kind: "component",
240
240
  type: ProgressRingComponent,
@@ -310,7 +310,7 @@ i0.ɵɵngDeclareClassMetadata({
310
310
  }
311
311
  </div>
312
312
  `,
313
- styles: [":host{display:block;height:100%}.kpi-card{position:relative;background:#fff;border:1px solid #e2e8f0;border-radius:10px;padding:16px;display:flex;flex-direction:column;gap:4px;min-width:0;height:100%;box-sizing:border-box;transition:border-color .15s ease,box-shadow .15s ease}:host(:focus){outline:none}:host(:focus-visible) .kpi-card{outline:2px solid #3b82f6;outline-offset:2px}.kpi-card.clickable{cursor:pointer}.kpi-card.clickable:hover{border-color:#93c5fd;box-shadow:0 2px 8px #3b82f614}.kpi-card.clickable:hover .kpi-arrow{color:#3b82f6;transform:translate(2px)}.kpi-arrow{position:absolute;bottom:14px;right:14px;color:#94a3b8;transition:color .15s ease,transform .15s ease}.kpi-icon{flex-shrink:0;width:36px;height:36px;border-radius:8px;display:flex;align-items:center;justify-content:center;margin-bottom:8px}.green-icon{background:#dcfce7;color:#16a34a}.blue-icon{background:#dbeafe;color:#2563eb}.amber-icon{background:#fef3c7;color:#d97706}.orange-icon{background:#ffedd5;color:#c2410c}.red-icon{background:#fee2e2;color:#dc2626}.slate-icon{background:#f1f5f9;color:#475569}.kpi-label{font-size:.75rem;font-weight:600;color:#64748b;text-transform:uppercase;letter-spacing:.04em}.kpi-top{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;min-height:36px;margin-bottom:4px}.kpi-ring{flex-shrink:0}.kpi-card.ring-corner .kpi-top{display:contents}.kpi-card.ring-corner .kpi-ring{position:absolute;top:12px;right:12px}.kpi-value{font-size:1.5rem;font-weight:700;color:#111827;line-height:1.1}.kpi-value.green-value{color:#16a34a}.kpi-value.blue-value{color:#3b82f6}.kpi-value.red-value{color:#dc2626}.kpi-subtitle{font-size:.75rem;color:#64748b;margin-top:2px}.kpi-value--loading{display:flex;align-items:center;height:1.65rem}.kpi-bar{display:block;width:60%;max-width:8rem;height:1.1rem;border-radius:6px;background:#e2e8f0;animation:kpi-pulse 1.4s ease-in-out infinite}.kpi-subtitle--loading{align-self:flex-start;max-width:100%;border-radius:4px;background:#e2e8f0;color:transparent;-webkit-user-select:none;user-select:none;animation:kpi-pulse 1.4s ease-in-out infinite}.kpi-loading-text{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@keyframes kpi-pulse{50%{opacity:.55}}@media(prefers-reduced-motion:reduce){.kpi-bar,.kpi-subtitle--loading{animation:none}}\n"]
313
+ styles: [":host{display:block;height:100%}.kpi-card{position:relative;background:#fff;border:1px solid #e2e8f0;border-radius:10px;padding:16px;display:flex;flex-direction:column;gap:4px;min-width:0;height:100%;box-sizing:border-box;transition:border-color .15s ease,box-shadow .15s ease}:host(:focus){outline:none}:host(:focus-visible) .kpi-card{outline:2px solid #3b82f6;outline-offset:2px}.kpi-card.clickable{cursor:pointer}.kpi-card.clickable:hover{border-color:#93c5fd;box-shadow:0 2px 8px #3b82f614}.kpi-card.clickable:hover .kpi-arrow{color:#3b82f6;transform:translateY(-50%) translate(2px)}.kpi-arrow{position:absolute;top:50%;right:16px;transform:translateY(-50%);color:#94a3b8;transition:color .15s ease,transform .15s ease}.kpi-icon{flex-shrink:0;width:36px;height:36px;border-radius:8px;display:flex;align-items:center;justify-content:center;margin-bottom:8px}.green-icon{background:#dcfce7;color:#16a34a}.blue-icon{background:#dbeafe;color:#2563eb}.amber-icon{background:#fef3c7;color:#d97706}.orange-icon{background:#ffedd5;color:#c2410c}.red-icon{background:#fee2e2;color:#dc2626}.slate-icon{background:#f1f5f9;color:#475569}.kpi-label{font-size:.75rem;font-weight:600;color:#64748b;text-transform:uppercase;letter-spacing:.04em}.kpi-top{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;min-height:36px;margin-bottom:4px}.kpi-ring{flex-shrink:0}.kpi-card.ring-corner .kpi-top{display:contents}.kpi-card.ring-corner .kpi-ring{position:absolute;top:12px;right:12px}.kpi-value{font-size:1.5rem;font-weight:700;color:#111827;line-height:1.1}.kpi-value.green-value{color:#16a34a}.kpi-value.blue-value{color:#3b82f6}.kpi-value.red-value{color:#dc2626}.kpi-subtitle{font-size:.75rem;color:#64748b;margin-top:2px}.kpi-value--loading{display:flex;align-items:center;height:1.65rem}.kpi-bar{display:block;width:60%;max-width:8rem;height:1.1rem;border-radius:6px;background:#e2e8f0;animation:kpi-pulse 1.4s ease-in-out infinite}.kpi-subtitle--loading{align-self:flex-start;max-width:100%;border-radius:4px;background:#e2e8f0;color:transparent;-webkit-user-select:none;user-select:none;animation:kpi-pulse 1.4s ease-in-out infinite}.kpi-loading-text{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@keyframes kpi-pulse{50%{opacity:.55}}@media(prefers-reduced-motion:reduce){.kpi-bar,.kpi-subtitle--loading{animation:none}}\n"]
314
314
  }]
315
315
  }],
316
316
  propDecorators: {
@@ -1 +1 @@
1
- {"version":3,"file":"forgeroute-ui-kpi-card.mjs","names":[],"sources":["../../../projects/forgeroute-ui/kpi-card/src/lib/kpi-card/kpi-card.component.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, ElementRef, computed, inject, input } from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { ProgressRingComponent, ProgressRingVariant } from '@forgeroute/ui/progress-ring';\nimport { UiLabelsService } from '@forgeroute/ui/core';\n\nexport type KpiCardColor = 'green' | 'blue' | 'amber' | 'orange' | 'red' | 'slate';\n/** Colour of the big value: `default` (dark slate), `green`, `blue`, or `red` (for figures that need attention: overdue, outstanding, failed). */\nexport type KpiCardValueColor = 'default' | 'green' | 'blue' | 'red';\n\n/**\n * Compact KPI summary card: optional icon, uppercase label, large value, optional subtitle.\n * Set `clickable` to show a hover state + chevron (bind `(click)` on the host). A clickable card is a keyboard button:\n * role=\"button\", focusable (tabindex 0, visible focus ring), and Enter / Space fire the host's (click). Give it an\n * accessible name with [attr.aria-label] when the label alone isn't enough (e.g. \"Net Commission: $12.5K — show details\").\n *\n * Optional background: `background=\"#fef2f2\"` fills the card with any CSS colour (default white), e.g. a soft red for money going out; the\n * text keeps its own colours, so pick a light shade.\n *\n * Optional ring (top-right corner, level with the icon when the card has one — no extra height; beside the label otherwise): `[progress]=\"67\"` (+ `progressMax`, `progressVariant`, `progressSize`) draws a ui-progress-ring beside the label; extra lines\n * (a pace badge, a projection…) go in an element with the `kpi-footer` attribute.\n *\n * <ui-kpi-card label=\"Deals Closed\" [value]=\"'' + deals\" subtitle=\"Year to Date\" icon=\"check-circle\" color=\"blue\" />\n * <ui-kpi-card label=\"Net Commission\" [value]=\"net\" icon=\"dollar\" color=\"green\" [highlight]=\"true\"\n * [clickable]=\"true\" (click)=\"openDetails()\" />\n */\n@Component({\n selector: 'ui-kpi-card',\n standalone: true,\n imports: [ProgressRingComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.role]': 'clickable() ? \"button\" : null',\n '[attr.aria-busy]': 'loading() ? \"true\" : null',\n '[attr.tabindex]': 'clickable() ? 0 : null',\n '(keydown.enter)': 'onActivateKey($event)',\n '(keydown.space)': 'onActivateKey($event)',\n },\n template: `\n <div class=\"kpi-card\" [class.highlight]=\"highlight()\" [class.clickable]=\"clickable()\" [class.ring-corner]=\"hasProgress() && !!iconSvg()\" [style.background]=\"background() || null\">\n @if (iconSvg()) {\n <div [class]=\"'kpi-icon ' + color() + '-icon'\" aria-hidden=\"true\" [innerHTML]=\"iconSvg()\"></div>\n }\n @if (hasProgress()) {\n <div class=\"kpi-top\">\n <span class=\"kpi-label\" data-testid=\"kpi-label\">{{ label() }}</span>\n <ui-progress-ring class=\"kpi-ring\" [attr.aria-hidden]=\"loading() ? 'true' : null\" [value]=\"progress()!\" [max]=\"progressMax()\" [size]=\"progressSize()\" [strokeWidth]=\"progressStrokeWidth()\"\n [variant]=\"progressVariant()\" [ariaLabel]=\"progressAriaLabel() || labels.t('kpiCard.progress', { label: label() })\" [valueText]=\"progressValueText()\" />\n </div>\n } @else {\n <span class=\"kpi-label\" data-testid=\"kpi-label\">{{ label() }}</span>\n }\n @if (loading()) {\n <span class=\"kpi-value kpi-value--loading\" aria-hidden=\"true\" data-testid=\"kpi-value-placeholder\"><span class=\"kpi-bar\"></span></span>\n <span class=\"kpi-loading-text\">{{ loadingLabel() }}</span>\n @if (subtitle()) {\n <span class=\"kpi-subtitle kpi-subtitle--loading\" aria-hidden=\"true\" data-testid=\"kpi-subtitle-placeholder\">{{ subtitle() }}</span>\n }\n } @else {\n <span class=\"kpi-value\" data-testid=\"kpi-value\"\n [class.green-value]=\"highlight() || valueColor() === 'green'\"\n [class.blue-value]=\"valueColor() === 'blue'\"\n [class.red-value]=\"valueColor() === 'red'\">{{ value() }}</span>\n @if (subtitle()) {\n <span class=\"kpi-subtitle\">{{ subtitle() }}</span>\n }\n }\n <ng-content select=\"[kpi-footer]\" />\n @if (clickable()) {\n <svg class=\"kpi-arrow\" width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><polyline points=\"9 18 15 12 9 6\"/></svg>\n }\n </div>\n `,\n styles: [`\n :host { display: block; height: 100%; }\n .kpi-card {\n position: relative;\n background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;\n padding: 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0;\n height: 100%; box-sizing: border-box;\n transition: border-color 150ms ease, box-shadow 150ms ease;\n }\n :host(:focus) { outline: none; }\n :host(:focus-visible) .kpi-card { outline: 2px solid #3b82f6; outline-offset: 2px; }\n .kpi-card.clickable { cursor: pointer; }\n .kpi-card.clickable:hover { border-color: #93c5fd; box-shadow: 0 2px 8px rgba(59,130,246,0.08); }\n .kpi-card.clickable:hover .kpi-arrow { color: #3b82f6; transform: translateX(2px); }\n .kpi-arrow {\n position: absolute; bottom: 14px; right: 14px;\n color: #94a3b8; transition: color 150ms ease, transform 150ms ease;\n }\n .kpi-icon {\n flex-shrink: 0; width: 36px; height: 36px; border-radius: 8px;\n display: flex; align-items: center; justify-content: center;\n margin-bottom: 8px;\n }\n .green-icon { background: #dcfce7; color: #16a34a; }\n .blue-icon { background: #dbeafe; color: #2563eb; }\n .amber-icon { background: #fef3c7; color: #d97706; }\n .orange-icon { background: #ffedd5; color: #c2410c; }\n .red-icon { background: #fee2e2; color: #dc2626; }\n .slate-icon { background: #f1f5f9; color: #475569; }\n .kpi-label {\n font-size: 0.75rem; font-weight: 600; color: #64748b;\n text-transform: uppercase; letter-spacing: 0.04em;\n }\n .kpi-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; min-height: 36px; margin-bottom: 4px; }\n .kpi-ring { flex-shrink: 0; }\n /* Icon + ring: the ring sits in the card's top-right corner, level with the icon, so the ring adds no height (the label row is just the label). */\n .kpi-card.ring-corner .kpi-top { display: contents; }\n .kpi-card.ring-corner .kpi-ring { position: absolute; top: 12px; right: 12px; }\n .kpi-value { font-size: 1.5rem; font-weight: 700; color: #111827; line-height: 1.1; }\n .kpi-value.green-value { color: #16a34a; }\n .kpi-value.blue-value { color: #3b82f6; }\n .kpi-value.red-value { color: #dc2626; }\n .kpi-subtitle { font-size: 0.75rem; color: #64748b; margin-top: 2px; } /* slate-500: AA contrast on white */\n /* loading: the value / subtitle are replaced by grey placeholders of the SAME box (value line = 1.5rem x 1.1 line-height; the subtitle\n placeholder is the subtitle's own text made transparent), so the card keeps its size while loading. */\n .kpi-value--loading { display: flex; align-items: center; height: 1.65rem; }\n .kpi-bar { display: block; width: 60%; max-width: 8rem; height: 1.1rem; border-radius: 6px; background: #e2e8f0; animation: kpi-pulse 1.4s ease-in-out infinite; }\n .kpi-subtitle--loading {\n align-self: flex-start; max-width: 100%; border-radius: 4px; background: #e2e8f0; color: transparent;\n -webkit-user-select: none; user-select: none; animation: kpi-pulse 1.4s ease-in-out infinite;\n }\n /* \"Loading\" for assistive tech, visually hidden (the placeholders above are aria-hidden). */\n .kpi-loading-text { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }\n @keyframes kpi-pulse { 50% { opacity: 0.55; } }\n @media (prefers-reduced-motion: reduce) {\n .kpi-bar, .kpi-subtitle--loading { animation: none; }\n }\n `],\n})\nexport class KpiCardComponent {\n protected readonly labels = inject(UiLabelsService);\n private readonly sanitizer = inject(DomSanitizer);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n readonly label = input('');\n readonly value = input('');\n readonly subtitle = input('');\n /** Built-in icon name (see KPI_ICONS keys), e.g. 'dollar', 'users', 'check-circle'. */\n readonly icon = input('');\n readonly color = input<KpiCardColor>('slate');\n readonly highlight = input(false);\n readonly clickable = input(false);\n readonly valueColor = input<KpiCardValueColor>('default');\n /**\n * (library source 2026-11-04, not yet published) While true the value (and the subtitle, when one is set) are replaced by grey\n * placeholders and the card is `aria-busy=\"true\"`; assistive tech reads the label followed by the `loadingLabel` text\n * (visually hidden), never the stale value or subtitle. The card keeps its size: the value placeholder has the value line's box and the\n * subtitle placeholder is the subtitle's own (transparent) text, so pass the subtitle you will show while loading to keep the height\n * identical. The progress ring (when there is one) stays visible but is hidden from assistive tech (`aria-hidden=\"true\"` on it) while loading, since its\n * value belongs to the data that is being replaced. Default false = unchanged. Everything else (icon, ring, `kpi-footer` slot, `clickable`, colours) is unaffected.\n */\n readonly loading = input(false);\n /** What assistive tech hears instead of the value while `loading` (default 'Loading'). */\n readonly loadingLabelInput = input<string | null>(null, { alias: 'loadingLabel' });\n readonly loadingLabel = computed(() => this.loadingLabelInput() ?? this.labels.t('kpiCard.loadingLabel'));\n /** Card background as any CSS colour (`#fef2f2`, `var(--surface)` …). Empty (default) = white. The text colours do not change, so use a light shade. */\n readonly background = input('');\n\n // ── Optional progress ring (top right, next to the label) — omit `progress` and the card is unchanged ──\n /** Completed amount shown as a `ui-progress-ring` beside the label. `null` (default) = no ring. */\n readonly progress = input<number | null>(null);\n /** Total for `progress` (default 100, so `progress` is a percentage). */\n readonly progressMax = input(100);\n /** Ring diameter in px. */\n readonly progressSize = input(58);\n readonly progressStrokeWidth = input(5);\n /** Fixed ring color; leave it out and the color follows completion (red / amber / blue / green). */\n readonly progressVariant = input<ProgressRingVariant | null | undefined>(null);\n /** Accessible name of the ring; default \"<label> progress\". */\n readonly progressAriaLabel = input('');\n /** Human reading of the ring for assistive tech, e.g. \"$200K of $300K\". */\n readonly progressValueText = input('');\n protected readonly hasProgress = computed(() => this.progress() !== null && this.progress() !== undefined);\n\n /** Enter / Space on a clickable card act like a click (Space would otherwise scroll the page). */\n protected onActivateKey(event: Event) {\n if (!this.clickable()) return;\n event.preventDefault();\n this.host.nativeElement.click();\n }\n\n protected readonly iconSvg = computed((): SafeHtml | null => {\n const svg = KPI_ICONS[this.icon()];\n return svg ? this.sanitizer.bypassSecurityTrustHtml(svg) : null;\n });\n}\n\n// Static, library-owned SVG markup only — never user input.\nconst KPI_ICONS: Record<string, string> = {\n 'shield-check': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z\"/><path d=\"m9 12 2 2 4-4\"/></svg>',\n 'clock': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\"/><polyline points=\"12 6 12 12 16 14\"/></svg>',\n 'alert-circle': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\"/><line x1=\"12\" y1=\"8\" x2=\"12\" y2=\"12\"/><line x1=\"12\" y1=\"16\" x2=\"12.01\" y2=\"16\"/></svg>',\n 'alert-triangle': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z\"/><line x1=\"12\" y1=\"9\" x2=\"12\" y2=\"13\"/><line x1=\"12\" y1=\"17\" x2=\"12.01\" y2=\"17\"/></svg>',\n 'check-circle': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M22 11.08V12a10 10 0 1 1-5.93-9.14\"/><polyline points=\"22 4 12 14.01 9 11.01\"/></svg>',\n 'users': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2\"/><circle cx=\"9\" cy=\"7\" r=\"4\"/><path d=\"M23 21v-2a4 4 0 0 0-3-3.87\"/><path d=\"M16 3.13a4 4 0 0 1 0 7.75\"/></svg>',\n 'user': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2\"/><circle cx=\"12\" cy=\"7\" r=\"4\"/></svg>',\n 'send': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><line x1=\"22\" y1=\"2\" x2=\"11\" y2=\"13\"/><polygon points=\"22 2 15 22 11 13 2 9 22 2\"/></svg>',\n 'inbox': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polyline points=\"22 12 16 12 14 15 10 15 8 12 2 12\"/><path d=\"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z\"/></svg>',\n 'mail': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect x=\"2\" y=\"4\" width=\"20\" height=\"16\" rx=\"2\"/><path d=\"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7\"/></svg>',\n 'message': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z\"/></svg>',\n 'play': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polygon points=\"5 3 19 12 5 21 5 3\"/></svg>',\n 'eye': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z\"/><circle cx=\"12\" cy=\"12\" r=\"3\"/></svg>',\n 'percent': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><line x1=\"19\" y1=\"5\" x2=\"5\" y2=\"19\"/><circle cx=\"6.5\" cy=\"6.5\" r=\"2.5\"/><circle cx=\"17.5\" cy=\"17.5\" r=\"2.5\"/></svg>',\n 'dollar': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><line x1=\"12\" y1=\"1\" x2=\"12\" y2=\"23\"/><path d=\"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6\"/></svg>',\n 'phone': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z\"/></svg>',\n 'file': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z\"/><polyline points=\"14 2 14 8 20 8\"/><line x1=\"16\" y1=\"13\" x2=\"8\" y2=\"13\"/><line x1=\"16\" y1=\"17\" x2=\"8\" y2=\"17\"/></svg>',\n 'target': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\"/><circle cx=\"12\" cy=\"12\" r=\"6\"/><circle cx=\"12\" cy=\"12\" r=\"2\"/></svg>',\n 'trending-up': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polyline points=\"23 6 13.5 15.5 8.5 10.5 1 18\"/><polyline points=\"17 6 23 6 23 12\"/></svg>',\n 'x-circle': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\"/><line x1=\"15\" y1=\"9\" x2=\"9\" y2=\"15\"/><line x1=\"9\" y1=\"9\" x2=\"15\" y2=\"15\"/></svg>',\n 'video': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect x=\"2\" y=\"5\" width=\"14\" height=\"14\" rx=\"2\"/><path d=\"m16 10 6-3.5v11L16 14\"/></svg>',\n 'calendar': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect x=\"3\" y=\"4\" width=\"18\" height=\"18\" rx=\"2\"/><line x1=\"16\" y1=\"2\" x2=\"16\" y2=\"6\"/><line x1=\"8\" y1=\"2\" x2=\"8\" y2=\"6\"/><line x1=\"3\" y1=\"10\" x2=\"21\" y2=\"10\"/></svg>',\n 'activity': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polyline points=\"22 12 18 12 15 21 9 3 6 12 2 12\"/></svg>',\n};\n"],"mappings":";;;;;AAmIA,IAAa,mBAAb,MAAa,iBAAgB;CA1G7B,cAAA;EA2GqB,KAAA,SAAS,OAAO,eAAe;EACjC,KAAA,YAAY,OAAO,YAAY;EAC/B,KAAA,OAAY,OAAgC,UAAU;EAE9D,KAAA,QAAa,MAAM,IAAG,GA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MAAM,YAAoC;CACxC,gBAAgB;CAChB,SAAS;CACT,gBAAgB;CAChB,kBAAkB;CAClB,gBAAgB;CAChB,SAAS;CACT,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,WAAW;CACX,QAAQ;CACR,OAAO;CACP,WAAW;CACX,UAAU;CACV,SAAS;CACT,QAAQ;CACR,UAAU;CACV,eAAe;CACf,YAAY;CACZ,SAAS;CACT,YAAY;CACZ,YAAY;AACb"}
1
+ {"version":3,"file":"forgeroute-ui-kpi-card.mjs","names":[],"sources":["../../../projects/forgeroute-ui/kpi-card/src/lib/kpi-card/kpi-card.component.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, ElementRef, computed, inject, input } from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { ProgressRingComponent, ProgressRingVariant } from '@forgeroute/ui/progress-ring';\nimport { UiLabelsService } from '@forgeroute/ui/core';\n\nexport type KpiCardColor = 'green' | 'blue' | 'amber' | 'orange' | 'red' | 'slate';\n/** Colour of the big value: `default` (dark slate), `green`, `blue`, or `red` (for figures that need attention: overdue, outstanding, failed). */\nexport type KpiCardValueColor = 'default' | 'green' | 'blue' | 'red';\n\n/**\n * Compact KPI summary card: optional icon, uppercase label, large value, optional subtitle.\n * Set `clickable` to show a hover state + chevron (bind `(click)` on the host). A clickable card is a keyboard button:\n * role=\"button\", focusable (tabindex 0, visible focus ring), and Enter / Space fire the host's (click). Give it an\n * accessible name with [attr.aria-label] when the label alone isn't enough (e.g. \"Net Commission: $12.5K — show details\").\n *\n * Optional background: `background=\"#fef2f2\"` fills the card with any CSS colour (default white), e.g. a soft red for money going out; the\n * text keeps its own colours, so pick a light shade.\n *\n * Optional ring (top-right corner, level with the icon when the card has one — no extra height; beside the label otherwise): `[progress]=\"67\"` (+ `progressMax`, `progressVariant`, `progressSize`) draws a ui-progress-ring beside the label; extra lines\n * (a pace badge, a projection…) go in an element with the `kpi-footer` attribute.\n *\n * <ui-kpi-card label=\"Deals Closed\" [value]=\"'' + deals\" subtitle=\"Year to Date\" icon=\"check-circle\" color=\"blue\" />\n * <ui-kpi-card label=\"Net Commission\" [value]=\"net\" icon=\"dollar\" color=\"green\" [highlight]=\"true\"\n * [clickable]=\"true\" (click)=\"openDetails()\" />\n */\n@Component({\n selector: 'ui-kpi-card',\n standalone: true,\n imports: [ProgressRingComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.role]': 'clickable() ? \"button\" : null',\n '[attr.aria-busy]': 'loading() ? \"true\" : null',\n '[attr.tabindex]': 'clickable() ? 0 : null',\n '(keydown.enter)': 'onActivateKey($event)',\n '(keydown.space)': 'onActivateKey($event)',\n },\n template: `\n <div class=\"kpi-card\" [class.highlight]=\"highlight()\" [class.clickable]=\"clickable()\" [class.ring-corner]=\"hasProgress() && !!iconSvg()\" [style.background]=\"background() || null\">\n @if (iconSvg()) {\n <div [class]=\"'kpi-icon ' + color() + '-icon'\" aria-hidden=\"true\" [innerHTML]=\"iconSvg()\"></div>\n }\n @if (hasProgress()) {\n <div class=\"kpi-top\">\n <span class=\"kpi-label\" data-testid=\"kpi-label\">{{ label() }}</span>\n <ui-progress-ring class=\"kpi-ring\" [attr.aria-hidden]=\"loading() ? 'true' : null\" [value]=\"progress()!\" [max]=\"progressMax()\" [size]=\"progressSize()\" [strokeWidth]=\"progressStrokeWidth()\"\n [variant]=\"progressVariant()\" [ariaLabel]=\"progressAriaLabel() || labels.t('kpiCard.progress', { label: label() })\" [valueText]=\"progressValueText()\" />\n </div>\n } @else {\n <span class=\"kpi-label\" data-testid=\"kpi-label\">{{ label() }}</span>\n }\n @if (loading()) {\n <span class=\"kpi-value kpi-value--loading\" aria-hidden=\"true\" data-testid=\"kpi-value-placeholder\"><span class=\"kpi-bar\"></span></span>\n <span class=\"kpi-loading-text\">{{ loadingLabel() }}</span>\n @if (subtitle()) {\n <span class=\"kpi-subtitle kpi-subtitle--loading\" aria-hidden=\"true\" data-testid=\"kpi-subtitle-placeholder\">{{ subtitle() }}</span>\n }\n } @else {\n <span class=\"kpi-value\" data-testid=\"kpi-value\"\n [class.green-value]=\"highlight() || valueColor() === 'green'\"\n [class.blue-value]=\"valueColor() === 'blue'\"\n [class.red-value]=\"valueColor() === 'red'\">{{ value() }}</span>\n @if (subtitle()) {\n <span class=\"kpi-subtitle\">{{ subtitle() }}</span>\n }\n }\n <ng-content select=\"[kpi-footer]\" />\n @if (clickable()) {\n <svg class=\"kpi-arrow\" width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><polyline points=\"9 18 15 12 9 6\"/></svg>\n }\n </div>\n `,\n styles: [`\n :host { display: block; height: 100%; }\n .kpi-card {\n position: relative;\n background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;\n padding: 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0;\n height: 100%; box-sizing: border-box;\n transition: border-color 150ms ease, box-shadow 150ms ease;\n }\n :host(:focus) { outline: none; }\n :host(:focus-visible) .kpi-card { outline: 2px solid #3b82f6; outline-offset: 2px; }\n .kpi-card.clickable { cursor: pointer; }\n .kpi-card.clickable:hover { border-color: #93c5fd; box-shadow: 0 2px 8px rgba(59,130,246,0.08); }\n .kpi-card.clickable:hover .kpi-arrow { color: #3b82f6; transform: translateY(-50%) translateX(2px); }\n .kpi-arrow {\n position: absolute; top: 50%; right: 16px; transform: translateY(-50%);\n color: #94a3b8; transition: color 150ms ease, transform 150ms ease;\n }\n .kpi-icon {\n flex-shrink: 0; width: 36px; height: 36px; border-radius: 8px;\n display: flex; align-items: center; justify-content: center;\n margin-bottom: 8px;\n }\n .green-icon { background: #dcfce7; color: #16a34a; }\n .blue-icon { background: #dbeafe; color: #2563eb; }\n .amber-icon { background: #fef3c7; color: #d97706; }\n .orange-icon { background: #ffedd5; color: #c2410c; }\n .red-icon { background: #fee2e2; color: #dc2626; }\n .slate-icon { background: #f1f5f9; color: #475569; }\n .kpi-label {\n font-size: 0.75rem; font-weight: 600; color: #64748b;\n text-transform: uppercase; letter-spacing: 0.04em;\n }\n .kpi-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; min-height: 36px; margin-bottom: 4px; }\n .kpi-ring { flex-shrink: 0; }\n /* Icon + ring: the ring sits in the card's top-right corner, level with the icon, so the ring adds no height (the label row is just the label). */\n .kpi-card.ring-corner .kpi-top { display: contents; }\n .kpi-card.ring-corner .kpi-ring { position: absolute; top: 12px; right: 12px; }\n .kpi-value { font-size: 1.5rem; font-weight: 700; color: #111827; line-height: 1.1; }\n .kpi-value.green-value { color: #16a34a; }\n .kpi-value.blue-value { color: #3b82f6; }\n .kpi-value.red-value { color: #dc2626; }\n .kpi-subtitle { font-size: 0.75rem; color: #64748b; margin-top: 2px; } /* slate-500: AA contrast on white */\n /* loading: the value / subtitle are replaced by grey placeholders of the SAME box (value line = 1.5rem x 1.1 line-height; the subtitle\n placeholder is the subtitle's own text made transparent), so the card keeps its size while loading. */\n .kpi-value--loading { display: flex; align-items: center; height: 1.65rem; }\n .kpi-bar { display: block; width: 60%; max-width: 8rem; height: 1.1rem; border-radius: 6px; background: #e2e8f0; animation: kpi-pulse 1.4s ease-in-out infinite; }\n .kpi-subtitle--loading {\n align-self: flex-start; max-width: 100%; border-radius: 4px; background: #e2e8f0; color: transparent;\n -webkit-user-select: none; user-select: none; animation: kpi-pulse 1.4s ease-in-out infinite;\n }\n /* \"Loading\" for assistive tech, visually hidden (the placeholders above are aria-hidden). */\n .kpi-loading-text { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }\n @keyframes kpi-pulse { 50% { opacity: 0.55; } }\n @media (prefers-reduced-motion: reduce) {\n .kpi-bar, .kpi-subtitle--loading { animation: none; }\n }\n `],\n})\nexport class KpiCardComponent {\n protected readonly labels = inject(UiLabelsService);\n private readonly sanitizer = inject(DomSanitizer);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n readonly label = input('');\n readonly value = input('');\n readonly subtitle = input('');\n /** Built-in icon name (see KPI_ICONS keys), e.g. 'dollar', 'users', 'check-circle'. */\n readonly icon = input('');\n readonly color = input<KpiCardColor>('slate');\n readonly highlight = input(false);\n readonly clickable = input(false);\n readonly valueColor = input<KpiCardValueColor>('default');\n /**\n * (library source 2026-11-04, not yet published) While true the value (and the subtitle, when one is set) are replaced by grey\n * placeholders and the card is `aria-busy=\"true\"`; assistive tech reads the label followed by the `loadingLabel` text\n * (visually hidden), never the stale value or subtitle. The card keeps its size: the value placeholder has the value line's box and the\n * subtitle placeholder is the subtitle's own (transparent) text, so pass the subtitle you will show while loading to keep the height\n * identical. The progress ring (when there is one) stays visible but is hidden from assistive tech (`aria-hidden=\"true\"` on it) while loading, since its\n * value belongs to the data that is being replaced. Default false = unchanged. Everything else (icon, ring, `kpi-footer` slot, `clickable`, colours) is unaffected.\n */\n readonly loading = input(false);\n /** What assistive tech hears instead of the value while `loading` (default 'Loading'). */\n readonly loadingLabelInput = input<string | null>(null, { alias: 'loadingLabel' });\n readonly loadingLabel = computed(() => this.loadingLabelInput() ?? this.labels.t('kpiCard.loadingLabel'));\n /** Card background as any CSS colour (`#fef2f2`, `var(--surface)` …). Empty (default) = white. The text colours do not change, so use a light shade. */\n readonly background = input('');\n\n // ── Optional progress ring (top right, next to the label) — omit `progress` and the card is unchanged ──\n /** Completed amount shown as a `ui-progress-ring` beside the label. `null` (default) = no ring. */\n readonly progress = input<number | null>(null);\n /** Total for `progress` (default 100, so `progress` is a percentage). */\n readonly progressMax = input(100);\n /** Ring diameter in px. */\n readonly progressSize = input(58);\n readonly progressStrokeWidth = input(5);\n /** Fixed ring color; leave it out and the color follows completion (red / amber / blue / green). */\n readonly progressVariant = input<ProgressRingVariant | null | undefined>(null);\n /** Accessible name of the ring; default \"<label> progress\". */\n readonly progressAriaLabel = input('');\n /** Human reading of the ring for assistive tech, e.g. \"$200K of $300K\". */\n readonly progressValueText = input('');\n protected readonly hasProgress = computed(() => this.progress() !== null && this.progress() !== undefined);\n\n /** Enter / Space on a clickable card act like a click (Space would otherwise scroll the page). */\n protected onActivateKey(event: Event) {\n if (!this.clickable()) return;\n event.preventDefault();\n this.host.nativeElement.click();\n }\n\n protected readonly iconSvg = computed((): SafeHtml | null => {\n const svg = KPI_ICONS[this.icon()];\n return svg ? this.sanitizer.bypassSecurityTrustHtml(svg) : null;\n });\n}\n\n// Static, library-owned SVG markup only — never user input.\nconst KPI_ICONS: Record<string, string> = {\n 'shield-check': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z\"/><path d=\"m9 12 2 2 4-4\"/></svg>',\n 'clock': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\"/><polyline points=\"12 6 12 12 16 14\"/></svg>',\n 'alert-circle': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\"/><line x1=\"12\" y1=\"8\" x2=\"12\" y2=\"12\"/><line x1=\"12\" y1=\"16\" x2=\"12.01\" y2=\"16\"/></svg>',\n 'alert-triangle': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z\"/><line x1=\"12\" y1=\"9\" x2=\"12\" y2=\"13\"/><line x1=\"12\" y1=\"17\" x2=\"12.01\" y2=\"17\"/></svg>',\n 'check-circle': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M22 11.08V12a10 10 0 1 1-5.93-9.14\"/><polyline points=\"22 4 12 14.01 9 11.01\"/></svg>',\n 'users': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2\"/><circle cx=\"9\" cy=\"7\" r=\"4\"/><path d=\"M23 21v-2a4 4 0 0 0-3-3.87\"/><path d=\"M16 3.13a4 4 0 0 1 0 7.75\"/></svg>',\n 'user': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2\"/><circle cx=\"12\" cy=\"7\" r=\"4\"/></svg>',\n 'send': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><line x1=\"22\" y1=\"2\" x2=\"11\" y2=\"13\"/><polygon points=\"22 2 15 22 11 13 2 9 22 2\"/></svg>',\n 'inbox': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polyline points=\"22 12 16 12 14 15 10 15 8 12 2 12\"/><path d=\"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z\"/></svg>',\n 'mail': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect x=\"2\" y=\"4\" width=\"20\" height=\"16\" rx=\"2\"/><path d=\"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7\"/></svg>',\n 'message': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z\"/></svg>',\n 'play': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polygon points=\"5 3 19 12 5 21 5 3\"/></svg>',\n 'eye': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z\"/><circle cx=\"12\" cy=\"12\" r=\"3\"/></svg>',\n 'percent': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><line x1=\"19\" y1=\"5\" x2=\"5\" y2=\"19\"/><circle cx=\"6.5\" cy=\"6.5\" r=\"2.5\"/><circle cx=\"17.5\" cy=\"17.5\" r=\"2.5\"/></svg>',\n 'dollar': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><line x1=\"12\" y1=\"1\" x2=\"12\" y2=\"23\"/><path d=\"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6\"/></svg>',\n 'phone': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z\"/></svg>',\n 'file': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z\"/><polyline points=\"14 2 14 8 20 8\"/><line x1=\"16\" y1=\"13\" x2=\"8\" y2=\"13\"/><line x1=\"16\" y1=\"17\" x2=\"8\" y2=\"17\"/></svg>',\n 'target': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\"/><circle cx=\"12\" cy=\"12\" r=\"6\"/><circle cx=\"12\" cy=\"12\" r=\"2\"/></svg>',\n 'trending-up': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polyline points=\"23 6 13.5 15.5 8.5 10.5 1 18\"/><polyline points=\"17 6 23 6 23 12\"/></svg>',\n 'x-circle': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\"/><line x1=\"15\" y1=\"9\" x2=\"9\" y2=\"15\"/><line x1=\"9\" y1=\"9\" x2=\"15\" y2=\"15\"/></svg>',\n 'video': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect x=\"2\" y=\"5\" width=\"14\" height=\"14\" rx=\"2\"/><path d=\"m16 10 6-3.5v11L16 14\"/></svg>',\n 'calendar': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect x=\"3\" y=\"4\" width=\"18\" height=\"18\" rx=\"2\"/><line x1=\"16\" y1=\"2\" x2=\"16\" y2=\"6\"/><line x1=\"8\" y1=\"2\" x2=\"8\" y2=\"6\"/><line x1=\"3\" y1=\"10\" x2=\"21\" y2=\"10\"/></svg>',\n 'activity': '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polyline points=\"22 12 18 12 15 21 9 3 6 12 2 12\"/></svg>',\n};\n"],"mappings":";;;;;AAmIA,IAAa,mBAAb,MAAa,iBAAgB;CA1G7B,cAAA;EA2GqB,KAAA,SAAS,OAAO,eAAe;EACjC,KAAA,YAAY,OAAO,YAAY;EAC/B,KAAA,OAAY,OAAgC,UAAU;EAE9D,KAAA,QAAa,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA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ChB,SAAS;CACT,gBAAgB;CAChB,kBAAkB;CAClB,gBAAgB;CAChB,SAAS;CACT,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,WAAW;CACX,QAAQ;CACR,OAAO;CACP,WAAW;CACX,UAAU;CACV,SAAS;CACT,QAAQ;CACR,UAAU;CACV,eAAe;CACf,YAAY;CACZ,SAAS;CACT,YAAY;CACZ,YAAY;AACb"}
@@ -9,7 +9,7 @@ import { EmptyStateComponent } from "@forgeroute/ui/empty-state";
9
9
  import { PaginationComponent } from "@forgeroute/ui/pagination";
10
10
  import { AvatarComponent } from "@forgeroute/ui/avatar";
11
11
  import { TextareaInputComponent } from "@forgeroute/ui/textarea-input";
12
- import { IconComponent } from "@forgeroute/ui/icon";
12
+ import { TooltipDirective } from "@forgeroute/ui/tooltip";
13
13
  import { LiveRegionComponent } from "@forgeroute/ui/live-region";
14
14
  const NOTES_MAX_LENGTH = 1e4;
15
15
  const STATE_RANK = {
@@ -402,9 +402,13 @@ var NotesComponent = class NotesComponent {
402
402
  @if (!readOnly() && editingId() !== note.id && !note.queued) {
403
403
  <div class="note-actions">
404
404
  @if (editable()) {
405
- <ui-icon name="edit" [size]="14" [tooltip]="labels.t('notes.editNote')" (iconClick)="startEdit(note)" />
405
+ <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)">
406
+ <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>
407
+ </button>
406
408
  }
407
- <ui-icon name="delete" variant="danger" [size]="14" [tooltip]="labels.t('notes.deleteNote')" (iconClick)="confirmDelete(note.id)" />
409
+ <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)">
410
+ <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>
411
+ </button>
408
412
  </div>
409
413
  }
410
414
  </div>
@@ -431,7 +435,7 @@ var NotesComponent = class NotesComponent {
431
435
  </ui-modal>
432
436
  `,
433
437
  isInline: true,
434
- styles: [":host{display:block}.note-add{padding:14px;margin-bottom:18px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:12px}.note-add-footer{display:flex;justify-content:flex-end;margin-top:10px}.note-offline-hint{margin:0 0 12px;font-size:.875rem;color:#475569}.note-loading{padding:24px 0;font-size:.875rem;color:#64748b;text-align:center}.note-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}.note-item{display:flex;gap:12px;padding:14px;background:#fff;border:1px solid #e2e8f0;border-radius:12px;transition:border-color .15s,box-shadow .15s}@media(hover:hover){.note-item:hover{border-color:#cbd5e1;box-shadow:0 1px 3px #0f172a0f}}.note-item.editing{background:#f8fafc;border-color:#bfdbfe}@media(prefers-reduced-motion:reduce){.note-item{transition:none}}.note-avatar{flex-shrink:0}.note-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:6px}.note-head{display:flex;align-items:center;flex-wrap:wrap;gap:2px 6px;min-height:28px}.note-author{font-size:.875rem;font-weight:600;color:#0f172a}.note-dot{color:#94a3b8;font-size:.75rem}.note-date{font-size:.75rem;color:#64748b}.note-edited{font-size:.75rem;font-style:italic;color:#64748b}.note-queued{font-size:.75rem;font-weight:500;color:#475569;background:#f1f5f9;border:1px dashed #94a3b8;border-radius:999px;padding:1px 8px}.note-queued-bad{color:#991b1b;background:#fef2f2;border:1px solid #b91c1c;font-weight:700}.note-actions{display:flex;align-items:center;gap:2px;margin-left:auto}.note-body{margin:0;font-size:.9375rem;line-height:1.6;color:#1e293b;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word}.note-item-footer{display:flex;justify-content:flex-end;gap:8px;margin-top:4px}.note-delete-msg{margin:0;font-size:.9375rem;line-height:1.5;color:#334155}@media(max-width:480px){.note-item{padding:12px;gap:10px}.note-add{padding:12px}}\n"],
438
+ styles: [":host{display:block}.note-add{padding:14px;margin-bottom:18px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:12px}.note-add-footer{display:flex;justify-content:flex-end;margin-top:10px}.note-offline-hint{margin:0 0 12px;font-size:.875rem;color:#475569}.note-loading{padding:24px 0;font-size:.875rem;color:#64748b;text-align:center}.note-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}.note-item{display:flex;gap:12px;padding:14px;background:#fff;border:1px solid #e2e8f0;border-radius:12px;transition:border-color .15s,box-shadow .15s}@media(hover:hover){.note-item:hover{border-color:#cbd5e1;box-shadow:0 1px 3px #0f172a0f}}.note-item.editing{background:#f8fafc;border-color:#bfdbfe}@media(prefers-reduced-motion:reduce){.note-item{transition:none}}.note-avatar{flex-shrink:0}.note-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:6px}.note-head{display:flex;align-items:center;flex-wrap:wrap;gap:2px 6px;min-height:28px}.note-author{font-size:.875rem;font-weight:600;color:#0f172a}.note-dot{color:#94a3b8;font-size:.75rem}.note-date{font-size:.75rem;color:#64748b}.note-edited{font-size:.75rem;font-style:italic;color:#64748b}.note-queued{font-size:.75rem;font-weight:500;color:#475569;background:#f1f5f9;border:1px dashed #94a3b8;border-radius:999px;padding:1px 8px}.note-queued-bad{color:#991b1b;background:#fef2f2;border:1px solid #b91c1c;font-weight:700}.note-actions{display:flex;align-items:center;gap:6px;margin-left:auto}.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 .15s,color .15s,border-color .15s}.note-icon-btn:after{content:\"\";position:absolute;top:50%;left:50%;width:44px;height:44px;transform:translate(-50%,-50%)}.note-icon-btn--edit{color:#64748b;border:1px solid #e2e8f0}.note-icon-btn--edit:hover{background:#f1f5f9;color:#1e293b}.note-icon-btn--delete{color:#b91c1c;border:1px solid #fecaca}.note-icon-btn--delete:hover{background:#fef2f2;border-color:#fca5a5;color:#991b1b}.note-icon-btn:focus-visible{outline:2px solid #2563eb;outline-offset:2px}.note-body{margin:0;font-size:.9375rem;line-height:1.6;color:#1e293b;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word}.note-item-footer{display:flex;justify-content:flex-end;gap:8px;margin-top:4px}.note-delete-msg{margin:0;font-size:.9375rem;line-height:1.5;color:#334155}@media(max-width:480px){.note-item{padding:12px;gap:10px}.note-add{padding:12px}}\n"],
435
439
  dependencies: [
436
440
  {
437
441
  kind: "ngmodule",
@@ -565,20 +569,10 @@ var NotesComponent = class NotesComponent {
565
569
  ]
566
570
  },
567
571
  {
568
- kind: "component",
569
- type: IconComponent,
570
- selector: "ui-icon",
571
- inputs: [
572
- "name",
573
- "tooltip",
574
- "ariaLabel",
575
- "size",
576
- "variant",
577
- "disabled",
578
- "loading",
579
- "interactive"
580
- ],
581
- outputs: ["iconClick"]
572
+ kind: "directive",
573
+ type: TooltipDirective,
574
+ selector: "[uiTooltip]",
575
+ inputs: ["uiTooltip", "tooltipPosition"]
582
576
  },
583
577
  {
584
578
  kind: "component",
@@ -629,7 +623,7 @@ i0.ɵɵngDeclareClassMetadata({
629
623
  EmptyStateComponent,
630
624
  PaginationComponent,
631
625
  TextareaInputComponent,
632
- IconComponent,
626
+ TooltipDirective,
633
627
  AvatarComponent,
634
628
  LiveRegionComponent
635
629
  ],
@@ -677,9 +671,13 @@ i0.ɵɵngDeclareClassMetadata({
677
671
  @if (!readOnly() && editingId() !== note.id && !note.queued) {
678
672
  <div class="note-actions">
679
673
  @if (editable()) {
680
- <ui-icon name="edit" [size]="14" [tooltip]="labels.t('notes.editNote')" (iconClick)="startEdit(note)" />
674
+ <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)">
675
+ <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>
676
+ </button>
681
677
  }
682
- <ui-icon name="delete" variant="danger" [size]="14" [tooltip]="labels.t('notes.deleteNote')" (iconClick)="confirmDelete(note.id)" />
678
+ <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)">
679
+ <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>
680
+ </button>
683
681
  </div>
684
682
  }
685
683
  </div>
@@ -705,7 +703,7 @@ i0.ɵɵngDeclareClassMetadata({
705
703
  <ui-button modal-footer-right variant="danger" size="sm" data-testid="delete-note-confirm" [loading]="saving()" (click)="deleteNote()">{{ labels.t('notes.deleteNote2') }}</ui-button>
706
704
  </ui-modal>
707
705
  `,
708
- styles: [":host{display:block}.note-add{padding:14px;margin-bottom:18px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:12px}.note-add-footer{display:flex;justify-content:flex-end;margin-top:10px}.note-offline-hint{margin:0 0 12px;font-size:.875rem;color:#475569}.note-loading{padding:24px 0;font-size:.875rem;color:#64748b;text-align:center}.note-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}.note-item{display:flex;gap:12px;padding:14px;background:#fff;border:1px solid #e2e8f0;border-radius:12px;transition:border-color .15s,box-shadow .15s}@media(hover:hover){.note-item:hover{border-color:#cbd5e1;box-shadow:0 1px 3px #0f172a0f}}.note-item.editing{background:#f8fafc;border-color:#bfdbfe}@media(prefers-reduced-motion:reduce){.note-item{transition:none}}.note-avatar{flex-shrink:0}.note-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:6px}.note-head{display:flex;align-items:center;flex-wrap:wrap;gap:2px 6px;min-height:28px}.note-author{font-size:.875rem;font-weight:600;color:#0f172a}.note-dot{color:#94a3b8;font-size:.75rem}.note-date{font-size:.75rem;color:#64748b}.note-edited{font-size:.75rem;font-style:italic;color:#64748b}.note-queued{font-size:.75rem;font-weight:500;color:#475569;background:#f1f5f9;border:1px dashed #94a3b8;border-radius:999px;padding:1px 8px}.note-queued-bad{color:#991b1b;background:#fef2f2;border:1px solid #b91c1c;font-weight:700}.note-actions{display:flex;align-items:center;gap:2px;margin-left:auto}.note-body{margin:0;font-size:.9375rem;line-height:1.6;color:#1e293b;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word}.note-item-footer{display:flex;justify-content:flex-end;gap:8px;margin-top:4px}.note-delete-msg{margin:0;font-size:.9375rem;line-height:1.5;color:#334155}@media(max-width:480px){.note-item{padding:12px;gap:10px}.note-add{padding:12px}}\n"]
706
+ styles: [":host{display:block}.note-add{padding:14px;margin-bottom:18px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:12px}.note-add-footer{display:flex;justify-content:flex-end;margin-top:10px}.note-offline-hint{margin:0 0 12px;font-size:.875rem;color:#475569}.note-loading{padding:24px 0;font-size:.875rem;color:#64748b;text-align:center}.note-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}.note-item{display:flex;gap:12px;padding:14px;background:#fff;border:1px solid #e2e8f0;border-radius:12px;transition:border-color .15s,box-shadow .15s}@media(hover:hover){.note-item:hover{border-color:#cbd5e1;box-shadow:0 1px 3px #0f172a0f}}.note-item.editing{background:#f8fafc;border-color:#bfdbfe}@media(prefers-reduced-motion:reduce){.note-item{transition:none}}.note-avatar{flex-shrink:0}.note-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:6px}.note-head{display:flex;align-items:center;flex-wrap:wrap;gap:2px 6px;min-height:28px}.note-author{font-size:.875rem;font-weight:600;color:#0f172a}.note-dot{color:#94a3b8;font-size:.75rem}.note-date{font-size:.75rem;color:#64748b}.note-edited{font-size:.75rem;font-style:italic;color:#64748b}.note-queued{font-size:.75rem;font-weight:500;color:#475569;background:#f1f5f9;border:1px dashed #94a3b8;border-radius:999px;padding:1px 8px}.note-queued-bad{color:#991b1b;background:#fef2f2;border:1px solid #b91c1c;font-weight:700}.note-actions{display:flex;align-items:center;gap:6px;margin-left:auto}.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 .15s,color .15s,border-color .15s}.note-icon-btn:after{content:\"\";position:absolute;top:50%;left:50%;width:44px;height:44px;transform:translate(-50%,-50%)}.note-icon-btn--edit{color:#64748b;border:1px solid #e2e8f0}.note-icon-btn--edit:hover{background:#f1f5f9;color:#1e293b}.note-icon-btn--delete{color:#b91c1c;border:1px solid #fecaca}.note-icon-btn--delete:hover{background:#fef2f2;border-color:#fca5a5;color:#991b1b}.note-icon-btn:focus-visible{outline:2px solid #2563eb;outline-offset:2px}.note-body{margin:0;font-size:.9375rem;line-height:1.6;color:#1e293b;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word}.note-item-footer{display:flex;justify-content:flex-end;gap:8px;margin-top:4px}.note-delete-msg{margin:0;font-size:.9375rem;line-height:1.5;color:#334155}@media(max-width:480px){.note-item{padding:12px;gap:10px}.note-add{padding:12px}}\n"]
709
707
  }]
710
708
  }],
711
709
  ctorParameters: () => [],
@@ -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,OAAO,OAAO;EACrF,SAAS,MAAM,EAAE,GAAG,MAAM,OAAO,MAAM,SAAS,IAAI,MAAM,MAAM,SAAS,EAAE,CAAC,KAAK,IAAA,CAAK,YAAW;CACnG;CAGU,QAAQ,MAAY;EAAa,OAAO,KAAK,KAAI,CAAE,CAAC,SAAS,KAAK,UAAS;CAAI;CAG/E,UAAU,MAAY;EAAa,MAAM,IAAI,KAAK,KAAI,CAAE,CAAC;EAAQ,OAAO,IAAI,KAAK,KAAK,KAAK,UAAS;CAAI;CAElH,IAAY,UAAO;EAAK,OAAO,KAAK,SAAQ,IAAK,GAAG,KAAK,UAAU,KAAK,SAAQ,MAAO,GAAG,KAAK,QAAO,SAAU,KAAK,aAAY,EAAE,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,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 : 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;AAgJxB,IAAa,iBAAb,MAAa,eAAc;CAyFf,SAAS,MAAY;EAC7B,MAAM,SAAS,QAAQ,KAAK,OAAO,EAAE,WAAW,EAAA,CAAG,KAAI,CAAE,CAAC,MAAM,KAAK,CAAC,CAAC,OAAO,OAAO;EACrF,SAAS,MAAM,EAAE,GAAG,MAAM,OAAO,MA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AAA,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;KAAgB,UAAA;KAAA,QAAA,CAAA,aAAA,iBAAA;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;;AAmHrK,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAc,YAAA,CAAA;EAvH1B,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAU,YACR;GAAI,iBACC,wBAAwB;GAAM,SACtC;IAAC;IAAa;IAAiB;IAAgB;IAAqB;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
  });