Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .changeset/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ not `fixed`: a patch that only touches angular still must not bump and republish
three packages whose tarballs did not change.

**`onlyUpdatePeerDependentsWhenOutOfRange`** stops a core release from
rewriting each adapter's `@dynamic-field-kit/core` peer range. The adapters use
only core APIs that have existed since 1.3.0, so `^1.3.0` is the honest range —
tightening it on every core release would force consumers to upgrade core for
features their adapter does not call.
rewriting each adapter's `@dynamic-field-kit/core` peer range. The floor is the
oldest core that has every API the adapter imports, and it moves by hand when an
adapter starts calling something new: since 1.12.0 the adapters import
`resolveVisible` and `makeLabelId`, so the range is `^1.12.0`. Tightening it on
every core release would force consumers to upgrade core for features their
adapter does not call.
5 changes: 0 additions & 5 deletions .changeset/angular-builtin-types.md

This file was deleted.

9 changes: 0 additions & 9 deletions .changeset/declarative-conditions.md

This file was deleted.

9 changes: 0 additions & 9 deletions .changeset/default-renderer-labels.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/svelte-devtools.md

This file was deleted.

2 changes: 0 additions & 2 deletions .changeset/tame-glasses-flow.md

This file was deleted.

26 changes: 13 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions packages/angular/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# @dynamic-field-kit/angular

## 1.12.0

### Minor Changes

- Conditions as data with appearWhen and requiredWhen, labelled built-in controls, DevTools for Svelte and a built-in control for every field type in Angular. Every adapter now needs core 1.12.0.
- 5b535dc: Conditions as data. A field takes `appearWhen` and `requiredWhen`: a condition written as plain data, so a field list can be stored as JSON or sent from a server. A condition tests a value at the field's own level (`{ field: 'country', equals: 'US' }`, `notEquals`, `in: [...]`, `truthy`, `empty`; a dotted path reads deeper, `root: true` reads the top-level form) or combines others with `all`, `any` and `not`. `appearWhen` hides the field like `appearCondition`, which wins when both are set. `requiredWhen` passes `required: true` to the renderer and reports the `required` message for an empty value while it holds; `required: true` wins over it. Every adapter's `MultiFieldInput` reads `appearWhen` through core's new `resolveVisible`; core also exports `evaluateCondition` and `resolveRequired`. `fieldsToJsonSchema` writes both conditions as `if` / `then` instead of dropping them, and `fieldsFromJsonSchema` reads `dependentRequired` (and draft-07 `dependencies`) and `if` / `then` / `else` testing `const`, `enum` or presence back into them, so a field list survives the round trip. The adapters now import `resolveVisible` from core, so an adapter from this release needs core from this release too; upgrade them together.

### Patch Changes

- 0a6adae: 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.
- The `@dynamic-field-kit/core` peer range is now `^1.12.0`. The adapter calls `resolveVisible` and `makeLabelId`, which older cores do not have, so npm now reports a core that is too old instead of the form failing at run time.
- e22327a: Built-in renderers are labelled. A field without a registered renderer now renders its `label` as a `<label for>` tied to the control (`id="{fieldId}-label"`, class `dfk-field-label`), so the control has an accessible name; a radio group gets `role="radiogroup"` and `aria-labelledby` pointing at its caption. In React, Vue and Svelte the label, the control and the error message sit in one `<div class="dfk-field">`, which keeps them together in a grid layout; in Angular the `<dfk-dynamic-input>` element that already holds them gets the class `dfk-field`. CSS that selected a built-in control as a direct child of the layout needs updating (see MIGRATING). Registered renderers are unaffected. In Angular, an error passed in by a form store now also sets `aria-describedby` on the control. Core gains `makeLabelId(id)`.

## 1.11.1

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/angular/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dynamic-field-kit/angular",
"version": "1.11.1",
"version": "1.12.0",
"description": "Angular renderer for dynamic-field-kit",
"license": "MIT",
"private": false,
Expand Down Expand Up @@ -29,7 +29,7 @@
"peerDependencies": {
"@angular/common": ">=16 <23",
"@angular/core": ">=16 <23",
"@dynamic-field-kit/core": "^1.3.0"
"@dynamic-field-kit/core": "^1.12.0"
},
"publishConfig": {
"access": "public",
Expand All @@ -54,7 +54,7 @@
"@angular/core": "^21.2.0",
"@angular/forms": "^21.2.25",
"@angular/platform-browser": "^21.2.0",
"@dynamic-field-kit/core": "^1.11.0",
"@dynamic-field-kit/core": "^1.12.0",
"@vitest/coverage-istanbul": "^4.1.11",
"jsdom": "^30.1.3",
"ng-packagr": "^21.2.0",
Expand Down
8 changes: 8 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @dynamic-field-kit/core

## 1.12.0

### Minor Changes

- Conditions as data with appearWhen and requiredWhen, labelled built-in controls, DevTools for Svelte and a built-in control for every field type in Angular. Every adapter now needs core 1.12.0.
- 5b535dc: Conditions as data. A field takes `appearWhen` and `requiredWhen`: a condition written as plain data, so a field list can be stored as JSON or sent from a server. A condition tests a value at the field's own level (`{ field: 'country', equals: 'US' }`, `notEquals`, `in: [...]`, `truthy`, `empty`; a dotted path reads deeper, `root: true` reads the top-level form) or combines others with `all`, `any` and `not`. `appearWhen` hides the field like `appearCondition`, which wins when both are set. `requiredWhen` passes `required: true` to the renderer and reports the `required` message for an empty value while it holds; `required: true` wins over it. Every adapter's `MultiFieldInput` reads `appearWhen` through core's new `resolveVisible`; core also exports `evaluateCondition` and `resolveRequired`. `fieldsToJsonSchema` writes both conditions as `if` / `then` instead of dropping them, and `fieldsFromJsonSchema` reads `dependentRequired` (and draft-07 `dependencies`) and `if` / `then` / `else` testing `const`, `enum` or presence back into them, so a field list survives the round trip. The adapters now import `resolveVisible` from core, so an adapter from this release needs core from this release too; upgrade them together.
- e22327a: Built-in renderers are labelled. A field without a registered renderer now renders its `label` as a `<label for>` tied to the control (`id="{fieldId}-label"`, class `dfk-field-label`), so the control has an accessible name; a radio group gets `role="radiogroup"` and `aria-labelledby` pointing at its caption. In React, Vue and Svelte the label, the control and the error message sit in one `<div class="dfk-field">`, which keeps them together in a grid layout; in Angular the `<dfk-dynamic-input>` element that already holds them gets the class `dfk-field`. CSS that selected a built-in control as a direct child of the layout needs updating (see MIGRATING). Registered renderers are unaffected. In Angular, an error passed in by a form store now also sets `aria-describedby` on the control. Core gains `makeLabelId(id)`.

## 1.11.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dynamic-field-kit/core",
"version": "1.11.0",
"version": "1.12.0",
"description": "Core types and field registry for dynamic-field-kit",
"license": "MIT",
"main": "dist/index.js",
Expand Down
12 changes: 12 additions & 0 deletions packages/react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# @dynamic-field-kit/react

## 1.12.0

### Minor Changes

- Conditions as data with appearWhen and requiredWhen, labelled built-in controls, DevTools for Svelte and a built-in control for every field type in Angular. Every adapter now needs core 1.12.0.
- 5b535dc: Conditions as data. A field takes `appearWhen` and `requiredWhen`: a condition written as plain data, so a field list can be stored as JSON or sent from a server. A condition tests a value at the field's own level (`{ field: 'country', equals: 'US' }`, `notEquals`, `in: [...]`, `truthy`, `empty`; a dotted path reads deeper, `root: true` reads the top-level form) or combines others with `all`, `any` and `not`. `appearWhen` hides the field like `appearCondition`, which wins when both are set. `requiredWhen` passes `required: true` to the renderer and reports the `required` message for an empty value while it holds; `required: true` wins over it. Every adapter's `MultiFieldInput` reads `appearWhen` through core's new `resolveVisible`; core also exports `evaluateCondition` and `resolveRequired`. `fieldsToJsonSchema` writes both conditions as `if` / `then` instead of dropping them, and `fieldsFromJsonSchema` reads `dependentRequired` (and draft-07 `dependencies`) and `if` / `then` / `else` testing `const`, `enum` or presence back into them, so a field list survives the round trip. The adapters now import `resolveVisible` from core, so an adapter from this release needs core from this release too; upgrade them together.

### Patch Changes

- The `@dynamic-field-kit/core` peer range is now `^1.12.0`. The adapter calls `resolveVisible` and `makeLabelId`, which older cores do not have, so npm now reports a core that is too old instead of the form failing at run time.
- e22327a: Built-in renderers are labelled. A field without a registered renderer now renders its `label` as a `<label for>` tied to the control (`id="{fieldId}-label"`, class `dfk-field-label`), so the control has an accessible name; a radio group gets `role="radiogroup"` and `aria-labelledby` pointing at its caption. In React, Vue and Svelte the label, the control and the error message sit in one `<div class="dfk-field">`, which keeps them together in a grid layout; in Angular the `<dfk-dynamic-input>` element that already holds them gets the class `dfk-field`. CSS that selected a built-in control as a direct child of the layout needs updating (see MIGRATING). Registered renderers are unaffected. In Angular, an error passed in by a form store now also sets `aria-describedby` on the control. Core gains `makeLabelId(id)`.

## 1.11.0

### Minor Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dynamic-field-kit/react",
"version": "1.11.0",
"version": "1.12.0",
"description": "React renderer for dynamic-field-kit",
"license": "MIT",
"main": "dist/index.js",
Expand All @@ -21,12 +21,12 @@
"CHANGELOG.md"
],
"peerDependencies": {
"@dynamic-field-kit/core": "^1.3.0",
"@dynamic-field-kit/core": "^1.12.0",
"react": "^18.0.0 || ^19.0.0",
"react-dom": "^18.0.0 || ^19.0.0"
},
"devDependencies": {
"@dynamic-field-kit/core": "^1.11.0",
"@dynamic-field-kit/core": "^1.12.0",
"@testing-library/dom": "^10.4.2",
"@testing-library/jest-dom": "^7.0.1",
"@testing-library/react": "^16.0.0",
Expand Down
Loading
Loading