✨ (pagetop): Añade Flex/FlexItem para usar Flexbox
Container y Navbar lo adoptan vía `with_flex()`/`PropsOp::flex_item()`. Y se elimina `ButtonSet` porque su funcionalidad queda cubierta por este mecanismo más general. Incluye el ejemplo `examples/intro-flex.rs` con los patrones de uso.
This commit is contained in:
parent
4e4fdf7b10
commit
17e16652e4
26 changed files with 2023 additions and 193 deletions
|
|
@ -140,17 +140,22 @@ async fn form_controls(request: HttpRequest) -> Result<Markup, ErrorPage> {
|
|||
.with_child(form::Hidden::field("origin", "form-selections"))
|
||||
// Botonera de acciones.
|
||||
.with_child(
|
||||
button::ButtonSet::new()
|
||||
.with_button(
|
||||
Container::new()
|
||||
.with_flex(
|
||||
Flex::row()
|
||||
.with_wrap(flex::Behavior::Wrap)
|
||||
.with_gap(flex::Gap::Both(UnitValue::RelRem(0.5))),
|
||||
)
|
||||
.with_child(
|
||||
Button::submit(Lc::t("btn_submit", &LOC))
|
||||
.with_style(button::Style::Solid(Intent::Primary)),
|
||||
)
|
||||
.with_button(
|
||||
.with_child(
|
||||
Button::reset(Lc::t("btn_reset", &LOC)).with_style(
|
||||
button::Style::Outline(Intent::Neutral),
|
||||
),
|
||||
)
|
||||
.with_button(
|
||||
.with_child(
|
||||
Button::plain(Lc::t("btn_cancel", &LOC))
|
||||
.with_style(button::Style::Link),
|
||||
),
|
||||
|
|
@ -255,17 +260,22 @@ async fn form_controls(request: HttpRequest) -> Result<Markup, ErrorPage> {
|
|||
.with_child(form::Hidden::field("origin", "form-text"))
|
||||
// Botonera de acciones.
|
||||
.with_child(
|
||||
button::ButtonSet::new()
|
||||
.with_button(
|
||||
Container::new()
|
||||
.with_flex(
|
||||
Flex::row()
|
||||
.with_wrap(flex::Behavior::Wrap)
|
||||
.with_gap(flex::Gap::Both(UnitValue::RelRem(0.5))),
|
||||
)
|
||||
.with_child(
|
||||
Button::submit(Lc::t("btn_submit", &LOC))
|
||||
.with_style(button::Style::Solid(Intent::Primary)),
|
||||
)
|
||||
.with_button(
|
||||
.with_child(
|
||||
Button::reset(Lc::t("btn_reset", &LOC)).with_style(
|
||||
button::Style::Outline(Intent::Neutral),
|
||||
),
|
||||
)
|
||||
.with_button(
|
||||
.with_child(
|
||||
Button::plain(Lc::t("btn_cancel", &LOC))
|
||||
.with_style(button::Style::Link),
|
||||
),
|
||||
|
|
@ -430,16 +440,21 @@ fn form_lists() -> Form {
|
|||
.with_child(form::Hidden::field("origin", "form-lists"))
|
||||
// Botonera de acciones.
|
||||
.with_child(
|
||||
button::ButtonSet::new()
|
||||
.with_button(
|
||||
Container::new()
|
||||
.with_flex(
|
||||
Flex::row()
|
||||
.with_wrap(flex::Behavior::Wrap)
|
||||
.with_gap(flex::Gap::Both(UnitValue::RelRem(0.5))),
|
||||
)
|
||||
.with_child(
|
||||
Button::submit(Lc::t("btn_submit", &LOC))
|
||||
.with_style(button::Style::Solid(Intent::Primary)),
|
||||
)
|
||||
.with_button(
|
||||
.with_child(
|
||||
Button::reset(Lc::t("btn_reset", &LOC))
|
||||
.with_style(button::Style::Outline(Intent::Neutral)),
|
||||
)
|
||||
.with_button(
|
||||
.with_child(
|
||||
Button::plain(Lc::t("btn_cancel", &LOC)).with_style(button::Style::Link),
|
||||
),
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue