5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 21:56:21 +00:00
panel/app/views/components/_dropdown.haml

35 lines
812 B
Text
Raw Permalink Normal View History

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'
}
}
%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',
target: 'dropdown.button'
},
aria: {
expanded: 'false'
}
}
= text
.dropdown-menu{
class: dropdown_classes,
data: {
target: 'dropdown.dropdown'
}
}
= yield