(base): Añade componente Dialog

Sustituye `PropsOp::Translate` por `Rename` para que los temas traduzcan
atributos `data-dialog-*` al vocabulario propio (p. ej. `data-bs-*` en
Bootsier).
This commit is contained in:
Manuel Cillero 2026-08-26 21:56:10 +02:00
parent 3c67d9d04c
commit 76c5cb9b76
11 changed files with 362 additions and 42 deletions

View file

@ -285,6 +285,39 @@ async fn form_controls(request: HttpRequest) -> Result<Markup, ErrorPage> {
},
)
.with_child(form_lists()),
)
// Bloque 4: diálogo modal.
.with_child(
Block::new()
.with_title(Lc::t("block_dialog", &LOC))
.with_child(
Dialog::new()
.with_id("delete-confirm")
.with_title(Lc::t("dialog_delete_title", &LOC))
.with_child(Html::with(|cx| {
html! {
p { (Lc::t("dialog_delete_body", &LOC).using(cx)) }
}
}))
.with_footer(
Button::plain(Lc::t("btn_cancel", &LOC))
.with_prop(PropsOp::set("data-dialog-dismiss", "modal"))
.with_style(button::ButtonStyle::Outline(
Intent::Secondary,
)),
)
.with_footer(
Button::plain(Lc::t("btn_ok", &LOC))
.with_prop(PropsOp::set("data-dialog-dismiss", "modal"))
.with_style(button::ButtonStyle::Solid(Intent::Primary)),
),
)
.with_child(
Button::plain(Lc::t("btn_delete", &LOC))
.with_prop(PropsOp::set("data-dialog-toggle", "modal"))
.with_prop(PropsOp::set("data-dialog-target", "#delete-confirm"))
.with_style(button::ButtonStyle::Solid(Intent::Danger)),
),
),
)
.render()

View file

@ -4,6 +4,7 @@ block_selections = Checkboxes, switches and radio buttons
block_text = Text fields, multiline and range
block_lists = Selection lists
block_lists_floating = Select lists and floating labels
block_dialog = Modal dialog
fieldset_text = Text fields
label_name = Full name
@ -77,3 +78,6 @@ btn_reset = Reset
btn_cancel = Cancel
btn_ok = Ok
btn_delete = Delete record
dialog_delete_title = Delete record
dialog_delete_body = Are you sure you want to delete this record? This action cannot be undone.

View file

@ -4,6 +4,7 @@ block_selections = Casillas, interruptores y botones de opción
block_text = Campos de texto, multilínea y rango
block_lists = Listas de selección
block_lists_floating = Listas de selección y etiquetas flotantes
block_dialog = Diálogo modal
fieldset_text = Campos de texto
label_name = Nombre completo
@ -77,3 +78,6 @@ btn_reset = Restablecer
btn_cancel = Cancelar
btn_ok = Aceptar
btn_delete = Eliminar registro
dialog_delete_title = Eliminar registro
dialog_delete_body = ¿Seguro que quieres eliminar este registro? Esta acción no se puede deshacer.