Repository navigation
feat: add form_row control for labeled form rows - #37
Merged
Merged
Conversation
Add FormRowControl (wire FormRow) with content, prefix, helper, error, padding and the common layout keywords. form_row/formrow take the field positionally or as content:, and raise when it is missing.
2 tasks
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.
Engine counterpart: AdamMusa/ruflet-engine#21
Adds the
form_rowcontrol (SPEC B2). It renders asCupertinoFormRowon Apple platforms and as a Material label-and-field row elsewhere.Usage
formrowis the compact alias.contentcan also be passed ascontent:.Schema
controls/shared/formrow_control.rb,FormRowControl,TYPE = "formrow",WIRE = "FormRow". It is registered asform_rowandformrowin the shared and top-level CLASS_MAPs. DSL helpersform_row(content = nil, **props)andformroware added inmaterial_control_methods.rb,shared_control_forwarders.rbanddsl.rb.content error helper padding prefix, plus the common layout set.on_animation_endandon_size_changeonly, both from the common layout set.contentis required: a missing one raisesArgumentError, "form_row requires content", ascontext_menudoes.prefix,helperanderrortake a String or any control.The engine PR describes how each key renders on Material and Cupertino.
Tests
test/form_row_compatibility_test.rb(new): 10 runs, 33 assertions. It checks the wire typeFormRow, the serialization of content, prefix, helper, error and padding, control-valued labels, thecontent:keyword, the required-content error, theformrowalias, theRuflet::DSL::Apphelper, serialization as a child row, the common layout keywords and thehas_handler?events. It also checks that unknown keywords and events raise, and that both spellings resolve to the same class in both CLASS_MAPs.verify_pr.sh(Flutter 3.41.2):