pub struct Grid<C = Schema> { /* private fields */ }Expand description
A block of cols columns, clamped to 1..12, laying out a form’s fields or a detail page’s
columns.
The grid lays its columns out once it is wide enough for them: 28rem for two columns, 42rem for
three and 56rem for four or more. Narrower, it stacks its children in one column. It measures
its own width rather than the screen’s, so a grid in a narrow column stacks on a wide screen. A
child spans more than one column through its span.
use tablo_core::{Field, Grid, Group, Schema, Section};
let product = Product::fields();
Schema::new(Grid::new(3).schema((
Group::new().span(2).schema(Section::new("Product").schema((
Field::text(product.name()),
Field::text(product.description()).multiline(4),
))),
Section::new("Status").schema(Field::toggle(product.visible())),
)));Implementations§
Source§impl Grid<()>
impl Grid<()>
Sourcepub fn columns<M>(self, children: impl IntoDetail<M>) -> Grid<Detail<M>>
pub fn columns<M>(self, children: impl IntoDetail<M>) -> Grid<Detail<M>>
Holds a detail page’s columns and blocks.
Source§impl<F> Grid<Schema<F>>
impl<F> Grid<Schema<F>>
Sourcepub fn visible_when(
self,
watched: &impl Watched<F>,
values: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn visible_when( self, watched: &impl Watched<F>, values: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Shows the block and every field it holds only while watched posts one of
values, as TextField::visible_when shows a
field.
Trait Implementations§
Source§impl<M> IntoDetail<M> for Grid<Detail<M>>
impl<M> IntoDetail<M> for Grid<Detail<M>>
fn into_detail(self) -> Detail<M>
Source§impl<M> IntoDetail<M> for Grid<()>
impl<M> IntoDetail<M> for Grid<()>
fn into_detail(self) -> Detail<M>
Source§impl<F> IntoSchema<F> for Grid<Schema<F>>
impl<F> IntoSchema<F> for Grid<Schema<F>>
fn into_schema(self) -> Schema<F>
Source§impl<F> IntoSchema<F> for Grid<()>
impl<F> IntoSchema<F> for Grid<()>
fn into_schema(self) -> Schema<F>
Auto Trait Implementations§
impl<C> Forget for Grid<C>
impl<C> Freeze for Grid<C>where
C: Freeze,
impl<C> Move for Grid<C>
impl<C> RefUnwindSafe for Grid<C>where
C: RefUnwindSafe,
impl<C> Send for Grid<C>where
C: Send,
impl<C> Sync for Grid<C>where
C: Sync,
impl<C> Unpin for Grid<C>where
C: Unpin,
impl<C> UnsafeUnpin for Grid<C>where
C: UnsafeUnpin,
impl<C> UnwindSafe for Grid<C>where
C: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more