Repository navigation
feat: add Table control - #47
Merged
Merged
Conversation
Add table, table_row and tablerow helpers with the Table and TableRow wire types. Block children of table become rows; table_row children are its cells.
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.
Adds the Ruby side of
Tableand itsTableRowchild type (Work Package F, item F5).Engine counterpart (renderer): AdamMusa/ruflet-engine#33
Usage
API
controls/shared/table_control.rb:TableControl, TYPEtable, WIRETable.border_color border_radius border_width cell_padding column_widths controls default_column_width default_vertical_alignment inner_borders rowsplus the common layout keywords.on_animation_end,on_size_change.controls/shared/tablerow_control.rb:TableRowControl, TYPEtablerow, WIRETableRow.bgcolor controls data key visible.table,table_rowandtablerowin the shared and top-level registries.table(rows = nil, **props, &block),table_row(children = nil, **props, &block)andtableroware inmaterial_control_methods.rb,shared_control_forwarders.rbanddsl.rb.tableare sent ascontrols; Dart readsrows, thencontrols.table_rowchildren are its cells.column_widthsinteger keys are serialized as strings ("0"), which Dart parses. The Ruby side sends no defaults.Notes for review
table,table_rowandtablerowhelpers.tableemits a<table>tag, which the HTML transformer already maps with its own HTML-table builder, so plain HTML tables behave as before.Kernel#tableis private, like every other forwarder, so it does not changerespond_to?.Tests
test/table_compatibility_test.rb(6 runs). It covers:_c,rows, nested cells, rowbgcolor,column_widthskey stringification, and every keyword;tableandtable_row;Ruflet.control(:table),:table_row, thetablerowalias and theRuflet::DSLhelpers;verify_pr.shwithRUBY_PKGS="ruflet_core ruflet_rails": ruflet_core 146/146 files, 624 runs; ruflet_rails 15/15 files, 278 runs. The engine pair passes too (+732 tests, analyze clean). The wire-key audit shows 0 new findings.