♻️ (locale): Sustituye Attr<Lc> por Lc::none()
This commit is contained in:
parent
c3ff8a6ff8
commit
213aa18b12
17 changed files with 275 additions and 146 deletions
|
|
@ -161,15 +161,15 @@ pub struct Field {
|
|||
/// Devuelve el valor inicial del campo.
|
||||
value: AttrValue,
|
||||
/// Devuelve la etiqueta del campo.
|
||||
label: Attr<Lc>,
|
||||
label: Lc,
|
||||
/// Devuelve el texto de ayuda del campo.
|
||||
help_text: Attr<Lc>,
|
||||
help_text: Lc,
|
||||
/// Devuelve la longitud mínima permitida en caracteres.
|
||||
minlength: Attr<u16>,
|
||||
/// Devuelve la longitud máxima permitida en caracteres.
|
||||
maxlength: Attr<u16>,
|
||||
/// Devuelve el texto indicativo del campo.
|
||||
placeholder: Attr<Lc>,
|
||||
placeholder: Lc,
|
||||
/// Devuelve la configuración de autocompletado del campo.
|
||||
autocomplete: Attr<form::Autocomplete>,
|
||||
/// Devuelve si el campo recibe el foco automáticamente al cargar la página.
|
||||
|
|
@ -418,17 +418,17 @@ impl Field {
|
|||
self
|
||||
}
|
||||
|
||||
/// Establece o elimina la etiqueta visible del campo (basta pasar `None` para quitarla).
|
||||
/// Establece la etiqueta visible del campo (usa [`Lc::none()`] para quitarla).
|
||||
#[builder_fn]
|
||||
pub fn with_label(mut self, label: impl Into<Option<Lc>>) -> Self {
|
||||
self.label.alter_opt(label.into());
|
||||
pub fn with_label(mut self, label: Lc) -> Self {
|
||||
self.label = label;
|
||||
self
|
||||
}
|
||||
|
||||
/// Establece o elimina el texto de ayuda del campo (basta pasar `None` para quitarlo).
|
||||
/// Establece el texto de ayuda del campo (usa [`Lc::none()`] para quitarlo).
|
||||
#[builder_fn]
|
||||
pub fn with_help_text(mut self, help_text: impl Into<Option<Lc>>) -> Self {
|
||||
self.help_text.alter_opt(help_text.into());
|
||||
pub fn with_help_text(mut self, help_text: Lc) -> Self {
|
||||
self.help_text = help_text;
|
||||
self
|
||||
}
|
||||
|
||||
|
|
@ -446,13 +446,13 @@ impl Field {
|
|||
self
|
||||
}
|
||||
|
||||
/// Establece o elimina el texto indicativo del campo (`None` para quitarlo).
|
||||
/// Establece el texto indicativo del campo (usa [`Lc::none()`] para quitarlo).
|
||||
///
|
||||
/// Este texto aparece en el mismo campo y desaparece en cuanto el usuario empieza a escribir.
|
||||
/// Al ser texto visible para el usuario se acepta [`Lc`] para poder localizarlo.
|
||||
#[builder_fn]
|
||||
pub fn with_placeholder(mut self, placeholder: impl Into<Option<Lc>>) -> Self {
|
||||
self.placeholder.alter_opt(placeholder.into());
|
||||
pub fn with_placeholder(mut self, placeholder: Lc) -> Self {
|
||||
self.placeholder = placeholder;
|
||||
self
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue