Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
a5c00fe
Initial implementation
straku Sep 11, 2025
e0ce670
TEMP: Change fixtures to use nested data
straku Sep 11, 2025
6430200
Temp: Add story with nested data for DataForm
straku Sep 12, 2025
423d60e
Change approach to typing an item and update usage
straku Sep 12, 2025
3153f67
Fix tests
straku Sep 12, 2025
898024a
Add setValue to boolean field in the stories
straku Sep 12, 2025
4fdb8de
Allow `DeepPartial< Item >` to accept full `Item`
straku Sep 12, 2025
508f710
Rely on `DeepPartial` in `setValue`
straku Sep 12, 2025
1e15efe
Disable validation in filter controls
straku Sep 12, 2025
d1e45c8
Filters: prepare data and field
oandregal Sep 12, 2025
3e0c027
Update custom Edit to match the DeepPartial shape of onChange
oandregal Sep 12, 2025
2070e12
Use Item instead of DeepPartial<Item> as parameter to getValue and se…
oandregal Sep 12, 2025
d3467a3
Fix modal with nested data
oandregal Sep 12, 2025
cb4cdcd
Update story and fix the DeepPartial type definition.
oandregal Sep 12, 2025
e761011
Port new tests to existing test file
oandregal Sep 12, 2025
af025fb
Revert changes to fields
oandregal Sep 12, 2025
9f33dbe
Adapt new places after rebase
oandregal Sep 12, 2025
ed9a157
Fix author field in DataForm story
straku Sep 15, 2025
05fc231
Remove unused import, finer scope for useCallback dependencies
straku Sep 15, 2025
2bf7cb0
Add comment for DeepPartial type
straku Sep 15, 2025
6ffd2ec
Doc changes
straku Sep 15, 2025
684463a
Use setValue for custom validation functions item argument
straku Sep 15, 2025
a26aebd
Update readme after validation changes
straku Sep 15, 2025
ad84488
Story: return partial, not item
oandregal Sep 16, 2025
f848c91
Do not make password required in a custom rule
oandregal Sep 16, 2025
661c3f0
Filters: setValue should return a partial
oandregal Sep 16, 2025
6e1cfa7
Revert "Update readme after validation changes"
straku Sep 16, 2025
eb9be76
Use full item for custom validation functions
straku Sep 16, 2025
c69e9d2
Fix wrong conflict resolution
straku Sep 16, 2025
131bc7e
Fix onChange for date related controls
straku Sep 16, 2025
ed0226e
Improve internal types used in date control: DateRange
oandregal Sep 16, 2025
8c15df5
Improve internal types used in Date control: DateRelative
oandregal Sep 16, 2025
ad9aed6
Datetime: fix relative filter
oandregal Sep 16, 2025
5d332a3
Integer control: improve internal types and checks
oandregal Sep 16, 2025
1f7b912
ToggleControl: fix validation
oandregal Sep 16, 2025
28fc311
Add changelog entry
oandregal Sep 16, 2025
bfa4bdc
DataForm panel: fix modal (changes accumulate)
oandregal Sep 16, 2025
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
Prev Previous commit
Next Next commit
Fix author field in DataForm story
  • Loading branch information
straku committed Sep 16, 2025
commit ed9a157a9456508c36916d34abf8406bfd7bee18
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ const fields: Field< SamplePost >[] = [
{ value: 3, label: 'Alice' },
{ value: 4, label: 'Bob' },
],
setValue: ( { item, value } ) => {
return {
...item,
author: Number( value ),
};
},
},
{
id: 'reviewer',
Expand Down Expand Up @@ -1569,6 +1575,10 @@ const DataAdapterComponent = () => {
to highlight how DataForm can wrangle data in scenarios such as
nested data, bridge data to/from UI controls, and derived data.
</p>
<p>
<b>Current data snapshot:</b>
</p>
<pre>{ JSON.stringify( data, null, 2 ) }</pre>
<h2>Nested data</h2>
<p>
The first example demonstrates how to signal nested data via{ ' ' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export default function InputWidget( {
}
return currentField;
}, [ fields, filter.field ] );
Comment on lines +37 to +74
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@straku I pushed 83db790 as per our conversations. It seems to work nicely, and so we can continue working with Item data (instead of partials) as parameter to getValue/setValue.


const data = useMemo( () => {
return ( view.filters ?? [] ).reduce(
( acc, activeFilter ) => {
Expand Down