2024-02-05 16:16:57 +00:00
|
|
|
-#
|
|
|
|
@param :text [String] Contenido del botón
|
|
|
|
@param :button_classes [Array] Clases para el botón
|
|
|
|
@param :dropdown_classes [Array] Clases para el listado
|
|
|
|
@yield Un bloque que renderiza components/dropdown_item
|
|
|
|
- button_classes = local_assigns[:button_classes]&.join(' ')
|
|
|
|
- dropdown_classes = local_assigns[:dropdown_classes]&.join(' ')
|
|
|
|
|
|
|
|
.btn-group{
|
|
|
|
data: {
|
|
|
|
controller: 'dropdown'
|
|
|
|
}
|
|
|
|
}
|
2024-03-22 18:44:28 +00:00
|
|
|
%button.btn.btn-outline-secondary.dropdown-toggle{
|
2024-02-05 16:16:57 +00:00
|
|
|
type: 'button',
|
|
|
|
class: button_classes,
|
|
|
|
data: {
|
|
|
|
toggle: 'true',
|
|
|
|
display: 'static',
|
|
|
|
action: 'dropdown#toggle',
|
2024-07-20 18:21:03 +00:00
|
|
|
'dropdown-target': 'button'
|
2024-02-05 16:16:57 +00:00
|
|
|
},
|
|
|
|
aria: {
|
|
|
|
expanded: 'false'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
= text
|
|
|
|
.dropdown-menu{
|
|
|
|
class: dropdown_classes,
|
|
|
|
data: {
|
2024-07-20 18:21:03 +00:00
|
|
|
'dropdown-target': 'dropdown'
|
2024-02-05 16:16:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
= yield
|