feat(core): add field layout defaults and section width inheritance - #133
Merged
Conversation
+ Add registry-backed default widths and option layouts for built-in fields. + Apply default widths and wrapped options across the builder and renderer, including inherited section widths for nested fields. Add editor controls for section and child widths while keeping default values out of saved schemas. + Update health and rich-text field defaults, documentation, and tests covering registry defaults, normalization, form creation, and rendering.
Deploying esheet with
|
| Latest commit: |
de9a3b7
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://fcbab88f.esheet.pages.dev |
| Branch Preview URL: | https://132-wrapped-default.esheet.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This change introduces registry-driven default layout behavior for eSheet fields. Fields now receive sensible default widths and option layouts based on their field type, while sections can control the row width of their descendants.
The builder, renderer, custom field packages, documentation, and test coverage have all been updated to use the same layout rules.
What Changed
Field Type Defaults
The core field registry now defines default properties for built-in field types.
Text, selection, rating, and similar input fields default to:
width: 'third'Matrix, rich, display, media, and container fields default to:
width: 'full'The following option-based fields default to horizontal wrapping:
multitextradiocheckopenchoiceThe new
getDefaultPropAPI provides access to these registry defaults.Section Width Inheritance
Section widths are now inherited by their descendants.
For example, a section with
width: 'half'causes its child fields to render using half-row width. Nested sections can define their own width, which takes precedence over the outer section.The new
getInheritedSectionWidthhelper resolves the nearest configured section width.Builder Updates
The builder now uses registry defaults when displaying field properties.
The edit panel includes controls for:
When a selected value matches the field type’s default, the property is removed from the saved definition. This keeps schemas smaller and preserves the distinction between defaults and explicit overrides.
Renderer and Field Updates
The field grid now resolves width in this order:
Radio, checkbox, open-choice, and multi-text fields now resolve their option layout from registry metadata when no explicit value is present.
Custom Field Packages
The following custom field types now explicitly default to full width:
Documentation
Updated:
The documentation now describes field-category defaults instead of treating full width and stacked options as universal defaults.
Tests Added
Coverage was added for:
Relevant tests include:
Compatibility
This is backward-compatible with existing schemas:
widthvalues remain supported.optionLayoutvalues remain supported.