@forgeroute/ui 0.5.25 → 0.5.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/fesm2022/forgeroute-ui-card-list-item.mjs +30 -8
  2. package/fesm2022/forgeroute-ui-card-list-item.mjs.map +1 -1
  3. package/fesm2022/forgeroute-ui-checkbox.mjs +2 -2
  4. package/fesm2022/forgeroute-ui-checkbox.mjs.map +1 -1
  5. package/fesm2022/forgeroute-ui-color-input.mjs +40 -6
  6. package/fesm2022/forgeroute-ui-color-input.mjs.map +1 -1
  7. package/fesm2022/forgeroute-ui-combobox.mjs +2 -2
  8. package/fesm2022/forgeroute-ui-combobox.mjs.map +1 -1
  9. package/fesm2022/forgeroute-ui-contact-picker.mjs +4 -4
  10. package/fesm2022/forgeroute-ui-contact-picker.mjs.map +1 -1
  11. package/fesm2022/forgeroute-ui-conversations.mjs +2 -0
  12. package/fesm2022/forgeroute-ui-conversations.mjs.map +1 -1
  13. package/fesm2022/forgeroute-ui-data-table-core.mjs +2 -2
  14. package/fesm2022/forgeroute-ui-data-table-core.mjs.map +1 -1
  15. package/fesm2022/forgeroute-ui-date-input.mjs +2 -2
  16. package/fesm2022/forgeroute-ui-date-input.mjs.map +1 -1
  17. package/fesm2022/forgeroute-ui-datetime-input.mjs +2 -2
  18. package/fesm2022/forgeroute-ui-datetime-input.mjs.map +1 -1
  19. package/fesm2022/forgeroute-ui-detail-card.mjs +20 -4
  20. package/fesm2022/forgeroute-ui-detail-card.mjs.map +1 -1
  21. package/fesm2022/forgeroute-ui-dropdown.mjs +16 -2
  22. package/fesm2022/forgeroute-ui-dropdown.mjs.map +1 -1
  23. package/fesm2022/forgeroute-ui-file-input.mjs +7 -5
  24. package/fesm2022/forgeroute-ui-file-input.mjs.map +1 -1
  25. package/fesm2022/forgeroute-ui-icon-picker.mjs +2 -2
  26. package/fesm2022/forgeroute-ui-icon-picker.mjs.map +1 -1
  27. package/fesm2022/forgeroute-ui-media.mjs +67 -2
  28. package/fesm2022/forgeroute-ui-media.mjs.map +1 -1
  29. package/fesm2022/forgeroute-ui-messaging.mjs +3 -0
  30. package/fesm2022/forgeroute-ui-messaging.mjs.map +1 -1
  31. package/fesm2022/forgeroute-ui-multi-select.mjs +2 -2
  32. package/fesm2022/forgeroute-ui-multi-select.mjs.map +1 -1
  33. package/fesm2022/forgeroute-ui-notes.mjs +1 -0
  34. package/fesm2022/forgeroute-ui-notes.mjs.map +1 -1
  35. package/fesm2022/forgeroute-ui-option-card.mjs +1 -0
  36. package/fesm2022/forgeroute-ui-option-card.mjs.map +1 -1
  37. package/fesm2022/forgeroute-ui-payments.mjs +3 -0
  38. package/fesm2022/forgeroute-ui-payments.mjs.map +1 -1
  39. package/fesm2022/forgeroute-ui-pdf.mjs +1 -0
  40. package/fesm2022/forgeroute-ui-pdf.mjs.map +1 -1
  41. package/fesm2022/forgeroute-ui-quickbooks.mjs +1 -0
  42. package/fesm2022/forgeroute-ui-quickbooks.mjs.map +1 -1
  43. package/fesm2022/forgeroute-ui-radio-matrix.mjs +2 -2
  44. package/fesm2022/forgeroute-ui-radio-matrix.mjs.map +1 -1
  45. package/fesm2022/forgeroute-ui-radio.mjs +2 -2
  46. package/fesm2022/forgeroute-ui-radio.mjs.map +1 -1
  47. package/fesm2022/forgeroute-ui-select.mjs +2 -2
  48. package/fesm2022/forgeroute-ui-select.mjs.map +1 -1
  49. package/fesm2022/forgeroute-ui-setup.mjs +1 -0
  50. package/fesm2022/forgeroute-ui-setup.mjs.map +1 -1
  51. package/fesm2022/forgeroute-ui-square.mjs +1 -0
  52. package/fesm2022/forgeroute-ui-square.mjs.map +1 -1
  53. package/fesm2022/forgeroute-ui-star-rating.mjs +2 -2
  54. package/fesm2022/forgeroute-ui-star-rating.mjs.map +1 -1
  55. package/fesm2022/forgeroute-ui-stripe.mjs +1 -0
  56. package/fesm2022/forgeroute-ui-stripe.mjs.map +1 -1
  57. package/fesm2022/forgeroute-ui-swatch-picker.mjs +2 -2
  58. package/fesm2022/forgeroute-ui-swatch-picker.mjs.map +1 -1
  59. package/fesm2022/forgeroute-ui-table-toolbar.mjs +17 -5
  60. package/fesm2022/forgeroute-ui-table-toolbar.mjs.map +1 -1
  61. package/fesm2022/forgeroute-ui-text-input.mjs +2 -2
  62. package/fesm2022/forgeroute-ui-text-input.mjs.map +1 -1
  63. package/fesm2022/forgeroute-ui-textarea-input.mjs +23 -36
  64. package/fesm2022/forgeroute-ui-textarea-input.mjs.map +1 -1
  65. package/fesm2022/forgeroute-ui-time-input.mjs +2 -2
  66. package/fesm2022/forgeroute-ui-time-input.mjs.map +1 -1
  67. package/package.json +1 -1
  68. package/types/forgeroute-ui-card-list-item.d.ts +11 -3
  69. package/types/forgeroute-ui-color-input.d.ts +7 -0
  70. package/types/forgeroute-ui-detail-card.d.ts +7 -0
  71. package/types/forgeroute-ui-dropdown.d.ts +2 -0
  72. package/types/forgeroute-ui-media.d.ts +28 -0
  73. package/types/forgeroute-ui-messaging.d.ts +1 -1
  74. package/types/forgeroute-ui-quickbooks.d.ts +1 -1
  75. package/types/forgeroute-ui-square.d.ts +2 -2
  76. package/types/forgeroute-ui-stripe.d.ts +1 -1
  77. package/types/forgeroute-ui-textarea-input.d.ts +9 -9
@@ -231,7 +231,7 @@ var DateInputComponent = class DateInputComponent {
231
231
  </div>
232
232
  `,
233
233
  isInline: true,
234
- styles: [":host{display:block}.di-field{display:flex;flex-direction:column;gap:6px}.di-label{font-size:.8125rem;font-weight:600;color:#374151;line-height:1}.di-required{color:#dc2626;margin-left:2px}.di-input{width:100%;box-sizing:border-box;padding:8px 12px;font-size:.875rem;font-family:inherit;color:#1e293b;background:#fff;border:1px solid #7c8ba1;border-radius:8px;outline:none;transition:border-color .15s,box-shadow .15s;appearance:none}.di-input:focus{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61f}.di-error .di-input{border-color:#ef4444}.di-error .di-input:focus{box-shadow:0 0 0 3px #ef44441f}.di-disabled .di-input{opacity:.5;cursor:not-allowed}.di-desc{margin:0;font-size:.75rem;line-height:1.4;color:#64748b}.di-desc-error{color:#dc2626}@media(pointer:coarse),(max-width:480px){.di-input{font-size:1rem}}@media(pointer:coarse),(max-width:480px){.di-input{min-height:44px}}\n"],
234
+ styles: [":host{display:block}.di-field{display:flex;flex-direction:column;gap:6px}.di-label{font-size:.8125rem;font-weight:600;color:#374151;line-height:1}.di-required{color:#dc2626;margin-left:2px}.di-input{width:100%;box-sizing:border-box;padding:8px 12px;font-size:.875rem;font-family:inherit;color:#1e293b;background:#fff;border:1px solid #7c8ba1;border-radius:8px;outline:none;transition:border-color .15s,box-shadow .15s;appearance:none}.di-input:focus{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61f}.di-error .di-input{border-color:#ef4444}.di-error .di-input:focus{box-shadow:0 0 0 3px #ef44441f}.di-disabled .di-input{opacity:.5;cursor:not-allowed}.di-desc{margin:-6px 0 0;font-size:.75rem;line-height:1.4;color:#64748b}.di-desc-error{color:#dc2626}@media(pointer:coarse),(max-width:480px){.di-input{font-size:1rem}}@media(pointer:coarse),(max-width:480px){.di-input{min-height:44px}}\n"],
235
235
  changeDetection: i0.ChangeDetectionStrategy.OnPush
236
236
  });
237
237
  }
@@ -292,7 +292,7 @@ i0.ɵɵngDeclareClassMetadata({
292
292
  }
293
293
  </div>
294
294
  `,
295
- styles: [":host{display:block}.di-field{display:flex;flex-direction:column;gap:6px}.di-label{font-size:.8125rem;font-weight:600;color:#374151;line-height:1}.di-required{color:#dc2626;margin-left:2px}.di-input{width:100%;box-sizing:border-box;padding:8px 12px;font-size:.875rem;font-family:inherit;color:#1e293b;background:#fff;border:1px solid #7c8ba1;border-radius:8px;outline:none;transition:border-color .15s,box-shadow .15s;appearance:none}.di-input:focus{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61f}.di-error .di-input{border-color:#ef4444}.di-error .di-input:focus{box-shadow:0 0 0 3px #ef44441f}.di-disabled .di-input{opacity:.5;cursor:not-allowed}.di-desc{margin:0;font-size:.75rem;line-height:1.4;color:#64748b}.di-desc-error{color:#dc2626}@media(pointer:coarse),(max-width:480px){.di-input{font-size:1rem}}@media(pointer:coarse),(max-width:480px){.di-input{min-height:44px}}\n"]
295
+ styles: [":host{display:block}.di-field{display:flex;flex-direction:column;gap:6px}.di-label{font-size:.8125rem;font-weight:600;color:#374151;line-height:1}.di-required{color:#dc2626;margin-left:2px}.di-input{width:100%;box-sizing:border-box;padding:8px 12px;font-size:.875rem;font-family:inherit;color:#1e293b;background:#fff;border:1px solid #7c8ba1;border-radius:8px;outline:none;transition:border-color .15s,box-shadow .15s;appearance:none}.di-input:focus{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61f}.di-error .di-input{border-color:#ef4444}.di-error .di-input:focus{box-shadow:0 0 0 3px #ef44441f}.di-disabled .di-input{opacity:.5;cursor:not-allowed}.di-desc{margin:-6px 0 0;font-size:.75rem;line-height:1.4;color:#64748b}.di-desc-error{color:#dc2626}@media(pointer:coarse),(max-width:480px){.di-input{font-size:1rem}}@media(pointer:coarse),(max-width:480px){.di-input{min-height:44px}}\n"]
296
296
  }]
297
297
  }],
298
298
  ctorParameters: () => [],
@@ -1 +1 @@
1
- {"version":3,"file":"forgeroute-ui-date-input.mjs","names":[],"sources":["../../../projects/forgeroute-ui/date-input/src/lib/date-input/date-input.component.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, input, output, signal, computed, effect, forwardRef, inject } from '@angular/core';\nimport { AbstractControl, ControlValueAccessor, NG_VALIDATORS, NG_VALUE_ACCESSOR, ValidationErrors, Validator } from '@angular/forms';\nimport { FieldIssue, UiFieldValidity, createFieldReveal, mergeDescribedBy, issueToErrors, requiredIssue, parseIso, isoKey, formatIsoDate } from '@forgeroute/ui/core';\nimport { UiLabelsService } from '@forgeroute/ui/core';\n\n@Component({\n selector: 'ui-date-input',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [{\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DateInputComponent),\n multi: true,\n }, {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => DateInputComponent),\n multi: true,\n }, {\n provide: UiFieldValidity,\n useExisting: forwardRef(() => DateInputComponent),\n }],\n template: `\n <div class=\"di-field\" [class.di-error]=\"_activeError()\" [class.di-disabled]=\"disabled()\">\n @if (label()) {\n <label class=\"di-label\" [for]=\"_inputId\">\n {{ label() }}\n @if (required()) { <span class=\"di-required\" aria-hidden=\"true\">*</span> }\n </label>\n }\n <input\n class=\"di-input\"\n type=\"date\"\n [id]=\"_inputId\"\n [value]=\"_value()\"\n [disabled]=\"disabled()\"\n [attr.min]=\"min() || null\"\n [attr.max]=\"max() || null\"\n [attr.required]=\"required() || null\"\n [attr.aria-invalid]=\"_activeError() ? 'true' : null\"\n [attr.aria-describedby]=\"_describedBy()\"\n (change)=\"onChange($event)\"\n (blur)=\"onBlur()\"\n />\n @if (_activeError()) {\n <p class=\"di-desc di-desc-error\" [id]=\"_inputId + '-desc'\" role=\"alert\">{{ _activeError() }}</p>\n } @else if (hint()) {\n <p class=\"di-desc\" [id]=\"_inputId + '-desc'\">{{ hint() }}</p>\n }\n </div>\n `,\n styles: [`\n :host { display: block; }\n\n .di-field { display: flex; flex-direction: column; gap: 6px; }\n\n .di-label {\n font-size: 0.8125rem; font-weight: 600; color: #374151; line-height: 1;\n }\n .di-required { color: #dc2626; margin-left: 2px; }\n\n .di-input {\n width: 100%; box-sizing: border-box;\n padding: 8px 12px; font-size: 0.875rem; font-family: inherit;\n color: #1e293b; background: #fff;\n border: 1px solid #7c8ba1; border-radius: 8px;\n outline: none; transition: border-color 0.15s, box-shadow 0.15s;\n appearance: none;\n &:focus {\n border-color: #3b82f6;\n box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);\n }\n }\n\n .di-error .di-input {\n border-color: #ef4444;\n &:focus { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12); }\n }\n\n .di-disabled .di-input { opacity: 0.5; cursor: not-allowed; }\n\n .di-desc { margin: 0; font-size: 0.75rem; line-height: 1.4; color: #64748b; }\n .di-desc-error { color: #dc2626; }\n\n @media (pointer: coarse), (max-width: 480px) { .di-input { font-size: 1rem; } }\n @media (pointer: coarse), (max-width: 480px) { .di-input { min-height: 44px; } }\n `],\n})\n/**\n * Native date picker (ControlValueAccessor, ISO string value).\n * Built-in validation: `required` -> \"<label> is required.\"; a value that is not a real date -> \"Please enter a valid date.\";\n * below `min` -> \"Must be on or after <date>\"; above `max` -> \"Must be on or before <date>\" (a `min`/`max` that cannot be\n * parsed is ignored). Disabled fields are never invalid.\n *\n * Validity API (same on every ui input): the component is an Angular `Validator` (`ngModel` / `FormControl` report\n * `.invalid` / `.errors`), exposes the signals `invalid` + `errorMessage` and the `invalidChange` output, and provides\n * `UiFieldValidity` so a host can use `viewChildren(UiFieldValidity)`. Messages (built-in and a host `[error]`) are displayed only after the user left THIS field (blur); `[showErrors]=\"true\"` reveals the message of an untouched field at once, and setting it back to false clears the touched state.\n */\nexport class DateInputComponent implements ControlValueAccessor, Validator, UiFieldValidity {\n protected readonly labels = inject(UiLabelsService);\n readonly label = input('');\n readonly required = input(false);\n readonly min = input('');\n readonly max = input('');\n readonly hint = input('');\n /** Id(s) of an external element that also describes this control (e.g. one shared error text for a group of fields). Space separated; MERGED after the control's own hint / error id in `aria-describedby`, never replacing it. Empty = unchanged. */\n readonly ariaDescribedBy = input('');\n readonly error = input('');\n /** The host's \"tried to submit\" flag (e.g. after a failed Save click). `true` reveals the message of an untouched field at once (the field also shows it after the user left THIS field); switching it from true back to false forgets that the field was left. */\n readonly showErrors = input(false);\n\n /** The `[disabled]` input. Public so `[disabled]=\"x\"` in a host template type-checks (a protected alias target fails with TS2445); disabled when this OR the form control says so. */\n readonly _disabledInput = input(false, { alias: 'disabled' });\n private readonly _cvaDisabled = signal(false);\n protected readonly disabled = computed(() => this._disabledInput() || this._cvaDisabled());\n\n protected readonly _value = signal('');\n\n /** `aria-describedby`: the error / hint text, then the host's `ariaDescribedBy` id(s). */\n protected readonly _describedBy = computed(() => mergeDescribedBy((this._activeError() || this.hint()) ? this._inputId + '-desc' : null, this.ariaDescribedBy()));\n private readonly _reveal = createFieldReveal(this.showErrors);\n private readonly _issue = computed(() => this._check(this._value()));\n /** True while the value breaks a built-in rule or the host passed an `[error]`. */\n readonly invalid = computed(() => !!this.error() || !!this._issue());\n /** Message of the first broken built-in rule ('' when valid), shown or not. */\n readonly errorMessage = computed(() => this._issue()?.message ?? '');\n /** Emits whenever the field becomes invalid / valid. */\n readonly invalidChange = output<boolean>();\n /** Emits the new value ('YYYY-MM-DD', or '' when cleared) when the USER changes it - the same value the form control receives. Not emitted for values the host writes. */\n readonly valueChange = output<string>();\n protected readonly _activeError = computed(() => this._reveal.revealed() ? (this.error() || this.errorMessage()) : '');\n private _onValidatorChange = () => {};\n\n constructor() {\n effect(() => { this.invalidChange.emit(this.invalid()); });\n }\n\n /** Re-run the form control's validation when a rule input (required, maxlength, min, options, ...) changes. */\n ngOnChanges() { this._onValidatorChange(); }\n\n validate(control: AbstractControl): ValidationErrors | null {\n const v = control.value;\n return issueToErrors(this._check(v == null ? '' : String(v)));\n }\n registerOnValidatorChange(fn: () => void) { this._onValidatorChange = fn; }\n\n protected readonly _inputId = `di-${Math.random().toString(36).slice(2, 8)}`;\n\n private _onChange = (_: string) => {};\n private _onTouched = () => {};\n\n writeValue(val: string) { this._value.set(val ?? ''); }\n registerOnChange(fn: (v: string) => void) { this._onChange = fn; }\n registerOnTouched(fn: () => void) { this._onTouched = fn; }\n setDisabledState(d: boolean) { this._cvaDisabled.set(d); }\n\n protected onChange(event: Event) {\n const val = (event.target as HTMLInputElement).value;\n this._value.set(val);\n this._onChange(val);\n this.valueChange.emit(val);\n }\n\n protected onBlur() { this._onTouched(); this._reveal.touched.set(true); }\n\n private _check(value: string): FieldIssue | null {\n if (this.disabled()) return null;\n const text = value.trim();\n if (!text) return this.required() ? requiredIssue(this.label()) : null;\n const p = parseIso(text, false);\n if (!p) return { key: 'date', message: this.labels.t('validation.date') };\n const min = this.min() ? parseIso(this.min(), false) : null;\n if (min && isoKey(p) < isoKey(min)) return { key: 'min', message: this.labels.t('validation.onOrAfter', { value: formatIsoDate(this.min(), this.labels.locale()) }), value: { min: this.min(), actual: text } };\n const max = this.max() ? parseIso(this.max(), false) : null;\n if (max && isoKey(p) > isoKey(max)) return { key: 'max', message: this.labels.t('validation.onOrBefore', { value: formatIsoDate(this.max(), this.labels.locale()) }), value: { max: this.max(), actual: text } };\n return null;\n }\n}\n"],"mappings":";;;;AAiGA,IAAa,qBAAb,MAAa,mBAAkB;CAmC7B,cAAA;EAlCmB,KAAA,SAAS,OAAO,eAAe;EACzC,KAAA,QAAW,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;EACpB,KAAA,WAAW,MAAM,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;EACvB,KAAA,MAAW,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,MAAA,CAAA,+BAAA,CAAA,CAAA;EACpB,KAAA,MAAW,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,MAAA,CAAA,+BAAA,CAAA,CAAA;EACpB,KAAA,OAAW,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;EAEpB,KAAA,kBAAkB,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,kBAAA,CAAA,+BAAA,CAAA,CAAA;EAC3B,KAAA,QAAW,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;EAEpB,KAAA,aAAa,MAAM,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,aAAA,CAAA,+BAAA,CAAA,CAAA;EAGzB,KAAA,iBAAiB,MAAM,OAAK;GAAA,GAAA,YAAA,EAAA,WA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A,mBAAA;KAAA,YAAA;KAAA,UAAA;KAAA,YAAA;KAAA,mBAAA;IAAA;IAAA,OAAA;KAAA,mBAAA;KAAA,YAAA;KAAA,UAAA;KAAA,YAAA;KAAA,mBAAA;IAAA;IAAA,YAAA;KAAA,mBAAA;KAAA,YAAA;KAAA,UAAA;KAAA,YAAA;KAAA,mBAAA;IAAA;IAAA,gBAAA;KAAA,mBAAA;KAAA,YAAA;KAAA,UAAA;KAAA,YAAA;KAAA,mBAAA;IAAA;GAAA;GAAA,SAAA;IAAA,eAAA;IAAA,aAAA;GAAA;GAAA,WAxFlB;IAAC;KACV,SAAS;KACT,aAAa,iBAAiB,kBAAkB;KAChD,OAAO;IACR;IAAE;KACD,SAAS;KACT,aAAa,iBAAiB,kBAAkB;KAChD,OAAO;IACR;IAAE;KACD,SAAS;KACT,aAAa,iBAAiB,kBAAkB;IACjD;GAAA;GAAC,eAAA;GAAA,UAAA;GAAA,UACQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BT,UAAA;GAAA,QAAA,CAAA,s3BAAA;GAAA,iBAAA,GAAA,wBAAA;EAAA,CAAA;CAAA;;AAgDU,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAkB,YAAA,CAAA;EA5F9B,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAe,YACb;GAAI,iBACC,wBAAwB;GAAM,WACpC;IAAC;KACV,SAAS;KACT,aAAa,iBAAgB,kBAAmB;KAChD,OAAO;IACR;IAAE;KACD,SAAS;KACT,aAAa,iBAAgB,kBAAmB;KAChD,OAAO;IACR;IAAE;KACD,SAAS;KACT,aAAa,iBAAgB,kBAAmB;IACjD;GAAA;GAAC,UACQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BT,QAAA,CAAA,s3BAAA;EAAA,CAAA"}
1
+ {"version":3,"file":"forgeroute-ui-date-input.mjs","names":[],"sources":["../../../projects/forgeroute-ui/date-input/src/lib/date-input/date-input.component.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, input, output, signal, computed, effect, forwardRef, inject } from '@angular/core';\nimport { AbstractControl, ControlValueAccessor, NG_VALIDATORS, NG_VALUE_ACCESSOR, ValidationErrors, Validator } from '@angular/forms';\nimport { FieldIssue, UiFieldValidity, createFieldReveal, mergeDescribedBy, issueToErrors, requiredIssue, parseIso, isoKey, formatIsoDate } from '@forgeroute/ui/core';\nimport { UiLabelsService } from '@forgeroute/ui/core';\n\n@Component({\n selector: 'ui-date-input',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [{\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DateInputComponent),\n multi: true,\n }, {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => DateInputComponent),\n multi: true,\n }, {\n provide: UiFieldValidity,\n useExisting: forwardRef(() => DateInputComponent),\n }],\n template: `\n <div class=\"di-field\" [class.di-error]=\"_activeError()\" [class.di-disabled]=\"disabled()\">\n @if (label()) {\n <label class=\"di-label\" [for]=\"_inputId\">\n {{ label() }}\n @if (required()) { <span class=\"di-required\" aria-hidden=\"true\">*</span> }\n </label>\n }\n <input\n class=\"di-input\"\n type=\"date\"\n [id]=\"_inputId\"\n [value]=\"_value()\"\n [disabled]=\"disabled()\"\n [attr.min]=\"min() || null\"\n [attr.max]=\"max() || null\"\n [attr.required]=\"required() || null\"\n [attr.aria-invalid]=\"_activeError() ? 'true' : null\"\n [attr.aria-describedby]=\"_describedBy()\"\n (change)=\"onChange($event)\"\n (blur)=\"onBlur()\"\n />\n @if (_activeError()) {\n <p class=\"di-desc di-desc-error\" [id]=\"_inputId + '-desc'\" role=\"alert\">{{ _activeError() }}</p>\n } @else if (hint()) {\n <p class=\"di-desc\" [id]=\"_inputId + '-desc'\">{{ hint() }}</p>\n }\n </div>\n `,\n styles: [`\n :host { display: block; }\n\n .di-field { display: flex; flex-direction: column; gap: 6px; }\n\n .di-label {\n font-size: 0.8125rem; font-weight: 600; color: #374151; line-height: 1;\n }\n .di-required { color: #dc2626; margin-left: 2px; }\n\n .di-input {\n width: 100%; box-sizing: border-box;\n padding: 8px 12px; font-size: 0.875rem; font-family: inherit;\n color: #1e293b; background: #fff;\n border: 1px solid #7c8ba1; border-radius: 8px;\n outline: none; transition: border-color 0.15s, box-shadow 0.15s;\n appearance: none;\n &:focus {\n border-color: #3b82f6;\n box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);\n }\n }\n\n .di-error .di-input {\n border-color: #ef4444;\n &:focus { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12); }\n }\n\n .di-disabled .di-input { opacity: 0.5; cursor: not-allowed; }\n\n .di-desc { margin: -6px 0 0; font-size: 0.75rem; line-height: 1.4; color: #64748b; }\n .di-desc-error { color: #dc2626; }\n\n @media (pointer: coarse), (max-width: 480px) { .di-input { font-size: 1rem; } }\n @media (pointer: coarse), (max-width: 480px) { .di-input { min-height: 44px; } }\n `],\n})\n/**\n * Native date picker (ControlValueAccessor, ISO string value).\n * Built-in validation: `required` -> \"<label> is required.\"; a value that is not a real date -> \"Please enter a valid date.\";\n * below `min` -> \"Must be on or after <date>\"; above `max` -> \"Must be on or before <date>\" (a `min`/`max` that cannot be\n * parsed is ignored). Disabled fields are never invalid.\n *\n * Validity API (same on every ui input): the component is an Angular `Validator` (`ngModel` / `FormControl` report\n * `.invalid` / `.errors`), exposes the signals `invalid` + `errorMessage` and the `invalidChange` output, and provides\n * `UiFieldValidity` so a host can use `viewChildren(UiFieldValidity)`. Messages (built-in and a host `[error]`) are displayed only after the user left THIS field (blur); `[showErrors]=\"true\"` reveals the message of an untouched field at once, and setting it back to false clears the touched state.\n */\nexport class DateInputComponent implements ControlValueAccessor, Validator, UiFieldValidity {\n protected readonly labels = inject(UiLabelsService);\n readonly label = input('');\n readonly required = input(false);\n readonly min = input('');\n readonly max = input('');\n readonly hint = input('');\n /** Id(s) of an external element that also describes this control (e.g. one shared error text for a group of fields). Space separated; MERGED after the control's own hint / error id in `aria-describedby`, never replacing it. Empty = unchanged. */\n readonly ariaDescribedBy = input('');\n readonly error = input('');\n /** The host's \"tried to submit\" flag (e.g. after a failed Save click). `true` reveals the message of an untouched field at once (the field also shows it after the user left THIS field); switching it from true back to false forgets that the field was left. */\n readonly showErrors = input(false);\n\n /** The `[disabled]` input. Public so `[disabled]=\"x\"` in a host template type-checks (a protected alias target fails with TS2445); disabled when this OR the form control says so. */\n readonly _disabledInput = input(false, { alias: 'disabled' });\n private readonly _cvaDisabled = signal(false);\n protected readonly disabled = computed(() => this._disabledInput() || this._cvaDisabled());\n\n protected readonly _value = signal('');\n\n /** `aria-describedby`: the error / hint text, then the host's `ariaDescribedBy` id(s). */\n protected readonly _describedBy = computed(() => mergeDescribedBy((this._activeError() || this.hint()) ? this._inputId + '-desc' : null, this.ariaDescribedBy()));\n private readonly _reveal = createFieldReveal(this.showErrors);\n private readonly _issue = computed(() => this._check(this._value()));\n /** True while the value breaks a built-in rule or the host passed an `[error]`. */\n readonly invalid = computed(() => !!this.error() || !!this._issue());\n /** Message of the first broken built-in rule ('' when valid), shown or not. */\n readonly errorMessage = computed(() => this._issue()?.message ?? '');\n /** Emits whenever the field becomes invalid / valid. */\n readonly invalidChange = output<boolean>();\n /** Emits the new value ('YYYY-MM-DD', or '' when cleared) when the USER changes it - the same value the form control receives. Not emitted for values the host writes. */\n readonly valueChange = output<string>();\n protected readonly _activeError = computed(() => this._reveal.revealed() ? (this.error() || this.errorMessage()) : '');\n private _onValidatorChange = () => {};\n\n constructor() {\n effect(() => { this.invalidChange.emit(this.invalid()); });\n }\n\n /** Re-run the form control's validation when a rule input (required, maxlength, min, options, ...) changes. */\n ngOnChanges() { this._onValidatorChange(); }\n\n validate(control: AbstractControl): ValidationErrors | null {\n const v = control.value;\n return issueToErrors(this._check(v == null ? '' : String(v)));\n }\n registerOnValidatorChange(fn: () => void) { this._onValidatorChange = fn; }\n\n protected readonly _inputId = `di-${Math.random().toString(36).slice(2, 8)}`;\n\n private _onChange = (_: string) => {};\n private _onTouched = () => {};\n\n writeValue(val: string) { this._value.set(val ?? ''); }\n registerOnChange(fn: (v: string) => void) { this._onChange = fn; }\n registerOnTouched(fn: () => void) { this._onTouched = fn; }\n setDisabledState(d: boolean) { this._cvaDisabled.set(d); }\n\n protected onChange(event: Event) {\n const val = (event.target as HTMLInputElement).value;\n this._value.set(val);\n this._onChange(val);\n this.valueChange.emit(val);\n }\n\n protected onBlur() { this._onTouched(); this._reveal.touched.set(true); }\n\n private _check(value: string): FieldIssue | null {\n if (this.disabled()) return null;\n const text = value.trim();\n if (!text) return this.required() ? requiredIssue(this.label()) : null;\n const p = parseIso(text, false);\n if (!p) return { key: 'date', message: this.labels.t('validation.date') };\n const min = this.min() ? parseIso(this.min(), false) : null;\n if (min && isoKey(p) < isoKey(min)) return { key: 'min', message: this.labels.t('validation.onOrAfter', { value: formatIsoDate(this.min(), this.labels.locale()) }), value: { min: this.min(), actual: text } };\n const max = this.max() ? parseIso(this.max(), false) : null;\n if (max && isoKey(p) > isoKey(max)) return { key: 'max', message: this.labels.t('validation.onOrBefore', { value: formatIsoDate(this.max(), this.labels.locale()) }), value: { max: this.max(), actual: text } };\n return null;\n }\n}\n"],"mappings":";;;;AAiGA,IAAa,qBAAb,MAAa,mBAAkB;CAmC7B,cAAA;EAlCmB,KAAA,SAAS,OAAO,eAAe;EACzC,KAAA,QAAW,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;EACpB,KAAA,WAAW,MAAM,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;EACvB,KAAA,MAAW,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,MAAA,CAAA,+BAAA,CAAA,CAAA;EACpB,KAAA,MAAW,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,MAAA,CAAA,+BAAA,CAAA,CAAA;EACpB,KAAA,OAAW,MAAM,IAAG,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UAAA;GAAe,YACb;GAAI,iBACC,wBAAwB;GAAM,WACpC;IAAC;KACV,SAAS;KACT,aAAa,iBAAgB,kBAAmB;KAChD,OAAO;IACR;IAAE;KACD,SAAS;KACT,aAAa,iBAAgB,kBAAmB;KAChD,OAAO;IACR;IAAE;KACD,SAAS;KACT,aAAa,iBAAgB,kBAAmB;IACjD;GAAA;GAAC,UACQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BT,QAAA,CAAA,63BAAA;EAAA,CAAA"}
@@ -226,7 +226,7 @@ var DatetimeInputComponent = class DatetimeInputComponent {
226
226
  </div>
227
227
  `,
228
228
  isInline: true,
229
- styles: [":host{display:block}.dti-field{display:flex;flex-direction:column;gap:6px}.dti-label{font-size:.8125rem;font-weight:600;color:#374151;line-height:1}.dti-required{color:#dc2626;margin-left:2px}.dti-input{width:100%;box-sizing:border-box;padding:8px 12px;font-size:.875rem;font-family:inherit;color:#1e293b;background:#fff;border:1px solid #7c8ba1;border-radius:8px;outline:none;transition:border-color .15s,box-shadow .15s;appearance:none}.dti-input:focus{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61f}.dti-error .dti-input{border-color:#ef4444}.dti-error .dti-input:focus{box-shadow:0 0 0 3px #ef44441f}.dti-disabled .dti-input{opacity:.5;cursor:not-allowed}.dti-desc{margin:0;font-size:.75rem;line-height:1.4;color:#64748b}.dti-desc-error{color:#dc2626}@media(pointer:coarse),(max-width:480px){.dti-input{font-size:1rem}}@media(pointer:coarse),(max-width:480px){.dti-input{min-height:44px}}\n"],
229
+ styles: [":host{display:block}.dti-field{display:flex;flex-direction:column;gap:6px}.dti-label{font-size:.8125rem;font-weight:600;color:#374151;line-height:1}.dti-required{color:#dc2626;margin-left:2px}.dti-input{width:100%;box-sizing:border-box;padding:8px 12px;font-size:.875rem;font-family:inherit;color:#1e293b;background:#fff;border:1px solid #7c8ba1;border-radius:8px;outline:none;transition:border-color .15s,box-shadow .15s;appearance:none}.dti-input:focus{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61f}.dti-error .dti-input{border-color:#ef4444}.dti-error .dti-input:focus{box-shadow:0 0 0 3px #ef44441f}.dti-disabled .dti-input{opacity:.5;cursor:not-allowed}.dti-desc{margin:-6px 0 0;font-size:.75rem;line-height:1.4;color:#64748b}.dti-desc-error{color:#dc2626}@media(pointer:coarse),(max-width:480px){.dti-input{font-size:1rem}}@media(pointer:coarse),(max-width:480px){.dti-input{min-height:44px}}\n"],
230
230
  changeDetection: i0.ChangeDetectionStrategy.OnPush
231
231
  });
232
232
  }
@@ -287,7 +287,7 @@ i0.ɵɵngDeclareClassMetadata({
287
287
  }
288
288
  </div>
289
289
  `,
290
- styles: [":host{display:block}.dti-field{display:flex;flex-direction:column;gap:6px}.dti-label{font-size:.8125rem;font-weight:600;color:#374151;line-height:1}.dti-required{color:#dc2626;margin-left:2px}.dti-input{width:100%;box-sizing:border-box;padding:8px 12px;font-size:.875rem;font-family:inherit;color:#1e293b;background:#fff;border:1px solid #7c8ba1;border-radius:8px;outline:none;transition:border-color .15s,box-shadow .15s;appearance:none}.dti-input:focus{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61f}.dti-error .dti-input{border-color:#ef4444}.dti-error .dti-input:focus{box-shadow:0 0 0 3px #ef44441f}.dti-disabled .dti-input{opacity:.5;cursor:not-allowed}.dti-desc{margin:0;font-size:.75rem;line-height:1.4;color:#64748b}.dti-desc-error{color:#dc2626}@media(pointer:coarse),(max-width:480px){.dti-input{font-size:1rem}}@media(pointer:coarse),(max-width:480px){.dti-input{min-height:44px}}\n"]
290
+ styles: [":host{display:block}.dti-field{display:flex;flex-direction:column;gap:6px}.dti-label{font-size:.8125rem;font-weight:600;color:#374151;line-height:1}.dti-required{color:#dc2626;margin-left:2px}.dti-input{width:100%;box-sizing:border-box;padding:8px 12px;font-size:.875rem;font-family:inherit;color:#1e293b;background:#fff;border:1px solid #7c8ba1;border-radius:8px;outline:none;transition:border-color .15s,box-shadow .15s;appearance:none}.dti-input:focus{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61f}.dti-error .dti-input{border-color:#ef4444}.dti-error .dti-input:focus{box-shadow:0 0 0 3px #ef44441f}.dti-disabled .dti-input{opacity:.5;cursor:not-allowed}.dti-desc{margin:-6px 0 0;font-size:.75rem;line-height:1.4;color:#64748b}.dti-desc-error{color:#dc2626}@media(pointer:coarse),(max-width:480px){.dti-input{font-size:1rem}}@media(pointer:coarse),(max-width:480px){.dti-input{min-height:44px}}\n"]
291
291
  }]
292
292
  }],
293
293
  ctorParameters: () => [],
@@ -1 +1 @@
1
- {"version":3,"file":"forgeroute-ui-datetime-input.mjs","names":[],"sources":["../../../projects/forgeroute-ui/datetime-input/src/lib/datetime-input/datetime-input.component.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, input, output, signal, computed, effect, forwardRef, inject } from '@angular/core';\nimport { AbstractControl, ControlValueAccessor, NG_VALIDATORS, NG_VALUE_ACCESSOR, ValidationErrors, Validator } from '@angular/forms';\nimport { FieldIssue, UiFieldValidity, createFieldReveal, mergeDescribedBy, issueToErrors, requiredIssue, parseIso, isoKey, formatIsoDateTime } from '@forgeroute/ui/core';\nimport { UiLabelsService } from '@forgeroute/ui/core';\n\n@Component({\n selector: 'ui-datetime-input',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [{\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DatetimeInputComponent),\n multi: true,\n }, {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => DatetimeInputComponent),\n multi: true,\n }, {\n provide: UiFieldValidity,\n useExisting: forwardRef(() => DatetimeInputComponent),\n }],\n template: `\n <div class=\"dti-field\" [class.dti-error]=\"_activeError()\" [class.dti-disabled]=\"disabled()\">\n @if (label()) {\n <label class=\"dti-label\" [for]=\"_inputId\">\n {{ label() }}\n @if (required()) { <span class=\"dti-required\" aria-hidden=\"true\">*</span> }\n </label>\n }\n <input\n class=\"dti-input\"\n type=\"datetime-local\"\n [id]=\"_inputId\"\n [value]=\"_value()\"\n [disabled]=\"disabled()\"\n [attr.min]=\"min() || null\"\n [attr.max]=\"max() || null\"\n [attr.required]=\"required() || null\"\n [attr.aria-invalid]=\"_activeError() ? 'true' : null\"\n [attr.aria-describedby]=\"_describedBy()\"\n (change)=\"onChange($event)\"\n (blur)=\"onBlur()\"\n />\n @if (_activeError()) {\n <p class=\"dti-desc dti-desc-error\" [id]=\"_inputId + '-desc'\" role=\"alert\">{{ _activeError() }}</p>\n } @else if (hint()) {\n <p class=\"dti-desc\" [id]=\"_inputId + '-desc'\">{{ hint() }}</p>\n }\n </div>\n `,\n styles: [`\n :host { display: block; }\n\n .dti-field { display: flex; flex-direction: column; gap: 6px; }\n\n .dti-label {\n font-size: 0.8125rem; font-weight: 600; color: #374151; line-height: 1;\n }\n .dti-required { color: #dc2626; margin-left: 2px; }\n\n .dti-input {\n width: 100%; box-sizing: border-box;\n padding: 8px 12px; font-size: 0.875rem; font-family: inherit;\n color: #1e293b; background: #fff;\n border: 1px solid #7c8ba1; border-radius: 8px;\n outline: none; transition: border-color 0.15s, box-shadow 0.15s;\n appearance: none;\n &:focus {\n border-color: #3b82f6;\n box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);\n }\n }\n\n .dti-error .dti-input {\n border-color: #ef4444;\n &:focus { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12); }\n }\n\n .dti-disabled .dti-input { opacity: 0.5; cursor: not-allowed; }\n\n .dti-desc { margin: 0; font-size: 0.75rem; line-height: 1.4; color: #64748b; }\n .dti-desc-error { color: #dc2626; }\n\n @media (pointer: coarse), (max-width: 480px) { .dti-input { font-size: 1rem; } }\n @media (pointer: coarse), (max-width: 480px) { .dti-input { min-height: 44px; } }\n `],\n})\n/**\n * Native date-time picker (ControlValueAccessor, ISO string value).\n * Built-in validation: `required` -> \"<label> is required.\"; a value that is not a real date-time -> \"Please enter a valid date-time.\";\n * below `min` -> \"Must be on or after <date>\"; above `max` -> \"Must be on or before <date>\" (a `min`/`max` that cannot be\n * parsed is ignored). Disabled fields are never invalid.\n *\n * Validity API (same on every ui input): the component is an Angular `Validator` (`ngModel` / `FormControl` report\n * `.invalid` / `.errors`), exposes the signals `invalid` + `errorMessage` and the `invalidChange` output, and provides\n * `UiFieldValidity` so a host can use `viewChildren(UiFieldValidity)`. Messages (built-in and a host `[error]`) are displayed only after the user left THIS field (blur); `[showErrors]=\"true\"` reveals the message of an untouched field at once, and setting it back to false clears the touched state.\n */\nexport class DatetimeInputComponent implements ControlValueAccessor, Validator, UiFieldValidity {\n protected readonly labels = inject(UiLabelsService);\n readonly label = input('');\n readonly required = input(false);\n readonly min = input('');\n readonly max = input('');\n readonly hint = input('');\n /** Id(s) of an external element that also describes this control (e.g. one shared error text for a group of fields). Space separated; MERGED after the control's own hint / error id in `aria-describedby`, never replacing it. Empty = unchanged. */\n readonly ariaDescribedBy = input('');\n readonly error = input('');\n /** The host's \"tried to submit\" flag (e.g. after a failed Save click). `true` reveals the message of an untouched field at once (the field also shows it after the user left THIS field); switching it from true back to false forgets that the field was left. */\n readonly showErrors = input(false);\n\n readonly _disabledInput = input(false, { alias: 'disabled' });\n private readonly _cvaDisabled = signal(false);\n protected readonly disabled = computed(() => this._disabledInput() || this._cvaDisabled());\n\n protected readonly _value = signal('');\n\n /** `aria-describedby`: the error / hint text, then the host's `ariaDescribedBy` id(s). */\n protected readonly _describedBy = computed(() => mergeDescribedBy((this._activeError() || this.hint()) ? this._inputId + '-desc' : null, this.ariaDescribedBy()));\n private readonly _reveal = createFieldReveal(this.showErrors);\n private readonly _issue = computed(() => this._check(this._value()));\n /** True while the value breaks a built-in rule or the host passed an `[error]`. */\n readonly invalid = computed(() => !!this.error() || !!this._issue());\n /** Message of the first broken built-in rule ('' when valid), shown or not. */\n readonly errorMessage = computed(() => this._issue()?.message ?? '');\n /** Emits whenever the field becomes invalid / valid. */\n readonly invalidChange = output<boolean>();\n protected readonly _activeError = computed(() => this._reveal.revealed() ? (this.error() || this.errorMessage()) : '');\n private _onValidatorChange = () => {};\n\n constructor() {\n effect(() => { this.invalidChange.emit(this.invalid()); });\n }\n\n /** Re-run the form control's validation when a rule input (required, maxlength, min, options, ...) changes. */\n ngOnChanges() { this._onValidatorChange(); }\n\n validate(control: AbstractControl): ValidationErrors | null {\n const v = control.value;\n return issueToErrors(this._check(v == null ? '' : String(v)));\n }\n registerOnValidatorChange(fn: () => void) { this._onValidatorChange = fn; }\n\n protected readonly _inputId = `dti-${Math.random().toString(36).slice(2, 8)}`;\n\n private _onChange = (_: string) => {};\n private _onTouched = () => {};\n\n writeValue(val: string) { this._value.set(val ?? ''); }\n registerOnChange(fn: (v: string) => void) { this._onChange = fn; }\n registerOnTouched(fn: () => void) { this._onTouched = fn; }\n setDisabledState(d: boolean) { this._cvaDisabled.set(d); }\n\n protected onChange(event: Event) {\n const val = (event.target as HTMLInputElement).value;\n this._value.set(val);\n this._onChange(val);\n }\n\n protected onBlur() { this._onTouched(); this._reveal.touched.set(true); }\n\n private _check(value: string): FieldIssue | null {\n if (this.disabled()) return null;\n const text = value.trim();\n if (!text) return this.required() ? requiredIssue(this.label()) : null;\n const p = parseIso(text, true);\n if (!p) return { key: 'date', message: this.labels.t('validation.dateTime') };\n const min = this.min() ? parseIso(this.min(), true) : null;\n if (min && isoKey(p) < isoKey(min)) return { key: 'min', message: this.labels.t('validation.onOrAfter', { value: formatIsoDateTime(this.min(), this.labels.locale()) }), value: { min: this.min(), actual: text } };\n const max = this.max() ? parseIso(this.max(), true) : null;\n if (max && isoKey(p) > isoKey(max)) return { key: 'max', message: this.labels.t('validation.onOrBefore', { value: formatIsoDateTime(this.max(), this.labels.locale()) }), value: { max: this.max(), actual: text } };\n return null;\n }\n}\n"],"mappings":";;;;AAiGA,IAAa,yBAAb,MAAa,uBAAsB;CAgCjC,cAAA;EA/BmB,KAAA,SAAS,OAAO,eAAe;EACzC,KAAA,QAAW,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,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AA;GAAA,UACQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BT,UAAA;GAAA,QAAA,CAAA,q4BAAA;GAAA,iBAAA,GAAA,wBAAA;EAAA,CAAA;CAAA;;AAgDU,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAsB,YAAA,CAAA;EA5FlC,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAmB,YACjB;GAAI,iBACC,wBAAwB;GAAM,WACpC;IAAC;KACV,SAAS;KACT,aAAa,iBAAgB,sBAAuB;KACpD,OAAO;IACR;IAAE;KACD,SAAS;KACT,aAAa,iBAAgB,sBAAuB;KACpD,OAAO;IACR;IAAE;KACD,SAAS;KACT,aAAa,iBAAgB,sBAAuB;IACrD;GAAA;GAAC,UACQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BT,QAAA,CAAA,q4BAAA;EAAA,CAAA"}
1
+ {"version":3,"file":"forgeroute-ui-datetime-input.mjs","names":[],"sources":["../../../projects/forgeroute-ui/datetime-input/src/lib/datetime-input/datetime-input.component.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, input, output, signal, computed, effect, forwardRef, inject } from '@angular/core';\nimport { AbstractControl, ControlValueAccessor, NG_VALIDATORS, NG_VALUE_ACCESSOR, ValidationErrors, Validator } from '@angular/forms';\nimport { FieldIssue, UiFieldValidity, createFieldReveal, mergeDescribedBy, issueToErrors, requiredIssue, parseIso, isoKey, formatIsoDateTime } from '@forgeroute/ui/core';\nimport { UiLabelsService } from '@forgeroute/ui/core';\n\n@Component({\n selector: 'ui-datetime-input',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [{\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DatetimeInputComponent),\n multi: true,\n }, {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => DatetimeInputComponent),\n multi: true,\n }, {\n provide: UiFieldValidity,\n useExisting: forwardRef(() => DatetimeInputComponent),\n }],\n template: `\n <div class=\"dti-field\" [class.dti-error]=\"_activeError()\" [class.dti-disabled]=\"disabled()\">\n @if (label()) {\n <label class=\"dti-label\" [for]=\"_inputId\">\n {{ label() }}\n @if (required()) { <span class=\"dti-required\" aria-hidden=\"true\">*</span> }\n </label>\n }\n <input\n class=\"dti-input\"\n type=\"datetime-local\"\n [id]=\"_inputId\"\n [value]=\"_value()\"\n [disabled]=\"disabled()\"\n [attr.min]=\"min() || null\"\n [attr.max]=\"max() || null\"\n [attr.required]=\"required() || null\"\n [attr.aria-invalid]=\"_activeError() ? 'true' : null\"\n [attr.aria-describedby]=\"_describedBy()\"\n (change)=\"onChange($event)\"\n (blur)=\"onBlur()\"\n />\n @if (_activeError()) {\n <p class=\"dti-desc dti-desc-error\" [id]=\"_inputId + '-desc'\" role=\"alert\">{{ _activeError() }}</p>\n } @else if (hint()) {\n <p class=\"dti-desc\" [id]=\"_inputId + '-desc'\">{{ hint() }}</p>\n }\n </div>\n `,\n styles: [`\n :host { display: block; }\n\n .dti-field { display: flex; flex-direction: column; gap: 6px; }\n\n .dti-label {\n font-size: 0.8125rem; font-weight: 600; color: #374151; line-height: 1;\n }\n .dti-required { color: #dc2626; margin-left: 2px; }\n\n .dti-input {\n width: 100%; box-sizing: border-box;\n padding: 8px 12px; font-size: 0.875rem; font-family: inherit;\n color: #1e293b; background: #fff;\n border: 1px solid #7c8ba1; border-radius: 8px;\n outline: none; transition: border-color 0.15s, box-shadow 0.15s;\n appearance: none;\n &:focus {\n border-color: #3b82f6;\n box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);\n }\n }\n\n .dti-error .dti-input {\n border-color: #ef4444;\n &:focus { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12); }\n }\n\n .dti-disabled .dti-input { opacity: 0.5; cursor: not-allowed; }\n\n .dti-desc { margin: -6px 0 0; font-size: 0.75rem; line-height: 1.4; color: #64748b; }\n .dti-desc-error { color: #dc2626; }\n\n @media (pointer: coarse), (max-width: 480px) { .dti-input { font-size: 1rem; } }\n @media (pointer: coarse), (max-width: 480px) { .dti-input { min-height: 44px; } }\n `],\n})\n/**\n * Native date-time picker (ControlValueAccessor, ISO string value).\n * Built-in validation: `required` -> \"<label> is required.\"; a value that is not a real date-time -> \"Please enter a valid date-time.\";\n * below `min` -> \"Must be on or after <date>\"; above `max` -> \"Must be on or before <date>\" (a `min`/`max` that cannot be\n * parsed is ignored). Disabled fields are never invalid.\n *\n * Validity API (same on every ui input): the component is an Angular `Validator` (`ngModel` / `FormControl` report\n * `.invalid` / `.errors`), exposes the signals `invalid` + `errorMessage` and the `invalidChange` output, and provides\n * `UiFieldValidity` so a host can use `viewChildren(UiFieldValidity)`. Messages (built-in and a host `[error]`) are displayed only after the user left THIS field (blur); `[showErrors]=\"true\"` reveals the message of an untouched field at once, and setting it back to false clears the touched state.\n */\nexport class DatetimeInputComponent implements ControlValueAccessor, Validator, UiFieldValidity {\n protected readonly labels = inject(UiLabelsService);\n readonly label = input('');\n readonly required = input(false);\n readonly min = input('');\n readonly max = input('');\n readonly hint = input('');\n /** Id(s) of an external element that also describes this control (e.g. one shared error text for a group of fields). Space separated; MERGED after the control's own hint / error id in `aria-describedby`, never replacing it. Empty = unchanged. */\n readonly ariaDescribedBy = input('');\n readonly error = input('');\n /** The host's \"tried to submit\" flag (e.g. after a failed Save click). `true` reveals the message of an untouched field at once (the field also shows it after the user left THIS field); switching it from true back to false forgets that the field was left. */\n readonly showErrors = input(false);\n\n readonly _disabledInput = input(false, { alias: 'disabled' });\n private readonly _cvaDisabled = signal(false);\n protected readonly disabled = computed(() => this._disabledInput() || this._cvaDisabled());\n\n protected readonly _value = signal('');\n\n /** `aria-describedby`: the error / hint text, then the host's `ariaDescribedBy` id(s). */\n protected readonly _describedBy = computed(() => mergeDescribedBy((this._activeError() || this.hint()) ? this._inputId + '-desc' : null, this.ariaDescribedBy()));\n private readonly _reveal = createFieldReveal(this.showErrors);\n private readonly _issue = computed(() => this._check(this._value()));\n /** True while the value breaks a built-in rule or the host passed an `[error]`. */\n readonly invalid = computed(() => !!this.error() || !!this._issue());\n /** Message of the first broken built-in rule ('' when valid), shown or not. */\n readonly errorMessage = computed(() => this._issue()?.message ?? '');\n /** Emits whenever the field becomes invalid / valid. */\n readonly invalidChange = output<boolean>();\n protected readonly _activeError = computed(() => this._reveal.revealed() ? (this.error() || this.errorMessage()) : '');\n private _onValidatorChange = () => {};\n\n constructor() {\n effect(() => { this.invalidChange.emit(this.invalid()); });\n }\n\n /** Re-run the form control's validation when a rule input (required, maxlength, min, options, ...) changes. */\n ngOnChanges() { this._onValidatorChange(); }\n\n validate(control: AbstractControl): ValidationErrors | null {\n const v = control.value;\n return issueToErrors(this._check(v == null ? '' : String(v)));\n }\n registerOnValidatorChange(fn: () => void) { this._onValidatorChange = fn; }\n\n protected readonly _inputId = `dti-${Math.random().toString(36).slice(2, 8)}`;\n\n private _onChange = (_: string) => {};\n private _onTouched = () => {};\n\n writeValue(val: string) { this._value.set(val ?? ''); }\n registerOnChange(fn: (v: string) => void) { this._onChange = fn; }\n registerOnTouched(fn: () => void) { this._onTouched = fn; }\n setDisabledState(d: boolean) { this._cvaDisabled.set(d); }\n\n protected onChange(event: Event) {\n const val = (event.target as HTMLInputElement).value;\n this._value.set(val);\n this._onChange(val);\n }\n\n protected onBlur() { this._onTouched(); this._reveal.touched.set(true); }\n\n private _check(value: string): FieldIssue | null {\n if (this.disabled()) return null;\n const text = value.trim();\n if (!text) return this.required() ? requiredIssue(this.label()) : null;\n const p = parseIso(text, true);\n if (!p) return { key: 'date', message: this.labels.t('validation.dateTime') };\n const min = this.min() ? parseIso(this.min(), true) : null;\n if (min && isoKey(p) < isoKey(min)) return { key: 'min', message: this.labels.t('validation.onOrAfter', { value: formatIsoDateTime(this.min(), this.labels.locale()) }), value: { min: this.min(), actual: text } };\n const max = this.max() ? parseIso(this.max(), true) : null;\n if (max && isoKey(p) > isoKey(max)) return { key: 'max', message: this.labels.t('validation.onOrBefore', { value: formatIso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eAAA,gBAAA;GAAA,WAxFtB;IAAC;KACV,SAAS;KACT,aAAa,iBAAiB,sBAAsB;KACpD,OAAO;IACR;IAAE;KACD,SAAS;KACT,aAAa,iBAAiB,sBAAsB;KACpD,OAAO;IACR;IAAE;KACD,SAAS;KACT,aAAa,iBAAiB,sBAAsB;IACrD;GAAA;GAAC,eAAA;GAAA,UAAA;GAAA,UACQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BT,UAAA;GAAA,QAAA,CAAA,44BAAA;GAAA,iBAAA,GAAA,wBAAA;EAAA,CAAA;CAAA;;AAgDU,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAsB,YAAA,CAAA;EA5FlC,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAmB,YACjB;GAAI,iBACC,wBAAwB;GAAM,WACpC;IAAC;KACV,SAAS;KACT,aAAa,iBAAgB,sBAAuB;KACpD,OAAO;IACR;IAAE;KACD,SAAS;KACT,aAAa,iBAAgB,sBAAuB;KACpD,OAAO;IACR;IAAE;KACD,SAAS;KACT,aAAa,iBAAgB,sBAAuB;IACrD;GAAA;GAAC,UACQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BT,QAAA,CAAA,44BAAA;EAAA,CAAA"}
@@ -32,6 +32,7 @@ var DetailCardComponent = class DetailCardComponent {
32
32
  this.fill = input(false, ...ngDevMode ? [{ debugName: "fill" }] : /* istanbul ignore next */ []);
33
33
  this.noPadding = input(false, ...ngDevMode ? [{ debugName: "noPadding" }] : /* istanbul ignore next */ []);
34
34
  this.maxBodyHeight = input("", ...ngDevMode ? [{ debugName: "maxBodyHeight" }] : /* istanbul ignore next */ []);
35
+ this.overflowVisible = input(false, ...ngDevMode ? [{ debugName: "overflowVisible" }] : /* istanbul ignore next */ []);
35
36
  this.selectable = input(false, ...ngDevMode ? [{ debugName: "selectable" }] : /* istanbul ignore next */ []);
36
37
  this.selected = model(false, ...ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []);
37
38
  this.selectedColor = input("#3b82f6", ...ngDevMode ? [{ debugName: "selectedColor" }] : /* istanbul ignore next */ []);
@@ -235,6 +236,13 @@ var DetailCardComponent = class DetailCardComponent {
235
236
  isRequired: false,
236
237
  transformFunction: null
237
238
  },
239
+ overflowVisible: {
240
+ classPropertyName: "overflowVisible",
241
+ publicName: "overflowVisible",
242
+ isSignal: true,
243
+ isRequired: false,
244
+ transformFunction: null
245
+ },
238
246
  selectable: {
239
247
  classPropertyName: "selectable",
240
248
  publicName: "selectable",
@@ -280,7 +288,7 @@ var DetailCardComponent = class DetailCardComponent {
280
288
  },
281
289
  ngImport: i0,
282
290
  template: `
283
- <div class="dc" [class.dc-fill]="fill()" [class.dc-has-text-color]="!!textColor()" [class.dc-has-bg]="!!((selectable() && selected() && selectedBackground()) || background())" [class.dc-selectable]="selectable()" [class.dc-selected]="selectable() && selected()"
291
+ <div class="dc" [class.dc-fill]="fill()" [class.dc-overflow]="overflowVisible()" [class.dc-has-text-color]="!!textColor()" [class.dc-has-bg]="!!((selectable() && selected() && selectedBackground()) || background())" [class.dc-selectable]="selectable()" [class.dc-selected]="selectable() && selected()"
284
292
  [style.outline-color]="selectable() && selected() ? selectedColor() : null"
285
293
  [style.background]="(selectable() && selected() && selectedBackground()) || background() || null" (click)="onCardClick($event)"
286
294
  [style.color]="textColor() || null" [style.--dc-text]="textColor() || null" [style.--dc-body-max-height]="maxBodyHeight() || null">
@@ -326,7 +334,7 @@ var DetailCardComponent = class DetailCardComponent {
326
334
  </div>
327
335
  `,
328
336
  isInline: true,
329
- styles: [":host{display:block;margin-bottom:16px}:host(:last-child){margin-bottom:0}:host(.dc-fill-host){height:100%;margin-bottom:0}.dc.dc-fill{height:100%;box-sizing:border-box;display:flex;flex-direction:column}.dc.dc-fill .dc-body-wrap{flex:1 1 auto;min-height:0}.dc.dc-fill .dc-body{display:flex;flex-direction:column}.dc-selectable{cursor:pointer}.dc-selected{outline:2px solid #3b82f6;outline-offset:-1px}.dc{background:#fff;border:1px solid #e2e8f0;border-radius:10px;overflow:hidden}.dc-header{display:flex;align-items:center;flex-wrap:wrap;gap:8px 10px;padding:14px 18px}.dc-header.open{border-bottom:1px solid #f1f5f9}.dc-has-bg .dc-header.open{border-bottom-color:#94a3b859}.dc-header.collapsible{cursor:pointer;-webkit-user-select:none;user-select:none}@media(hover:hover){.dc-header.collapsible:hover{background:#f8fafc}}.dc-chevron{flex-shrink:0;color:var(--dc-text, #64748b)}.dc-chevron svg{transition:transform .2s}.dc-chevron svg.rotated{transform:rotate(-90deg)}.dc-header-text{display:flex;flex-direction:column;gap:2px;flex:1 1 160px;min-width:0;word-break:break-word;overflow-wrap:anywhere}.dc-title{font-size:.8125rem;font-weight:800;letter-spacing:.07em;color:var(--dc-text, #1e293b);line-height:1.3;text-transform:uppercase}.dc-title--as-written{text-transform:none}.dc-subtitle{font-size:.8125rem;color:var(--dc-text, #475569)}.dc-has-text-color .dc-subtitle{opacity:.8}.dc-has-text-color .dc-header.open{border-bottom-color:#94a3b859}.dc-edit{flex-shrink:0;margin-left:auto}.dc-edit-action{display:inline-flex;align-items:center;justify-content:center;gap:5px;font-family:inherit;font-size:.8rem;font-weight:500;line-height:1.4;color:#64748b;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:4px 10px;cursor:pointer;white-space:nowrap;transition:background-color .15s ease,color .15s ease}.dc-edit-action:hover{background:#f1f5f9;color:#1e293b}.dc-edit-action:focus-visible{outline:2px solid var(--ui-focus, #3b82f6);outline-offset:2px}@media(pointer:coarse),(max-width:480px){.dc-edit-action{min-height:44px}}.dc-body-wrap{display:grid;grid-template-rows:1fr;transition:grid-template-rows .25s ease}.dc-body-wrap.collapsed{grid-template-rows:0fr}.dc-body{box-sizing:border-box;padding:16px 18px;min-height:0;overflow-x:hidden;overflow-y:auto;max-height:var(--dc-body-max-height, none)}.dc-body.dc-body--flush{padding:0}.dc-footer{padding:10px 18px;border-top:1px solid #f1f5f9}.dc-footer:empty,.dc-footer.dc-footer--hidden{display:none}.dc-footer.dc-footer--end:not(:empty):not(.dc-footer--hidden){display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px}.dc-has-bg .dc-footer{border-top-color:#94a3b859}@media(max-width:480px){.dc-footer{padding:10px 14px}.dc-header{padding:12px 14px}.dc-body{padding:14px}.dc-edit{margin-left:0}}@media(prefers-reduced-motion:reduce){.dc-body-wrap,.dc-chevron svg{transition:none}}\n"],
337
+ styles: [":host{display:block;margin-bottom:16px}:host(:last-child){margin-bottom:0}:host(.dc-fill-host){height:100%;margin-bottom:0}.dc.dc-fill{height:100%;box-sizing:border-box;display:flex;flex-direction:column}.dc.dc-fill .dc-body-wrap{flex:1 1 auto;min-height:0}.dc.dc-fill .dc-body{display:flex;flex-direction:column}.dc.dc-overflow{overflow:visible}.dc.dc-overflow .dc-header{border-radius:9px 9px 0 0}.dc.dc-overflow .dc-footer{border-radius:0 0 9px 9px}.dc.dc-overflow .dc-body-wrap:not(.collapsed) .dc-body{overflow:visible}.dc-selectable{cursor:pointer}.dc-selected{outline:2px solid #3b82f6;outline-offset:-1px}.dc{background:#fff;border:1px solid #e2e8f0;border-radius:10px;overflow:hidden}.dc-header{display:flex;align-items:center;flex-wrap:wrap;gap:8px 10px;padding:14px 18px}.dc-header.open{border-bottom:1px solid #f1f5f9}.dc-has-bg .dc-header.open{border-bottom-color:#94a3b859}.dc-header.collapsible{cursor:pointer;-webkit-user-select:none;user-select:none}@media(hover:hover){.dc-header.collapsible:hover{background:#f8fafc}}.dc-chevron{flex-shrink:0;color:var(--dc-text, #64748b)}.dc-chevron svg{transition:transform .2s}.dc-chevron svg.rotated{transform:rotate(-90deg)}.dc-header-text{display:flex;flex-direction:column;gap:2px;flex:1 1 160px;min-width:0;word-break:break-word;overflow-wrap:anywhere}.dc-title{font-size:.8125rem;font-weight:800;letter-spacing:.07em;color:var(--dc-text, #1e293b);line-height:1.3;text-transform:uppercase}.dc-title--as-written{text-transform:none}.dc-subtitle{font-size:.8125rem;color:var(--dc-text, #475569)}.dc-has-text-color .dc-subtitle{opacity:.8}.dc-has-text-color .dc-header.open{border-bottom-color:#94a3b859}.dc-edit{flex-shrink:0;margin-left:auto}.dc-edit-action{display:inline-flex;align-items:center;justify-content:center;gap:5px;font-family:inherit;font-size:.8rem;font-weight:500;line-height:1.4;color:#64748b;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:4px 10px;cursor:pointer;white-space:nowrap;transition:background-color .15s ease,color .15s ease}.dc-edit-action:hover{background:#f1f5f9;color:#1e293b}.dc-edit-action:focus-visible{outline:2px solid var(--ui-focus, #3b82f6);outline-offset:2px}@media(pointer:coarse),(max-width:480px){.dc-edit-action{min-height:44px}}.dc-body-wrap{display:grid;grid-template-rows:1fr;transition:grid-template-rows .25s ease}.dc-body-wrap.collapsed{grid-template-rows:0fr}.dc-body{box-sizing:border-box;padding:16px 18px;min-height:0;overflow-x:hidden;overflow-y:auto;max-height:var(--dc-body-max-height, none)}.dc-body.dc-body--flush{padding:0}.dc-footer{padding:10px 18px;border-top:1px solid #f1f5f9}.dc-footer:empty,.dc-footer.dc-footer--hidden{display:none}.dc-footer.dc-footer--end:not(:empty):not(.dc-footer--hidden){display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px}.dc-has-bg .dc-footer{border-top-color:#94a3b859}@media(max-width:480px){.dc-footer{padding:10px 14px}.dc-header{padding:12px 14px}.dc-body{padding:14px}.dc-edit{margin-left:0}}@media(prefers-reduced-motion:reduce){.dc-body-wrap,.dc-chevron svg{transition:none}}\n"],
330
338
  dependencies: [{
331
339
  kind: "component",
332
340
  type: ButtonComponent,
@@ -381,7 +389,7 @@ i0.ɵɵngDeclareClassMetadata({
381
389
  "[attr.aria-label]": "groupLabel()"
382
390
  },
383
391
  template: `
384
- <div class="dc" [class.dc-fill]="fill()" [class.dc-has-text-color]="!!textColor()" [class.dc-has-bg]="!!((selectable() && selected() && selectedBackground()) || background())" [class.dc-selectable]="selectable()" [class.dc-selected]="selectable() && selected()"
392
+ <div class="dc" [class.dc-fill]="fill()" [class.dc-overflow]="overflowVisible()" [class.dc-has-text-color]="!!textColor()" [class.dc-has-bg]="!!((selectable() && selected() && selectedBackground()) || background())" [class.dc-selectable]="selectable()" [class.dc-selected]="selectable() && selected()"
385
393
  [style.outline-color]="selectable() && selected() ? selectedColor() : null"
386
394
  [style.background]="(selectable() && selected() && selectedBackground()) || background() || null" (click)="onCardClick($event)"
387
395
  [style.color]="textColor() || null" [style.--dc-text]="textColor() || null" [style.--dc-body-max-height]="maxBodyHeight() || null">
@@ -426,7 +434,7 @@ i0.ɵɵngDeclareClassMetadata({
426
434
  <div class="dc-footer" [class.dc-footer--hidden]="!isOpen()" [class.dc-footer--end]="footerAlign() === 'end'" [style.background]="footerBackground() || null"><ng-content select="[card-footer]" /></div>
427
435
  </div>
428
436
  `,
429
- styles: [":host{display:block;margin-bottom:16px}:host(:last-child){margin-bottom:0}:host(.dc-fill-host){height:100%;margin-bottom:0}.dc.dc-fill{height:100%;box-sizing:border-box;display:flex;flex-direction:column}.dc.dc-fill .dc-body-wrap{flex:1 1 auto;min-height:0}.dc.dc-fill .dc-body{display:flex;flex-direction:column}.dc-selectable{cursor:pointer}.dc-selected{outline:2px solid #3b82f6;outline-offset:-1px}.dc{background:#fff;border:1px solid #e2e8f0;border-radius:10px;overflow:hidden}.dc-header{display:flex;align-items:center;flex-wrap:wrap;gap:8px 10px;padding:14px 18px}.dc-header.open{border-bottom:1px solid #f1f5f9}.dc-has-bg .dc-header.open{border-bottom-color:#94a3b859}.dc-header.collapsible{cursor:pointer;-webkit-user-select:none;user-select:none}@media(hover:hover){.dc-header.collapsible:hover{background:#f8fafc}}.dc-chevron{flex-shrink:0;color:var(--dc-text, #64748b)}.dc-chevron svg{transition:transform .2s}.dc-chevron svg.rotated{transform:rotate(-90deg)}.dc-header-text{display:flex;flex-direction:column;gap:2px;flex:1 1 160px;min-width:0;word-break:break-word;overflow-wrap:anywhere}.dc-title{font-size:.8125rem;font-weight:800;letter-spacing:.07em;color:var(--dc-text, #1e293b);line-height:1.3;text-transform:uppercase}.dc-title--as-written{text-transform:none}.dc-subtitle{font-size:.8125rem;color:var(--dc-text, #475569)}.dc-has-text-color .dc-subtitle{opacity:.8}.dc-has-text-color .dc-header.open{border-bottom-color:#94a3b859}.dc-edit{flex-shrink:0;margin-left:auto}.dc-edit-action{display:inline-flex;align-items:center;justify-content:center;gap:5px;font-family:inherit;font-size:.8rem;font-weight:500;line-height:1.4;color:#64748b;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:4px 10px;cursor:pointer;white-space:nowrap;transition:background-color .15s ease,color .15s ease}.dc-edit-action:hover{background:#f1f5f9;color:#1e293b}.dc-edit-action:focus-visible{outline:2px solid var(--ui-focus, #3b82f6);outline-offset:2px}@media(pointer:coarse),(max-width:480px){.dc-edit-action{min-height:44px}}.dc-body-wrap{display:grid;grid-template-rows:1fr;transition:grid-template-rows .25s ease}.dc-body-wrap.collapsed{grid-template-rows:0fr}.dc-body{box-sizing:border-box;padding:16px 18px;min-height:0;overflow-x:hidden;overflow-y:auto;max-height:var(--dc-body-max-height, none)}.dc-body.dc-body--flush{padding:0}.dc-footer{padding:10px 18px;border-top:1px solid #f1f5f9}.dc-footer:empty,.dc-footer.dc-footer--hidden{display:none}.dc-footer.dc-footer--end:not(:empty):not(.dc-footer--hidden){display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px}.dc-has-bg .dc-footer{border-top-color:#94a3b859}@media(max-width:480px){.dc-footer{padding:10px 14px}.dc-header{padding:12px 14px}.dc-body{padding:14px}.dc-edit{margin-left:0}}@media(prefers-reduced-motion:reduce){.dc-body-wrap,.dc-chevron svg{transition:none}}\n"]
437
+ styles: [":host{display:block;margin-bottom:16px}:host(:last-child){margin-bottom:0}:host(.dc-fill-host){height:100%;margin-bottom:0}.dc.dc-fill{height:100%;box-sizing:border-box;display:flex;flex-direction:column}.dc.dc-fill .dc-body-wrap{flex:1 1 auto;min-height:0}.dc.dc-fill .dc-body{display:flex;flex-direction:column}.dc.dc-overflow{overflow:visible}.dc.dc-overflow .dc-header{border-radius:9px 9px 0 0}.dc.dc-overflow .dc-footer{border-radius:0 0 9px 9px}.dc.dc-overflow .dc-body-wrap:not(.collapsed) .dc-body{overflow:visible}.dc-selectable{cursor:pointer}.dc-selected{outline:2px solid #3b82f6;outline-offset:-1px}.dc{background:#fff;border:1px solid #e2e8f0;border-radius:10px;overflow:hidden}.dc-header{display:flex;align-items:center;flex-wrap:wrap;gap:8px 10px;padding:14px 18px}.dc-header.open{border-bottom:1px solid #f1f5f9}.dc-has-bg .dc-header.open{border-bottom-color:#94a3b859}.dc-header.collapsible{cursor:pointer;-webkit-user-select:none;user-select:none}@media(hover:hover){.dc-header.collapsible:hover{background:#f8fafc}}.dc-chevron{flex-shrink:0;color:var(--dc-text, #64748b)}.dc-chevron svg{transition:transform .2s}.dc-chevron svg.rotated{transform:rotate(-90deg)}.dc-header-text{display:flex;flex-direction:column;gap:2px;flex:1 1 160px;min-width:0;word-break:break-word;overflow-wrap:anywhere}.dc-title{font-size:.8125rem;font-weight:800;letter-spacing:.07em;color:var(--dc-text, #1e293b);line-height:1.3;text-transform:uppercase}.dc-title--as-written{text-transform:none}.dc-subtitle{font-size:.8125rem;color:var(--dc-text, #475569)}.dc-has-text-color .dc-subtitle{opacity:.8}.dc-has-text-color .dc-header.open{border-bottom-color:#94a3b859}.dc-edit{flex-shrink:0;margin-left:auto}.dc-edit-action{display:inline-flex;align-items:center;justify-content:center;gap:5px;font-family:inherit;font-size:.8rem;font-weight:500;line-height:1.4;color:#64748b;background:none;border:1px solid #e2e8f0;border-radius:6px;padding:4px 10px;cursor:pointer;white-space:nowrap;transition:background-color .15s ease,color .15s ease}.dc-edit-action:hover{background:#f1f5f9;color:#1e293b}.dc-edit-action:focus-visible{outline:2px solid var(--ui-focus, #3b82f6);outline-offset:2px}@media(pointer:coarse),(max-width:480px){.dc-edit-action{min-height:44px}}.dc-body-wrap{display:grid;grid-template-rows:1fr;transition:grid-template-rows .25s ease}.dc-body-wrap.collapsed{grid-template-rows:0fr}.dc-body{box-sizing:border-box;padding:16px 18px;min-height:0;overflow-x:hidden;overflow-y:auto;max-height:var(--dc-body-max-height, none)}.dc-body.dc-body--flush{padding:0}.dc-footer{padding:10px 18px;border-top:1px solid #f1f5f9}.dc-footer:empty,.dc-footer.dc-footer--hidden{display:none}.dc-footer.dc-footer--end:not(:empty):not(.dc-footer--hidden){display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px}.dc-has-bg .dc-footer{border-top-color:#94a3b859}@media(max-width:480px){.dc-footer{padding:10px 14px}.dc-header{padding:12px 14px}.dc-body{padding:14px}.dc-edit{margin-left:0}}@media(prefers-reduced-motion:reduce){.dc-body-wrap,.dc-chevron svg{transition:none}}\n"]
430
438
  }]
431
439
  }],
432
440
  propDecorators: {
@@ -613,6 +621,14 @@ i0.ɵɵngDeclareClassMetadata({
613
621
  required: false
614
622
  }]
615
623
  }],
624
+ overflowVisible: [{
625
+ type: i0.Input,
626
+ args: [{
627
+ isSignal: true,
628
+ alias: "overflowVisible",
629
+ required: false
630
+ }]
631
+ }],
616
632
  selectable: [{
617
633
  type: i0.Input,
618
634
  args: [{
@@ -1 +1 @@
1
- {"version":3,"file":"forgeroute-ui-detail-card.mjs","names":[],"sources":["../../../projects/forgeroute-ui/detail-card/src/lib/detail-card/detail-card.component.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, input, model, output, computed, inject } from '@angular/core';\nimport { ButtonComponent } from '@forgeroute/ui/core';\nimport { UiLabelsService } from '@forgeroute/ui/core';\n\n/** Elements inside a selectable card whose clicks never toggle the selection (they act on their own). */\nconst SELECT_IGNORE = 'button, a[href], input, select, textarea, label, [role=button], [role=link], [data-no-select]';\n\n/**\n * Card for detail pages: an optional header and a body, both filled by the page that uses it.\n *\n * Header (all optional - set `[showHeader]=\"false\"` and the card is just the body):\n * - `title` / `subtitle`: the bold uppercase title and the grey line under it.\n * - `titleId`: an id for the title text, which also names the card for assistive tech (aria-labelledby).\n * - `ariaLabel`: the card's accessible name when the header does not provide one (`[showHeader]=\"false\"`, or a header with no title). A visible title always wins; `titleId` still names the card by aria-labelledby.\n * - `<div card-header-leading>`: something before the title block, such as a logo or an icon.\n * - `<ng-container card-header>`: your own header content, shown under the title (or instead of it when no title is set).\n * - `<ng-container card-header-action>`: buttons or links on the right side of the header.\n * - `showEdit` + `editLabel` + `(editClick)`: the built-in Edit button. `editAriaLabel` gives it a longer accessible name\n * (\"Edit informant information\") when the visible label alone is ambiguous; it should contain the visible label.\n * - `fill`: the card stretches to the height of its container (a grid cell or flex item) and its body grows, so cards in\n * one row end at the same height; the default card is only as tall as its content.\n * Use it in grid / flex cells: the spacing between cells comes from the gap, so a filled card's margin-bottom is 0 (the default card keeps 16px).\n * - `background`: the card's background colour (any CSS colour; default white).\n * - `headerBackground`: the background colour of the header bar only (any CSS colour; default none, the card's own background shows). The body keeps the card's `background`, and a header-less card (`showHeader` false) has no bar to colour. A collapsible header keeps this colour on hover. Pair it with `textColor` when the colour is dark.\n * - `textColor`: the colour of the title, subtitle, chevron and body text (any CSS colour; default: the normal slate colours). Use it for light text on a dark `background`. Text you colour yourself inside the body keeps its own colour.\n * - `<ng-container card-footer>` / `<div card-footer>`: a footer bar under the body (a pager, totals, a link). Hidden while empty or collapsed, 10px 18px padding,\n * a light top line; `footerBackground` colours it (pair it with `headerBackground` to frame the card). In a `fill` card it is pinned to the bottom edge.\n * - `footerAlign=\"end\"` (library source 2026-11-04, not yet published): turns the `[card-footer]` bar into a right-aligned action row (flex, `justify-content: flex-end`,\n * 8px gap, wraps on a narrow card) for one or several buttons under the body, e.g. `<ui-button card-footer variant=\"secondary\" size=\"sm\">Open Resident</ui-button>`.\n * Default `'start'` = the footer is unchanged (block content, left-aligned). Hidden while empty or collapsed in both modes.\n * - The body has built-in padding (16px 18px, matching the header's 18px side padding); there is no padding-size input. `[noPadding]=\"true\"` (library source 2026-11-06, not yet published) removes the body padding for a table / list / grid that runs edge to edge.\n * - `collapsible` (default true): a chevron toggle and a clickable header; `[(expanded)]` is two-way.\n * Without a header, or with `collapsible` false, the body is always open.\n *\n * The title is shown in capitals unless `[uppercaseTitle]=\"false\"` (then it shows as written, e.g. \"Case IDs\"); the casing is CSS only, so the accessible name and heading text are always the text you gave; the subtitle keeps the case you give it. The body is the default content slot. A collapsed body is removed from the tab order and from assistive tech.\n *\n * - `selectable` (default false) + `[(selected)]` + `selectedColor` / `selectedBackground`: a pickable card (a product card, a plan). A click anywhere on the card\n * toggles `selected`, except a click on or inside an interactive element (`button, a[href], input, select, textarea, label, [role=button],\n * [role=link], [data-no-select]`; mark any other control with `data-no-select`) and except when text inside the card is being selected\n * (a drag). A selected card gets `data-selected=\"true\"` on the host, a 2px outline (`selectedColor`, default `#3b82f6`, drawn 1px inside the edge) and,\n * when `selectedBackground` is set, that background (instead of `background`). A selectable card shows the pointer cursor.\n * The card is NOT focusable and has no extra role: **a selectable card must contain its own checkbox (or radio)**, which is the keyboard and\n * assistive-tech path (`[checked]=\"selected()\"` / `(change)`). With `selectable` false there is no handler, cursor or outline.\n * (A click on a collapsible header outside its controls still collapses the card as before.)\n *\n * <ui-detail-card title=\"COMMUNICATIONS\" subtitle=\"All calls, texts, and emails\"> ...body... </ui-detail-card>\n * <ui-detail-card title=\"CONTACT INFO\" [showEdit]=\"true\" (editClick)=\"openEdit()\"> ... </ui-detail-card>\n * <ui-detail-card [showHeader]=\"false\"> ...body only... </ui-detail-card>\n * <ui-detail-card [showHeader]=\"false\" ariaLabel=\"Report filters\"> ...body only, but named for assistive tech... </ui-detail-card>\n * <ui-detail-card [collapsible]=\"false\">\n * <div card-header>Any markup</div>\n * <ui-button card-header-action size=\"xs\" variant=\"secondary\">Add</ui-button>\n * ...body...\n * </ui-detail-card>\n */\n@Component({\n selector: 'ui-detail-card',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [ButtonComponent],\n host: {\n 'role': 'group',\n '[class.dc-fill-host]': 'fill()',\n '[attr.data-selected]': 'selectable() && selected() ? \"true\" : null',\n '[attr.aria-labelledby]': 'showHeader() && title() && titleId() ? titleId() : null',\n '[attr.aria-label]': 'groupLabel()',\n },\n template: `\n <div class=\"dc\" [class.dc-fill]=\"fill()\" [class.dc-has-text-color]=\"!!textColor()\" [class.dc-has-bg]=\"!!((selectable() && selected() && selectedBackground()) || background())\" [class.dc-selectable]=\"selectable()\" [class.dc-selected]=\"selectable() && selected()\"\n [style.outline-color]=\"selectable() && selected() ? selectedColor() : null\"\n [style.background]=\"(selectable() && selected() && selectedBackground()) || background() || null\" (click)=\"onCardClick($event)\"\n [style.color]=\"textColor() || null\" [style.--dc-text]=\"textColor() || null\" [style.--dc-body-max-height]=\"maxBodyHeight() || null\">\n @if (showHeader()) {\n <div class=\"dc-header\" [class.collapsible]=\"collapsible()\" [class.open]=\"isOpen()\" [style.background]=\"headerBackground() || null\" (click)=\"onHeaderClick($event)\">\n @if (collapsible()) {\n <ui-button class=\"dc-chevron\" variant=\"icon\" size=\"sm\"\n [ariaLabel]=\"title() || labels.t('detailCard.toggleSection')\"\n [ariaExpanded]=\"isOpen()\"\n (click)=\"$event.stopPropagation(); toggle()\">\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\"\n stroke-linecap=\"round\" stroke-linejoin=\"round\" [class.rotated]=\"!isOpen()\" aria-hidden=\"true\">\n <path d=\"M6 9l6 6 6-6\"/>\n </svg>\n </ui-button>\n }\n <ng-content select=\"[card-header-leading]\" />\n <div class=\"dc-header-text\">\n @if (title()) { <span class=\"dc-title\" [class.dc-title--as-written]=\"!uppercaseTitle()\" [attr.id]=\"titleId() || null\" [attr.role]=\"headingLevel() ? 'heading' : null\" [attr.aria-level]=\"headingLevel() || null\">{{ title() }}</span> }\n @if (subtitle()) { <span class=\"dc-subtitle\">{{ subtitle() }}</span> }\n <ng-content select=\"[card-header]\" />\n </div>\n @if (showEdit()) {\n <span class=\"dc-edit\"><button type=\"button\" class=\"dc-edit-action\" [attr.aria-label]=\"editAriaLabel() || null\" [attr.data-testid]=\"editTestId() || null\" (click)=\"$event.stopPropagation(); editClick.emit()\">\n @if (editIcon()) {\n <svg width=\"13\" height=\"13\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" aria-hidden=\"true\">\n <path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"/>\n <path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"/>\n </svg>\n }\n {{ editLabel() }}\n </button></span>\n }\n <ng-content select=\"[card-header-action]\" />\n </div>\n }\n <div class=\"dc-body-wrap\" [class.collapsed]=\"!isOpen()\" [attr.inert]=\"isOpen() ? null : ''\" [attr.aria-hidden]=\"isOpen() ? null : 'true'\">\n <div class=\"dc-body\" [class.dc-body--flush]=\"noPadding()\">\n <ng-content />\n </div>\n </div>\n <div class=\"dc-footer\" [class.dc-footer--hidden]=\"!isOpen()\" [class.dc-footer--end]=\"footerAlign() === 'end'\" [style.background]=\"footerBackground() || null\"><ng-content select=\"[card-footer]\" /></div>\n </div>\n `,\n styles: [`\n :host { display: block; margin-bottom: 16px; }\n :host(:last-child) { margin-bottom: 0; }\n /* fill: the card takes the height of its grid cell / flex item and the body grows. */\n :host(.dc-fill-host) { height: 100%; margin-bottom: 0; } /* margin 0: height 100% + the 16px margin would overflow the cell; spacing comes from the grid gap */\n .dc.dc-fill { height: 100%; box-sizing: border-box; display: flex; flex-direction: column; } /* border-box: the 1px border must not push the card past its cell */\n .dc.dc-fill .dc-body-wrap { flex: 1 1 auto; min-height: 0; }\n /* fill: the body (a stretched cell of the .dc-body-wrap grid) is a flex column, so projected content can grow to the card's height (e.g. pin a price to the bottom with margin-top: auto) */\n .dc.dc-fill .dc-body { display: flex; flex-direction: column; }\n\n .dc-selectable { cursor: pointer; }\n .dc-selected { outline: 2px solid #3b82f6; outline-offset: -1px; } /* the colour comes from selectedColor (inline outline-color) */\n .dc { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; }\n\n .dc-header { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 14px 18px; }\n .dc-header.open { border-bottom: 1px solid #f1f5f9; }\n /* a card with its own background colour (or a selected background) gets a darker, translucent header line: the pale default vanishes on a tint */\n .dc-has-bg .dc-header.open { border-bottom-color: rgba(148, 163, 184, 0.35); }\n .dc-header.collapsible { cursor: pointer; -webkit-user-select: none; user-select: none; } /* Safari needs the -webkit- prefix */\n @media (hover: hover) { .dc-header.collapsible:hover { background: #f8fafc; } }\n\n .dc-chevron { flex-shrink: 0; color: var(--dc-text, #64748b); }\n .dc-chevron svg { transition: transform 0.2s; }\n .dc-chevron svg.rotated { transform: rotate(-90deg); }\n\n .dc-header-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 160px; min-width: 0; word-break: break-word; overflow-wrap: anywhere; } /* word-break: Safari < 15.4 has no overflow-wrap: anywhere */\n .dc-title { font-size: 0.8125rem; font-weight: 800; letter-spacing: 0.07em; color: var(--dc-text, #1e293b); line-height: 1.3; text-transform: uppercase; }\n .dc-title--as-written { text-transform: none; }\n .dc-subtitle { font-size: 0.8125rem; color: var(--dc-text, #475569); } /* 13px: the same size as the title (which is bold capitals), no longer the smaller 12px */\n .dc-has-text-color .dc-subtitle { opacity: 0.8; }\n .dc-has-text-color .dc-header.open { border-bottom-color: rgba(148, 163, 184, 0.35); }\n .dc-edit { flex-shrink: 0; margin-left: auto; }\n /* Same look as the contact detail page's Edit link: 0.8rem / 500, slate text, light border, 6px radius. */\n .dc-edit-action { display: inline-flex; align-items: center; justify-content: center; gap: 5px; font-family: inherit; font-size: 0.8rem; font-weight: 500; line-height: 1.4; color: #64748b; background: none; border: 1px solid #e2e8f0; border-radius: 6px; padding: 4px 10px; cursor: pointer; white-space: nowrap; transition: background-color 150ms ease, color 150ms ease; }\n .dc-edit-action:hover { background: #f1f5f9; color: #1e293b; }\n .dc-edit-action:focus-visible { outline: 2px solid var(--ui-focus, #3b82f6); outline-offset: 2px; }\n @media (pointer: coarse), (max-width: 480px) { .dc-edit-action { min-height: 44px; } } /* the library-wide 44px touch target */\n\n .dc-body-wrap { display: grid; grid-template-rows: 1fr; transition: grid-template-rows 0.25s ease; }\n .dc-body-wrap.collapsed { grid-template-rows: 0fr; }\n /* A tall body scrolls inside the card instead of stretching it: set a max height with the maxBodyHeight input or the --dc-body-max-height custom property (default none: the body is as tall as its content). */\n .dc-body { box-sizing: border-box; padding: 16px 18px; min-height: 0; overflow-x: hidden; overflow-y: auto; max-height: var(--dc-body-max-height, none); }\n\n /* noPadding: the body has no padding of its own, for a table, list or grid that runs edge to edge. */\n .dc-body.dc-body--flush { padding: 0; }\n\n /* Footer slot: a bar under the body (e.g. a pager), hidden while empty or collapsed. In a filled card it sits at the bottom edge. */\n .dc-footer { padding: 10px 18px; border-top: 1px solid #f1f5f9; }\n .dc-footer:empty, .dc-footer.dc-footer--hidden { display: none; }\n /* footerAlign=\"end\": a right-aligned action row (never shown while the footer is empty or collapsed). */\n .dc-footer.dc-footer--end:not(:empty):not(.dc-footer--hidden) { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }\n .dc-has-bg .dc-footer { border-top-color: rgba(148, 163, 184, 0.35); }\n\n @media (max-width: 480px) {\n .dc-footer { padding: 10px 14px; }\n .dc-header { padding: 12px 14px; }\n .dc-body { padding: 14px; }\n .dc-edit { margin-left: 0; }\n }\n @media (prefers-reduced-motion: reduce) {\n .dc-body-wrap, .dc-chevron svg { transition: none; }\n }\n `],\n})\nexport class DetailCardComponent {\n protected readonly labels = inject(UiLabelsService);\n /** Bold uppercase title. Empty = no title text. */\n readonly title = input('');\n /** true (default) = the title is displayed in capitals (CSS only); false = shown as written. The text, aria-label and heading name are never changed. */\n readonly uppercaseTitle = input(true);\n /** 1-6 makes the title a real heading for screen readers (role=heading, aria-level); null keeps it plain text. */\n readonly headingLevel = input<1 | 2 | 3 | 4 | 5 | 6 | null>(null);\n /** Optional id for the title text; the card is then labelled by it. Without it the title is the card's aria-label. */\n readonly titleId = input('');\n /** Accessible name of the card when the header gives none (no header, or no title). A visible title wins; blank = no name. */\n readonly ariaLabel = input('');\n /** Grey line under the title. */\n readonly subtitle = input('');\n /** Card background as any CSS colour (`#f8fafc`, `var(--surface)` …). Empty = white. */\n readonly background = input('');\n /** Background colour of the header bar only, as any CSS colour (`#eaf3ff`, `var(--surface-2)` …). Empty = the header has no colour of its own (the card background shows). The body is not affected. */\n readonly headerBackground = input('');\n /** Background colour of the footer bar (the `[card-footer]` slot) as any CSS colour. Empty = no colour of its own. */\n readonly footerBackground = input('');\n /** Alignment of the `[card-footer]` content: `'start'` (default, unchanged) or `'end'` = a right-aligned action row with an 8px gap. */\n readonly footerAlign = input<'start' | 'end'>('start');\n /** Text colour as any CSS colour (`#fff`, `var(--on-dark)` …). Empty = the default colours. Colours the title, subtitle, chevron and body text. */\n readonly textColor = input('');\n /** false = no header at all (no title, edit button, toggle or divider): the card is only the body, always open. */\n readonly showHeader = input(true);\n /** Chevron toggle + clickable header. false = the body is always open. */\n readonly collapsible = input(true);\n /** Two-way: whether the body is open. */\n readonly expanded = model(true);\n /** Show the built-in Edit button in the header. */\n readonly showEdit = input(false);\n readonly editLabelInput = input<string | null>(null, { alias: 'editLabel' });\n readonly editLabel = computed(() => this.editLabelInput() ?? this.labels.t('detailCard.editLabel'));\n readonly editClick = output<void>();\n /** `data-testid` of the built-in Edit button (on the Edit `<button>`); none when empty. */\n readonly editTestId = input('');\n /** false = no pencil icon in the Edit button (text only). Default true: unchanged. */\n readonly editIcon = input(true);\n /** Accessible name of the Edit button, e.g. \"Edit informant information\". Empty = the visible `editLabel`. */\n readonly editAriaLabel = input('');\n /** true = the card fills the height of its container (a grid cell / flex item) so sibling cards line up; the body grows. Spacing between cells comes from the gap: the filled card's margin-bottom is 0. Default false: unchanged. */\n readonly fill = input(false);\n /** true = the body has no padding, so a table, list or grid inside runs edge to edge (the header and footer keep theirs). Default false: the 16px 18px body padding. */\n readonly noPadding = input(false);\n /** Max height of the card body (any CSS length, e.g. `360px`): a longer body scrolls inside the card so the card never gets crazy long. Empty = no limit (or the `--dc-body-max-height` custom property, which a page can set on the card or an ancestor). */\n readonly maxBodyHeight = input('');\n\n /** true = a click on the card (outside interactive controls and text selections) toggles `selected`. The card must contain its own checkbox for keyboard / screen-reader users. Default false: no handler, cursor or outline. */\n readonly selectable = input(false);\n /** Two-way: whether the card is selected (only shown / toggled when `selectable`). */\n readonly selected = model(false);\n /** CSS colour of the 2px outline of a selected card. Default `#3b82f6`. */\n readonly selectedColor = input('#3b82f6');\n /** CSS colour used as the card background while selected (wins over `background`). Empty = the background does not change. */\n readonly selectedBackground = input('');\n\n /** The group's aria-label: the visible title (unless `titleId` names the card instead), else `ariaLabel`, else none. */\n groupLabel(): string | null {\n if (this.showHeader() && this.title()) return this.titleId() ? null : this.title();\n return this.ariaLabel().trim() || null;\n }\n /** The body is open unless the card has a header that is collapsible and was collapsed. */\n isOpen(): boolean { return !(this.showHeader() && this.collapsible()) || this.expanded(); }\n\n /** selectable: a click on the card toggles `selected` unless it came from an interactive element or ends a text selection. */\n onCardClick(event: Event) {\n if (!this.selectable()) return;\n const card = event.currentTarget as HTMLElement | null;\n const target = event.target as Element | null;\n if (!card || !target || typeof target.closest !== 'function') return;\n const control = target.closest(SELECT_IGNORE);\n if (control && card.contains(control)) return;\n const sel = card.ownerDocument.defaultView?.getSelection?.();\n if (sel && !sel.isCollapsed && sel.toString() !== '' && (card.contains(sel.anchorNode) || card.contains(sel.focusNode))) return; // a text drag, not a click\n this.selected.set(!this.selected());\n }\n\n toggle() { this.expanded.set(!this.expanded()); }\n\n /** A click on the header toggles, except on a control inside it (Edit, your own header actions, links, inputs). */\n onHeaderClick(event: Event) {\n if (!this.showHeader() || !this.collapsible()) return;\n const target = event.target as Element | null;\n if (target?.closest('button, a, input, select, textarea, label, [role=\"button\"], [role=\"link\"], [tabindex]:not([tabindex=\"-1\"])')?.closest('.dc-header')) {\n // A real control was clicked: its own handler decides. The chevron button toggles through its own (click).\n return;\n }\n this.toggle();\n }\n}\n"],"mappings":";;;AAKA,MAAM,gBAAgB;AA4KtB,IAAa,sBAAb,MAAa,oBAAmB;CA1HhC,cAAA;EA2HqB,KAAA,SAAS,OAAO,eAAe;EAEzC,KAAA,QAAQ,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;EAEjB,KAAA,iBAAiB,MAAM,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,iBAAA,CAAA,+BAAA,CAAA,CAAA;EAE5B,KAAA,eAAe,MAAoC,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,eAAA,CAAA,+BAAA,CAAA,CAAA;EAExD,KAAA,UAAU,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;EAEnB,KAAA,YAAY,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;EAErB,KAAA,WAAW,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;EAEpB,KAAA,aAAa,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,aAAA,CAAA,+BAAA,CAAA,CAAA;EAEtB,KAAA,mBAAmB,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,mBAAA,CAAA,+BAAA,CAAA,CAAA;EAE5B,KAAA,mBAAmB,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,mBAAA,CAAA,+BAAA,CAAA,CAAA;EAE5B,KAAA,cAAc,MAAuB,SAAQ,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;EAE7C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KAAA,YAAA;KAAA,UAAA;KAAA,YAAA;KAAA,mBAAA;IAAA;GAAA;GAAA,SAAA;IAAA,UAAA;IAAA,WAAA;IAAA,UAAA;GAAA;GAAA,MAAA;IAAA,YAAA,EAAA,QAAA,QAAA;IAAA,YAAA;KAAA,sBAAA;KAAA,sBAAA;KAAA,wBAAA;KAAA,mBAAA;IAAA;GAAA;GAAA,UAAA;GAAA,UA9GpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CT,UAAA;GAAA,QAAA,CAAA,+zFAAA;GAAA,cAAA,CAAA;IAAA,MAAA;IAAA,MArDS;IAAe,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;IAAA;GAAA,CAAA;GAAA,iBAAA,GAAA,wBAAA;EAAA,CAAA;CAAA;;AAsHd,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAmB,YAAA,CAAA;EA1H/B,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAgB,YACd;GAAI,iBACC,wBAAwB;GAAM,SACtC,CAAC,eAAe;GAAC,MACpB;IACJ,QAAQ;IACR,wBAAwB;IACxB,wBAAwB;IACxB,0BAA0B;IAC1B,qBAAqB;GACtB;GAAA,UACS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CT,QAAA,CAAA,+zFAAA;EAAA,CAAA"}
1
+ {"version":3,"file":"forgeroute-ui-detail-card.mjs","names":[],"sources":["../../../projects/forgeroute-ui/detail-card/src/lib/detail-card/detail-card.component.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, input, model, output, computed, inject } from '@angular/core';\nimport { ButtonComponent } from '@forgeroute/ui/core';\nimport { UiLabelsService } from '@forgeroute/ui/core';\n\n/** Elements inside a selectable card whose clicks never toggle the selection (they act on their own). */\nconst SELECT_IGNORE = 'button, a[href], input, select, textarea, label, [role=button], [role=link], [data-no-select]';\n\n/**\n * Card for detail pages: an optional header and a body, both filled by the page that uses it.\n *\n * Header (all optional - set `[showHeader]=\"false\"` and the card is just the body):\n * - `title` / `subtitle`: the bold uppercase title and the grey line under it.\n * - `titleId`: an id for the title text, which also names the card for assistive tech (aria-labelledby).\n * - `ariaLabel`: the card's accessible name when the header does not provide one (`[showHeader]=\"false\"`, or a header with no title). A visible title always wins; `titleId` still names the card by aria-labelledby.\n * - `<div card-header-leading>`: something before the title block, such as a logo or an icon.\n * - `<ng-container card-header>`: your own header content, shown under the title (or instead of it when no title is set).\n * - `<ng-container card-header-action>`: buttons or links on the right side of the header.\n * - `showEdit` + `editLabel` + `(editClick)`: the built-in Edit button. `editAriaLabel` gives it a longer accessible name\n * (\"Edit informant information\") when the visible label alone is ambiguous; it should contain the visible label.\n * - `fill`: the card stretches to the height of its container (a grid cell or flex item) and its body grows, so cards in\n * one row end at the same height; the default card is only as tall as its content.\n * Use it in grid / flex cells: the spacing between cells comes from the gap, so a filled card's margin-bottom is 0 (the default card keeps 16px).\n * - `background`: the card's background colour (any CSS colour; default white).\n * - `headerBackground`: the background colour of the header bar only (any CSS colour; default none, the card's own background shows). The body keeps the card's `background`, and a header-less card (`showHeader` false) has no bar to colour. A collapsible header keeps this colour on hover. Pair it with `textColor` when the colour is dark.\n * - `textColor`: the colour of the title, subtitle, chevron and body text (any CSS colour; default: the normal slate colours). Use it for light text on a dark `background`. Text you colour yourself inside the body keeps its own colour.\n * - `<ng-container card-footer>` / `<div card-footer>`: a footer bar under the body (a pager, totals, a link). Hidden while empty or collapsed, 10px 18px padding,\n * a light top line; `footerBackground` colours it (pair it with `headerBackground` to frame the card). In a `fill` card it is pinned to the bottom edge.\n * - `footerAlign=\"end\"` (library source 2026-11-04, not yet published): turns the `[card-footer]` bar into a right-aligned action row (flex, `justify-content: flex-end`,\n * 8px gap, wraps on a narrow card) for one or several buttons under the body, e.g. `<ui-button card-footer variant=\"secondary\" size=\"sm\">Open Resident</ui-button>`.\n * Default `'start'` = the footer is unchanged (block content, left-aligned). Hidden while empty or collapsed in both modes.\n * - The body has built-in padding (16px 18px, matching the header's 18px side padding); there is no padding-size input. `[noPadding]=\"true\"` (library source 2026-11-06, not yet published) removes the body padding for a table / list / grid that runs edge to edge.\n * - `collapsible` (default true): a chevron toggle and a clickable header; `[(expanded)]` is two-way.\n * Without a header, or with `collapsible` false, the body is always open.\n *\n * The title is shown in capitals unless `[uppercaseTitle]=\"false\"` (then it shows as written, e.g. \"Case IDs\"); the casing is CSS only, so the accessible name and heading text are always the text you gave; the subtitle keeps the case you give it. The body is the default content slot. A collapsed body is removed from the tab order and from assistive tech.\n *\n * - `selectable` (default false) + `[(selected)]` + `selectedColor` / `selectedBackground`: a pickable card (a product card, a plan). A click anywhere on the card\n * toggles `selected`, except a click on or inside an interactive element (`button, a[href], input, select, textarea, label, [role=button],\n * [role=link], [data-no-select]`; mark any other control with `data-no-select`) and except when text inside the card is being selected\n * (a drag). A selected card gets `data-selected=\"true\"` on the host, a 2px outline (`selectedColor`, default `#3b82f6`, drawn 1px inside the edge) and,\n * when `selectedBackground` is set, that background (instead of `background`). A selectable card shows the pointer cursor.\n * The card is NOT focusable and has no extra role: **a selectable card must contain its own checkbox (or radio)**, which is the keyboard and\n * assistive-tech path (`[checked]=\"selected()\"` / `(change)`). With `selectable` false there is no handler, cursor or outline.\n * (A click on a collapsible header outside its controls still collapses the card as before.)\n *\n * <ui-detail-card title=\"COMMUNICATIONS\" subtitle=\"All calls, texts, and emails\"> ...body... </ui-detail-card>\n * <ui-detail-card title=\"CONTACT INFO\" [showEdit]=\"true\" (editClick)=\"openEdit()\"> ... </ui-detail-card>\n * <ui-detail-card [showHeader]=\"false\"> ...body only... </ui-detail-card>\n * <ui-detail-card [showHeader]=\"false\" ariaLabel=\"Report filters\"> ...body only, but named for assistive tech... </ui-detail-card>\n * <ui-detail-card [collapsible]=\"false\">\n * <div card-header>Any markup</div>\n * <ui-button card-header-action size=\"xs\" variant=\"secondary\">Add</ui-button>\n * ...body...\n * </ui-detail-card>\n */\n@Component({\n selector: 'ui-detail-card',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [ButtonComponent],\n host: {\n 'role': 'group',\n '[class.dc-fill-host]': 'fill()',\n '[attr.data-selected]': 'selectable() && selected() ? \"true\" : null',\n '[attr.aria-labelledby]': 'showHeader() && title() && titleId() ? titleId() : null',\n '[attr.aria-label]': 'groupLabel()',\n },\n template: `\n <div class=\"dc\" [class.dc-fill]=\"fill()\" [class.dc-overflow]=\"overflowVisible()\" [class.dc-has-text-color]=\"!!textColor()\" [class.dc-has-bg]=\"!!((selectable() && selected() && selectedBackground()) || background())\" [class.dc-selectable]=\"selectable()\" [class.dc-selected]=\"selectable() && selected()\"\n [style.outline-color]=\"selectable() && selected() ? selectedColor() : null\"\n [style.background]=\"(selectable() && selected() && selectedBackground()) || background() || null\" (click)=\"onCardClick($event)\"\n [style.color]=\"textColor() || null\" [style.--dc-text]=\"textColor() || null\" [style.--dc-body-max-height]=\"maxBodyHeight() || null\">\n @if (showHeader()) {\n <div class=\"dc-header\" [class.collapsible]=\"collapsible()\" [class.open]=\"isOpen()\" [style.background]=\"headerBackground() || null\" (click)=\"onHeaderClick($event)\">\n @if (collapsible()) {\n <ui-button class=\"dc-chevron\" variant=\"icon\" size=\"sm\"\n [ariaLabel]=\"title() || labels.t('detailCard.toggleSection')\"\n [ariaExpanded]=\"isOpen()\"\n (click)=\"$event.stopPropagation(); toggle()\">\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\"\n stroke-linecap=\"round\" stroke-linejoin=\"round\" [class.rotated]=\"!isOpen()\" aria-hidden=\"true\">\n <path d=\"M6 9l6 6 6-6\"/>\n </svg>\n </ui-button>\n }\n <ng-content select=\"[card-header-leading]\" />\n <div class=\"dc-header-text\">\n @if (title()) { <span class=\"dc-title\" [class.dc-title--as-written]=\"!uppercaseTitle()\" [attr.id]=\"titleId() || null\" [attr.role]=\"headingLevel() ? 'heading' : null\" [attr.aria-level]=\"headingLevel() || null\">{{ title() }}</span> }\n @if (subtitle()) { <span class=\"dc-subtitle\">{{ subtitle() }}</span> }\n <ng-content select=\"[card-header]\" />\n </div>\n @if (showEdit()) {\n <span class=\"dc-edit\"><button type=\"button\" class=\"dc-edit-action\" [attr.aria-label]=\"editAriaLabel() || null\" [attr.data-testid]=\"editTestId() || null\" (click)=\"$event.stopPropagation(); editClick.emit()\">\n @if (editIcon()) {\n <svg width=\"13\" height=\"13\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" aria-hidden=\"true\">\n <path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"/>\n <path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"/>\n </svg>\n }\n {{ editLabel() }}\n </button></span>\n }\n <ng-content select=\"[card-header-action]\" />\n </div>\n }\n <div class=\"dc-body-wrap\" [class.collapsed]=\"!isOpen()\" [attr.inert]=\"isOpen() ? null : ''\" [attr.aria-hidden]=\"isOpen() ? null : 'true'\">\n <div class=\"dc-body\" [class.dc-body--flush]=\"noPadding()\">\n <ng-content />\n </div>\n </div>\n <div class=\"dc-footer\" [class.dc-footer--hidden]=\"!isOpen()\" [class.dc-footer--end]=\"footerAlign() === 'end'\" [style.background]=\"footerBackground() || null\"><ng-content select=\"[card-footer]\" /></div>\n </div>\n `,\n styles: [`\n :host { display: block; margin-bottom: 16px; }\n :host(:last-child) { margin-bottom: 0; }\n /* fill: the card takes the height of its grid cell / flex item and the body grows. */\n :host(.dc-fill-host) { height: 100%; margin-bottom: 0; } /* margin 0: height 100% + the 16px margin would overflow the cell; spacing comes from the grid gap */\n .dc.dc-fill { height: 100%; box-sizing: border-box; display: flex; flex-direction: column; } /* border-box: the 1px border must not push the card past its cell */\n .dc.dc-fill .dc-body-wrap { flex: 1 1 auto; min-height: 0; }\n /* fill: the body (a stretched cell of the .dc-body-wrap grid) is a flex column, so projected content can grow to the card's height (e.g. pin a price to the bottom with margin-top: auto) */\n .dc.dc-fill .dc-body { display: flex; flex-direction: column; }\n\n /* overflowVisible: popups from the body (a picker's result list, a menu) may extend past the card edge. The header and footer round their own outer corners because the card no longer clips them. A collapsed body still clips. */\n .dc.dc-overflow { overflow: visible; }\n .dc.dc-overflow .dc-header { border-radius: 9px 9px 0 0; }\n .dc.dc-overflow .dc-footer { border-radius: 0 0 9px 9px; }\n .dc.dc-overflow .dc-body-wrap:not(.collapsed) .dc-body { overflow: visible; }\n\n .dc-selectable { cursor: pointer; }\n .dc-selected { outline: 2px solid #3b82f6; outline-offset: -1px; } /* the colour comes from selectedColor (inline outline-color) */\n .dc { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; }\n\n .dc-header { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 14px 18px; }\n .dc-header.open { border-bottom: 1px solid #f1f5f9; }\n /* a card with its own background colour (or a selected background) gets a darker, translucent header line: the pale default vanishes on a tint */\n .dc-has-bg .dc-header.open { border-bottom-color: rgba(148, 163, 184, 0.35); }\n .dc-header.collapsible { cursor: pointer; -webkit-user-select: none; user-select: none; } /* Safari needs the -webkit- prefix */\n @media (hover: hover) { .dc-header.collapsible:hover { background: #f8fafc; } }\n\n .dc-chevron { flex-shrink: 0; color: var(--dc-text, #64748b); }\n .dc-chevron svg { transition: transform 0.2s; }\n .dc-chevron svg.rotated { transform: rotate(-90deg); }\n\n .dc-header-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 160px; min-width: 0; word-break: break-word; overflow-wrap: anywhere; } /* word-break: Safari < 15.4 has no overflow-wrap: anywhere */\n .dc-title { font-size: 0.8125rem; font-weight: 800; letter-spacing: 0.07em; color: var(--dc-text, #1e293b); line-height: 1.3; text-transform: uppercase; }\n .dc-title--as-written { text-transform: none; }\n .dc-subtitle { font-size: 0.8125rem; color: var(--dc-text, #475569); } /* 13px: the same size as the title (which is bold capitals), no longer the smaller 12px */\n .dc-has-text-color .dc-subtitle { opacity: 0.8; }\n .dc-has-text-color .dc-header.open { border-bottom-color: rgba(148, 163, 184, 0.35); }\n .dc-edit { flex-shrink: 0; margin-left: auto; }\n /* Same look as the contact detail page's Edit link: 0.8rem / 500, slate text, light border, 6px radius. */\n .dc-edit-action { display: inline-flex; align-items: center; justify-content: center; gap: 5px; font-family: inherit; font-size: 0.8rem; font-weight: 500; line-height: 1.4; color: #64748b; background: none; border: 1px solid #e2e8f0; border-radius: 6px; padding: 4px 10px; cursor: pointer; white-space: nowrap; transition: background-color 150ms ease, color 150ms ease; }\n .dc-edit-action:hover { background: #f1f5f9; color: #1e293b; }\n .dc-edit-action:focus-visible { outline: 2px solid var(--ui-focus, #3b82f6); outline-offset: 2px; }\n @media (pointer: coarse), (max-width: 480px) { .dc-edit-action { min-height: 44px; } } /* the library-wide 44px touch target */\n\n .dc-body-wrap { display: grid; grid-template-rows: 1fr; transition: grid-template-rows 0.25s ease; }\n .dc-body-wrap.collapsed { grid-template-rows: 0fr; }\n /* A tall body scrolls inside the card instead of stretching it: set a max height with the maxBodyHeight input or the --dc-body-max-height custom property (default none: the body is as tall as its content). */\n .dc-body { box-sizing: border-box; padding: 16px 18px; min-height: 0; overflow-x: hidden; overflow-y: auto; max-height: var(--dc-body-max-height, none); }\n\n /* noPadding: the body has no padding of its own, for a table, list or grid that runs edge to edge. */\n .dc-body.dc-body--flush { padding: 0; }\n\n /* Footer slot: a bar under the body (e.g. a pager), hidden while empty or collapsed. In a filled card it sits at the bottom edge. */\n .dc-footer { padding: 10px 18px; border-top: 1px solid #f1f5f9; }\n .dc-footer:empty, .dc-footer.dc-footer--hidden { display: none; }\n /* footerAlign=\"end\": a right-aligned action row (never shown while the footer is empty or collapsed). */\n .dc-footer.dc-footer--end:not(:empty):not(.dc-footer--hidden) { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }\n .dc-has-bg .dc-footer { border-top-color: rgba(148, 163, 184, 0.35); }\n\n @media (max-width: 480px) {\n .dc-footer { padding: 10px 14px; }\n .dc-header { padding: 12px 14px; }\n .dc-body { padding: 14px; }\n .dc-edit { margin-left: 0; }\n }\n @media (prefers-reduced-motion: reduce) {\n .dc-body-wrap, .dc-chevron svg { transition: none; }\n }\n `],\n})\nexport class DetailCardComponent {\n protected readonly labels = inject(UiLabelsService);\n /** Bold uppercase title. Empty = no title text. */\n readonly title = input('');\n /** true (default) = the title is displayed in capitals (CSS only); false = shown as written. The text, aria-label and heading name are never changed. */\n readonly uppercaseTitle = input(true);\n /** 1-6 makes the title a real heading for screen readers (role=heading, aria-level); null keeps it plain text. */\n readonly headingLevel = input<1 | 2 | 3 | 4 | 5 | 6 | null>(null);\n /** Optional id for the title text; the card is then labelled by it. Without it the title is the card's aria-label. */\n readonly titleId = input('');\n /** Accessible name of the card when the header gives none (no header, or no title). A visible title wins; blank = no name. */\n readonly ariaLabel = input('');\n /** Grey line under the title. */\n readonly subtitle = input('');\n /** Card background as any CSS colour (`#f8fafc`, `var(--surface)` …). Empty = white. */\n readonly background = input('');\n /** Background colour of the header bar only, as any CSS colour (`#eaf3ff`, `var(--surface-2)` …). Empty = the header has no colour of its own (the card background shows). The body is not affected. */\n readonly headerBackground = input('');\n /** Background colour of the footer bar (the `[card-footer]` slot) as any CSS colour. Empty = no colour of its own. */\n readonly footerBackground = input('');\n /** Alignment of the `[card-footer]` content: `'start'` (default, unchanged) or `'end'` = a right-aligned action row with an 8px gap. */\n readonly footerAlign = input<'start' | 'end'>('start');\n /** Text colour as any CSS colour (`#fff`, `var(--on-dark)` …). Empty = the default colours. Colours the title, subtitle, chevron and body text. */\n readonly textColor = input('');\n /** false = no header at all (no title, edit button, toggle or divider): the card is only the body, always open. */\n readonly showHeader = input(true);\n /** Chevron toggle + clickable header. false = the body is always open. */\n readonly collapsible = input(true);\n /** Two-way: whether the body is open. */\n readonly expanded = model(true);\n /** Show the built-in Edit button in the header. */\n readonly showEdit = input(false);\n readonly editLabelInput = input<string | null>(null, { alias: 'editLabel' });\n readonly editLabel = computed(() => this.editLabelInput() ?? this.labels.t('detailCard.editLabel'));\n readonly editClick = output<void>();\n /** `data-testid` of the built-in Edit button (on the Edit `<button>`); none when empty. */\n readonly editTestId = input('');\n /** false = no pencil icon in the Edit button (text only). Default true: unchanged. */\n readonly editIcon = input(true);\n /** Accessible name of the Edit button, e.g. \"Edit informant information\". Empty = the visible `editLabel`. */\n readonly editAriaLabel = input('');\n /** true = the card fills the height of its container (a grid cell / flex item) so sibling cards line up; the body grows. Spacing between cells comes from the gap: the filled card's margin-bottom is 0. Default false: unchanged. */\n readonly fill = input(false);\n /** true = the body has no padding, so a table, list or grid inside runs edge to edge (the header and footer keep theirs). Default false: the 16px 18px body padding. */\n readonly noPadding = input(false);\n /** Max height of the card body (any CSS length, e.g. `360px`): a longer body scrolls inside the card so the card never gets crazy long. Empty = no limit (or the `--dc-body-max-height` custom property, which a page can set on the card or an ancestor). */\n readonly maxBodyHeight = input('');\n /** true = content in the body (a ui-contact-picker result list, a dropdown menu) may extend beyond the card's edge instead of being clipped or scrolling inside the body. Ignored while the body is collapsed. Do not combine with `maxBodyHeight`, whose scrolling needs the clip. Default false: unchanged. */\n readonly overflowVisible = input(false);\n\n /** true = a click on the card (outside interactive controls and text selections) toggles `selected`. The card must contain its own checkbox for keyboard / screen-reader users. Default false: no handler, cursor or outline. */\n readonly selectable = input(false);\n /** Two-way: whether the card is selected (only shown / toggled when `selectable`). */\n readonly selected = model(false);\n /** CSS colour of the 2px outline of a selected card. Default `#3b82f6`. */\n readonly selectedColor = input('#3b82f6');\n /** CSS colour used as the card background while selected (wins over `background`). Empty = the background does not change. */\n readonly selectedBackground = input('');\n\n /** The group's aria-label: the visible title (unless `titleId` names the card instead), else `ariaLabel`, else none. */\n groupLabel(): string | null {\n if (this.showHeader() && this.title()) return this.titleId() ? null : this.title();\n return this.ariaLabel().trim() || null;\n }\n /** The body is open unless the card has a header that is collapsible and was collapsed. */\n isOpen(): boolean { return !(this.showHeader() && this.collapsible()) || this.expanded(); }\n\n /** selectable: a click on the card toggles `selected` unless it came from an interactive element or ends a text selection. */\n onCardClick(event: Event) {\n if (!this.selectable()) return;\n const card = event.currentTarget as HTMLElement | null;\n const target = event.target as Element | null;\n if (!card || !target || typeof target.closest !== 'function') return;\n const control = target.closest(SELECT_IGNORE);\n if (control && card.contains(control)) return;\n const sel = card.ownerDocument.defaultView?.getSelection?.();\n if (sel && !sel.isCollapsed && sel.toString() !== '' && (card.contains(sel.anchorNode) || card.contains(sel.focusNode))) return; // a text drag, not a click\n this.selected.set(!this.selected());\n }\n\n toggle() { this.expanded.set(!this.expanded()); }\n\n /** A click on the header toggles, except on a control inside it (Edit, your own header actions, links, inputs). */\n onHeaderClick(event: Event) {\n if (!this.showHeader() || !this.collapsible()) return;\n const target = event.target as Element | null;\n if (target?.closest('button, a, input, select, textarea, label, [role=\"button\"], [role=\"link\"], [tabindex]:not([tabindex=\"-1\"])')?.closest('.dc-header')) {\n // A real control was clicked: its own handler decides. The chevron button toggles through its own (click).\n return;\n }\n this.toggle();\n }\n}\n"],"mappings":";;;AAKA,MAAM,gBAAgB;AAkLtB,IAAa,sBAAb,MAAa,oBAAmB;CAhIhC,cAAA;EAiIqB,KAAA,SAAS,OAAO,eAAe;EAEzC,KAAA,QAAQ,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;EAEjB,KAAA,iBAAiB,MAAM,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,iBAAA,CAAA,+BAAA,CAAA,CAAA;EAE5B,KAAA,eAAe,MAAoC,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,eAAA,CAAA,+BAAA,CAAA,CAAA;EAExD,KAAA,UAA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AAA,QAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;IAAA;GAAA,CAAA;GAAA,iBAAA,GAAA,wBAAA;EAAA,CAAA;CAAA;;AA4Hd,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAmB,YAAA,CAAA;EAhI/B,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAgB,YACd;GAAI,iBACC,wBAAwB;GAAM,SACtC,CAAC,eAAe;GAAC,MACpB;IACJ,QAAQ;IACR,wBAAwB;IACxB,wBAAwB;IACxB,0BAA0B;IAC1B,qBAAqB;GACtB;GAAA,UACS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CT,QAAA,CAAA,khGAAA;EAAA,CAAA"}
@@ -163,6 +163,19 @@ var DropdownComponent = class DropdownComponent {
163
163
  this.menuMaxHeight.set(null);
164
164
  }
165
165
  }
166
+ _verticalBounds(host, vh) {
167
+ let top = 0, bottom = vh;
168
+ for (let el = host.parentElement; el && el !== document.body && el !== document.documentElement; el = el.parentElement) {
169
+ if (getComputedStyle(el).overflowY === "visible") continue;
170
+ const r = el.getBoundingClientRect();
171
+ top = Math.max(top, r.top);
172
+ bottom = Math.min(bottom, r.bottom);
173
+ }
174
+ return {
175
+ top,
176
+ bottom
177
+ };
178
+ }
166
179
  _place() {
167
180
  const host = this._host.nativeElement;
168
181
  const trigger = host.querySelector(".dd-trigger");
@@ -182,8 +195,9 @@ var DropdownComponent = class DropdownComponent {
182
195
  const fitsStart = t.left + width <= vw - MARGIN;
183
196
  const fitsEnd = t.right - width >= MARGIN;
184
197
  const end = mode === "end" || mode === "auto" && !fitsStart && (fitsEnd || t.right > vw / 2);
185
- const below = vh - t.bottom - GAP - MARGIN;
186
- const above = t.top - GAP - MARGIN;
198
+ const { top: boundTop, bottom: boundBottom } = this._verticalBounds(host, vh);
199
+ const below = boundBottom - t.bottom - GAP - MARGIN;
200
+ const above = t.top - boundTop - GAP - MARGIN;
187
201
  const up = naturalHeight > below && above > below;
188
202
  this.alignEnd.set(end);
189
203
  this.openUp.set(up);