@formancy/angular 0.1.0 → 0.2.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"formancy-angular.mjs","sources":["../../src/provide.ts","../../src/field.ts","../../src/repeater.ts","../../src/wizard.ts","../../src/submit.ts","../../src/registry.ts","../../src/fields.ts","../../src/form.ts","../../src/error-summary.ts","../../src/formancy-angular.ts"],"sourcesContent":["import { InjectionToken, inject } from '@angular/core'\nimport type { Provider } from '@angular/core'\nimport type { FormEngine } from '@formancy/core'\n\n/**\n * The engine reaches components through DI, never through inputs drilling: a\n * form is one engine instance, and every inject* helper resolves against it.\n */\nexport const FORMANCY_ENGINE = new InjectionToken<FormEngine>('formancy.engine')\n\nexport function provideFormancy(engine: FormEngine): Provider[] {\n return [{ provide: FORMANCY_ENGINE, useValue: engine }]\n}\n\nexport function injectEngine(): FormEngine {\n const engine = inject(FORMANCY_ENGINE, { optional: true })\n if (engine === null) {\n throw new Error('formancy needs provideFormancy(engine) in the injector tree above this component')\n }\n return engine\n}\n","import { DestroyRef, inject, signal } from '@angular/core'\nimport type { Signal } from '@angular/core'\nimport { parsePath } from '@formancy/core'\nimport type { FieldSnapshot, Path } from '@formancy/core'\nimport { injectEngine } from './provide.js'\n\nexport interface FieldBinding {\n /** The live field state. One signal per field: a keystroke elsewhere never\n * recomputes this, because the engine wakes only the fields it touched. */\n snapshot: Signal<FieldSnapshot>\n setValue(value: unknown): void\n touch(): void\n}\n\n/**\n * One field's live state as a signal — the Angular half of the same protocol\n * React binds with useSyncExternalStore. The engine's snapshots are\n * identity-stable, so `set` is a real change exactly when the field changed,\n * which is what zoneless OnPush change detection needs: no zone, no\n * ChangeDetectorRef, no whole-form re-render.\n *\n * Call from an injection context (field member initialiser or constructor).\n */\nexport function injectField(path: string | Path): FieldBinding {\n const engine = injectEngine()\n const parsed = typeof path === 'string' ? parsePath(path) : path\n\n const snapshot = signal(engine.getFieldSnapshot(parsed))\n const unsubscribe = engine.subscribeField(parsed, () => {\n snapshot.set(engine.getFieldSnapshot(parsed))\n })\n inject(DestroyRef).onDestroy(unsubscribe)\n\n return {\n snapshot: snapshot.asReadonly(),\n setValue: (value) => engine.setValue(parsed, value),\n touch: () => engine.touch(parsed),\n }\n}\n","import { DestroyRef, computed, inject, signal } from '@angular/core'\nimport type { Signal } from '@angular/core'\nimport { parsePath } from '@formancy/core'\nimport type { Path } from '@formancy/core'\nimport { injectEngine } from './provide.js'\n\nexport interface RepeaterBinding {\n /** The live row list length. The engine treats the repeater path as\n * subscribable in its own right, so no polling and no array identity tricks. */\n rowCount: Signal<number>\n /** Stable per-row keys, in row order. Never track a row by its index. */\n rowIds: Signal<readonly string[]>\n addRow(): void\n removeRow(index: number): void\n}\n\n/**\n * A repeater's live row count as a signal — the Angular half of React's\n * useRepeater. Reading rowCount eagerly doubles as validation: the engine\n * throws on a non-repeater path here, at wiring time, not at first render.\n *\n * Call from an injection context (field member initialiser or constructor).\n */\nexport function injectRepeater(path: string | Path): RepeaterBinding {\n const engine = injectEngine()\n const parsed = typeof path === 'string' ? parsePath(path) : path\n\n const rowCount = signal(engine.rowCount(parsed))\n const unsubscribe = engine.subscribeField(parsed, () => {\n rowCount.set(engine.rowCount(parsed))\n })\n inject(DestroyRef).onDestroy(unsubscribe)\n\n return {\n rowCount: rowCount.asReadonly(),\n // Computed from rowCount: the engine mints an id when a row is created, so\n // the count changing is exactly when the ids change.\n rowIds: computed(() =>\n Array.from({ length: rowCount() }, (_, index) => engine.rowId(parsed, index)),\n ),\n addRow: () => engine.addRow(parsed),\n removeRow: (index) => engine.removeRow(parsed, index),\n }\n}\n","import { DestroyRef, inject, signal } from '@angular/core'\nimport type { Signal } from '@angular/core'\nimport { injectEngine } from './provide.js'\n\nexport interface WizardBinding {\n /** The live page index. */\n page: Signal<number>\n pageCount: number\n /** Resolves true iff the page advanced; a failed validation keeps the page. */\n next(): Promise<boolean>\n back(): void\n /** Unvalidated jump — error navigation, never a way past a gate. */\n goTo(pageIndex: number): void\n}\n\n/**\n * The wizard's live position as a signal. Throws on an unpaged form rather\n * than degrading to a one-page pseudo-wizard: a stepper rendered over a flat\n * form is a bug in the caller, and a loud error at wiring beats a mute\n * component. Same words as React's useWizard, because it is the same policy.\n *\n * Call from an injection context (field member initialiser or constructor).\n */\nexport function injectWizard(): WizardBinding {\n const engine = injectEngine()\n const wizard = engine.wizard()\n if (wizard === undefined) {\n throw new Error('injectWizard needs a schema with pages; this form has none')\n }\n\n const page = signal(wizard.page())\n const unsubscribe = wizard.subscribe(() => page.set(wizard.page()))\n inject(DestroyRef).onDestroy(unsubscribe)\n\n return {\n page: page.asReadonly(),\n pageCount: wizard.pageCount,\n next: () => wizard.next(),\n back: () => wizard.back(),\n goTo: (pageIndex) => wizard.goTo(pageIndex),\n }\n}\n","import { parsePath } from '@formancy/core'\nimport { injectEngine } from './provide.js'\n\n/**\n * Submit the form: touch everything, validate everything, and on failure move\n * focus to the first invalid control — the WCAG-required behaviour that every\n * consumer would otherwise have to hand-roll, and most would forget.\n *\n * Focus lives in the binding, not the engine, because it needs the DOM after\n * the commit; the engine only names the field (firstInvalid) and mints the id.\n * Same policy, word for word, as React's useSubmit — the fixtures hold both\n * renderers to it.\n */\nexport function injectSubmit(): () => { ok: boolean; errors: Record<string, string[]> } {\n const engine = injectEngine()\n\n return () => {\n const outcome = engine.submit()\n if (!outcome.ok && typeof document !== 'undefined') {\n // An ErrorSummary takes precedence: it lists every problem, and focusing\n // it announces the situation once. It focuses ITSELF when errors appear,\n // so nothing to do here. Without one, fall back to the first control.\n const summary = document.querySelector('[data-formancy-part=\"error-summary\"]')\n if (summary === null) {\n const firstInvalid = engine.firstInvalid()\n if (firstInvalid !== null) {\n const ids = engine.getFieldSnapshot(parsePath(firstInvalid)).ids\n document.getElementById(ids.control)?.focus()\n }\n }\n }\n return outcome\n }\n}\n","import { InjectionToken, inject } from '@angular/core'\nimport type { Provider, Type } from '@angular/core'\nimport type { FieldType } from '@formancy/spec'\n\n/**\n * What a field component learns about its slot. React passes `{ path, label }`\n * as props; here they travel through DI because the components are created\n * dynamically by the registry, and an injection token is how Angular hands\n * per-instance context across a dynamic boundary without inputs to mistype.\n */\nexport interface FormancyFieldContext {\n readonly path: string\n readonly label: string\n}\n\nexport const FORMANCY_FIELD_CONTEXT = new InjectionToken<FormancyFieldContext>(\n 'formancy.field-context',\n)\n\nexport function injectFieldContext(): FormancyFieldContext {\n const context = inject(FORMANCY_FIELD_CONTEXT, { optional: true })\n if (context === null) {\n throw new Error(\n 'formancy field components render inside a formancy-field slot, which provides FORMANCY_FIELD_CONTEXT for the path and label',\n )\n }\n return context\n}\n\n/**\n * The component registry — theming mechanism number two, same words as React.\n * The schema decides WHAT a field is; the registry decides what RENDERS it,\n * with per-path entries beating per-type entries beating the built-in\n * defaults. A design system replaces the entire visual layer by providing a\n * registry, without forking anything.\n */\nexport interface FormancyRegistry {\n byType?: Partial<Record<FieldType, Type<unknown>>>\n byPath?: Record<string, Type<unknown>>\n}\n\nexport const FORMANCY_REGISTRY = new InjectionToken<FormancyRegistry>('formancy.registry')\n\nexport function provideFormancyRegistry(registry: FormancyRegistry): Provider[] {\n return [{ provide: FORMANCY_REGISTRY, useValue: registry }]\n}\n","import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core'\nimport type { Type } from '@angular/core'\nimport type { FieldOption, FieldType } from '@formancy/spec'\nimport { injectField } from './field.js'\nimport type { FieldBinding } from './field.js'\nimport { injectEngine } from './provide.js'\nimport { injectFieldContext } from './registry.js'\n\n/**\n * The built-in unstyled field components — the Angular rendering of the same\n * decisions React's defaults made. Zero CSS; `data-formancy-part` is the\n * styling hook; every id and ARIA attribute comes from the engine's prop\n * getters so the wiring is byte-identical across renderers.\n *\n * The interpolations that become accessible text (labels, error codes) sit on\n * one template line on purpose: element-internal whitespace would leak into\n * textContent, and the conformance driver reads error codes verbatim.\n */\n\n/** Shared unstyled shell: real label, projected control, error text as the\n * describedby target. */\n@Component({\n selector: 'formancy-field-shell',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <div data-formancy-part=\"field\" [attr.data-state]=\"showError() ? 'invalid' : 'valid'\">\n <label data-formancy-part=\"label\" [id]=\"field().snapshot().props.label.id\" [attr.for]=\"field().snapshot().props.label.for\">{{ label() }}</label>\n <ng-content />\n @if (showError()) {\n <p data-formancy-part=\"error\" [id]=\"field().snapshot().props.error.id\">{{ errorText() }}</p>\n }\n </div>\n `,\n})\nexport class FormancyFieldShell {\n readonly field = input.required<FieldBinding>()\n readonly label = input.required<string>()\n\n protected readonly showError = computed(() => {\n const snapshot = this.field().snapshot()\n return snapshot.touched && snapshot.errors.length > 0\n })\n\n protected readonly errorText = computed(() => this.field().snapshot().errors.join(', '))\n}\n\n/** The state every leaf control shares; components extend it so the templates\n * stay the only per-type code. Context comes through DI (see registry.ts). */\nabstract class FieldComponentBase {\n protected readonly context = injectFieldContext()\n protected readonly field = injectField(this.context.path)\n protected readonly control = computed(() => this.field.snapshot().props.control)\n private readonly engine = injectEngine()\n\n /**\n * Option labels resolved to strings, since a label may be a reference into\n * the message catalogue. Falling back to the stored value keeps an\n * untranslated option selectable rather than blank.\n */\n protected readonly options = computed<ReadonlyArray<{ value: string; label: string }>>(() =>\n (this.field.snapshot().def.options ?? []).map((option: FieldOption) => ({\n value: option.value,\n label: this.engine.text(option.label) ?? option.value,\n })),\n )\n}\n\n@Component({\n selector: 'formancy-text-field',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FormancyFieldShell],\n template: `\n <formancy-field-shell [field]=\"field\" [label]=\"context.label\">\n <input\n type=\"text\"\n [id]=\"control().id\"\n [attr.name]=\"control().name\"\n [attr.aria-invalid]=\"control()['aria-invalid']\"\n [attr.aria-required]=\"control()['aria-required']\"\n [attr.aria-describedby]=\"control()['aria-describedby']\"\n [disabled]=\"control().disabled === true\"\n [value]=\"text()\"\n (input)=\"onInput($event)\"\n (blur)=\"field.touch()\"\n />\n </formancy-field-shell>\n `,\n})\nexport class FormancyTextField extends FieldComponentBase {\n protected readonly text = computed(() => {\n const value = this.field.snapshot().value\n return typeof value === 'string' ? value : ''\n })\n\n protected onInput(event: Event): void {\n this.field.setValue((event.target as HTMLInputElement).value)\n }\n}\n\n@Component({\n selector: 'formancy-textarea-field',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FormancyFieldShell],\n template: `\n <formancy-field-shell [field]=\"field\" [label]=\"context.label\">\n <textarea\n [id]=\"control().id\"\n [attr.name]=\"control().name\"\n [attr.aria-invalid]=\"control()['aria-invalid']\"\n [attr.aria-required]=\"control()['aria-required']\"\n [attr.aria-describedby]=\"control()['aria-describedby']\"\n [disabled]=\"control().disabled === true\"\n [value]=\"text()\"\n (input)=\"onInput($event)\"\n (blur)=\"field.touch()\"\n ></textarea>\n </formancy-field-shell>\n `,\n})\nexport class FormancyTextareaField extends FieldComponentBase {\n protected readonly text = computed(() => {\n const value = this.field.snapshot().value\n return typeof value === 'string' ? value : ''\n })\n\n protected onInput(event: Event): void {\n this.field.setValue((event.target as HTMLTextAreaElement).value)\n }\n}\n\n@Component({\n selector: 'formancy-number-field',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FormancyFieldShell],\n template: `\n <formancy-field-shell [field]=\"field\" [label]=\"context.label\">\n <input\n type=\"number\"\n [id]=\"control().id\"\n [attr.name]=\"control().name\"\n [attr.aria-invalid]=\"control()['aria-invalid']\"\n [attr.aria-required]=\"control()['aria-required']\"\n [attr.aria-describedby]=\"control()['aria-describedby']\"\n [disabled]=\"control().disabled === true\"\n [value]=\"text()\"\n (input)=\"onInput($event)\"\n (blur)=\"field.touch()\"\n />\n </formancy-field-shell>\n `,\n})\nexport class FormancyNumberField extends FieldComponentBase {\n protected readonly text = computed(() => {\n const value = this.field.snapshot().value\n return typeof value === 'number' ? String(value) : ''\n })\n\n protected onInput(event: Event): void {\n const raw = (event.target as HTMLInputElement).value\n this.field.setValue(raw === '' ? null : Number(raw))\n }\n}\n\n@Component({\n selector: 'formancy-checkbox-field',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FormancyFieldShell],\n template: `\n <formancy-field-shell [field]=\"field\" [label]=\"context.label\">\n <input\n type=\"checkbox\"\n [id]=\"control().id\"\n [attr.name]=\"control().name\"\n [attr.aria-invalid]=\"control()['aria-invalid']\"\n [attr.aria-required]=\"control()['aria-required']\"\n [attr.aria-describedby]=\"control()['aria-describedby']\"\n [disabled]=\"control().disabled === true\"\n [checked]=\"checked()\"\n (change)=\"onChange($event)\"\n (blur)=\"field.touch()\"\n />\n </formancy-field-shell>\n `,\n})\nexport class FormancyCheckboxField extends FieldComponentBase {\n protected readonly checked = computed(() => this.field.snapshot().value === true)\n\n protected onChange(event: Event): void {\n this.field.setValue((event.target as HTMLInputElement).checked)\n }\n}\n\n@Component({\n selector: 'formancy-date-field',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FormancyFieldShell],\n template: `\n <formancy-field-shell [field]=\"field\" [label]=\"context.label\">\n <input\n type=\"date\"\n [id]=\"control().id\"\n [attr.name]=\"control().name\"\n [attr.aria-invalid]=\"control()['aria-invalid']\"\n [attr.aria-required]=\"control()['aria-required']\"\n [attr.aria-describedby]=\"control()['aria-describedby']\"\n [disabled]=\"control().disabled === true\"\n [value]=\"text()\"\n (input)=\"onInput($event)\"\n (blur)=\"field.touch()\"\n />\n </formancy-field-shell>\n `,\n})\nexport class FormancyDateField extends FieldComponentBase {\n protected readonly text = computed(() => {\n const value = this.field.snapshot().value\n return typeof value === 'string' ? value : ''\n })\n\n protected onInput(event: Event): void {\n const raw = (event.target as HTMLInputElement).value\n this.field.setValue(raw === '' ? null : raw)\n }\n}\n\n@Component({\n selector: 'formancy-select-field',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FormancyFieldShell],\n template: `\n <formancy-field-shell [field]=\"field\" [label]=\"context.label\">\n <select\n [id]=\"control().id\"\n [attr.name]=\"control().name\"\n [attr.aria-invalid]=\"control()['aria-invalid']\"\n [attr.aria-required]=\"control()['aria-required']\"\n [attr.aria-describedby]=\"control()['aria-describedby']\"\n [disabled]=\"control().disabled === true\"\n (change)=\"onChange($event)\"\n (blur)=\"field.touch()\"\n >\n <!-- The empty option is the unanswered state; without it the browser\n silently pre-selects the first real option, which the engine never\n heard about. Selectedness is bound per option because a select's\n value property is only settable once its options exist. -->\n <option value=\"\" [selected]=\"selected() === ''\"></option>\n @for (option of options(); track option.value) {\n <option [value]=\"option.value\" [selected]=\"selected() === option.value\">{{ option.label }}</option>\n }\n </select>\n </formancy-field-shell>\n `,\n})\nexport class FormancySelectField extends FieldComponentBase {\n protected readonly selected = computed(() => {\n const value = this.field.snapshot().value\n return typeof value === 'string' ? value : ''\n })\n\n protected onChange(event: Event): void {\n const raw = (event.target as HTMLSelectElement).value\n this.field.setValue(raw === '' ? null : raw)\n }\n}\n\n@Component({\n selector: 'formancy-radio-group-field',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <fieldset\n data-formancy-part=\"field\"\n [attr.data-state]=\"showError() ? 'invalid' : 'valid'\"\n [attr.aria-describedby]=\"control()['aria-describedby']\"\n >\n <legend data-formancy-part=\"label\">{{ context.label }}</legend>\n @for (option of options(); track option.value) {\n <span data-formancy-part=\"radio-option\">\n <input\n type=\"radio\"\n [id]=\"optionId(option)\"\n [attr.name]=\"control().name\"\n [value]=\"option.value\"\n [checked]=\"field.snapshot().value === option.value\"\n (change)=\"field.setValue(option.value)\"\n (blur)=\"field.touch()\"\n />\n <label [attr.for]=\"optionId(option)\">{{ option.label }}</label>\n </span>\n }\n @if (showError()) {\n <p data-formancy-part=\"error\" [id]=\"field.snapshot().props.error.id\">{{ errorText() }}</p>\n }\n </fieldset>\n `,\n})\nexport class FormancyRadioGroupField extends FieldComponentBase {\n protected readonly showError = computed(() => {\n const snapshot = this.field.snapshot()\n return snapshot.touched && snapshot.errors.length > 0\n })\n\n protected readonly errorText = computed(() => this.field.snapshot().errors.join(', '))\n\n protected optionId(option: { value: string }): string {\n return `${this.field.snapshot().ids.control}:${option.value}`\n }\n}\n\n/**\n * The built-in unstyled components. `null` means the type renders nothing here:\n * hidden and static are non-inputs, and the container types are laid out by\n * their own machinery, not by a leaf slot.\n */\nexport const DEFAULT_FIELD_COMPONENTS: Record<FieldType, Type<unknown> | null> = {\n text: FormancyTextField,\n textarea: FormancyTextareaField,\n number: FormancyNumberField,\n checkbox: FormancyCheckboxField,\n date: FormancyDateField,\n select: FormancySelectField,\n radio: FormancyRadioGroupField,\n hidden: null,\n static: null,\n group: null,\n page: null,\n repeater: null,\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n Directive,\n Injector,\n ViewContainerRef,\n computed,\n effect,\n inject,\n input,\n output,\n runInInjectionContext,\n} from '@angular/core'\nimport type { ComponentRef, OnChanges, OnDestroy, OnInit, Signal, Type } from '@angular/core'\nimport { parsePath } from '@formancy/core'\nimport type { FieldSnapshot } from '@formancy/core'\nimport type { FieldDef } from '@formancy/spec'\nimport { DEFAULT_FIELD_COMPONENTS } from './fields.js'\nimport { injectField } from './field.js'\nimport { injectRepeater } from './repeater.js'\nimport type { RepeaterBinding } from './repeater.js'\nimport { injectSubmit } from './submit.js'\nimport { injectWizard } from './wizard.js'\nimport type { WizardBinding } from './wizard.js'\nimport { injectEngine } from './provide.js'\nimport { FORMANCY_FIELD_CONTEXT, FORMANCY_REGISTRY } from './registry.js'\n\nexport interface SubmitOutcome {\n ok: boolean\n errors: Record<string, string[]>\n /** The canonical value, present when accepted. */\n data?: unknown\n}\n\n/**\n * A minimal dynamic-component outlet: NgComponentOutlet's job without pulling\n * @angular/common into the library's runtime dependencies for one directive.\n * Creation happens in ngOnChanges — the framework-blessed moment for view\n * manipulation — and the injector input is how the slot hands each component\n * its FORMANCY_FIELD_CONTEXT.\n */\n@Directive({ selector: '[formancyOutlet]' })\nexport class FormancyComponentOutlet implements OnChanges, OnDestroy {\n private readonly container = inject(ViewContainerRef)\n\n readonly formancyOutlet = input.required<Type<unknown>>()\n readonly formancyOutletInjector = input.required<Injector>()\n\n private ref: ComponentRef<unknown> | undefined\n\n ngOnChanges(): void {\n this.ref?.destroy()\n this.ref = this.container.createComponent(this.formancyOutlet(), {\n injector: this.formancyOutletInjector(),\n })\n }\n\n ngOnDestroy(): void {\n this.ref?.destroy()\n }\n}\n\n/**\n * One field's slot: resolve the component through the registry (per-path beats\n * per-type beats the defaults) and mount it while the field is visible.\n *\n * A hidden field leaves the DOM entirely: display:none would still ship the\n * markup, keep it in the accessibility tree's shadow, and leak its labels to\n * screen-reader \"read all\" passes.\n *\n * The binding is wired in ngOnInit rather than a field initialiser because the\n * path arrives as an input, which does not exist yet at construction time.\n */\n@Component({\n selector: 'formancy-field',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FormancyComponentOutlet],\n template: `\n @if (state; as s) {\n @if (s.component !== null && s.snapshot().visible) {\n <ng-container [formancyOutlet]=\"s.component\" [formancyOutletInjector]=\"s.injector\" />\n }\n }\n `,\n})\nexport class FormancyFieldSlot implements OnInit {\n private readonly registry = inject(FORMANCY_REGISTRY, { optional: true })\n private readonly injector = inject(Injector)\n\n readonly path = input.required<string>()\n readonly fallbackLabel = input<string>()\n\n protected state?: {\n snapshot: Signal<FieldSnapshot>\n component: Type<unknown> | null\n injector: Injector\n }\n\n ngOnInit(): void {\n const path = this.path()\n const binding = runInInjectionContext(this.injector, () => injectField(path))\n const snapshot = binding.snapshot\n const component =\n this.registry?.byPath?.[path] ??\n this.registry?.byType?.[snapshot().type] ??\n DEFAULT_FIELD_COMPONENTS[snapshot().type]\n // Labels ride on the model definition (version-0 presentation-lite); the\n // labels input is the fallback, and the wire path is at least honest.\n const label = snapshot().label ?? this.fallbackLabel() ?? path\n this.state = {\n snapshot,\n component,\n injector: Injector.create({\n providers: [{ provide: FORMANCY_FIELD_CONTEXT, useValue: { path, label } }],\n parent: this.injector,\n }),\n }\n }\n}\n\ninterface RepeaterRow {\n index: number\n /** The row's stable identity, which `@for` tracks instead of its position. */\n id: string\n wires: readonly string[]\n}\n\n/**\n * A repeater's own chrome: a named fieldset, one row div per item with the row\n * fields and a remove control, and an add control. Row fields render here,\n * never in the flat list — a row needs its remove button and its position\n * context.\n */\n@Component({\n selector: 'formancy-repeater',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FormancyFieldSlot],\n template: `\n @if (state; as s) {\n <fieldset data-formancy-part=\"repeater\">\n <legend data-formancy-part=\"repeater-legend\">{{ s.label }}</legend>\n @for (row of s.rows(); track row.id) {\n <div data-formancy-part=\"row\">\n @for (instanceWire of row.wires; track instanceWire) {\n <formancy-field [path]=\"instanceWire\" [fallbackLabel]=\"fallbackFor(instanceWire)\" />\n }\n <!-- Position context in the NAME, so a screen-reader user knows\n which row this button kills without walking the tree. -->\n <button type=\"button\" (click)=\"s.repeater.removeRow(row.index)\">{{ s.removeLabel }} {{ row.index + 1 }} of {{ s.rows().length }}</button>\n </div>\n }\n <button type=\"button\" (click)=\"s.repeater.addRow()\">{{ s.addLabel }}</button>\n </fieldset>\n }\n `,\n})\nexport class FormancyRepeaterSection implements OnInit {\n private readonly engine = injectEngine()\n private readonly injector = inject(Injector)\n\n readonly wire = input.required<string>()\n readonly labels = input<Record<string, string>>()\n\n protected state?: {\n repeater: RepeaterBinding\n label: string\n addLabel: string\n removeLabel: string\n rows: Signal<readonly RepeaterRow[]>\n }\n\n ngOnInit(): void {\n const wire = this.wire()\n const def = this.engine.repeaters().find((candidate) => candidate.wire === wire)?.def\n const label = this.engine.text(def?.label) ?? this.labels()?.[wire] ?? wire\n const minItems = def?.minItems ?? 0\n\n const repeater = runInInjectionContext(this.injector, () => {\n const binding = injectRepeater(wire)\n // Seed to minItems: a repeater that promises one row must show one empty\n // row, not an add button and a shrug. An effect rather than a one-shot,\n // so dropping below the floor later re-seeds exactly as React's does.\n effect(() => {\n const shortfall = minItems - binding.rowCount()\n for (let i = 0; i < shortfall; i++) binding.addRow()\n })\n return binding\n })\n\n this.state = {\n repeater,\n label,\n addLabel: def?.addLabel ?? `Add ${label}`,\n removeLabel: def?.removeLabel ?? `Remove ${label}`,\n rows: computed(() =>\n Array.from({ length: repeater.rowCount() }, (_, index) => ({\n index,\n // Identity, not position: removing a row renumbers everything after\n // it, and tracking by index would make Angular reuse the wrong DOM\n // nodes — moving focus and animating the wrong element.\n id: repeater.rowIds()[index] ?? String(index),\n wires: this.engine.fieldPaths().filter((candidate) => candidate.startsWith(`${wire}[${index}]`)),\n })),\n ),\n }\n }\n\n protected fallbackFor(instanceWire: string): string | undefined {\n const template = instanceWire.replace(/\\[\\d+\\]/, '[]')\n return this.labels()?.[template] ?? this.labels()?.[instanceWire]\n }\n}\n\n/**\n * Renders the whole form from the engine: one slot per field, resolved through\n * the registry. Slots subscribe individually, so a keystroke re-renders one\n * field and a visibility flip mounts or unmounts exactly the fields it hit.\n * A paged schema renders a stepper, one page at a time, navigation, and the\n * submit control on the last page — a failed submit navigates to the first\n * page with a problem instead of leaving the user on a clean review page\n * staring at a rejection.\n */\n@Component({\n selector: 'formancy-form',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FormancyFieldSlot, FormancyRepeaterSection],\n template: `\n @if (wizard; as w) {\n <nav data-formancy-part=\"stepper\" aria-label=\"Progress\">\n <ol>\n @for (page of pages; track page.key; let i = $index) {\n <li [attr.aria-current]=\"i === w.page() ? 'step' : null\">{{ pageLabel(page) }}</li>\n }\n </ol>\n </nav>\n @for (wire of staticOnPage(); track wire) {\n <formancy-field [path]=\"wire\" [fallbackLabel]=\"fallbackFor(wire)\" />\n }\n @for (wire of repeatersOnPage(); track wire) {\n <formancy-repeater [wire]=\"wire\" [labels]=\"labels()\" />\n }\n <div data-formancy-part=\"wizard-nav\">\n @if (w.page() > 0) {\n <button type=\"button\" (click)=\"w.back()\">Back</button>\n }\n @if (w.page() < w.pageCount - 1) {\n <button type=\"button\" (click)=\"onNext()\">Next</button>\n } @else {\n <button type=\"button\" data-formancy-part=\"submit\" (click)=\"onSubmit()\">{{ submitLabel() ?? 'Submit' }}</button>\n }\n </div>\n } @else {\n @for (wire of staticWires; track wire) {\n <formancy-field [path]=\"wire\" [fallbackLabel]=\"fallbackFor(wire)\" />\n }\n @for (wire of repeaterWires; track wire) {\n <formancy-repeater [wire]=\"wire\" [labels]=\"labels()\" />\n }\n <button type=\"button\" data-formancy-part=\"submit\" (click)=\"onSubmit()\">{{ submitLabel() ?? 'Submit' }}</button>\n }\n `,\n})\nexport class FormancyForm {\n private readonly engine = injectEngine()\n private readonly submit = injectSubmit()\n\n protected readonly wizard: WizardBinding | undefined =\n this.engine.wizard() === undefined ? undefined : injectWizard()\n\n /**\n * Display text per wire path (row fields by their template wire,\n * `items[].name`). A `label` on the model definition wins — that is how\n * fixture schemas carry text until the spec's i18n section lands.\n */\n readonly labels = input<Record<string, string>>()\n readonly submitLabel = input<string>()\n readonly submitted = output<SubmitOutcome>()\n\n protected readonly pages = this.engine.pages()\n protected readonly repeaterWires = this.engine.repeaterPaths()\n\n // Row fields render inside their repeater's own section, never in the flat\n // list — a row needs its remove button and its position context. The static\n // wires never change: visibility is per-slot metadata, not list membership.\n protected readonly staticWires = this.engine\n .fieldPaths()\n .filter((wire) => !this.repeaterWires.some((repeater) => wire.startsWith(`${repeater}[`)))\n\n protected readonly staticOnPage = computed(() => {\n const wizard = this.wizard\n if (wizard === undefined) return this.staticWires\n return this.staticWires.filter((wire) => this.engine.pageOf(parsePath(wire)) === wizard.page())\n })\n\n protected readonly repeatersOnPage = computed(() => {\n const wizard = this.wizard\n if (wizard === undefined) return this.repeaterWires\n return this.repeaterWires.filter((wire) => this.engine.pageOf(parsePath(wire)) === wizard.page())\n })\n\n protected fallbackFor(wire: string): string | undefined {\n return this.labels()?.[wire]\n }\n\n protected pageLabel(page: { key: string; def: FieldDef }): string {\n return this.engine.text(page.def.label) ?? page.key\n }\n\n protected onNext(): void {\n void this.wizard?.next()\n }\n\n protected onSubmit(): void {\n const outcome = this.submit()\n if (!outcome.ok && this.wizard !== undefined) {\n // Take the user TO the problem: a rejection on a clean review page\n // explains nothing.\n const firstInvalid = this.engine.firstInvalid()\n if (firstInvalid !== null) this.wizard.goTo(this.engine.pageOf(parsePath(firstInvalid)))\n }\n this.submitted.emit(\n outcome.ok\n ? { ok: true, errors: outcome.errors, data: this.engine.value() }\n : { ok: false, errors: outcome.errors },\n )\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n afterRenderEffect,\n computed,\n inject,\n input,\n signal,\n viewChild,\n} from '@angular/core'\nimport type { ElementRef, Signal } from '@angular/core'\nimport { parsePath } from '@formancy/core'\nimport { injectEngine } from './provide.js'\n\n/**\n * The error summary a failed submit focuses.\n *\n * The semantics are deliberate and easy to get wrong: the container takes\n * focus via tabindex=\"-1\" — focusing it already makes screen readers announce\n * it, so role=\"alert\" would announce it TWICE. Each entry is a real in-page\n * link to the offending control, because links are what \"take me to the\n * problem\" already means to assistive tech.\n */\n@Component({\n selector: 'formancy-error-summary',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n @if (errors().length > 0) {\n <div data-formancy-part=\"error-summary\" tabindex=\"-1\" #region>\n <h2 data-formancy-part=\"error-summary-heading\">{{ heading() }}</h2>\n <ul>\n @for (entry of errors(); track entry.path) {\n <li><a [attr.href]=\"'#' + controlIdOf(entry.path)\" (click)=\"focusControl($event, entry.path)\">{{ labelFor(entry.path) }}: {{ entry.codes.join(', ') }}</a></li>\n }\n </ul>\n </div>\n }\n `,\n})\nexport class FormancyErrorSummary {\n readonly labels = input<Record<string, string>>()\n\n private readonly engine = injectEngine()\n private readonly region = viewChild<ElementRef<HTMLElement>>('region')\n\n protected readonly errors: Signal<ReadonlyArray<{ path: string; codes: readonly string[] }>>\n\n constructor() {\n const errors = signal(this.engine.visibleErrors())\n const unsubscribe = this.engine.subscribe(() => errors.set(this.engine.visibleErrors()))\n inject(DestroyRef).onDestroy(unsubscribe)\n this.errors = errors.asReadonly()\n\n // Focus when errors APPEAR (a submit surfaced them), not on every\n // keystroke that edits an already-broken field. afterRenderEffect, because\n // the container only exists in the DOM once the render that shows it ran.\n let previousCount = 0\n afterRenderEffect(() => {\n const count = this.errors().length\n if (count > 0 && previousCount === 0) this.region()?.nativeElement.focus()\n previousCount = count\n })\n }\n\n protected readonly heading = computed(() => {\n const count = this.errors().length\n return count === 1 ? 'There is 1 problem to fix' : `There are ${count} problems to fix`\n })\n\n protected labelFor(path: string): string {\n return this.labels()?.[path] ?? this.labels()?.[path.replace(/\\[\\d+\\]/, '[]')] ?? path\n }\n\n protected controlIdOf(path: string): string {\n return this.engine.getFieldSnapshot(parsePath(path)).ids.control\n }\n\n protected focusControl(event: Event, path: string): void {\n // The hash alone scrolls but does not focus; do both.\n event.preventDefault()\n document.getElementById(this.controlIdOf(path))?.focus()\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAIA;;;AAGG;MACU,eAAe,GAAG,IAAI,cAAc,CAAa,iBAAiB;AAEzE,SAAU,eAAe,CAAC,MAAkB,EAAA;IAChD,OAAO,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;AACzD;SAEgB,YAAY,GAAA;AAC1B,IAAA,MAAM,MAAM,GAAG,MAAM,CAAC,eAAe,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAC1D,IAAA,IAAI,MAAM,KAAK,IAAI,EAAE;AACnB,QAAA,MAAM,IAAI,KAAK,CAAC,kFAAkF,CAAC;IACrG;AACA,IAAA,OAAO,MAAM;AACf;;ACNA;;;;;;;;AAQG;AACG,SAAU,WAAW,CAAC,IAAmB,EAAA;AAC7C,IAAA,MAAM,MAAM,GAAG,YAAY,EAAE;AAC7B,IAAA,MAAM,MAAM,GAAG,OAAO,IAAI,KAAK,QAAQ,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,IAAI;IAEhE,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC;iFAAC;I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,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,oBAAoB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,wBAAA,EAAA,MAAA,EAAA,EAAA,MAAA,EAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,UAAA,EAAA,QAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,WAAA,EAAA,CAAA,EAAA,YAAA,EAAA,QAAA,EAAA,KAAA,EAAA,IAAA,EAAA,SAAA,EAAA,CAAA,QAAA,CAAA,EAAA,WAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAbrB;;;;;;;;;;;AAWT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAEU,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAhBhC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,wBAAwB;oBAClC,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,QAAQ,EAAE;;;;;;;;;;;AAWT,EAAA,CAAA;AACF,iBAAA;0LAK8D,QAAQ,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AC5CvE;;AAEG;;"}
1
+ {"version":3,"file":"formancy-angular.mjs","sources":["../../src/provide.ts","../../src/field.ts","../../src/repeater.ts","../../src/wizard.ts","../../src/focus-control.ts","../../src/submit.ts","../../src/registry.ts","../../src/rich-text.ts","../../src/rich-text-editor.ts","../../src/scanning.ts","../../src/options-source.ts","../../src/sourced-options.ts","../../src/uploads.ts","../../src/fields.ts","../../src/form.ts","../../src/error-summary.ts","../../src/resume-notice.ts","../../src/formancy-angular.ts"],"sourcesContent":["import { InjectionToken, inject } from '@angular/core'\nimport type { Provider } from '@angular/core'\nimport type { FormEngine } from '@formancy/core'\n\n/**\n * The engine reaches components through DI, never through inputs drilling: a\n * form is one engine instance, and every inject* helper resolves against it.\n */\nexport const FORMANCY_ENGINE = new InjectionToken<FormEngine>('formancy.engine')\n\nexport function provideFormancy(engine: FormEngine): Provider[] {\n return [{ provide: FORMANCY_ENGINE, useValue: engine }]\n}\n\nexport function injectEngine(): FormEngine {\n const engine = inject(FORMANCY_ENGINE, { optional: true })\n if (engine === null) {\n throw new Error('formancy needs provideFormancy(engine) in the injector tree above this component')\n }\n return engine\n}\n","import { DestroyRef, inject, signal } from '@angular/core'\nimport type { Signal } from '@angular/core'\nimport { parsePath } from '@formancy/core'\nimport type { FieldSnapshot, Path } from '@formancy/core'\nimport { injectEngine } from './provide.js'\n\nexport interface FieldBinding {\n /** The live field state. One signal per field: a keystroke elsewhere never\n * recomputes this, because the engine wakes only the fields it touched. */\n snapshot: Signal<FieldSnapshot>\n setValue(value: unknown): void\n touch(): void\n}\n\n/**\n * One field's live state as a signal — the Angular half of the same protocol\n * React binds with useSyncExternalStore. The engine's snapshots are\n * identity-stable, so `set` is a real change exactly when the field changed,\n * which is what zoneless OnPush change detection needs: no zone, no\n * ChangeDetectorRef, no whole-form re-render.\n *\n * Call from an injection context (field member initialiser or constructor).\n */\nexport function injectField(path: string | Path): FieldBinding {\n const engine = injectEngine()\n const parsed = typeof path === 'string' ? parsePath(path) : path\n\n const snapshot = signal(engine.getFieldSnapshot(parsed))\n const unsubscribe = engine.subscribeField(parsed, () => {\n snapshot.set(engine.getFieldSnapshot(parsed))\n })\n inject(DestroyRef).onDestroy(unsubscribe)\n\n return {\n snapshot: snapshot.asReadonly(),\n setValue: (value) => engine.setValue(parsed, value),\n touch: () => engine.touch(parsed),\n }\n}\n","import { DestroyRef, computed, inject, signal } from '@angular/core'\nimport type { Signal } from '@angular/core'\nimport { parsePath } from '@formancy/core'\nimport type { Path } from '@formancy/core'\nimport { injectEngine } from './provide.js'\n\nexport interface RepeaterBinding {\n /** The live row list length. The engine treats the repeater path as\n * subscribable in its own right, so no polling and no array identity tricks. */\n rowCount: Signal<number>\n /** Stable per-row keys, in row order. Never track a row by its index. */\n rowIds: Signal<readonly string[]>\n addRow(): void\n removeRow(index: number): void\n /** Move a row. The keyboard route to reordering; a drag is a second route to this. */\n moveRow(from: number, to: number): void\n}\n\n/**\n * A repeater's live row count as a signal — the Angular half of React's\n * useRepeater. Reading rowCount eagerly doubles as validation: the engine\n * throws on a non-repeater path here, at wiring time, not at first render.\n *\n * Call from an injection context (field member initialiser or constructor).\n */\nexport function injectRepeater(path: string | Path): RepeaterBinding {\n const engine = injectEngine()\n const parsed = typeof path === 'string' ? parsePath(path) : path\n\n const rowCount = signal(engine.rowCount(parsed))\n\n // A counter bumped on every notification, not only when the LENGTH changes.\n //\n // `rowCount.set` with an equal value notifies nothing, which is correct and was also\n // why reordering did not redraw: a move leaves the count alone, so the ids computed\n // from it kept their old order and Angular tracked rows by them -- reusing the wrong\n // DOM, which is the failure tracking by identity exists to prevent.\n const version = signal(0)\n\n const unsubscribe = engine.subscribeField(parsed, () => {\n rowCount.set(engine.rowCount(parsed))\n version.update((previous) => previous + 1)\n })\n inject(DestroyRef).onDestroy(unsubscribe)\n\n return {\n rowCount: rowCount.asReadonly(),\n // Read through `version` as well as `rowCount`. The comment here used to say the\n // count changing is exactly when the ids change, which was true until rows could be\n // reordered.\n rowIds: computed(() => {\n version()\n return Array.from({ length: rowCount() }, (_, index) => engine.rowId(parsed, index))\n }),\n addRow: () => engine.addRow(parsed),\n removeRow: (index) => engine.removeRow(parsed, index),\n moveRow: (from, to) => engine.moveRow(parsed, from, to),\n }\n}\n","import { DestroyRef, inject, signal } from '@angular/core'\nimport type { Signal } from '@angular/core'\nimport { injectEngine } from './provide.js'\n\nexport interface WizardBinding {\n /** The live page index. */\n page: Signal<number>\n pageCount: number\n /** Resolves true iff the page advanced; a failed validation keeps the page. */\n next(): Promise<boolean>\n back(): void\n /** Unvalidated jump — error navigation, never a way past a gate. */\n goTo(pageIndex: number): void\n}\n\n/**\n * The wizard's live position as a signal. Throws on an unpaged form rather\n * than degrading to a one-page pseudo-wizard: a stepper rendered over a flat\n * form is a bug in the caller, and a loud error at wiring beats a mute\n * component. Same words as React's useWizard, because it is the same policy.\n *\n * Call from an injection context (field member initialiser or constructor).\n */\nexport function injectWizard(): WizardBinding {\n const engine = injectEngine()\n const wizard = engine.wizard()\n if (wizard === undefined) {\n throw new Error('injectWizard needs a schema with pages; this form has none')\n }\n\n const page = signal(wizard.page())\n const unsubscribe = wizard.subscribe(() => page.set(wizard.page()))\n inject(DestroyRef).onDestroy(unsubscribe)\n\n return {\n page: page.asReadonly(),\n pageCount: wizard.pageCount,\n next: () => wizard.next(),\n back: () => wizard.back(),\n goTo: (pageIndex) => wizard.goTo(pageIndex),\n }\n}\n","/** Reveal enclosing tabs before focusing: hidden controls cannot emit focusin. */\nexport function focusControl(control: HTMLElement | null): void {\n if (control === null) return\n control.dispatchEvent(new Event('formancy-reveal', { bubbles: true }))\n control.focus()\n}\n","import { focusControl } from './focus-control.js'\nimport { parsePath } from '@formancy/core'\nimport { injectEngine } from './provide.js'\n\n/**\n * Submit the form: touch everything, validate everything, and on failure move\n * focus to the first invalid control — the WCAG-required behaviour that every\n * consumer would otherwise have to hand-roll, and most would forget.\n *\n * Focus lives in the binding, not the engine, because it needs the DOM after\n * the commit; the engine only names the field (firstInvalid) and mints the id.\n * Same policy, word for word, as React's useSubmit — the fixtures hold both\n * renderers to it.\n */\nexport function injectSubmit(): () => { ok: boolean; errors: Record<string, string[]> } {\n const engine = injectEngine()\n\n return () => {\n const outcome = engine.submit()\n if (!outcome.ok && typeof document !== 'undefined') {\n // An ErrorSummary takes precedence: it lists every problem, and focusing\n // it announces the situation once. It focuses ITSELF when errors appear,\n // so nothing to do here. Without one, fall back to the first control.\n const summary = document.querySelector('[data-formancy-part=\"error-summary\"]')\n if (summary === null) {\n const firstInvalid = engine.firstInvalid()\n if (firstInvalid !== null) {\n const ids = engine.getFieldSnapshot(parsePath(firstInvalid)).ids\n focusControl(document.getElementById(ids.control))\n }\n }\n }\n return outcome\n }\n}\n","import { InjectionToken, inject } from '@angular/core'\nimport type { Provider, Type } from '@angular/core'\nimport type { FieldType } from '@formancy/spec'\n\n/**\n * What a field component learns about its slot. React passes `{ path, label }`\n * as props; here they travel through DI because the components are created\n * dynamically by the registry, and an injection token is how Angular hands\n * per-instance context across a dynamic boundary without inputs to mistype.\n */\nexport interface FormancyFieldContext {\n readonly path: string\n readonly label: string\n}\n\nexport const FORMANCY_FIELD_CONTEXT = new InjectionToken<FormancyFieldContext>(\n 'formancy.field-context',\n)\n\nexport function injectFieldContext(): FormancyFieldContext {\n const context = inject(FORMANCY_FIELD_CONTEXT, { optional: true })\n if (context === null) {\n throw new Error(\n 'formancy field components render inside a formancy-field slot, which provides FORMANCY_FIELD_CONTEXT for the path and label',\n )\n }\n return context\n}\n\n/**\n * The component registry — theming mechanism number two, same words as React.\n * The schema decides WHAT a field is; the registry decides what RENDERS it,\n * with per-path entries beating per-type entries beating the built-in\n * defaults. A design system replaces the entire visual layer by providing a\n * registry, without forking anything.\n */\nexport interface FormancyRegistry {\n byType?: Partial<Record<FieldType, Type<unknown>>>\n byPath?: Record<string, Type<unknown>>\n}\n\nexport const FORMANCY_REGISTRY = new InjectionToken<FormancyRegistry>('formancy.registry')\n\nexport function provideFormancyRegistry(registry: FormancyRegistry): Provider[] {\n return [{ provide: FORMANCY_REGISTRY, useValue: registry }]\n}\n","import { ChangeDetectionStrategy, Component, computed, forwardRef, input } from '@angular/core'\nimport { parseRichText } from '@formancy/spec'\nimport type { RichBlock, RichInline } from '@formancy/spec'\n\n/**\n * One run of inline nodes, recursing through its own selector.\n *\n * Angular has no fragment component, so emphasis inside emphasis is expressed\n * by the component referring to itself — which is why it is its own\n * declaration rather than part of the block template below.\n */\n@Component({\n selector: 'formancy-rich-inline',\n changeDetection: ChangeDetectionStrategy.OnPush,\n // Itself, through forwardRef. A standalone component that uses its own\n // selector has to import itself or the nested tag is an unknown element:\n // Angular renders it as an empty custom element and says nothing, so a link\n // comes out as an anchor with no text in it rather than as an error.\n imports: [forwardRef(() => FormancyRichInline)],\n template: `\n @for (node of nodes(); track $index) {\n @switch (node.kind) {\n @case ('text') {\n <!-- Interpolated. This is the line that makes the whole design safe,\n so it is the one worth pointing at. -->\n {{ asText(node) }}\n }\n @case ('strong') {\n <strong><formancy-rich-inline [nodes]=\"childrenOf(node)\" /></strong>\n }\n @case ('emphasis') {\n <em><formancy-rich-inline [nodes]=\"childrenOf(node)\" /></em>\n }\n @case ('link') {\n <!-- rel, because the destination was written by whoever filled the\n form in and the page showing it is usually an administrator's.\n The parser has already refused anything but http, https and\n mailto. -->\n <a [href]=\"hrefOf(node)\" rel=\"noreferrer noopener nofollow ugc\">\n <formancy-rich-inline [nodes]=\"childrenOf(node)\" />\n </a>\n }\n }\n }\n `,\n})\nexport class FormancyRichInline {\n readonly nodes = input.required<readonly RichInline[]>()\n\n protected asText(node: RichInline): string {\n return node.kind === 'text' ? node.text : ''\n }\n\n protected childrenOf(node: RichInline): readonly RichInline[] {\n return node.kind === 'text' ? [] : node.children\n }\n\n protected hrefOf(node: RichInline): string {\n return node.kind === 'link' ? node.href : ''\n }\n}\n\n/**\n * Showing a `richtext` answer, from the same parser the React renderer uses.\n *\n * No `[innerHTML]`, and no `DomSanitizer` — there is nothing to sanitise. The\n * stored answer is parsed into a typed tree in `@formancy/spec`, and every\n * element here is created by Angular from that tree, so the characters\n * somebody typed arrive as interpolated text and cannot become markup however\n * they are spelled ([0052](../../../docs/decisions/0052-richtext-is-not-html.md)).\n *\n * Both renderers building the same tree into the same elements is the promise\n * the engine makes across browser and server, applied to presentation: two\n * implementations, one meaning.\n */\n@Component({\n selector: 'formancy-rich-text',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FormancyRichInline],\n template: `\n @if (blocks().length > 0) {\n <div data-formancy-part=\"richtext\">\n @for (block of blocks(); track $index) {\n @if (block.kind === 'paragraph') {\n <p><formancy-rich-inline [nodes]=\"block.children\" /></p>\n } @else if (block.ordered) {\n <ol>\n @for (item of block.items; track $index) {\n <li><formancy-rich-inline [nodes]=\"item\" /></li>\n }\n </ol>\n } @else {\n <ul>\n @for (item of block.items; track $index) {\n <li><formancy-rich-inline [nodes]=\"item\" /></li>\n }\n </ul>\n }\n }\n </div>\n }\n `,\n})\nexport class FormancyRichText {\n readonly source = input<string>('')\n\n protected readonly blocks = computed<RichBlock[]>(() => parseRichText(this.source()))\n}\n","import { InjectionToken, inject } from '@angular/core'\nimport type { RichCommand } from '@formancy/spec'\n\n/**\n * A rich-text editing surface, supplied by the host.\n *\n * The same contract the React binding uses, deliberately to the letter: one\n * interface, one factory, one set of attributes. A renderer that invented its own\n * shape here would be the drift the conformance suite exists to prevent, except\n * in the one place the suite cannot see — what the HOST passes in.\n *\n * Why the host and not this package: a contenteditable editor means ProseMirror,\n * which is larger than this entire package, and most forms have no rich-text\n * field. Without a factory the field is a textarea with a toolbar, which is a\n * working editor and not a degraded mode\n * ([0061](../../../docs/decisions/0061-tiptap-over-the-closed-grammar.md)).\n *\n * What crosses this boundary is **the stored grammar in both directions, never\n * markup**. That is the whole reason an editor is admissible: nothing on either\n * side holds a string of HTML, so no consumer of an answer becomes a sanitiser\n * ([0052](../../../docs/decisions/0052-richtext-is-not-html.md)).\n */\nexport interface RichTextEditorHandle {\n /** The stored answer, in the grammar. */\n value: () => string\n /** Replace the content when the form's value changes underneath the editor. */\n setValue: (value: string) => void\n /**\n * Run a formatting command, so the field's own toolbar keeps working.\n *\n * Needed because an editor library brings keyboard shortcuts and no toolbar\n * UI. Leaving the field's toolbar out made Bold reachable by Ctrl+B and by no\n * visible control, which is a regression against the `<textarea>` it replaced\n * and unusable for anybody who does not know the shortcut.\n *\n * The commands are the grammar's whole surface — the same `RichCommand`\n * values the textarea's toolbar uses — so one toolbar drives either surface\n * and the two cannot offer different things.\n */\n run: (command: RichCommand, href?: string) => void\n /** Whether the command is on at the caret, for the toolbar's pressed state. */\n isActive: (command: RichCommand) => boolean\n destroy: () => void\n}\n\nexport interface RichTextEditorMount {\n /** Where to mount. The host's factory owns what it puts inside. */\n readonly element: Element\n /** The stored answer to open with, in the grammar. */\n readonly value: string\n /** Called with the new stored answer, in the grammar. */\n readonly onChange: (value: string) => void\n readonly editable: boolean\n /**\n * Attributes for the editing surface itself, so the ENGINE keeps owning the\n * accessibility wiring.\n *\n * These ids are minted by `@formancy/core` and composed centrally, which is\n * what makes `aria-describedby` identical in both renderers rather than\n * correct in one of them. An editor package that labelled its own surface\n * would be a third implementation, and the one nobody tests.\n */\n readonly attributes: Readonly<Record<string, string>>\n}\n\nexport type RichTextEditorFactory = (mount: RichTextEditorMount) => RichTextEditorHandle\n\n/**\n * Optional by design, and its absence costs less than the uploader's.\n *\n * A missing uploader makes a file field read-only, because there is nowhere to\n * put the bytes. A missing editor costs only the WYSIWYG surface: the answer is\n * still editable, still valid, and still the same grammar.\n */\nexport const FORMANCY_RICH_TEXT_EDITOR = new InjectionToken<RichTextEditorFactory>(\n 'formancy.richTextEditor',\n)\n\nexport function injectRichTextEditorFactory(): RichTextEditorFactory | null {\n return inject(FORMANCY_RICH_TEXT_EDITOR, { optional: true })\n}\n\n/** Providing one, for a host that wants the contenteditable surface. */\nexport function provideFormancyRichTextEditor(make: RichTextEditorFactory) {\n return { provide: FORMANCY_RICH_TEXT_EDITOR, useValue: make }\n}\n","import { InjectionToken, inject } from '@angular/core'\n\n/**\n * What a scanner is asked to read.\n *\n * The same contract the React binding declares: the field's resolved label, so a host's\n * camera sheet can say what it is looking for, and its data path, so a host can meter\n * one field's scans.\n *\n * **Nothing about the format is here.** `pattern` is the field's and the engine checks\n * it; a scanner told to pre-filter would be a second validator drifting from the first.\n */\nexport interface ScanRequest {\n /** The field's label, resolved through the message catalogue. */\n label: string\n /** The field's data path, e.g. `serial` or `items[1].serial`. */\n path: string\n}\n\n/**\n * Reads a code and reports the text on it.\n *\n * The camera, the permission prompt, the viewfinder and the decoding all belong to\n * whoever mounted the form ([0071](../../../docs/decisions/0071-a-scanner-is-supplied-not-built.md)).\n *\n * **Resolving with `null` means nobody scanned anything** — the sheet was closed. Not a\n * failure, and the field says nothing about it. **Rejecting means the device did not\n * work**, and the field says so in its status region rather than its error region,\n * because a hardware problem is not a wrong answer.\n *\n * **A scanner may not pre-validate**: a value the field's `pattern` refuses is still\n * what the camera read, and dropping it would leave the field looking empty.\n */\nexport type Scanner = (request: ScanRequest) => Promise<string | null>\n\n/**\n * Optional by design. A `scanner` widget with no scanner behind it renders the ordinary\n * text input and no button — typing was always the field's primary route, so there is\n * nothing to disable and a Scan button that opened nothing would be worse.\n */\nexport const FORMANCY_SCANNER = new InjectionToken<Scanner>('formancy.scanner')\n\nexport function injectScanner(): Scanner | null {\n return inject(FORMANCY_SCANNER, { optional: true })\n}\n\n/** Providing one, for a host that has a camera and a decoder. */\nexport function provideFormancyScanner(scan: Scanner) {\n return { provide: FORMANCY_SCANNER, useValue: scan }\n}\n","import { InjectionToken, inject } from '@angular/core'\nimport type { RemoteOption } from '@formancy/spec'\n\n/**\n * What a source is asked for.\n *\n * Declared here as well as in `@formancy/react` and deliberately not shared, exactly\n * as `ScanRequest` and `Scanner` are declared twice. A host contract each binding\n * states in its own words is a contract each binding can be read on its own.\n *\n * `kind` is a flat discriminator rather than a union of two interfaces: a host\n * written in plain JavaScript must be harmless, and a shape it can read with one\n * `if` is a shape it gets right.\n */\nexport interface OptionsRequest {\n /**\n * `search` — somebody is typing and wants matching rows.\n * `labels` — the form holds these values already and needs their names.\n */\n kind: 'search' | 'labels'\n /** The name the document gave, which the deployment resolves. */\n source: string\n /** The field's data path, e.g. `canton` or `people[1].canton`. */\n path: string\n /** What was typed. Empty on a `labels` request. */\n query: string\n /** The stored values to name. Empty on a `search`. */\n values: readonly string[]\n /**\n * The locale the form is being resolved in — the engine's, which is the host's own\n * `locale` when it passed one and the document's default otherwise.\n *\n * A remote label is a plain string, never a `{$t}` reference: nothing can check a\n * reference that arrives at runtime, and an unchecked one resolves to nothing and\n * shows an opaque identifier. So the source answers in the right language instead.\n */\n locale: string\n /** How many rows the control can show. A hint: the control caps what arrives anyway. */\n limit: number\n /** Aborted when the answer stops being wanted — a newer keystroke, or a destroy. */\n signal: AbortSignal\n}\n\n/**\n * Where one named list of options comes from.\n *\n * The third instance of the inversion the uploader and the scanner already are: the\n * document names a list, the deployment says what that name means, and nothing in\n * formancy ever makes a request of its own. A URL in a form document would be a\n * deployment detail in a portable format, unfixable once published, and an SSRF\n * surface on a self-hosted instance.\n */\nexport interface OptionsSource {\n resolve(request: OptionsRequest): Promise<readonly RemoteOption[]>\n /** How long to wait after a keystroke before asking. The control has a default. */\n debounceMs?: number\n /** Below this many characters, do not ask at all. The control says so on screen. */\n minQueryLength?: number\n /** How many rows to show at once. */\n maxRows?: number\n}\n\n/**\n * Every source this deployment has, by the name a document would use.\n *\n * A MAP rather than one resolver function, and that is the one deliberate difference\n * from `Scanner`. The control has to know **synchronously** whether a name resolves,\n * because absence here is the *file field's* branch and not the scanner's: a text\n * field with no scanner still collects the answer by typing, but a select whose\n * options come only from a source collects nothing at all, so it must say so instead\n * of rendering an empty chooser.\n */\nexport type OptionsSources = Readonly<Record<string, OptionsSource>>\n\n/**\n * Optional, and what its absence costs depends on the document. A form with no\n * sourced field never needs one; a field that names a source renders a message where\n * its chooser would be, exactly as the file field does without an uploader.\n */\nexport const FORMANCY_OPTIONS_SOURCES = new InjectionToken<OptionsSources>(\n 'formancy.optionsSources',\n)\n\nexport function injectOptionsSources(): OptionsSources | null {\n return inject(FORMANCY_OPTIONS_SOURCES, { optional: true })\n}\n\n/** Providing them, for a host that has the lists a document names. */\nexport function provideFormancyOptionsSources(sources: OptionsSources) {\n return { provide: FORMANCY_OPTIONS_SOURCES, useValue: sources }\n}\n","import { DestroyRef, computed, effect, inject, signal } from '@angular/core'\nimport type { Signal, WritableSignal } from '@angular/core'\nimport { acceptRemoteOptions, capRemoteOptions } from '@formancy/spec'\nimport type { RemoteOption } from '@formancy/spec'\nimport { injectOptionsSources } from './options-source.js'\n\n/**\n * A field's options, from the document or from the deployment.\n *\n * The same contract the React binding states in `use-sourced-options.ts`, written\n * out here rather than shared: the async lifecycle is expressed in this framework's\n * own primitives, and a shared abstraction would report that both bindings\n * implemented it when one had not.\n *\n * `optionsSource` decides which answers EXIST rather than how they are shown, so the\n * plain `<select>` honours it as well as the typeahead — one ignoring it would render\n * an empty chooser over a field that collects something.\n */\n\nexport interface SourcedOptionsState {\n /** The rows a source returned, empty until one does. */\n rows: Signal<readonly RemoteOption[]>\n /** Names for values the form already holds, so a resumed draft is not blank. */\n named: Signal<ReadonlyMap<string, string>>\n /** The document names a source this deployment does not have. */\n unavailable: Signal<boolean>\n /** A request is in flight. The control says `aria-busy`; it never disables itself. */\n busy: Signal<boolean>\n /** The one thing the field says out loud, or the empty string. */\n status: Signal<string>\n /** Whether this field is sourced at all. False is the ordinary case. */\n sourced: Signal<boolean>\n}\n\nconst DEBOUNCE_MS = 250\nconst MIN_QUERY = 0\nconst MAX_ROWS = 50\n\n/**\n * Wire a field's remote options up.\n *\n * Called from a component's field context, so it may inject. `query` is the signal\n * the control types into; a plain select passes a constant empty one, which asks the\n * source for everything and shows what fits.\n */\nexport function injectSourcedOptions(\n definition: Signal<{ optionsSource?: string; key: string }>,\n /**\n * The field's DATA PATH — `canton`, or `people[1].canton` inside a repeater.\n *\n * Which is what `OptionsRequest.path` promises. Both renderers sent the field KEY,\n * so a resolver could not tell two same-named sourced fields apart and never saw\n * which row it was answering for.\n */\n dataPath: () => string,\n storedValue: Signal<string | undefined>,\n query: Signal<string>,\n locale: () => string,\n /**\n * Whether this instance is the one that will render.\n *\n * A select that carries `widget: \"typeahead\"` delegates to another component, and\n * both extend the same base — so both wire this up and both ask. React added the\n * same flag for the same reason; without it a sourced typeahead sent every request\n * twice, and one set of answers was read by nobody.\n */\n enabled: Signal<boolean>,\n): SourcedOptionsState {\n const sources = injectOptionsSources()\n const destroyRef = inject(DestroyRef)\n\n const rows: WritableSignal<readonly RemoteOption[]> = signal([])\n const named: WritableSignal<ReadonlyMap<string, string>> = signal(new Map())\n const busy = signal(false)\n const failed = signal(false)\n const capped = signal<{ shown: number; total: number } | null>(null)\n\n const source = () => {\n const name = definition().optionsSource\n return name === undefined ? undefined : sources?.[name]\n }\n\n let generation = 0\n let inFlight: AbortController | undefined\n let timer: ReturnType<typeof setTimeout> | undefined\n\n /** Every labels request still in the air, so a destroy can abort all of them. */\n const labelRequests = new Set<AbortController>()\n\n const stop = (): void => {\n if (timer !== undefined) clearTimeout(timer)\n inFlight?.abort()\n }\n destroyRef.onDestroy(() => {\n stop()\n for (const controller of labelRequests) controller.abort()\n labelRequests.clear()\n })\n\n // The search, debounced and superseded by ABORTING rather than by ignoring: a\n // request nobody wants any more is one a host should be able to cancel, and the\n // signal is the only way to say so.\n effect(() => {\n const resolver = source()\n const text = query()\n const name = definition().optionsSource ?? ''\n const path = dataPath()\n if (!enabled() || resolver === undefined) return\n\n const minQueryLength = resolver.minQueryLength ?? MIN_QUERY\n const maxRows = resolver.maxRows ?? MAX_ROWS\n\n stop()\n // Bumped BEFORE the early return, not after it. Deleting characters back under the\n // minimum aborts whatever is in flight, and with the generation unchanged that\n // abort arrived at a handler that still believed it was current -- so backspacing\n // reported the source as broken, and left the box marked busy with nothing in\n // flight.\n const mine = (generation += 1)\n\n if (text.trim().length < minQueryLength) {\n rows.set([])\n capped.set(null)\n busy.set(false)\n return\n }\n\n const controller = new AbortController()\n inFlight = controller\n timer = setTimeout(() => {\n busy.set(true)\n failed.set(false)\n void resolver\n .resolve({\n kind: 'search',\n source: name,\n path,\n query: text,\n values: [],\n locale: locale(),\n limit: maxRows,\n signal: controller.signal,\n })\n .then((answer) => {\n if (mine !== generation) return\n // Refused whole rather than filtered: a partial list silently lacks the row\n // somebody came for, and they cannot tell that from a source that has none.\n const accepted = acceptRemoteOptions(answer)\n if (accepted === undefined) {\n failed.set(true)\n rows.set([])\n capped.set(null)\n return\n }\n const result = capRemoteOptions(accepted, maxRows)\n rows.set(result.shown)\n capped.set(result.capped ? { shown: result.shown.length, total: result.total } : null)\n })\n .catch(() => {\n if (mine !== generation) return\n failed.set(true)\n rows.set([])\n })\n .finally(() => {\n if (mine === generation) busy.set(false)\n })\n }, resolver.debounceMs ?? DEBOUNCE_MS)\n })\n\n // The names of what is already stored. Without this, a resumed draft, a wizard page\n // change or a datagrid row move — which remounts every control in the row by design\n // — renders an empty box over an answer the form holds.\n //\n // Asked at most ONCE per value, and remembered as \"asked\" rather than inferred from\n // the answer. A source is entitled not to know a value: a resumed form may hold one\n // the list no longer offers, and a host may implement only `kind: 'search'`. Inferring\n // from the answer meant the map was replaced, the signal changed, the effect re-ran\n // and it asked again — measured in the React binding at 602 requests in 300ms.\n const askedFor = new Set<string>()\n effect(() => {\n const resolver = source()\n const value = storedValue()\n if (!enabled() || resolver === undefined || value === undefined) return\n if (named().has(value) || askedFor.has(value)) return\n askedFor.add(value)\n\n // Registered, so a destroy aborts it. The search request was; this one was not,\n // which left a request outliving the component that asked for it -- and a host\n // honouring the signal had no way to know nobody was listening any more.\n const controller = new AbortController()\n labelRequests.add(controller)\n void resolver\n .resolve({\n kind: 'labels',\n source: definition().optionsSource ?? '',\n path: dataPath(),\n query: '',\n values: [value],\n locale: locale(),\n limit: 1,\n signal: controller.signal,\n })\n .then((answer) => {\n const accepted = acceptRemoteOptions(answer)\n if (accepted === undefined) return\n const next = new Map(named())\n for (const row of accepted) next.set(row.value, row.label)\n named.set(next)\n })\n // A name that does not arrive is not an error anybody can act on: the control\n // shows the raw value, exactly as it does for an option with no label.\n .catch(() => undefined)\n .finally(() => labelRequests.delete(controller))\n })\n\n return {\n rows: rows.asReadonly(),\n named: named.asReadonly(),\n busy: busy.asReadonly(),\n // `computed`, not a bare arrow: the template reads these, and a plain function\n // would re-run on every change detection instead of when its inputs move.\n sourced: computed(() => definition().optionsSource !== undefined),\n unavailable: computed(\n () => definition().optionsSource !== undefined && source() === undefined,\n ),\n status: computed(() => {\n const resolver = source()\n if (resolver === undefined) return ''\n if (failed()) return 'The options could not be loaded. Type to try again.'\n const needs = resolver.minQueryLength ?? MIN_QUERY\n if (query().trim().length < needs) return `Type at least ${String(needs)} characters to search.`\n // Set only once a request is actually on its way — after the debounce — so\n // nothing announces per keystroke.\n if (busy()) return 'Searching…'\n const limit = capped()\n if (limit !== null) {\n return `Showing the first ${String(limit.shown)} of ${String(limit.total)} — keep typing to narrow.`\n }\n return ''\n }),\n }\n}\n","import { InjectionToken, inject } from '@angular/core'\n\n/**\n * Where a file goes, and what the submission remembers about it.\n *\n * The same contract the React binding uses, with the same reasoning: this\n * package has no opinion about the destination, so the one field works against\n * local disk, S3 or a customer's own service without any of them becoming a\n * dependency of a renderer.\n *\n * The bytes never pass through the submission. What is stored is what the file\n * *is* and where it went, so a submission read back years later is small and\n * says what was attached even if the object store has since been emptied.\n */\nexport interface StoredFile {\n /** Stable within the submission; how a row is keyed and removed. */\n id: string\n name: string\n size: number\n contentType: string\n /** Where the bytes are, in whatever the host's storage calls a location. */\n storageKey: string\n}\n\n/**\n * Uploads one file and reports what was stored.\n *\n * Rejecting is a real answer: the field says so out loud rather than dropping\n * the file, because a submission somebody believes carries their evidence and\n * does not is the worst outcome available here.\n */\nexport type Uploader = (file: File) => Promise<StoredFile>\n\n/**\n * Optional by design. A form with no file fields needs no uploader, and a file\n * field without one renders read-only and says why — which beats turning a\n * form that mostly works into a failed injection.\n */\nexport const FORMANCY_UPLOADER = new InjectionToken<Uploader>('formancy.uploader')\n\nexport function injectUploader(): Uploader | null {\n return inject(FORMANCY_UPLOADER, { optional: true })\n}\n\n/** Providing one, for a host that has somewhere to put bytes. */\nexport function provideFormancyUploader(upload: Uploader) {\n return { provide: FORMANCY_UPLOADER, useValue: upload }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n computed,\n effect,\n inject,\n input,\n signal,\n viewChild,\n viewChildren,\n} from '@angular/core'\nimport type { ElementRef, Type } from '@angular/core'\nimport { applyRichCommand, narrowOptionsByLabel } from '@formancy/spec'\nimport type { FieldOption, FieldType, RichCommand } from '@formancy/spec'\nimport { injectField } from './field.js'\nimport type { FieldBinding } from './field.js'\nimport { injectEngine } from './provide.js'\nimport { injectFieldContext } from './registry.js'\nimport { FormancyRichText } from './rich-text.js'\nimport { injectRichTextEditorFactory } from './rich-text-editor.js'\nimport type { RichTextEditorHandle } from './rich-text-editor.js'\nimport { injectScanner } from './scanning.js'\nimport { injectSourcedOptions } from './sourced-options.js'\nimport { injectUploader } from './uploads.js'\nimport type { StoredFile } from './uploads.js'\n\n/**\n * The built-in unstyled field components — the Angular rendering of the same\n * decisions React's defaults made. Zero CSS; `data-formancy-part` is the\n * styling hook; every id and ARIA attribute comes from the engine's prop\n * getters so the wiring is byte-identical across renderers.\n *\n * The interpolations that become accessible text (labels, error codes) sit on\n * one template line on purpose: element-internal whitespace would leak into\n * textContent, and the conformance driver reads error codes verbatim.\n */\n\n/** Shared unstyled shell: real label, projected control, error text as the\n * describedby target. */\n@Component({\n selector: 'formancy-field-shell',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <div\n data-formancy-part=\"field\"\n [attr.data-formancy-field-path]=\"path()\"\n [attr.data-state]=\"showError() ? 'invalid' : 'valid'\"\n >\n <label data-formancy-part=\"label\" [id]=\"field().snapshot().props.label.id\" [attr.for]=\"field().snapshot().props.label.for\">{{ label() }}</label>\n <ng-content />\n @if (showError()) {\n <p data-formancy-part=\"error\" [id]=\"field().snapshot().props.error.id\">{{ errorText() }}</p>\n }\n </div>\n `,\n})\nexport class FormancyFieldShell {\n readonly field = input.required<FieldBinding>()\n readonly label = input.required<string>()\n /** Inert here; read by tools outside the renderer. See FormancyLayout. */\n readonly path = input<string>('')\n\n protected readonly showError = computed(() => {\n const snapshot = this.field().snapshot()\n return snapshot.touched && snapshot.errors.length > 0\n })\n\n protected readonly errorText = computed(() => this.field().snapshot().errors.join(', '))\n}\n\n/** The state every leaf control shares; components extend it so the templates\n * stay the only per-type code. Context comes through DI (see registry.ts). */\nabstract class FieldComponentBase {\n protected readonly context = injectFieldContext()\n protected readonly field = injectField(this.context.path)\n protected readonly control = computed(() => this.field.snapshot().props.control)\n protected readonly engine = injectEngine()\n\n /**\n * Option labels resolved to strings, since a label may be a reference into\n * the message catalogue. Falling back to the stored value keeps an\n * untranslated option selectable rather than blank.\n */\n protected readonly options = computed<ReadonlyArray<{ value: string; label: string }>>(() =>\n (this.field.snapshot().def.options ?? []).map((option: FieldOption) => ({\n value: option.value,\n label: this.engine.text(option.label) ?? option.value,\n })),\n )\n\n /**\n * What the control types into, when it has something to type into.\n *\n * A plain `<select>` never writes to it, so its source is asked for everything and\n * shows what fits; the typeahead writes every keystroke.\n */\n protected readonly sourceQuery = signal('')\n\n /** The remote half, or an inert one for the ordinary field that lists its options. */\n protected readonly remote = injectSourcedOptions(\n computed(() => {\n const def = this.field.snapshot().def\n return { key: def.key, ...(def.optionsSource === undefined ? {} : { optionsSource: def.optionsSource }) }\n }),\n () => this.context.path,\n computed(() => {\n const value = this.field.snapshot().value\n return typeof value === 'string' && value !== '' ? value : undefined\n }),\n this.sourceQuery,\n () => this.engine.locale(),\n computed(() => this.sourceEnabled()),\n )\n\n /**\n * Whether THIS component is the one that will render the field.\n *\n * True for every control but the select that hands over to the typeahead, which\n * overrides it. Both extend this base, so without the distinction a sourced\n * typeahead asked its source twice and read one set of answers.\n */\n protected sourceEnabled(): boolean {\n return true\n }\n\n /**\n * The options to offer: the document's, or the deployment's.\n *\n * The stored answer is always offerable even when the current query does not match\n * it — a control that dropped it would show an empty box over an answer the form\n * holds, and the next blur would look like the person cleared it.\n */\n protected readonly offered = computed<ReadonlyArray<{ value: string; label: string }>>(() => {\n if (!this.remote.sourced()) return this.options()\n const rows = [...this.remote.rows()]\n const stored = this.field.snapshot().value\n if (typeof stored === 'string' && stored !== '' && !rows.some((row) => row.value === stored)) {\n rows.unshift({ value: stored, label: this.remote.named().get(stored) ?? stored })\n }\n return rows\n })\n}\n\n/**\n * A single-line answer, and — with `widget: \"scanner\"` — a camera route to the same\n * string.\n *\n * The input is the control in both cases, never a second one beside it: typing is the\n * accessibility floor and the fallback at once, so it is what is always there and the\n * scan button is what is sometimes added. With no scanner supplied the markup is the\n * default control exactly, because a Scan button that opens nothing is worse than no\n * button ([0071](../../../docs/decisions/0071-a-scanner-is-supplied-not-built.md)).\n *\n * The React binding renders the same three elements for the same reasons.\n */\n@Component({\n selector: 'formancy-text-field',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FormancyFieldShell],\n template: `\n <formancy-field-shell [field]=\"field\" [label]=\"context.label\" [path]=\"context.path\">\n <input\n type=\"text\"\n [id]=\"control().id\"\n [attr.name]=\"control().name\"\n [attr.aria-invalid]=\"control()['aria-invalid']\"\n [attr.aria-required]=\"control()['aria-required']\"\n [attr.aria-describedby]=\"control()['aria-describedby']\"\n [disabled]=\"control().disabled === true\"\n [value]=\"text()\"\n (input)=\"onInput($event)\"\n (blur)=\"field.touch()\"\n />\n @if (scannable()) {\n <!-- The word is the visible label and the field's name completes the\n accessible one, so three scannable fields on a page do not offer three\n buttons called \"Scan\" — and the visible text is still contained in the\n accessible name (WCAG 2.5.3). One line, because element-internal\n whitespace leaks into the accessible name. -->\n <!-- Disabled only when the FIELD is, never while scanning: disabling the button\n somebody just pressed blurs it and the browser resets focus to the document\n body, so a keyboard user is returned to the top of the page and told to type\n instead into a field they must find again. Busy is said with aria-busy, which\n does not touch focus, and the guard in read() does what disabled was doing.\n Kept on one line because element-internal whitespace leaks into the accessible\n name. -->\n <button type=\"button\" data-formancy-part=\"scanner-button\" [disabled]=\"field.snapshot().disabled\" [attr.aria-busy]=\"scanning() ? 'true' : null\" (click)=\"read()\">Scan <span data-formancy-part=\"visually-hidden\">{{ context.label }}</span></button>\n <!-- The camera's own progress and its failures, in this field's polite\n region. NOT the error region: that one is the control's describedby\n target, it holds the engine's verdicts, and a refused permission put\n there would describe a hardware problem as a wrong answer. The same\n shape the file field uses for an upload. -->\n <p role=\"status\" data-formancy-part=\"scanner-status\">{{ status() }}</p>\n }\n </formancy-field-shell>\n `,\n})\nexport class FormancyTextField extends FieldComponentBase {\n private readonly scan = injectScanner()\n protected readonly scanning = signal(false)\n /** A device failure, held here rather than in the field's errors. See above. */\n private readonly trouble = signal<string | undefined>(undefined)\n\n protected readonly text = computed(() => {\n const value = this.field.snapshot().value\n return typeof value === 'string' ? value : ''\n })\n\n /**\n * A computed over the field's SIGNAL, not over `engine.getFieldSnapshot` — the\n * widget can arrive with a new document, and a plain method call is not a\n * dependency an OnPush component re-runs for.\n */\n protected readonly scannable = computed(\n () => this.scan !== null && this.field.snapshot().def.widget === 'scanner',\n )\n\n protected readonly status = computed(() =>\n this.scanning() ? 'Scanning…' : (this.trouble() ?? ''),\n )\n\n protected onInput(event: Event): void {\n this.commit((event.target as HTMLInputElement).value)\n }\n\n /**\n * The ONE place a text field's answer is written, typed or scanned.\n *\n * Structural rather than careful: the parameter is a `string`, so there is no path\n * from the camera to `setValue` that could store something typing could not — the\n * line a widget may never cross\n * ([0065](../../../docs/decisions/0065-a-widget-is-authored-not-registered.md)).\n */\n private commit(text: string): void {\n // See the React binding: `<input type=\"text\">` strips CR and LF from anything typed or\n // pasted, so a multi-line code payload stored verbatim would be an answer the default\n // control cannot produce -- the one thing a widget may never do.\n this.field.setValue(text.replace(/[\\r\\n]/g, ''))\n }\n\n protected async read(): Promise<void> {\n // Re-entrancy, which `disabled` used to prevent: a second press while a scan is in\n // flight is ignored rather than opening a second camera session.\n if (this.scan === null || this.scanning()) return\n this.scanning.set(true)\n this.trouble.set(undefined)\n try {\n const text = await this.scan({ label: this.context.label, path: this.context.path })\n // Nobody scanned anything: the sheet was closed, or they changed their mind.\n // Not a failure, and an apology in a live region for a decision somebody made\n // on purpose is noise.\n if (text === null) return\n if (typeof text !== 'string') {\n // A host written in plain JavaScript can resolve with anything. Reported as\n // the device failure it is, rather than stored — an object in a text field is\n // exactly what `commit` exists to make impossible.\n this.trouble.set(\n 'Scanning did not work: the scanner did not return text. Type the value instead.',\n )\n return\n }\n // Stored as typed, THEN touched — so a value the field's `pattern` refuses\n // shows the engine's own error rather than being dropped. Dropping it would\n // discard the only record of what the camera read and leave the field looking\n // empty, which is the worse of the two failures by some distance.\n this.commit(text)\n this.field.touch()\n } catch (error) {\n this.trouble.set(\n `Scanning did not work: ${\n error instanceof Error ? error.message : String(error)\n }. Type the value instead.`,\n )\n } finally {\n this.scanning.set(false)\n }\n }\n}\n\n@Component({\n selector: 'formancy-textarea-field',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FormancyFieldShell],\n template: `\n <formancy-field-shell [field]=\"field\" [label]=\"context.label\" [path]=\"context.path\">\n <textarea\n [id]=\"control().id\"\n [attr.name]=\"control().name\"\n [attr.aria-invalid]=\"control()['aria-invalid']\"\n [attr.aria-required]=\"control()['aria-required']\"\n [attr.aria-describedby]=\"control()['aria-describedby']\"\n [disabled]=\"control().disabled === true\"\n [value]=\"text()\"\n (input)=\"onInput($event)\"\n (blur)=\"field.touch()\"\n ></textarea>\n </formancy-field-shell>\n `,\n})\nexport class FormancyTextareaField extends FieldComponentBase {\n protected readonly text = computed(() => {\n const value = this.field.snapshot().value\n return typeof value === 'string' ? value : ''\n })\n\n protected onInput(event: Event): void {\n this.field.setValue((event.target as HTMLTextAreaElement).value)\n }\n}\n\n@Component({\n selector: 'formancy-number-field',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FormancyFieldShell],\n template: `\n <formancy-field-shell [field]=\"field\" [label]=\"context.label\" [path]=\"context.path\">\n <input\n type=\"number\"\n [id]=\"control().id\"\n [attr.name]=\"control().name\"\n [attr.aria-invalid]=\"control()['aria-invalid']\"\n [attr.aria-required]=\"control()['aria-required']\"\n [attr.aria-describedby]=\"control()['aria-describedby']\"\n [disabled]=\"control().disabled === true\"\n [value]=\"text()\"\n (input)=\"onInput($event)\"\n (blur)=\"field.touch()\"\n />\n </formancy-field-shell>\n `,\n})\nexport class FormancyNumberField extends FieldComponentBase {\n protected readonly text = computed(() => {\n const value = this.field.snapshot().value\n return typeof value === 'number' ? String(value) : ''\n })\n\n protected onInput(event: Event): void {\n const raw = (event.target as HTMLInputElement).value\n this.field.setValue(raw === '' ? null : Number(raw))\n }\n}\n\n@Component({\n selector: 'formancy-checkbox-field',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FormancyFieldShell],\n template: `\n <formancy-field-shell [field]=\"field\" [label]=\"context.label\" [path]=\"context.path\">\n <input\n type=\"checkbox\"\n [id]=\"control().id\"\n [attr.name]=\"control().name\"\n [attr.aria-invalid]=\"control()['aria-invalid']\"\n [attr.aria-required]=\"control()['aria-required']\"\n [attr.aria-describedby]=\"control()['aria-describedby']\"\n [attr.data-formancy-part]=\"part()\"\n [disabled]=\"control().disabled === true\"\n [checked]=\"checked()\"\n (change)=\"onChange($event)\"\n (blur)=\"field.touch()\"\n />\n </formancy-field-shell>\n `,\n})\nexport class FormancyCheckboxField extends FieldComponentBase {\n protected readonly checked = computed(() => this.field.snapshot().value === true)\n\n /**\n * `widget: \"toggle\"` is a part name and NOT `role=\"switch\"`.\n *\n * ARIA's switch means a control that takes effect when you operate it, and a form\n * field sets a value submitted later or never — so announcing \"switch\" describes\n * it incorrectly to the people who rely on the description. A role is also not\n * paint: changing it would make this the first widget to change what a control\n * claims to be, which is the line the widget mechanism exists to hold. The switch\n * is CSS, and conformance keeps finding this by role `checkbox` either way.\n *\n * Null rather than absent when there is no widget, because Angular omits an\n * attribute bound to null — which is what keeps an ordinary checkbox's markup\n * exactly as it was.\n */\n protected readonly part = computed(() =>\n this.field.snapshot().def.widget === 'toggle' ? 'toggle' : null,\n )\n\n protected onChange(event: Event): void {\n this.field.setValue((event.target as HTMLInputElement).checked)\n }\n}\n\n@Component({\n selector: 'formancy-date-field',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FormancyFieldShell],\n template: `\n <formancy-field-shell [field]=\"field\" [label]=\"context.label\" [path]=\"context.path\">\n <input\n type=\"date\"\n [id]=\"control().id\"\n [attr.name]=\"control().name\"\n [attr.aria-invalid]=\"control()['aria-invalid']\"\n [attr.aria-required]=\"control()['aria-required']\"\n [attr.aria-describedby]=\"control()['aria-describedby']\"\n [disabled]=\"control().disabled === true\"\n [value]=\"text()\"\n (input)=\"onInput($event)\"\n (blur)=\"field.touch()\"\n />\n </formancy-field-shell>\n `,\n})\nexport class FormancyDateField extends FieldComponentBase {\n protected readonly text = computed(() => {\n const value = this.field.snapshot().value\n return typeof value === 'string' ? value : ''\n })\n\n protected onInput(event: Event): void {\n const raw = (event.target as HTMLInputElement).value\n this.field.setValue(raw === '' ? null : raw)\n }\n}\n\n@Component({\n selector: 'formancy-time-field',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FormancyFieldShell],\n template: `\n <formancy-field-shell [field]=\"field\" [label]=\"context.label\" [path]=\"context.path\">\n <input\n type=\"time\"\n [id]=\"control().id\"\n [attr.name]=\"control().name\"\n [attr.aria-invalid]=\"control()['aria-invalid']\"\n [attr.aria-required]=\"control()['aria-required']\"\n [attr.aria-describedby]=\"control()['aria-describedby']\"\n [attr.min]=\"earliest()\"\n [attr.max]=\"latest()\"\n [disabled]=\"control().disabled === true\"\n [value]=\"text()\"\n (input)=\"onInput($event)\"\n (blur)=\"field.touch()\"\n />\n </formancy-field-shell>\n `,\n})\n/**\n * A time of day, as `HH:MM`.\n *\n * `<input type=\"time\">` gives the platform's picker, keyboard handling and locale\n * display — a 12-hour clock where the reader expects one — while its `value` is\n * always 24-hour `HH:MM`. Exactly the split the format wants: the reader sees their\n * convention, the answer records one canonical shape.\n *\n * No `step`, so the browser offers no seconds. A time answer has none, and a control\n * offering precision the format discards loses what somebody typed.\n */\nexport class FormancyTimeField extends FieldComponentBase {\n protected readonly text = computed(() => {\n const value = this.field.snapshot().value\n return typeof value === 'string' ? value : ''\n })\n\n /* Bounds handed to the browser as well as checked by the engine. The engine's\n check is the truth — it runs again on the server — and these let the platform\n grey out what it will not accept, which beats a message after the fact. */\n protected readonly earliest = computed(() => {\n const bound = this.field.snapshot().def.earliest\n return typeof bound === 'string' ? bound : null\n })\n\n protected readonly latest = computed(() => {\n const bound = this.field.snapshot().def.latest\n return typeof bound === 'string' ? bound : null\n })\n\n protected onInput(event: Event): void {\n const raw = (event.target as HTMLInputElement).value\n this.field.setValue(raw === '' ? null : raw)\n }\n}\n\n@Component({\n selector: 'formancy-datetime-field',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FormancyFieldShell],\n template: `\n <formancy-field-shell [field]=\"field\" [label]=\"context.label\" [path]=\"context.path\">\n <input\n type=\"datetime-local\"\n [id]=\"control().id\"\n [attr.name]=\"control().name\"\n [attr.aria-invalid]=\"control()['aria-invalid']\"\n [attr.aria-required]=\"control()['aria-required']\"\n [attr.aria-describedby]=\"control()['aria-describedby']\"\n [disabled]=\"control().disabled === true\"\n [value]=\"localText()\"\n (input)=\"onInput($event)\"\n (blur)=\"field.touch()\"\n />\n </formancy-field-shell>\n `,\n})\n/**\n * An instant, stored as `YYYY-MM-DDTHH:MM:SSZ`.\n *\n * `datetime-local` because no browser has a zoned datetime input, so the control\n * shows a local wall clock and this converts. The conversion is why this is not the\n * date field with another `type`:\n *\n * - **In:** the control gives `YYYY-MM-DDTHH:MM` in the reader's own zone, and `new\n * Date(local)` reads a zoneless string as local time — which is what is wanted at\n * the moment somebody types, and exactly what `bindTimestamp` refuses for a value\n * already stored, because the zone is not knowable later.\n * - **Out:** the stored instant is rendered back into local parts for the control,\n * never `toISOString()`, which would show UTC in a box the browser labels local.\n *\n * Seconds are therefore `00` in any answer a person typed. The format keeps them\n * because a machine-supplied answer has them, and one fixed width is what makes\n * ordering work.\n */\nexport class FormancyDateTimeField extends FieldComponentBase {\n protected readonly localText = computed(() => {\n const value = this.field.snapshot().value\n if (typeof value !== 'string' || value === '') return ''\n const instant = new Date(value)\n if (Number.isNaN(instant.getTime())) return ''\n const pad = (part: number): string => String(part).padStart(2, '0')\n return (\n `${String(instant.getFullYear())}-${pad(instant.getMonth() + 1)}-${pad(instant.getDate())}` +\n `T${pad(instant.getHours())}:${pad(instant.getMinutes())}`\n )\n })\n\n protected onInput(event: Event): void {\n const local = (event.target as HTMLInputElement).value\n if (local === '') {\n this.field.setValue(null)\n return\n }\n const instant = new Date(local)\n // A control can hand back something unparseable mid-edit. Null rather than a\n // malformed string keeps the stored answer always either empty or canonical,\n // which is what the engine's shape check assumes.\n this.field.setValue(\n Number.isNaN(instant.getTime()) ? null : `${instant.toISOString().slice(0, 19)}Z`,\n )\n }\n}\n\n/**\n * `widget: \"typeahead\"` - the same select, narrowed by typing.\n *\n * An ARIA 1.2 editable combobox over a listbox popup: a text box with\n * `role=\"combobox\"` and a `<ul role=\"listbox\">` of `<li role=\"option\">`. DOM focus\n * never leaves the text box, so the arrowed-over option is named by\n * `aria-activedescendant` - the only thing that says where somebody is when what\n * they are moving through does not hold focus.\n *\n * **The list element exists while the popup is collapsed.** `aria-expanded` and\n * `aria-controls` are required properties of the role, and an `aria-controls`\n * pointing at an element that is not there is an unresolvable IDREF - so the\n * listbox is rendered and `hidden` rather than created when it opens.\n *\n * `aria-autocomplete=\"list\"`, never `\"both\"`: nothing is written into the box on\n * the person's behalf, and `\"both\"` announces an inline completion that does not\n * exist. No `aria-haspopup`: `listbox` is the role's implicit popup.\n *\n * While a source is being asked, the box carries `aria-busy` and is never disabled:\n * disabling the element somebody just typed into blurs it, and the browser then\n * resets focus to the document body — the same reason the scanner's button stays\n * enabled while a scan is in flight.\n *\n * `aria-selected` is on the CHOSEN option and nothing else. Following the arrow\n * keys with it tells a screen reader the answer changed every time somebody\n * pressed Down to read the next row.\n *\n * **It cannot store what somebody typed.** `setValue` is reached from two places\n * here, with an option's own value or with `null`, and the text goes nowhere but\n * the filter - which is what makes\n * [0065](../../../docs/decisions/0065-a-widget-is-authored-not-registered.md)\n * structural rather than remembered. The filter itself is\n * `narrowOptionsByLabel` from `@formancy/spec`, the same function React calls, so\n * a query cannot narrow one way here and another way there.\n *\n * Every piece of state is a signal, and the field's own state arrives through\n * `injectField`, which is a signal fed by `engine.subscribeField`. Reading\n * `engine.getFieldSnapshot` instead - or wrapping a plain call in `computed()`,\n * which has no reactive dependency at all - renders this once and never again.\n * That bug has been written twice in this repository.\n */\n@Component({\n selector: 'formancy-typeahead-select',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FormancyFieldShell],\n template: `\n <formancy-field-shell [field]=\"field\" [label]=\"context.label\" [path]=\"context.path\">\n <!-- The popup's containing block, and the reason it is an element rather than\n nothing at all.\n\n The popup was absolutely positioned with 'top: auto', on the reasoning that\n it would then land at its STATIC position -- where it would have sat in the\n flow, directly under the box. That holds inside a block container and NOT\n inside a grid or flex one, and every theme lays a field out with\n 'display: grid'. For an absolutely positioned child of a grid container the\n static position is the container's own content-box origin, so the list opened\n over its own label and box rather than under them. Measured in the playground\n before the fix: the field's top edge was 457px, an in-flow child would have\n sat at 537px, and the popup sat at 459px.\n\n So the popup is given a containing block that wraps the control and nothing\n else, and every theme positions it against that explicitly. The status region\n stays OUTSIDE it, because it is a row of the field's grid exactly as the\n error region is. The React binding does the same, for the same reason. -->\n <div data-formancy-part=\"typeahead-anchor\">\n <input\n type=\"text\"\n role=\"combobox\"\n [id]=\"control().id\"\n [attr.name]=\"control().name\"\n [attr.aria-invalid]=\"control()['aria-invalid']\"\n [attr.aria-required]=\"control()['aria-required']\"\n [attr.aria-describedby]=\"control()['aria-describedby']\"\n [disabled]=\"control().disabled === true\"\n data-formancy-part=\"typeahead\"\n autocomplete=\"off\"\n aria-autocomplete=\"list\"\n [attr.aria-busy]=\"remote.busy() ? 'true' : null\"\n [attr.aria-expanded]=\"expanded()\"\n [attr.aria-controls]=\"listboxId()\"\n [attr.aria-activedescendant]=\"activeId()\"\n [value]=\"text()\"\n (input)=\"onInput($event)\"\n (click)=\"open.set(true)\"\n (keydown)=\"onKeyDown($event)\"\n (blur)=\"onBlur()\"\n />\n <!-- Named, because the listbox role is one whose accessible name is required.\n Not with the name the field already has: two elements answering to the\n same accessible name make every query by that name ambiguous. -->\n <ul\n [id]=\"listboxId()\"\n role=\"listbox\"\n [attr.aria-label]=\"popupLabel()\"\n data-formancy-part=\"typeahead-listbox\"\n [hidden]=\"!expanded()\"\n >\n @for (option of matches(); track option.value) {\n <li [id]=\"optionId(option.value)\" role=\"option\" data-formancy-part=\"typeahead-option\" [attr.data-active]=\"option.value === activeValue() ? 'true' : null\" [attr.aria-selected]=\"chosen()?.value === option.value ? 'true' : null\" (mousedown)=\"$event.preventDefault()\" (click)=\"choose(option.value)\">{{ option.label }}</li>\n }\n </ul>\n </div>\n <!-- Present from the start and empty until there is something to say: a live\n region created at the moment it gets its text is one several screen\n readers never announce. -->\n <!-- ONE region, four things it may say, and never the error region: a source\n being down is not a wrong answer, and the error region is the control's\n describedby target carrying the engine's verdict. -->\n <p role=\"status\" data-formancy-part=\"typeahead-status\" [attr.data-state]=\"statusState()\">{{ statusMessage() }}</p>\n </formancy-field-shell>\n `,\n})\nexport class FormancyTypeaheadSelect extends FieldComponentBase {\n /**\n * What is in the box while somebody types, or null when the box is simply\n * showing the answer.\n *\n * Two states rather than one string, because \"empty because they cleared it\" and\n * \"empty because there is no answer\" are different facts, and only the first\n * clears the answer on the way out.\n */\n protected readonly query = signal<string | null>(null)\n protected readonly open = signal(false)\n /** The arrowed-over option by VALUE, not by index: the filtered list changes on\n * every keystroke and an index would point at a different row after one. */\n protected readonly activeValue = signal<string | null>(null)\n\n /**\n * The option the form currently holds, looked up in what is OFFERED.\n *\n * `options()` is the document's list alone, and a field with `optionsSource` has\n * none — the schema forbids both — so looking there made `chosen` permanently\n * undefined for a sourced field, and the box showed an empty string over a stored\n * answer. React looked it up in the offered list from the start; this is the\n * divergence that made them two different controls.\n */\n protected readonly chosen = computed(() => {\n const value = this.field.snapshot().value\n return this.offered().find((option) => option.value === value)\n })\n\n /**\n * A source is the AUTHORITY on what matches: it was handed the query, and\n * re-folding its rows here would drop ones it matched on data the person cannot\n * see. A host wanting fetch-once-filter-locally composes `narrowOptionsByLabel` in\n * its own resolver, which is why that function lives in `@formancy/spec`.\n */\n protected readonly matches = computed(() =>\n this.remote.sourced()\n ? this.offered()\n : narrowOptionsByLabel(this.options(), this.query() ?? ''),\n )\n\n /** Collapsed whenever there is nothing on the screen, so `aria-expanded` never\n * claims a popup a person cannot see. */\n protected readonly expanded = computed(() => this.open() && this.matches().length > 0)\n\n protected readonly text = computed(() => this.query() ?? this.chosen()?.label ?? '')\n\n protected readonly listboxId = computed(() => `${this.control().id}:listbox`)\n\n protected readonly popupLabel = computed(() => `${this.context.label} suggestions`)\n\n private readonly activeIndex = computed(() =>\n this.matches().findIndex((option) => option.value === this.activeValue()),\n )\n\n /** Absent rather than empty when nothing is active: an empty IDREF is a broken\n * reference, not a way of saying \"nothing\". Angular omits an attribute bound to\n * null, which is exactly that. */\n protected readonly activeId = computed(() => {\n const index = this.activeIndex()\n if (!this.expanded() || index === -1) return null\n return this.optionId(this.matches()[index]!.value)\n })\n\n /**\n * A source's own words win over \"no options match\": while a request is in flight,\n * \"nothing matched\" is not yet true.\n */\n protected readonly statusMessage = computed(() => {\n const fromSource = this.remote.status()\n if (fromSource !== '') return fromSource\n return this.open() && this.matches().length === 0 && !this.remote.busy()\n ? 'No options match'\n : ''\n })\n\n /** What the region is saying, as a word a theme can select on. */\n protected readonly statusState = computed(() => {\n if (this.remote.busy()) return 'busy'\n const message = this.remote.status()\n if (message.startsWith('The options could not')) return 'failed'\n if (message !== '') return 'hint'\n return this.open() && this.matches().length === 0 ? 'empty' : null\n })\n\n /** One option's element id, in the shape the radio group already uses. */\n protected optionId(value: string): string {\n return `${this.control().id}:option:${value}`\n }\n\n /**\n * The one place the query changes, because it is two facts that must never disagree:\n * what the box shows, and what the source is asked for.\n *\n * They were separate signals and only typing wrote the second, so after choosing a\n * row or leaving the field the source kept answering the abandoned query while the\n * box showed the answer — and the popup on the next click held rows for a word\n * nobody had typed. React derives both from one piece of state, which is why it\n * never had this.\n */\n private setQuery(next: string | null): void {\n this.query.set(next)\n this.sourceQuery.set(next ?? '')\n }\n\n protected onInput(event: Event): void {\n this.setQuery((event.target as HTMLInputElement).value)\n this.open.set(true)\n // Nothing is active on a keystroke: aria-activedescendant is ABSENT rather\n // than pointing at a row the person has not moved to.\n this.activeValue.set(null)\n }\n\n protected onKeyDown(event: KeyboardEvent): void {\n const matches = this.matches()\n\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n event.preventDefault()\n if (!this.open()) {\n this.open.set(true)\n // Opens ON the answer when there is one, so Down then Enter cannot\n // quietly change an answer somebody only wanted to look at.\n const fallback = event.key === 'ArrowDown' ? matches[0] : matches[matches.length - 1]\n this.activeValue.set(this.chosen()?.value ?? fallback?.value ?? null)\n return\n }\n this.moveActive(event.key === 'ArrowDown' ? 1 : -1)\n return\n }\n\n if ((event.key === 'Home' || event.key === 'End') && this.expanded()) {\n // The popup's keys while it is open. Left to the caret, a long list is\n // reachable only by holding Down.\n event.preventDefault()\n this.activeValue.set(\n (event.key === 'Home' ? matches[0]! : matches[matches.length - 1]!).value,\n )\n return\n }\n\n if (event.key === 'Enter') {\n // Only while the list is showing. Otherwise Enter belongs to the form, and a\n // control that swallowed it would break submitting from the keyboard.\n if (!this.expanded()) return\n event.preventDefault()\n const index = this.activeIndex()\n if (index === -1) {\n this.open.set(false)\n return\n }\n this.choose(matches[index]!.value)\n return\n }\n\n if (event.key === 'Escape') {\n if (!this.open() && this.query() === null) return\n event.preventDefault()\n // \"Never mind about this list\", not \"delete what I chose earlier\": the query\n // is abandoned and the ANSWER is untouched.\n this.open.set(false)\n this.activeValue.set(null)\n this.setQuery(null)\n }\n }\n\n protected choose(value: string): void {\n this.field.setValue(value)\n this.setQuery(null)\n this.open.set(false)\n this.activeValue.set(null)\n }\n\n protected onBlur(): void {\n this.open.set(false)\n this.activeValue.set(null)\n const typed = this.query()\n if (typed !== null) {\n // An emptied box is the empty option, and the only route to null. Anything\n // else typed is abandoned - it was never an answer.\n if (typed.trim() === '') this.field.setValue(null)\n this.setQuery(null)\n }\n this.field.touch()\n }\n\n private moveActive(delta: number): void {\n const matches = this.matches()\n if (matches.length === 0) return\n const index = this.activeIndex()\n const from = index === -1 ? (delta > 0 ? -1 : matches.length) : index\n // Clamped, not wrapped: Down means further down the list, and a list that\n // jumps back to the top moves somebody past the end without saying so.\n const next = Math.min(Math.max(from + delta, 0), matches.length - 1)\n this.activeValue.set(matches[next]!.value)\n }\n}\n\n@Component({\n selector: 'formancy-select-field',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FormancyFieldShell, FormancyTypeaheadSelect],\n template: `\n @if (remote.unavailable()) {\n <!-- The document names a source this deployment does not have. Unlike a missing\n scanner this costs the whole field -- a select with no options collects\n nothing -- so it says so where the chooser would be, exactly as the file\n field does without an uploader.\n\n BEFORE the widget, and the order is the fix: dispatching to the typeahead\n first made this message unreachable for the very widget the feature was\n built for, leaving a working-looking combobox that returned nothing and\n announced \"No options match\" -- which says the list has no such row, when\n the truth is that there is no list. The React binding orders it the same. -->\n <formancy-field-shell [field]=\"field\" [label]=\"context.label\" [path]=\"context.path\">\n <p data-formancy-part=\"options-unavailable\">This field's answers come from \"{{ sourceName() }}\", which this application has not provided.</p>\n </formancy-field-shell>\n } @else if (typeahead()) {\n <!-- A widget changes the CONTROL and nothing else: same field, same\n accessible name, same stored answer. The registry still wins over every\n branch, because it replaces the component. -->\n <formancy-typeahead-select />\n } @else {\n <formancy-field-shell [field]=\"field\" [label]=\"context.label\" [path]=\"context.path\">\n <select\n [id]=\"control().id\"\n [attr.name]=\"control().name\"\n [attr.aria-invalid]=\"control()['aria-invalid']\"\n [attr.aria-required]=\"control()['aria-required']\"\n [attr.aria-describedby]=\"control()['aria-describedby']\"\n [disabled]=\"control().disabled === true\"\n (change)=\"onChange($event)\"\n (blur)=\"field.touch()\"\n >\n <!-- The empty option is the unanswered state; without it the browser\n silently pre-selects the first real option, which the engine never\n heard about. Selectedness is bound per option because a select's\n value property is only settable once its options exist. -->\n <option value=\"\" [selected]=\"selected() === ''\"></option>\n @for (option of offered(); track option.value) {\n <option [value]=\"option.value\" [selected]=\"selected() === option.value\">{{ option.label }}</option>\n }\n </select>\n <!-- Only a sourced select has anything to say: how many rows were left out, or\n that the source could not be reached. Never the error region, which carries\n the engine's verdict -- a source being down is not a wrong answer. -->\n @if (remote.sourced()) {\n <p role=\"status\" data-formancy-part=\"select-status\">{{ remote.status() }}</p>\n }\n </formancy-field-shell>\n }\n `,\n})\nexport class FormancySelectField extends FieldComponentBase {\n protected readonly typeahead = computed(() => this.field.snapshot().def.widget === 'typeahead')\n\n /** The name the document gave, for the message when this deployment has no such source. */\n protected readonly sourceName = computed(() => this.field.snapshot().def.optionsSource ?? '')\n\n /** This one hands over to the typeahead, which does its own asking. */\n protected override sourceEnabled(): boolean {\n return !this.typeahead()\n }\n\n protected readonly selected = computed(() => {\n const value = this.field.snapshot().value\n return typeof value === 'string' ? value : ''\n })\n\n protected onChange(event: Event): void {\n const raw = (event.target as HTMLSelectElement).value\n this.field.setValue(raw === '' ? null : raw)\n }\n}\n\n@Component({\n selector: 'formancy-radio-group-field',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <fieldset\n data-formancy-part=\"field\"\n [attr.data-formancy-field-path]=\"context.path\"\n [attr.data-state]=\"showError() ? 'invalid' : 'valid'\"\n [attr.aria-describedby]=\"control()['aria-describedby']\"\n >\n <legend data-formancy-part=\"label\">{{ context.label }}</legend>\n @if (field.snapshot().required) {\n <!-- A real element rather than the aria-required attribute, which\n role=group does not support: assistive technology ignores it\n there and an auditor reports it as invalid ARIA. The engine puts\n this id into the group's aria-describedby, so it is announced\n after the legend. Visible too, because WCAG 1.4.1. -->\n <span data-formancy-part=\"required-hint\" [id]=\"field.snapshot().ids.hint\">required</span>\n }\n @for (option of options(); track option.value) {\n <span data-formancy-part=\"radio-option\">\n <input\n type=\"radio\"\n [id]=\"optionId(option)\"\n [attr.name]=\"control().name\"\n [value]=\"option.value\"\n [checked]=\"field.snapshot().value === option.value\"\n (change)=\"field.setValue(option.value)\"\n (blur)=\"field.touch()\"\n />\n <label [attr.for]=\"optionId(option)\">{{ option.label }}</label>\n </span>\n }\n @if (showError()) {\n <p data-formancy-part=\"error\" [id]=\"field.snapshot().props.error.id\">{{ errorText() }}</p>\n }\n </fieldset>\n `,\n})\nexport class FormancyRadioGroupField extends FieldComponentBase {\n protected readonly showError = computed(() => {\n const snapshot = this.field.snapshot()\n return snapshot.touched && snapshot.errors.length > 0\n })\n\n protected readonly errorText = computed(() => this.field.snapshot().errors.join(', '))\n\n protected optionId(option: { value: string }): string {\n return `${this.field.snapshot().ids.control}:${option.value}`\n }\n}\n\n/**\n * The built-in unstyled components. `null` means the type renders nothing here:\n * hidden and static are non-inputs, and the container types are laid out by\n * their own machinery, not by a leaf slot.\n */\n/**\n * Text the reader sees that collects nothing — a heading, an explanation, a\n * notice.\n *\n * Not a label, because there is no control for one to label. Not a heading\n * element either: the spec does not say what level it would be, and guessing\n * produces a document outline that skips levels.\n */\n@Component({\n selector: 'formancy-static-field',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `<p data-formancy-part=\"static\">{{ context.label }}</p>`,\n})\nexport class FormancyStaticField {\n protected readonly context = injectFieldContext()\n}\n\n/**\n * Several answers from a list, every option visible at once.\n *\n * A fieldset with a legend, exactly like the radio group, because the\n * relationship is the same one: several controls answering a single question.\n * What differs is only that more than one may be chosen.\n *\n * \"At least one\" is a property of the QUESTION, not of any one box, so it\n * belongs to the group — but not as `aria-required`, which `role=\"group\"`\n * does not support and assistive technology therefore ignores. The group's\n * description carries it instead. On every box it would announce each option\n * as required, which is the opposite of what it means.\n */\n@Component({\n selector: 'formancy-select-boxes-field',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <fieldset\n data-formancy-part=\"field\"\n [attr.data-formancy-field-path]=\"context.path\"\n [attr.data-state]=\"showError() ? 'invalid' : 'valid'\"\n [attr.aria-describedby]=\"control()['aria-describedby']\"\n >\n <legend data-formancy-part=\"label\">{{ context.label }}</legend>\n @if (field.snapshot().required) {\n <!-- A real element rather than the aria-required attribute, which\n role=group does not support: assistive technology ignores it\n there and an auditor reports it as invalid ARIA. The engine puts\n this id into the group's aria-describedby, so it is announced\n after the legend. Visible too, because WCAG 1.4.1. -->\n <span data-formancy-part=\"required-hint\" [id]=\"field.snapshot().ids.hint\">required</span>\n }\n @for (option of options(); track option.value) {\n <span data-formancy-part=\"checkbox-option\">\n <input\n type=\"checkbox\"\n [id]=\"optionId(option)\"\n [attr.name]=\"control().name\"\n [value]=\"option.value\"\n [checked]=\"isChosen(option.value)\"\n [disabled]=\"field.snapshot().disabled\"\n (change)=\"toggle(option.value, $event)\"\n (blur)=\"field.touch()\"\n />\n <label [attr.for]=\"optionId(option)\">{{ option.label }}</label>\n </span>\n }\n @if (showError()) {\n <p data-formancy-part=\"error\" [id]=\"field.snapshot().props.error.id\">{{ errorText() }}</p>\n }\n </fieldset>\n `,\n})\nexport class FormancySelectBoxesField extends FieldComponentBase {\n protected readonly showError = computed(() => {\n const snapshot = this.field.snapshot()\n return snapshot.touched && snapshot.errors.length > 0\n })\n\n protected readonly errorText = computed(() => this.field.snapshot().errors.join(', '))\n\n protected readonly chosen = computed<readonly unknown[]>(() => {\n const value = this.field.snapshot().value\n return Array.isArray(value) ? value : []\n })\n\n protected isChosen(value: string): boolean {\n return this.chosen().includes(value)\n }\n\n protected optionId(option: { value: string }): string {\n return `${this.field.snapshot().ids.control}:${option.value}`\n }\n\n protected toggle(value: string, event: Event): void {\n const on = (event.target as HTMLInputElement).checked\n // Rebuilt in the options' own order rather than the order they were\n // ticked, so two people choosing the same answers store the same array and\n // the React binding stores it identically.\n const next = this.options()\n .map((option) => option.value)\n .filter((candidate) => (candidate === value ? on : this.isChosen(candidate)))\n this.field.setValue(next)\n }\n}\n\n/**\n * Formatted text, written as the restricted markup the spec defines.\n *\n * **Two surfaces over one value.** By default a toolbar over a textarea, whose\n * transformations live in `@formancy/spec` so a Bold button cannot mean one\n * thing here and something else in React. When the host provides an editor\n * factory, a contenteditable surface instead — which was refused in\n * [0052](../../../docs/decisions/0052-richtext-is-not-html.md) and admitted in\n * [0061](../../../docs/decisions/0061-tiptap-over-the-closed-grammar.md) once\n * the reason was read properly: 0052's argument was against a string of HTML\n * crossing the boundary, not against contenteditable, and a ProseMirror schema\n * built from the grammar cannot produce markup the grammar has no way to store.\n *\n * The factory is the host's because ProseMirror is larger than this whole\n * package and most forms have no rich-text field. Its absence is the default and\n * costs only the WYSIWYG surface.\n */\n@Component({\n selector: 'formancy-rich-text-field',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FormancyFieldShell, FormancyRichText],\n template: `\n <formancy-field-shell [field]=\"field\" [label]=\"context.label\" [path]=\"context.path\">\n @if (make !== null) {\n <!-- The toolbar stays. An editor library brings keyboard shortcuts and\n no toolbar UI, so leaving ours out left Bold reachable by Ctrl+B and\n by no visible control. One toolbar drives either surface, over the\n same RichCommand values. The preview does go: the surface IS the\n preview, which is the whole reason somebody wanted it. -->\n <div\n role=\"toolbar\"\n [attr.aria-label]=\"toolbarLabel()\"\n data-formancy-part=\"richtext-toolbar\"\n (keydown)=\"onToolbarKey($event)\"\n >\n @for (entry of commands; track entry.command; let i = $index) {\n <button\n type=\"button\"\n #toolbarButton\n [disabled]=\"field.snapshot().disabled\"\n [attr.tabindex]=\"i === active() ? 0 : -1\"\n data-formancy-part=\"richtext-button\"\n (focus)=\"active.set(i)\"\n (click)=\"press(entry.command)\"\n >\n <span aria-hidden=\"true\">{{ entry.glyph }}</span>\n <span data-formancy-part=\"visually-hidden\">{{ entry.name }}</span>\n </button>\n }\n </div>\n <div #editorHost data-formancy-part=\"richtext-editor\" (blur)=\"field.touch()\"></div>\n } @else {\n <!-- The ARIA toolbar pattern: ONE tab stop for the row, arrows within\n it. Five buttons that each took a tab press would put five stops\n between a keyboard user and the box they came to type in. -->\n <div\n role=\"toolbar\"\n [attr.aria-label]=\"toolbarLabel()\"\n data-formancy-part=\"richtext-toolbar\"\n (keydown)=\"onToolbarKey($event)\"\n >\n @for (entry of commands; track entry.command; let i = $index) {\n <button\n type=\"button\"\n #toolbarButton\n [disabled]=\"field.snapshot().disabled\"\n [attr.tabindex]=\"i === active() ? 0 : -1\"\n data-formancy-part=\"richtext-button\"\n (focus)=\"active.set(i)\"\n (click)=\"press(entry.command)\"\n >\n <span aria-hidden=\"true\">{{ entry.glyph }}</span>\n <span data-formancy-part=\"visually-hidden\">{{ entry.name }}</span>\n </button>\n }\n </div>\n <textarea\n #box\n [id]=\"control().id\"\n [attr.name]=\"control().name\"\n [attr.aria-describedby]=\"control()['aria-describedby']\"\n [attr.aria-invalid]=\"control()['aria-invalid']\"\n [attr.aria-required]=\"control()['aria-required']\"\n [disabled]=\"field.snapshot().disabled\"\n rows=\"5\"\n [value]=\"text()\"\n (keydown)=\"onKey($event)\"\n (input)=\"field.setValue($any($event.target).value)\"\n (blur)=\"field.touch()\"\n ></textarea>\n <div data-formancy-part=\"richtext-preview\">\n <formancy-rich-text [source]=\"text()\" />\n </div>\n }\n </formancy-field-shell>\n `,\n})\nexport class FormancyRichTextField extends FieldComponentBase {\n protected readonly text = computed(() => {\n const value = this.field.snapshot().value\n return typeof value === 'string' ? value : ''\n })\n\n protected readonly active = signal(0)\n\n protected readonly commands: ReadonlyArray<{\n command: RichCommand\n name: string\n glyph: string\n }> = [\n { command: 'strong', name: 'Bold', glyph: 'B' },\n { command: 'emphasis', name: 'Italic', glyph: 'I' },\n { command: 'link', name: 'Link', glyph: '↗' },\n { command: 'bulletList', name: 'Bulleted list', glyph: '•' },\n { command: 'orderedList', name: 'Numbered list', glyph: '1.' },\n ]\n\n private readonly box = viewChild<ElementRef<HTMLTextAreaElement>>('box')\n private readonly toolbarButtons = viewChildren<ElementRef<HTMLButtonElement>>('toolbarButton')\n\n protected readonly make = injectRichTextEditorFactory()\n private readonly editorHost = viewChild<ElementRef<HTMLDivElement>>('editorHost')\n private handle: RichTextEditorHandle | undefined\n\n /**\n * Mount once, then feed.\n *\n * A contenteditable rebuilt when the value changes loses the caret, the\n * selection and the undo stack, which is the difference between an editor and\n * a box that fights you. So the effect mounts on its first run and afterwards\n * only pushes a value that came from somewhere other than this editor —\n * comparing first, because pushing back the change it just reported would move\n * the caret to the end after every keystroke.\n */\n private readonly mounted = effect(() => {\n const next = this.text()\n const element = this.editorHost()?.nativeElement\n const make = this.make\n if (element === undefined || make === null) return\n\n if (this.handle === undefined) {\n this.handle = make({\n element,\n value: next,\n onChange: (value) => {\n this.field.setValue(value)\n },\n editable: this.field.snapshot().disabled !== true,\n attributes: this.editorAttributes(),\n })\n return\n }\n\n if (this.handle.value() === next) return\n\n // And never while the person is in the editor.\n //\n // Without this the editor reverts its own change. Pressing Bold updates the\n // document, reports the new answer, and the signal re-runs this effect — but\n // for one run `next` is still the answer from BEFORE the command. That run\n // sees a difference, pushes the stale answer back, un-bolds the word and\n // reports THAT. Observed in the playground: the stored value went to\n // `**hello**` and back to `hello` on its own.\n //\n // A value arriving from elsewhere while somebody is typing is rare; losing\n // what they just did is not recoverable. So the sync waits for them to leave,\n // and the comparison above catches it then.\n if (element.contains(document.activeElement)) return\n\n this.handle.setValue(next)\n })\n\n private readonly cleanup = inject(DestroyRef).onDestroy(() => {\n // ProseMirror holds DOM listeners and a plugin state. One left per mounted\n // form is a leak that only shows up in a long-lived admin app.\n this.handle?.destroy()\n this.handle = undefined\n })\n\n /**\n * The engine's wiring, passed to the surface rather than invented on it.\n *\n * Byte-identical to what the React binding passes, which is the point: the ids\n * and the describedby composition are computed once in `@formancy/core`, and a\n * renderer that assembled its own would be the implementation that drifts.\n * `aria-labelledby` rather than a `<label for>` because the surface is a div,\n * and `for` does not reach one.\n */\n private editorAttributes(): Record<string, string> {\n const control = this.control()\n const props = this.field.snapshot().props\n const attributes: Record<string, string> = {\n id: control.id,\n 'aria-labelledby': props.label.id,\n // The editing surface is a CHILD of the mount point, so it is the element\n // a theme has to style. Named here rather than left as the editor\n // library's own class, so a theme is not coupled to TipTap.\n 'data-formancy-part': 'richtext-surface',\n }\n const describedby = control['aria-describedby']\n if (describedby !== undefined) attributes['aria-describedby'] = describedby\n if (control['aria-invalid'] !== undefined) attributes['aria-invalid'] = 'true'\n if (control['aria-required'] !== undefined) attributes['aria-required'] = 'true'\n return attributes\n }\n\n /** Named with the field: a form may have several of these, and \"toolbar\"\n * five times says nothing about which question is being answered. */\n protected toolbarLabel(): string {\n const label = this.context.label\n return typeof label === 'string' ? `Formatting for ${label}` : 'Formatting'\n }\n\n protected press(command: RichCommand): void {\n if (command === 'link') {\n // A prompt rather than a dialog this package would then own the\n // accessibility of. A host wanting its own replaces the field through\n // the component registry.\n const href = window.prompt('Address for the link')\n if (href === null || href === '') return\n this.run(command, href)\n return\n }\n this.run(command)\n }\n\n protected onKey(event: KeyboardEvent): void {\n if (!(event.ctrlKey || event.metaKey)) return\n const key = event.key.toLowerCase()\n const command = key === 'b' ? 'strong' : key === 'i' ? 'emphasis' : undefined\n if (command === undefined) return\n event.preventDefault()\n this.run(command)\n }\n\n protected onToolbarKey(event: KeyboardEvent): void {\n const last = this.commands.length - 1\n const to =\n event.key === 'ArrowRight'\n ? this.active() + 1\n : event.key === 'ArrowLeft'\n ? this.active() - 1\n : event.key === 'Home'\n ? 0\n : event.key === 'End'\n ? last\n : undefined\n if (to === undefined) return\n event.preventDefault()\n const index = (to + this.commands.length) % this.commands.length\n this.active.set(index)\n this.toolbarButtons()[index]?.nativeElement.focus()\n }\n\n private run(command: RichCommand, href?: string): void {\n // With a WYSIWYG surface mounted the markers are not what somebody\n // typed, so inserting them would put literal asterisks into their\n // answer. The command goes to the editor instead.\n if (this.handle !== undefined) {\n this.handle.run(command, href)\n return\n }\n\n const element = this.box()?.nativeElement\n if (element === undefined) return\n\n const next = applyRichCommand(\n command,\n { value: this.text(), start: element.selectionStart, end: element.selectionEnd },\n href === undefined ? {} : { href },\n )\n this.field.setValue(next.value)\n // After the signal has been written through to the DOM. An editor that\n // drops the caret to the end after every button is one nobody can use for\n // a second word.\n requestAnimationFrame(() => {\n element.focus()\n element.setSelectionRange(next.start, next.end)\n })\n }\n}\n\n/**\n * Attached files.\n *\n * The control picks files; an injected uploader puts them somewhere and\n * reports what was stored. Without one the field is read-only and says so,\n * rather than accepting a file it has nowhere to put.\n */\n@Component({\n selector: 'formancy-file-field',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FormancyFieldShell],\n template: `\n <formancy-field-shell [field]=\"field\" [label]=\"context.label\" [path]=\"context.path\">\n @if (upload === null) {\n <p data-formancy-part=\"file-unavailable\">\n This form cannot accept files here, because no upload destination has been configured.\n </p>\n } @else {\n <!--\n The picker inside a drop target, not instead of one.\n\n Dropping is a pointer gesture with no keyboard equivalent, so it can\n only ever be a SECOND route (WCAG 2.1.1). The input stays exactly as it\n was and keeps the field's label and ARIA wiring; the region around it\n accepts a drop and hands the files to the same function. Two routes,\n one implementation, the same as the React binding.\n -->\n <div\n data-formancy-part=\"file-dropzone\"\n [attr.data-state]=\"over() ? 'over' : null\"\n (dragover)=\"onDragOver($event)\"\n (dragleave)=\"over.set(false)\"\n (drop)=\"onDrop($event)\"\n >\n <input\n type=\"file\"\n [id]=\"control().id\"\n [attr.name]=\"control().name\"\n [attr.aria-describedby]=\"control()['aria-describedby']\"\n [attr.accept]=\"acceptAttribute()\"\n [attr.multiple]=\"multiple() ? '' : null\"\n [disabled]=\"field.snapshot().disabled || busy()\"\n (change)=\"pick($event)\"\n />\n </div>\n }\n\n @if (files().length > 0 || removed().length > 0) {\n <ul data-formancy-part=\"file-list\">\n @for (file of files(); track file.id) {\n <li data-formancy-part=\"file-item\">\n <span>{{ file.name }}</span>\n <button\n type=\"button\"\n [disabled]=\"field.snapshot().disabled\"\n (click)=\"remove(file.id)\"\n >\n <!-- Named with the file, so a screen reader user hears which\n attachment a button removes rather than \"remove\" six\n times over. -->\n Remove {{ file.name }}\n </button>\n </li>\n }\n\n <!--\n A removed attachment stays visible with a way back. The bytes are\n still in storage until the unclaimed collector runs, so the removal\n is recoverable for free, and a misclick on the wrong row of six is\n the ordinary way somebody loses the evidence they came to attach.\n -->\n @for (entry of removed(); track entry.file.id) {\n <li data-formancy-part=\"file-item\" data-state=\"removed\">\n <span>{{ entry.file.name }}</span>\n <button\n type=\"button\"\n [disabled]=\"field.snapshot().disabled\"\n (click)=\"undo(entry.file.id)\"\n >\n Undo removing {{ entry.file.name }}\n </button>\n </li>\n }\n </ul>\n }\n\n <!-- One polite region per field for the upload itself: the form's error\n region belongs to validation, and a failed upload is not one. -->\n <p role=\"status\" data-formancy-part=\"file-status\">{{ status() }}</p>\n </formancy-field-shell>\n `,\n})\nexport class FormancyFileField extends FieldComponentBase {\n protected readonly upload = injectUploader()\n protected readonly over = signal(false)\n /** Attachments taken out of the answer but not yet forgotten, with where\n * they came from so undoing restores the order as well as the file. */\n protected readonly removed = signal<ReadonlyArray<{ at: number; file: StoredFile }>>([])\n\n protected onDragOver(event: DragEvent): void {\n // Without preventDefault the browser navigates to the file instead of\n // letting the page have it, which looks like the form vanishing.\n event.preventDefault()\n if (this.field.snapshot().disabled || this.busy()) return\n this.over.set(true)\n }\n\n protected onDrop(event: DragEvent): void {\n event.preventDefault()\n this.over.set(false)\n if (this.field.snapshot().disabled || this.busy()) return\n const dropped = event.dataTransfer?.files\n if (dropped === undefined || dropped.length === 0) return\n void this.store(Array.from(dropped))\n }\n\n protected undo(id: string): void {\n const entry = this.removed().find((other) => other.file.id === id)\n if (entry === undefined) return\n this.removed.update((before) => before.filter((other) => other.file.id !== id))\n const next = [...this.files()]\n next.splice(Math.min(entry.at, next.length), 0, entry.file)\n this.field.setValue(next)\n }\n protected readonly busy = signal(false)\n protected readonly failure = signal<string | undefined>(undefined)\n\n protected readonly files = computed<readonly StoredFile[]>(() => {\n const value = this.field.snapshot().value\n return Array.isArray(value) ? (value as StoredFile[]) : []\n })\n\n protected readonly status = computed(() => (this.busy() ? 'Uploading…' : (this.failure() ?? '')))\n\n protected acceptAttribute(): string | null {\n const accept = this.field.snapshot().def.accept\n return accept === undefined || accept.length === 0 ? null : accept.join(',')\n }\n\n protected multiple(): boolean {\n const max = this.field.snapshot().def.maxItems\n return max === undefined || max > 1\n }\n\n protected remove(id: string): void {\n const at = this.files().findIndex((file) => file.id === id)\n const going = this.files()[at]\n if (going === undefined) return\n // Out of the answer immediately, so a submit in between is correct, and\n // remembered with its position so undoing puts it BACK where it was rather\n // than on the end — the order matters to somebody who numbered their\n // attachments in a covering note.\n this.removed.update((before) => [...before, { at, file: going }])\n this.field.setValue(this.files().filter((file) => file.id !== id))\n }\n\n protected pick(event: Event): void {\n const input = event.target as HTMLInputElement\n const picked = input.files\n if (picked === null || picked.length === 0 || this.upload === null) return\n void this.store(Array.from(picked)).finally(() => {\n input.value = ''\n })\n }\n\n private async store(picked: readonly File[]): Promise<void> {\n this.busy.set(true)\n this.failure.set(undefined)\n\n // Each file succeeds or fails on its own.\n //\n // The first version collected them into an array and set the value once, so\n // a throw on the third of five discarded the two that had ALREADY uploaded:\n // their bytes were in storage, the submission never mentioned them, the\n // collector reclaimed them within the day, and the person was told the\n // upload failed when half of it had not. Whose fault the failure is does not\n // change who loses the file. The React binding does exactly the same thing.\n const uploaded: StoredFile[] = []\n const refused: string[] = []\n\n for (const file of picked) {\n try {\n uploaded.push(await this.upload!(file))\n } catch (error) {\n refused.push(`${file.name} (${error instanceof Error ? error.message : String(error)})`)\n }\n }\n\n // Recorded before the failure is reported, so nothing that reached storage\n // is left unclaimed while somebody reads the message.\n if (uploaded.length > 0) this.field.setValue([...this.files(), ...uploaded])\n\n if (refused.length > 0) {\n // Named, because \"the upload failed\" over a list of five attachments does\n // not say which one to try again.\n this.failure.set(\n refused.length === 1\n ? `${refused[0]!} was not attached.`\n : `${String(refused.length)} files were not attached: ${refused.join(', ')}.`,\n )\n }\n\n this.busy.set(false)\n this.field.touch()\n }\n}\n\nexport const DEFAULT_FIELD_COMPONENTS: Record<FieldType, Type<unknown> | null> = {\n text: FormancyTextField,\n textarea: FormancyTextareaField,\n number: FormancyNumberField,\n checkbox: FormancyCheckboxField,\n date: FormancyDateField,\n time: FormancyTimeField,\n datetime: FormancyDateTimeField,\n select: FormancySelectField,\n radio: FormancyRadioGroupField,\n selectboxes: FormancySelectBoxesField,\n file: FormancyFileField,\n richtext: FormancyRichTextField,\n hidden: null,\n static: FormancyStaticField,\n group: null,\n page: null,\n repeater: null,\n}\n","import { NgTemplateOutlet } from '@angular/common'\nimport {\n DestroyRef,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n Directive,\n ElementRef,\n Injector,\n ViewContainerRef,\n computed,\n effect,\n forwardRef,\n inject,\n input,\n output,\n runInInjectionContext,\n signal,\n viewChildren,\n} from '@angular/core'\nimport type { ComponentRef, OnChanges, OnDestroy, OnInit, Signal, Type } from '@angular/core'\nimport { encode } from 'uqr'\nimport { parsePath } from '@formancy/core'\nimport type { FieldSnapshot } from '@formancy/core'\nimport { datagridColumns, resolveText, LAYOUT_LEAF_KINDS, layoutChildren } from '@formancy/spec'\nimport type { FieldDef, LayoutNode } from '@formancy/spec'\nimport { DEFAULT_FIELD_COMPONENTS } from './fields.js'\nimport { injectField } from './field.js'\nimport { injectRepeater } from './repeater.js'\nimport type { RepeaterBinding } from './repeater.js'\nimport { injectSubmit } from './submit.js'\nimport { injectWizard } from './wizard.js'\nimport type { WizardBinding } from './wizard.js'\nimport { injectEngine } from './provide.js'\nimport { FORMANCY_FIELD_CONTEXT, FORMANCY_REGISTRY } from './registry.js'\n\nexport interface SubmitOutcome {\n ok: boolean\n errors: Record<string, string[]>\n /** The canonical value, present when accepted. */\n data?: unknown\n}\n\n/**\n * A minimal dynamic-component outlet: NgComponentOutlet's job without pulling\n * @angular/common into the library's runtime dependencies for one directive.\n * Creation happens in ngOnChanges — the framework-blessed moment for view\n * manipulation — and the injector input is how the slot hands each component\n * its FORMANCY_FIELD_CONTEXT.\n */\n@Directive({ selector: '[formancyOutlet]' })\nexport class FormancyComponentOutlet implements OnChanges, OnDestroy {\n private readonly container = inject(ViewContainerRef)\n\n readonly formancyOutlet = input.required<Type<unknown>>()\n readonly formancyOutletInjector = input.required<Injector>()\n\n private ref: ComponentRef<unknown> | undefined\n\n ngOnChanges(): void {\n this.ref?.destroy()\n this.ref = this.container.createComponent(this.formancyOutlet(), {\n injector: this.formancyOutletInjector(),\n })\n }\n\n ngOnDestroy(): void {\n this.ref?.destroy()\n }\n}\n\n/**\n * One field's slot: resolve the component through the registry (per-path beats\n * per-type beats the defaults) and mount it while the field is visible.\n *\n * A hidden field leaves the DOM entirely: display:none would still ship the\n * markup, keep it in the accessibility tree's shadow, and leak its labels to\n * screen-reader \"read all\" passes.\n *\n * The binding is wired in ngOnInit rather than a field initialiser because the\n * path arrives as an input, which does not exist yet at construction time.\n */\n@Component({\n selector: 'formancy-field',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FormancyComponentOutlet],\n template: `\n @if (state; as s) {\n @if (s.component !== null && s.snapshot().visible) {\n <ng-container [formancyOutlet]=\"s.component\" [formancyOutletInjector]=\"s.injector\" />\n }\n }\n `,\n})\nexport class FormancyFieldSlot implements OnInit {\n private readonly registry = inject(FORMANCY_REGISTRY, { optional: true })\n private readonly injector = inject(Injector)\n\n readonly path = input.required<string>()\n readonly fallbackLabel = input<string>()\n\n protected state?: {\n snapshot: Signal<FieldSnapshot>\n component: Type<unknown> | null\n injector: Injector\n }\n\n ngOnInit(): void {\n const path = this.path()\n const binding = runInInjectionContext(this.injector, () => injectField(path))\n const snapshot = binding.snapshot\n const component =\n this.registry?.byPath?.[path] ??\n this.registry?.byType?.[snapshot().type] ??\n DEFAULT_FIELD_COMPONENTS[snapshot().type]\n // Labels ride on the model definition (version-0 presentation-lite); the\n // labels input is the fallback, and the wire path is at least honest.\n const label = snapshot().label ?? this.fallbackLabel() ?? path\n this.state = {\n snapshot,\n component,\n injector: Injector.create({\n providers: [{ provide: FORMANCY_FIELD_CONTEXT, useValue: { path, label } }],\n parent: this.injector,\n }),\n }\n }\n}\n\ninterface RepeaterRow {\n index: number\n /** The row's stable identity, which `@for` tracks instead of its position. */\n id: string\n /** Each field of the row: its key within the row, and its positional wire.\n * Tracked by `key`, bound by `wire`. */\n children: ReadonlyArray<{ key: string; wire: string }>\n}\n\n/**\n * A repeater's own chrome: a named fieldset, one row div per item with the row\n * fields and a remove control, and an add control. Row fields render here,\n * never in the flat list — a row needs its remove button and its position\n * context.\n */\n@Component({\n selector: 'formancy-repeater',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgTemplateOutlet, FormancyFieldSlot],\n template: `\n @if (state; as s) {\n <fieldset data-formancy-part=\"repeater\">\n <legend data-formancy-part=\"repeater-legend\">{{ s.label }}</legend>\n <!-- The buttons a row carries, written once and used by both arrangements.\n Each one's text sits in its own element so a THEME can clip it and draw a\n mark instead, which is what a grid wants: \"Remove recipient 1 of 1\" on\n three wrapped lines took more room than the answers beside it. Clipped and\n never removed -- display: none and visibility: hidden both compute the\n button's name to the empty string, and a button called nothing is worse\n than a wide one. The renderer draws no mark of its own, because an icon is\n appearance and appearance belongs to the consumer.\n Their NAMES are identical in each, because 0068 put the row's position in\n them and a grid does not change where a person is. -->\n <ng-template #rowButtons let-row let-count=\"count\">\n <!-- Position context in the NAME, so a screen-reader user knows\n which row this button kills without walking the tree. -->\n <button type=\"button\" data-formancy-part=\"row-remove\" (click)=\"state!.repeater.removeRow(row.index)\"><span data-formancy-part=\"row-action-text\">{{ state!.removeLabel }} {{ row.index + 1 }} of {{ count }}</span></button>\n <!-- Reordering by button, which is the KEYBOARD route and therefore the\n primary one: WCAG 2.5.7 requires a non-drag equivalent for any drag,\n so a drag affordance can only ever be a second route to these.\n Absent at the ends rather than disabled: a disabled button is still in\n the tab order in some browsers and announces a control that does\n nothing. -->\n @if (row.index > 0) {\n <button type=\"button\" data-formancy-part=\"row-up\" (click)=\"state!.repeater.moveRow(row.index, row.index - 1)\"><span data-formancy-part=\"row-action-text\">Move {{ state!.label }} {{ row.index + 1 }} of {{ count }} up</span></button>\n }\n @if (row.index < count - 1) {\n <button type=\"button\" data-formancy-part=\"row-down\" (click)=\"state!.repeater.moveRow(row.index, row.index + 1)\"><span data-formancy-part=\"row-action-text\">Move {{ state!.label }} {{ row.index + 1 }} of {{ count }} down</span></button>\n }\n </ng-template>\n\n @if (plan().length > 0) {\n <!-- A container inside the fieldset rather than the fieldset itself, so the\n legend and the Add button do not become grid items.\n\n No role anywhere in here, and that is the decision rather than an\n omission. role=\"grid\" would take the arrow keys, which the controls in\n the cells already own -- a select with widget: \"typeahead\" is legal in a\n row and claims Up, Down, Home, End, Enter and Escape -- and it would\n replace twenty tab stops with one. A role is not paint, which is the\n line 0065 draws. -->\n <div data-formancy-part=\"datagrid\" [attr.data-columns]=\"plan().length\" [style]=\"trackStyle()\">\n <!-- Only once there is a row to head, and plain static text. A heading here\n names nothing, so a theme may delete it at phone width without changing\n what any control announces -- which is what makes the narrow-screen\n reflow possible at all. -->\n @if (s.rows().length > 0) {\n <div data-formancy-part=\"datagrid-head\">\n @for (entry of plan(); track entry.key) {\n <span data-formancy-part=\"datagrid-heading\" [attr.data-align]=\"entry.align\">{{ entry.heading }}</span>\n }\n </div>\n }\n @for (row of s.rows(); track row.id) {\n <div data-formancy-part=\"datagrid-row\">\n @for (entry of plan(); track entry.key) {\n <!-- Always emitted, even when every field in it renders nothing. A\n rule that hides one answer must not shift that row's remaining\n columns out of line with the heading strip and with every other\n row, which is the whole reason this arrangement exists. -->\n <div data-formancy-part=\"datagrid-cell\" [attr.data-align]=\"entry.align\">\n @for (child of cellChildren(row, entry.key); track child.wire) {\n <formancy-field [path]=\"child.wire\" [fallbackLabel]=\"fallbackFor(child.wire)\" />\n }\n </div>\n }\n <!-- One cell for all of a row's buttons, because there are two on the\n first and last rows and three in between. A track whose cell count\n varied per row is exactly what a table cannot express without a\n cell that announces a blank. -->\n <div data-formancy-part=\"datagrid-actions\">\n <ng-container *ngTemplateOutlet=\"rowButtons; context: { $implicit: row, count: s.rows().length }\" />\n </div>\n </div>\n }\n </div>\n } @else {\n @for (row of s.rows(); track row.id) {\n <div data-formancy-part=\"row\">\n <!-- Tracked by the POSITIONAL WIRE, which recreates every control in a\n row whenever the row moves, so focus is lost on a reorder.\n Deliberate, and the obstacle is named so the next attempt starts from\n it: tracking by the field's key instead would let Angular reuse the\n component, and this component reads its path once in ngOnInit and\n never rebinds -- so after a removal it would keep the old wire and\n show the wrong row's answer. A conformance fixture caught exactly\n that. Reactive path binding has to come first. -->\n @for (child of row.children; track child.wire) {\n <formancy-field [path]=\"child.wire\" [fallbackLabel]=\"fallbackFor(child.wire)\" />\n }\n <ng-container *ngTemplateOutlet=\"rowButtons; context: { $implicit: row, count: s.rows().length }\" />\n </div>\n }\n }\n <button type=\"button\" (click)=\"s.repeater.addRow()\">{{ s.addLabel }}</button>\n </fieldset>\n }\n `,\n})\nexport class FormancyRepeaterSection implements OnInit {\n private readonly engine = injectEngine()\n private readonly injector = inject(Injector)\n\n readonly wire = input.required<string>()\n readonly labels = input<Record<string, string>>()\n\n /** The repeater's own definition, kept because the column plan reads `widget`,\n * `columns` and the child labels off it on every render. */\n protected definition: FieldDef | undefined\n\n protected state?: {\n repeater: RepeaterBinding\n label: string\n addLabel: string\n removeLabel: string\n rows: Signal<readonly RepeaterRow[]>\n }\n\n /**\n * The columns the grid shows, in the order it shows them, or an empty list when the\n * widget was not asked for.\n *\n * `columns` without the widget stays inert on purpose: 0066 lets an author write the\n * arrangement before a renderer honours it, and a repeater that silently became a grid\n * because somebody sized its columns would be the opposite of that.\n *\n * The React binding computes the same list with the same helper, for the same reasons.\n */\n protected readonly plan = computed(\n (): ReadonlyArray<{ key: string; heading: string; align: string | null; width?: number }> => {\n const def = this.definition\n if (def?.widget !== 'datagrid') return []\n return datagridColumns(def, def.columns ?? []).map((entry) => ({\n key: entry.key,\n // The author's shortening, else the child's own label, else the labels input,\n // else the key. Visible text and NOTHING else -- never an id target and never an\n // aria-label, because a heading that named the answers beneath it is the failure\n // 0066 separates `header` from `label` to prevent.\n heading:\n this.engine.text(entry.column?.header) ??\n this.engine.text(entry.child?.label) ??\n this.fallbackFor(`${this.wire()}[0].${entry.key}`) ??\n entry.key,\n align: entry.column?.align ?? null,\n ...(entry.column?.width === undefined ? {} : { width: entry.column.width }),\n }))\n },\n )\n\n /**\n * The authored ratios, as ONE custom property rather than as `grid-template-columns`.\n *\n * A property lays nothing out by itself, so a theme's narrow-screen media query\n * replaces its own declaration and wins rather than losing to an inline one it cannot\n * outrank. It also carries a value space no attribute could enumerate: `width` is a\n * number with `exclusiveMinimum: 0`, so 1.5 is legal and nothing bounds it from above.\n *\n * Nothing at all when no column was sized, so the theme's fallback is live code.\n */\n protected trackStyle(): Record<string, string> {\n const plan = this.plan()\n if (!plan.some((entry) => entry.width !== undefined)) return {}\n return {\n '--fm-datagrid-columns': plan\n .map((entry) => (entry.width === undefined ? '1fr' : `${String(entry.width)}fr`))\n .join(' '),\n }\n }\n\n /**\n * The controls in one cell: every leaf inside the row that belongs to that column's\n * child field.\n *\n * One child, because a grid's rows are FLAT: a child holding fields of its own is\n * refused when the document is saved (0078). This walked the whole subtree under the\n * child while a group could be a column, and every clause that made that walk safe is\n * gone with the arrangement it served.\n *\n * Still a filter over the children that EXIST rather than the wire the column implies,\n * so a document nobody validated renders an empty cell rather than a field the engine\n * does not have.\n */\n protected cellChildren(row: RepeaterRow, key: string): readonly RepeaterRow['children'][number][] {\n const wanted = `${this.wire()}[${String(row.index)}].${key}`\n return row.children.filter((child) => child.wire === wanted)\n }\n\n ngOnInit(): void {\n const wire = this.wire()\n const def = this.engine.repeaters().find((candidate) => candidate.wire === wire)?.def\n this.definition = def\n const label = this.engine.text(def?.label) ?? this.labels()?.[wire] ?? wire\n const minItems = def?.minItems ?? 0\n\n const repeater = runInInjectionContext(this.injector, () => {\n const binding = injectRepeater(wire)\n // Seed to minItems: a repeater that promises one row must show one empty\n // row, not an add button and a shrug. An effect rather than a one-shot,\n // so dropping below the floor later re-seeds exactly as React's does.\n effect(() => {\n const shortfall = minItems - binding.rowCount()\n for (let i = 0; i < shortfall; i++) binding.addRow()\n })\n return binding\n })\n\n this.state = {\n repeater,\n label,\n addLabel: def?.addLabel ?? `Add ${label}`,\n removeLabel: def?.removeLabel ?? `Remove ${label}`,\n rows: computed(() =>\n Array.from({ length: repeater.rowCount() }, (_, index) => ({\n index,\n // Identity, not position: removing a row renumbers everything after\n // it, and tracking by index would make Angular reuse the wrong DOM\n // nodes — moving focus and animating the wrong element.\n id: repeater.rowIds()[index] ?? String(index),\n children: this.engine\n .fieldPaths()\n .filter((candidate) => candidate.startsWith(`${wire}[${index}]`))\n .map((candidate) => ({\n key: candidate.slice(`${wire}[${index}]`.length),\n wire: candidate,\n })),\n })),\n ),\n }\n }\n\n protected fallbackFor(instanceWire: string): string | undefined {\n const template = instanceWire.replace(/\\[\\d+\\]/, '[]')\n return this.labels()?.[template] ?? this.labels()?.[instanceWire]\n }\n}\n\n/**\n * Rendering a named `layouts` entry — fields side by side, in sections, in the\n * arrangement the document asks for rather than model order. The Angular half\n * of the same decisions packages/react/src/layout.tsx documents, and\n * deliberately the same markup.\n *\n * Four WCAG criteria shape it, and all four say the DOM is the arrangement:\n *\n * - **1.3.2 Meaningful Sequence** and **2.4.3 Focus Order** — children are\n * emitted in declared order and the stylesheet places them by source order\n * alone. Nothing here or in CSS may reorder them, or a screen reader and an\n * eye meet the form in different orders.\n * - **1.4.10 Reflow** — becoming one column when there is no room for two is a\n * media query, not a measurement. A layout that reflows only after scripts\n * have run does not reflow.\n * - **1.3.1 Info and Relationships** — a row is presentation and gets no\n * semantics; a labelled section is visibly grouping fields, so it is a real\n * `group` with an accessible name.\n *\n * Every container also carries `data-formancy-layout-path`, the index path of\n * the node that produced it, matching the React renderer attribute for\n * attribute. It is inert — nothing in this package reads it — and exists so a\n * tool outside the renderer can say which node an element on screen came from\n * without the renderer knowing anything about editing.\n */\n/**\n * One panel at a time, behind a row of tabs — the ARIA tabs pattern, matching\n * the React binding element for element.\n *\n * Written out rather than reached for from a library because the keyboard\n * behaviour IS the specification: arrows move between tabs, Home and End reach\n * the ends, and the strip is one tab stop through a roving tabindex, so a form\n * with twelve tabs does not cost twelve presses to get past.\n *\n * **Every panel stays in the DOM.** A closed tab is hidden, not removed. Tabs\n * are presentation, unlike pages: a field in a closed tab is still validated\n * and still submitted, so it has to be there to be validated, and the\n * browser's own find-in-page finds it. Removing it would also throw away what\n * somebody had typed the moment they looked at another tab.\n *\n * **A tab opens before error navigation focuses a control inside it.** An error summary focuses the\n * first invalid control, and focusing something inside a hidden panel does\n * nothing at all — the reader is told the form has an error and sent nowhere.\n */\n@Component({\n selector: 'formancy-tabs',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [forwardRef(() => FormancyLayout)],\n template: `\n <div data-formancy-part=\"layout-tabs\" [attr.data-formancy-layout-path]=\"at()\">\n <div\n role=\"tablist\"\n [attr.aria-label]=\"stripLabel()\"\n data-formancy-part=\"tablist\"\n (keydown)=\"onKeyDown($event)\"\n >\n @for (panel of panels(); track $index; let i = $index) {\n <button\n #tab\n type=\"button\"\n role=\"tab\"\n [id]=\"tabId(i)\"\n [attr.aria-controls]=\"panelId(i)\"\n [attr.aria-selected]=\"i === open()\"\n [attr.tabindex]=\"i === open() ? 0 : -1\"\n data-formancy-part=\"tab\"\n (click)=\"open.set(i)\"\n >{{ nameOf(panel, i) }}</button>\n }\n </div>\n\n @for (panel of panels(); track $index; let i = $index) {\n <div\n role=\"tabpanel\"\n [id]=\"panelId(i)\"\n [attr.aria-labelledby]=\"tabId(i)\"\n data-formancy-part=\"tabpanel\"\n [hidden]=\"i !== open()\"\n (formancy-reveal)=\"reveal(i)\"\n >\n <formancy-layout\n [nodes]=\"childrenOf(panel)\"\n [labels]=\"labels()\"\n [at]=\"panelPath(i)\"\n />\n </div>\n }\n </div>\n `,\n})\nexport class FormancyTabs {\n readonly at = input<string>('')\n readonly stripLabel = input<string | null>(null)\n readonly panels = input.required<readonly LayoutNode[]>()\n readonly labels = input<Record<string, string> | undefined>(undefined)\n\n protected readonly open = signal(0)\n private readonly changeDetector = inject(ChangeDetectorRef)\n\n protected reveal(index: number): void {\n this.open.set(index)\n this.changeDetector.detectChanges()\n }\n\n private readonly tabButtons = viewChildren<ElementRef<HTMLButtonElement>>('tab')\n private readonly engine = injectEngine()\n /** Set only by a key press, so focus is never taken from elsewhere. */\n private moveFocus = false\n\n private static counter = 0\n // After the counter, not before: a static read from a field initialiser runs\n // in declaration order, and the other way round it is NaN on every instance.\n private readonly id = `formancy-tabs-${String((FormancyTabs.counter += 1))}`\n\n constructor() {\n effect(() => {\n const index = this.open()\n if (!this.moveFocus) return\n this.moveFocus = false\n this.tabButtons()[index]?.nativeElement.focus()\n })\n }\n\n protected tabId(index: number): string {\n return `${this.id}-tab-${String(index)}`\n }\n\n protected panelId(index: number): string {\n return `${this.id}-panel-${String(index)}`\n }\n\n protected panelPath(index: number): string {\n const prefix = this.at()\n return prefix === '' ? String(index) : `${prefix}.${String(index)}`\n }\n\n protected childrenOf(node: LayoutNode): readonly LayoutNode[] {\n // `LAYOUT_LEAF_KINDS`, not `kind === 'field'`: a `qrcode` node is childless and is\n // not a field, so the old spelling read `children` off it and got `undefined`.\n return LAYOUT_LEAF_KINDS.has(node.kind) ? [node] : layoutChildren(node)\n }\n\n /** A tab's name is its section's heading. The validator insists it has one. */\n protected nameOf(node: LayoutNode, index: number): string {\n if (node.kind === 'field') return `Tab ${String(index + 1)}`\n const schema = this.engine.schema()\n return (\n resolveText(schema, node.label, schema.i18n?.defaultLocale ?? '') ??\n `Tab ${String(index + 1)}`\n )\n }\n\n protected onKeyDown(event: KeyboardEvent): void {\n const last = this.panels().length - 1\n const current = this.open()\n const next =\n event.key === 'ArrowRight'\n ? Math.min(current + 1, last)\n : event.key === 'ArrowLeft'\n ? Math.max(current - 1, 0)\n : event.key === 'Home'\n ? 0\n : event.key === 'End'\n ? last\n : undefined\n if (next === undefined) return\n event.preventDefault()\n this.moveFocus = true\n this.open.set(next)\n }\n}\n\n/** One per `formancy-code` on the page, so two codes never share a label id. */\nlet codeInstances = 0\n\n@Component({\n selector: 'formancy-code',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <div data-formancy-part=\"code\" [attr.data-state]=\"text() === '' ? 'empty' : 'ready'\">\n <!-- Named, and the name is ATTACHED. It was a loose span beside the value, and\n measured, the value's accessible name was the empty string: a screen reader\n announced a booking reference with nothing to say what it was. A label that\n only looks like a label is the failure this repository's describedby\n composition exists to prevent, in the one place a layout node wires its own.\n The React binding does the same. -->\n @if (label(); as caption) {\n <span [id]=\"labelId\" data-formancy-part=\"code-label\">{{ caption }}</span>\n }\n <!-- The drawing. Decorative: aria-hidden, because a picture of a code says nothing\n to a screen reader and an alt of \"QR code\" says nothing either. The value below\n is the content.\n Drawn from the encoder's matrix rather than with its own renderSVG, which emits\n white and black fills: a renderer shipping colours is the thing this project\n exists to avoid, so the modules use currentColor and the light ones are absent.\n Nothing is drawn for an empty answer -- an empty string encodes to a valid code,\n and a scannable picture of nothing is worse than no picture. -->\n @if (drawing(); as code) {\n <svg\n data-formancy-part=\"code-drawing\"\n [attr.viewBox]=\"'0 0 ' + code.size + ' ' + code.size\"\n aria-hidden=\"true\"\n focusable=\"false\"\n shape-rendering=\"crispEdges\"\n >\n @for (module of code.modules; track module.key) {\n <rect [attr.x]=\"module.x\" [attr.y]=\"module.y\" width=\"1\" height=\"1\" fill=\"currentColor\" />\n }\n </svg>\n }\n <!-- output is a live region, so its text is announced when the answer changes --\n right for a second view of an answer, and exactly why it must be named: an\n unnamed live region reads a string out of nowhere. -->\n <output data-formancy-part=\"code-value\" [attr.aria-labelledby]=\"label() ? labelId : null\">{{ text() }}</output>\n </div>\n `,\n})\n/**\n * A machine-readable code drawn from an answer the form already holds.\n *\n * A component with its OWN field binding rather than a method on the layout: reading the\n * snapshot from the layout rendered the value once and never again, because a plain method\n * call is not a signal an OnPush component re-runs for. Measured — the code stayed\n * `data-state=\"empty\"` after the answer was typed.\n *\n * **The accessible content is the value, not the picture.** A picture of a code says\n * nothing to a screen reader and an alt of \"QR code\" says nothing either; what somebody\n * needs is the value, which they can read, copy or dictate. There is no picture at all:\n * encoding one is a dependency for something a design system may want to draw its own way,\n * so the renderer emits the value and the hooks and a consumer registers a component for\n * the drawing. Out of the box a code node shows the value as text and no code — a usable\n * form with a visible gap, which is the right way round.\n */\nexport class FormancyCode implements OnInit {\n readonly path = input.required<string>()\n readonly label = input<string>()\n\n /**\n * The label's own id, so the value can point at it.\n *\n * From Angular's `inject(...)`-free counter rather than from the engine: the engine\n * mints ids for FIELDS, and a code is a layout node with no field of its own. Unique\n * per component instance, which is what two codes on one page need.\n */\n protected readonly labelId = `formancy-code-${String((codeInstances += 1))}`\n\n private readonly engine = injectEngine()\n private readonly destroyRef = inject(DestroyRef)\n\n /**\n * Subscribed, not computed.\n *\n * The first version was `computed(() => engine.getFieldSnapshot(...))`, which has no\n * reactive dependency at all -- `getFieldSnapshot` is a plain call, not a signal -- so\n * it ran once and never again. Measured twice now, in both renderers: the code stayed\n * `data-state=\"empty\"` after the answer was typed. A code is a live view of an answer\n * and has to subscribe like any other reader of one.\n */\n private readonly value = signal<unknown>(undefined)\n\n ngOnInit(): void {\n const parsed = parsePath(this.path())\n this.value.set(this.engine.getFieldSnapshot(parsed).value)\n const unsubscribe = this.engine.subscribeField(parsed, () => {\n this.value.set(this.engine.getFieldSnapshot(parsed).value)\n })\n this.destroyRef.onDestroy(unsubscribe)\n }\n\n protected readonly text = computed(() => {\n const value = this.value()\n if (typeof value === 'string') return value\n return value === null || value === undefined ? '' : String(value)\n })\n\n /**\n * The modules of the code, or undefined when there is nothing to encode.\n *\n * One rect per dark module rather than one path: a rect carries its own fill, so a theme\n * can address them, and the count is bounded by the version (a version 1 code is 23×23).\n * `track module.key` so Angular reuses rects across a redraw rather than rebuilding the\n * whole picture on every keystroke.\n */\n protected readonly drawing = computed(() => {\n const value = this.text()\n if (value === '') return undefined\n const { size, data } = encode(value)\n const modules: Array<{ key: string; x: number; y: number }> = []\n for (const [row, cells] of data.entries()) {\n for (const [column, dark] of cells.entries()) {\n if (dark) modules.push({ key: `${String(row)}.${String(column)}`, x: column, y: row })\n }\n }\n return { size, modules }\n })\n}\n\n@Component({\n selector: 'formancy-layout',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgTemplateOutlet, FormancyFieldSlot, FormancyRepeaterSection, FormancyTabs, FormancyCode],\n /**\n * Undoing an element rather than styling one.\n *\n * Angular gives every component a host element. This one recurses, so a container's\n * children arrive wrapped in a `<formancy-layout>` that React does not emit — and a\n * wrapper that takes part in layout is the only grid item its parent has, which is why\n * a two-column table produced one column in this renderer\n * ([0073](../../../docs/decisions/0073-a-host-element-is-not-a-layout.md)).\n *\n * `display: contents` removes the box and keeps the children, so the consumer's grid\n * sees what it sees in React. It also removes the element from the accessibility\n * tree, which is right: it has no role and names nothing.\n *\n * Set in the CONSTRUCTOR through CSSOM, and **never as a component style**: Angular\n * emits one as a `<style>` element that `style-src 'self'` blocks without a nonce,\n * which would silently restore the bug above. CSP does not govern CSSOM\n * ([0079](../../../docs/decisions/0079-a-host-is-undone-without-a-stylesheet.md),\n * which supersedes 0073's mechanism). `layout.test.ts` asserts both halves: the\n * display is `contents`, and no `<style>` is what says so.\n *\n * It also restores [0008](../../../docs/decisions/0008-layered-packages.md)'s \"nothing\n * below the component kit ships a CSS file\" rather than amending it, which is the better\n * outcome for a rule about who owns appearance.\n */\n template: `\n @for (node of nodes(); track $index; let i = $index) {\n <!-- A node that spans gets a cell to span WITH, and one that does not is left\n exactly as it was: a direct child of the container, so the markup of a form\n using no span is unchanged.\n\n The body is an ng-template rather than the same @if chain written twice,\n because two copies of a nine-branch chain is two places for them to drift.\n\n Two channels for one fact, and the reason is arithmetic: data-span is the\n authored value, which a selector can match, and --fm-span is the same number\n where CSS can COUNT with it, because 'grid-column: span attr(data-span)' is\n not a thing. 'all' needs no number -- it is 1 / -1 whatever the column count\n -- so it carries no property and the theme's fallback covers the rest.\n\n The React binding does the same, for the same reasons. -->\n @if (node.span !== undefined) {\n <div\n data-formancy-part=\"layout-cell\"\n [attr.data-span]=\"node.span\"\n [style]=\"spanStyle(node)\"\n >\n <ng-container *ngTemplateOutlet=\"nodeBody; context: { $implicit: node, i: i }\" />\n </div>\n } @else {\n <ng-container *ngTemplateOutlet=\"nodeBody; context: { $implicit: node, i: i }\" />\n }\n }\n\n <ng-template #nodeBody let-node let-i=\"i\">\n @if (node.kind === 'field') {\n @if (isRepeater(node.path)) {\n <formancy-repeater [wire]=\"node.path\" [labels]=\"labels()\" />\n } @else {\n <formancy-field [path]=\"node.path\" />\n }\n } @else if (node.kind === 'row') {\n <!-- Presentation only: two fields being beside each other is not a\n relationship the author described, and announcing \"group\" around\n every pair would be noise. -->\n <div\n data-formancy-part=\"layout-row\"\n [attr.data-formancy-layout-path]=\"pathOf(i)\"\n [attr.data-columns]=\"node.children.length\"\n >\n <formancy-layout [nodes]=\"node.children\" [labels]=\"labels()\" [at]=\"pathOf(i)\" />\n </div>\n } @else if (node.kind === 'column') {\n <div data-formancy-part=\"layout-column\" [attr.data-formancy-layout-path]=\"pathOf(i)\">\n <formancy-layout [nodes]=\"node.children\" [labels]=\"labels()\" [at]=\"pathOf(i)\" />\n </div>\n } @else if (node.kind === 'tabs') {\n <formancy-tabs\n [panels]=\"node.children\"\n [labels]=\"labels()\"\n [at]=\"pathOf(i)\"\n [stripLabel]=\"stripLabelFor(node)\"\n />\n } @else if (node.kind === 'qrcode') {\n <!-- The accessible content is the VALUE, not the picture. A picture of a code\n says nothing to a screen reader and an alt of \"QR code\" says nothing\n either; what somebody needs is the value, which they can read, copy or\n dictate. And there is no picture: encoding one is a dependency (a matrix,\n mask patterns, Reed-Solomon) for something a design system may want to draw\n its own way, so the renderer emits the value and the hooks and a consumer\n registers a component for the drawing. Out of the box a code node shows the\n value as text and no code -- a usable form with a visible gap, which is the\n right way round. -->\n <formancy-code\n [path]=\"node.path\"\n [label]=\"headingFor(node)?.text\"\n [attr.data-formancy-layout-path]=\"pathOf(i)\"\n />\n } @else if (node.kind === 'table') {\n <!-- A grid, not a <table>. Laying fields out in columns is not\n tabular data, and marking it up as a table would announce rows and\n columns that mean nothing (WCAG 1.3.1). The column count is data\n so the stylesheet can collapse it with a media query. -->\n <div\n data-formancy-part=\"layout-table\"\n [attr.data-formancy-layout-path]=\"pathOf(i)\"\n [attr.data-columns]=\"node.columns\"\n [attr.role]=\"headingFor(node) ? 'group' : null\"\n [attr.aria-labelledby]=\"headingFor(node)?.id ?? null\"\n >\n @if (headingFor(node); as heading) {\n <p [id]=\"heading.id\" data-formancy-part=\"layout-section-heading\">{{ heading.text }}</p>\n }\n <formancy-layout [nodes]=\"node.children\" [labels]=\"labels()\" [at]=\"pathOf(i)\" />\n </div>\n } @else if (headingFor(node); as heading) {\n <div\n data-formancy-part=\"layout-section\"\n [attr.data-formancy-layout-path]=\"pathOf(i)\"\n role=\"group\"\n [attr.aria-labelledby]=\"heading.id\"\n >\n <p [id]=\"heading.id\" data-formancy-part=\"layout-section-heading\">{{ heading.text }}</p>\n <formancy-layout [nodes]=\"node.children\" [labels]=\"labels()\" [at]=\"pathOf(i)\" />\n </div>\n } @else {\n <!-- A group with no accessible name is announced as \"group\" and tells\n nobody anything, so an unlabelled section stays a box. -->\n <div data-formancy-part=\"layout-section\" [attr.data-formancy-layout-path]=\"pathOf(i)\">\n <formancy-layout [nodes]=\"node.children\" [labels]=\"labels()\" [at]=\"pathOf(i)\" />\n </div>\n }\n </ng-template>\n `,\n})\nexport class FormancyLayout {\n readonly nodes = input.required<readonly LayoutNode[]>()\n readonly labels = input<Record<string, string> | undefined>(undefined)\n /** Index path of the container these nodes are the children of. */\n readonly at = input<string>('')\n\n private readonly engine = injectEngine()\n\n constructor() {\n // The host takes no part in layout. Through CSSOM rather than a stylesheet, for the\n // reason written above the template: a component style is a `<style>` element a\n // strict `style-src` blocks, and this has to hold with no CSP configuration at all.\n inject(ElementRef<HTMLElement>).nativeElement.style.setProperty('display', 'contents')\n }\n\n\n /** The span as a number CSS can count with, and nothing at all for `all`.\n *\n * A style OBJECT rather than `[style.--fm-span]`: both set a custom property --\n * measured, both work -- and the object form lets this return nothing for `all`\n * without binding an empty string. */\n protected spanStyle(node: LayoutNode): Record<string, string> {\n return typeof node.span === 'number' ? { '--fm-span': String(node.span) } : {}\n }\n /** This node's index path, as the dotted string the attribute carries. */\n protected pathOf(index: number): string {\n const prefix = this.at()\n return prefix === '' ? String(index) : `${prefix}.${String(index)}`\n }\n\n /**\n * Headings are cached per node. Minting an id inside the template would give\n * a different one on every change-detection pass, leaving aria-labelledby\n * pointing at an element that no longer exists.\n */\n private readonly headings = new WeakMap<object, { id: string; text: string } | null>()\n private static counter = 0\n\n /** A tabs node's own name, for the tab strip. Null when it has none. */\n protected stripLabelFor(node: LayoutNode): string | null {\n if (node.kind !== 'tabs') return null\n const schema = this.engine.schema()\n return resolveText(schema, node.label, schema.i18n?.defaultLocale ?? '') ?? null\n }\n\n protected isRepeater(path: string): boolean {\n return this.engine.repeaterPaths().includes(path)\n }\n\n protected headingFor(node: LayoutNode): { id: string; text: string } | null {\n const cached = this.headings.get(node)\n if (cached !== undefined) return cached\n\n const schema = this.engine.schema()\n const label = node.kind === 'field' ? undefined : node.label\n const text = resolveText(schema, label, schema.i18n?.defaultLocale ?? '')\n const heading =\n text === undefined || text === ''\n ? null\n : { id: `formancy-section-${String((FormancyLayout.counter += 1))}`, text }\n\n this.headings.set(node, heading)\n return heading\n }\n}\n\n/**\n * Renders the whole form from the engine: one slot per field, resolved through\n * the registry. Slots subscribe individually, so a keystroke re-renders one\n * field and a visibility flip mounts or unmounts exactly the fields it hit.\n * A paged schema renders a stepper, one page at a time, navigation, and the\n * submit control on the last page — a failed submit navigates to the first\n * page with a problem instead of leaving the user on a clean review page\n * staring at a rejection.\n */\n@Component({\n selector: 'formancy-form',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FormancyFieldSlot, FormancyRepeaterSection, FormancyLayout],\n template: `\n @if (wizard; as w) {\n <nav data-formancy-part=\"stepper\" aria-label=\"Progress\">\n <ol>\n @for (page of pages; track page.key; let i = $index) {\n <li [attr.aria-current]=\"i === w.page() ? 'step' : null\">{{ pageLabel(page) }}</li>\n }\n </ol>\n </nav>\n @for (wire of staticOnPage(); track wire) {\n <formancy-field [path]=\"wire\" [fallbackLabel]=\"fallbackFor(wire)\" />\n }\n @for (wire of repeatersOnPage(); track wire) {\n <formancy-repeater [wire]=\"wire\" [labels]=\"labels()\" />\n }\n <div data-formancy-part=\"wizard-nav\">\n @if (w.page() > 0) {\n <button type=\"button\" (click)=\"w.back()\">Back</button>\n }\n @if (w.page() < w.pageCount - 1) {\n <button type=\"button\" (click)=\"onNext()\">Next</button>\n } @else {\n <button type=\"button\" data-formancy-part=\"submit\" (click)=\"onSubmit()\">{{ submitLabel() ?? 'Submit' }}</button>\n }\n </div>\n } @else if (arrangement(); as nodes) {\n <formancy-layout [nodes]=\"nodes\" [labels]=\"labels()\" />\n <button type=\"button\" data-formancy-part=\"submit\" (click)=\"onSubmit()\">{{ submitLabel() ?? 'Submit' }}</button>\n } @else {\n @for (wire of staticWires; track wire) {\n <formancy-field [path]=\"wire\" [fallbackLabel]=\"fallbackFor(wire)\" />\n }\n @for (wire of repeaterWires; track wire) {\n <formancy-repeater [wire]=\"wire\" [labels]=\"labels()\" />\n }\n <button type=\"button\" data-formancy-part=\"submit\" (click)=\"onSubmit()\">{{ submitLabel() ?? 'Submit' }}</button>\n }\n `,\n})\nexport class FormancyForm {\n private readonly engine = injectEngine()\n private readonly submit = injectSubmit()\n\n protected readonly wizard: WizardBinding | undefined =\n this.engine.wizard() === undefined ? undefined : injectWizard()\n\n /**\n * Display text per wire path (row fields by their template wire,\n * `items[].name`). A `label` on the model definition wins — that is how\n * fixture schemas carry text until the spec's i18n section lands.\n */\n readonly labels = input<Record<string, string>>()\n /**\n * Render a named entry from the schema's `layouts` instead of model order.\n * Unknown or absent, the form falls back to model order.\n */\n readonly layout = input<string>()\n readonly submitLabel = input<string>()\n readonly submitted = output<SubmitOutcome>()\n\n protected readonly pages = this.engine.pages()\n protected readonly repeaterWires = this.engine.repeaterPaths()\n\n // Row fields render inside their repeater's own section, never in the flat\n // list — a row needs its remove button and its position context. The static\n // wires never change: visibility is per-slot metadata, not list membership.\n protected readonly staticWires = this.engine\n .fieldPaths()\n .filter((wire) => !this.repeaterWires.some((repeater) => wire.startsWith(`${repeater}[`)))\n\n protected readonly staticOnPage = computed(() => {\n const wizard = this.wizard\n if (wizard === undefined) return this.staticWires\n return this.staticWires.filter((wire) => this.engine.pageOf(parsePath(wire)) === wizard.page())\n })\n\n protected readonly repeatersOnPage = computed(() => {\n const wizard = this.wizard\n if (wizard === undefined) return this.repeaterWires\n return this.repeaterWires.filter((wire) => this.engine.pageOf(parsePath(wire)) === wizard.page())\n })\n\n /**\n * The nodes of the named layout, or undefined to fall back to model order —\n * a mistyped layout name should not produce an empty form.\n */\n protected readonly arrangement = computed<readonly LayoutNode[] | undefined>(() => {\n const name = this.layout()\n if (name === undefined) return undefined\n return this.engine.schema().layouts?.find((candidate) => candidate.name === name)?.nodes\n })\n\n protected fallbackFor(wire: string): string | undefined {\n return this.labels()?.[wire]\n }\n\n protected pageLabel(page: { key: string; def: FieldDef }): string {\n return this.engine.text(page.def.label) ?? page.key\n }\n\n protected onNext(): void {\n void this.wizard?.next()\n }\n\n protected onSubmit(): void {\n const outcome = this.submit()\n if (!outcome.ok && this.wizard !== undefined) {\n // Take the user TO the problem: a rejection on a clean review page\n // explains nothing.\n const firstInvalid = this.engine.firstInvalid()\n if (firstInvalid !== null) this.wizard.goTo(this.engine.pageOf(parsePath(firstInvalid)))\n }\n this.submitted.emit(\n outcome.ok\n ? { ok: true, errors: outcome.errors, data: this.engine.value() }\n : { ok: false, errors: outcome.errors },\n )\n }\n}\n","import { focusControl } from './focus-control.js'\nimport {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n afterRenderEffect,\n computed,\n inject,\n input,\n signal,\n viewChild,\n} from '@angular/core'\nimport type { ElementRef, Signal } from '@angular/core'\nimport { parsePath } from '@formancy/core'\nimport { injectEngine } from './provide.js'\n\n/**\n * The error summary a failed submit focuses.\n *\n * The semantics are deliberate and easy to get wrong: the container takes\n * focus via tabindex=\"-1\" — focusing it already makes screen readers announce\n * it, so role=\"alert\" would announce it TWICE. Each entry is a real in-page\n * link to the offending control, because links are what \"take me to the\n * problem\" already means to assistive tech.\n */\n@Component({\n selector: 'formancy-error-summary',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n @if (errors().length > 0) {\n <div data-formancy-part=\"error-summary\" tabindex=\"-1\" #region>\n <h2 data-formancy-part=\"error-summary-heading\">{{ heading() }}</h2>\n <ul>\n @for (entry of errors(); track entry.path) {\n <li><a [attr.href]=\"'#' + controlIdOf(entry.path)\" (click)=\"focusControl($event, entry.path)\">{{ labelFor(entry.path) }}: {{ entry.codes.join(', ') }}</a></li>\n }\n </ul>\n </div>\n }\n `,\n})\nexport class FormancyErrorSummary {\n readonly labels = input<Record<string, string>>()\n\n private readonly engine = injectEngine()\n private readonly region = viewChild<ElementRef<HTMLElement>>('region')\n\n protected readonly errors: Signal<ReadonlyArray<{ path: string; codes: readonly string[] }>>\n\n constructor() {\n const errors = signal(this.engine.visibleErrors())\n const unsubscribe = this.engine.subscribe(() => errors.set(this.engine.visibleErrors()))\n inject(DestroyRef).onDestroy(unsubscribe)\n this.errors = errors.asReadonly()\n\n // Focus when errors APPEAR (a submit surfaced them), not on every\n // keystroke that edits an already-broken field. afterRenderEffect, because\n // the container only exists in the DOM once the render that shows it ran.\n let previousCount = 0\n afterRenderEffect(() => {\n const count = this.errors().length\n if (count > 0 && previousCount === 0) this.region()?.nativeElement.focus()\n previousCount = count\n })\n }\n\n protected readonly heading = computed(() => {\n const count = this.errors().length\n return count === 1 ? 'There is 1 problem to fix' : `There are ${count} problems to fix`\n })\n\n protected labelFor(path: string): string {\n return this.labels()?.[path] ?? this.labels()?.[path.replace(/\\[\\d+\\]/, '[]')] ?? path\n }\n\n protected controlIdOf(path: string): string {\n return this.engine.getFieldSnapshot(parsePath(path)).ids.control\n }\n\n protected focusControl(event: Event, path: string): void {\n // The hash alone scrolls but does not focus; do both.\n event.preventDefault()\n focusControl(document.getElementById(this.controlIdOf(path)))\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n afterRenderEffect,\n computed,\n input,\n viewChild,\n} from '@angular/core'\nimport type { ElementRef } from '@angular/core'\n\n/**\n * Telling somebody their draft came back changed.\n *\n * The same component the React binding has, word for word in what it says,\n * because the two renderers agreeing about what a form TELLS somebody matters as\n * much as them agreeing about what it collects.\n *\n * The server already does the careful half: a republished form migrates a draft\n * lazily on resume, and answers whose field no longer exists move to\n * `data.__orphaned` rather than being deleted\n * ([0027](../../../docs/decisions/0027-lazy-draft-migration.md)).\n *\n * **Nothing showed that to the person.** They resumed a draft, some of their\n * answers were no longer on the form, and they submitted believing everything\n * they had typed was in it. The answers are not lost from storage — they are\n * lost from the submission, and nobody was told.\n *\n * The semantics follow `formancy-error-summary`, which solved the same shape of\n * problem: the container takes focus through `tabindex=\"-1\"` and is deliberately\n * NOT `role=\"alert\"`, because focusing it already makes a screen reader announce\n * it and doing both announces it twice.\n */\nexport interface ResumeMigration {\n readonly severity: 'lossy' | 'breaking'\n readonly changes: ReadonlyArray<{ readonly kind: string; readonly path?: string }>\n}\n\n@Component({\n selector: 'formancy-resume-notice',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n @if (migration() !== undefined) {\n <div\n role=\"region\"\n aria-label=\"This form changed while you were away\"\n data-formancy-part=\"resume-notice\"\n [attr.data-state]=\"migration()!.severity\"\n tabindex=\"-1\"\n #region\n >\n <h2 data-formancy-part=\"resume-notice-heading\">This form changed while you were away</h2>\n\n @if (migration()!.severity === 'breaking') {\n <p>\n It changed too much for your answers to be moved across, so this is being shown as you\n left it and <strong>cannot be submitted</strong>. Starting again will give you the\n current form.\n </p>\n } @else {\n <p>{{ summary() }}</p>\n @if (setAside().length > 0) {\n <ul data-formancy-part=\"resume-notice-list\">\n @for (path of setAside(); track path) {\n <li>{{ labelFor(path) }}</li>\n }\n </ul>\n }\n }\n </div>\n }\n `,\n})\nexport class FormancyResumeNotice {\n /** Omitted when the draft came back unchanged. */\n readonly migration = input<ResumeMigration | undefined>(undefined)\n /** Question wording for a field key, since a key is not what the form asked. */\n readonly labels = input<Readonly<Record<string, string>>>({})\n\n protected readonly setAside = computed(() =>\n (this.migration()?.changes ?? [])\n .map((change) => change.path)\n .filter((path): path is string => path !== undefined),\n )\n\n protected readonly summary = computed(() => {\n const count = this.setAside().length\n return count === 1\n ? 'One question is no longer on this form. Your answer to it is still kept with the rest and will be sent with them — it is just not shown here any more.'\n : `${String(count)} questions are no longer on this form. Your answers to them are still kept with the rest and will be sent with them — they are just not shown here any more.`\n })\n\n private readonly region = viewChild<ElementRef<HTMLDivElement>>('region')\n\n private readonly focused = afterRenderEffect(() => {\n if (this.migration() === undefined) return\n this.region()?.nativeElement.focus()\n })\n\n protected labelFor(path: string): string {\n return this.labels()[path] ?? path\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAIA;;;AAGG;MACU,eAAe,GAAG,IAAI,cAAc,CAAa,iBAAiB;AAEzE,SAAU,eAAe,CAAC,MAAkB,EAAA;IAChD,OAAO,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;AACzD;SAEgB,YAAY,GAAA;AAC1B,IAAA,MAAM,MAAM,GAAG,MAAM,CAAC,eAAe,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAC1D,IAAA,IAAI,MAAM,KAAK,IAAI,EAAE;AACnB,QAAA,MAAM,IAAI,KAAK,CAAC,kFAAkF,CAAC;IACrG;AACA,IAAA,OAAO,MAAM;AACf;;ACNA;;;;;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