♻️ Migra #[builder_fn] a #[builder_impl]
Sustituye las ~400 anotaciones `#[builder_fn]` método a método por un único `#[builder_impl]` por `impl`/`trait`, en 74 ficheros de pagetop y sus extensiones (admin, bootsier, menu, user).
This commit is contained in:
parent
c34dc02357
commit
1be3d88888
74 changed files with 104 additions and 394 deletions
|
|
@ -107,6 +107,7 @@ impl Component for MenuBlock {
|
|||
}
|
||||
}
|
||||
|
||||
#[builder_impl]
|
||||
impl MenuBlock {
|
||||
/// Crea un `MenuBlock` para el menú con el `machine_name` dado.
|
||||
pub fn with(menu_name: impl Into<String>) -> Self {
|
||||
|
|
@ -115,7 +116,6 @@ impl MenuBlock {
|
|||
block
|
||||
}
|
||||
|
||||
#[builder_fn]
|
||||
pub fn with_show_title(mut self, v: impl Into<Option<bool>>) -> Self {
|
||||
if let Some(v) = v.into() {
|
||||
self.show_title = v;
|
||||
|
|
@ -125,13 +125,11 @@ impl MenuBlock {
|
|||
|
||||
/// Establece la profundidad máxima de nodos a incluir. El efectivo nunca supera `2`, por muy
|
||||
/// alto que sea el valor indicado (ver "Limitaciones conocidas" en [`MenuBlock`]).
|
||||
#[builder_fn]
|
||||
pub fn with_max_depth(mut self, v: impl Into<Option<u8>>) -> Self {
|
||||
self.max_depth = v.into();
|
||||
self
|
||||
}
|
||||
|
||||
#[builder_fn]
|
||||
pub fn with_include_disabled(mut self, v: impl Into<Option<bool>>) -> Self {
|
||||
if let Some(v) = v.into() {
|
||||
self.include_disabled = v;
|
||||
|
|
@ -139,7 +137,6 @@ impl MenuBlock {
|
|||
self
|
||||
}
|
||||
|
||||
#[builder_fn]
|
||||
pub fn with_hide_when_empty(mut self, v: impl Into<Option<bool>>) -> Self {
|
||||
if let Some(v) = v.into() {
|
||||
self.hide_when_empty = v;
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@ impl Component for MenuBreadcrumb {
|
|||
}
|
||||
}
|
||||
|
||||
#[builder_impl]
|
||||
impl MenuBreadcrumb {
|
||||
/// Crea un `MenuBreadcrumb` para el menú con el `machine_name` dado.
|
||||
pub fn with(menu_name: impl Into<String>) -> Self {
|
||||
|
|
@ -81,7 +82,6 @@ impl MenuBreadcrumb {
|
|||
bc
|
||||
}
|
||||
|
||||
#[builder_fn]
|
||||
pub fn with_include_current(mut self, v: impl Into<Option<bool>>) -> Self {
|
||||
if let Some(v) = v.into() {
|
||||
self.include_current = v;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue