From 0a6adae3daf771ebdc901e80d24756379c1f4b81 Mon Sep 17 00:00:00 2001 From: Van Nguyen Date: Wed, 21 Oct 2026 00:18:54 +0700 Subject: [PATCH] fix(angular): draw a built-in control for every field type The README lists fourteen built-in types, but the Angular fallback drew only seven; radio, range, file, date, time, datetime-local and switch rendered "Unknown field type". - radio: a radiogroup named by its caption (aria-labelledby), a label per button, emitting the option's own value; aria flags on every button - range emits a number and starts at min; file emits the File, an array for multiple, null when cleared; date and time inputs emit the ISO text - switch is a checkbox, as in the other adapters - tests per type; README and MIGRATING say what changed --- .changeset/angular-builtin-types.md | 5 + docs/MIGRATING.md | 4 + packages/angular/README.md | 14 +- .../angular/src/components/DynamicInput.ts | 233 +++++++++++++++--- packages/angular/test/builtInTypes.spec.ts | 205 +++++++++++++++ .../test/defaultRendererLabels.spec.ts | 28 ++- 6 files changed, 449 insertions(+), 40 deletions(-) create mode 100644 .changeset/angular-builtin-types.md create mode 100644 packages/angular/test/builtInTypes.spec.ts diff --git a/.changeset/angular-builtin-types.md b/.changeset/angular-builtin-types.md new file mode 100644 index 0000000..be461f4 --- /dev/null +++ b/.changeset/angular-builtin-types.md @@ -0,0 +1,5 @@ +--- +'@dynamic-field-kit/angular': patch +--- + +The built-in fallback covers all fourteen field types the README lists, as in the React, Vue and Svelte adapters. `radio`, `range`, `file`, `date`, `time`, `datetime-local` and `switch` used to render "Unknown field type" when no renderer was registered. They now draw the same controls as the other adapters: a radio group (`role="radiogroup"`, named by its caption through `aria-labelledby`, a label per button, emitting the option's own value), a range that emits a number and starts at `min`, a file input that emits the `File` (an array for `multiple`, `null` when cleared), date and time inputs that emit the browser's ISO text, and a switch drawn as a checkbox. Each gets the label, `aria-invalid` and `aria-describedby` the other built-in controls have. diff --git a/docs/MIGRATING.md b/docs/MIGRATING.md index 996daac..4b7ebcf 100644 --- a/docs/MIGRATING.md +++ b/docs/MIGRATING.md @@ -35,6 +35,10 @@ there was no label at all, so the control had no accessible name. What moved: own CSS if your design shows the label elsewhere, but keep it in the page. - **Radio groups** have `role="radiogroup"` and `aria-labelledby` pointing at a `` caption (a group cannot take `