Class: BetterUi::General::Table::TfootComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- BetterUi::General::Table::TfootComponent
- Defined in:
- app/components/better_ui/general/table/tfoot_component.rb
Instance Attribute Summary collapse
-
#bordered ⇒ Object
readonly
Returns the value of attribute bordered.
-
#theme ⇒ Object
readonly
Returns the value of attribute theme.
Instance Method Summary collapse
-
#initialize(theme: :default, bordered: false, **html_options) ⇒ TfootComponent
constructor
A new instance of TfootComponent.
- #tfoot_attributes ⇒ Object
- #tfoot_classes ⇒ Object
Constructor Details
#initialize(theme: :default, bordered: false, **html_options) ⇒ TfootComponent
Returns a new instance of TfootComponent.
7 8 9 10 11 |
# File 'app/components/better_ui/general/table/tfoot_component.rb', line 7 def initialize(theme: :default, bordered: false, **) @theme = theme.to_sym @bordered = !!bordered = end |
Instance Attribute Details
#bordered ⇒ Object (readonly)
Returns the value of attribute bordered.
5 6 7 |
# File 'app/components/better_ui/general/table/tfoot_component.rb', line 5 def bordered @bordered end |
#theme ⇒ Object (readonly)
Returns the value of attribute theme.
5 6 7 |
# File 'app/components/better_ui/general/table/tfoot_component.rb', line 5 def theme @theme end |
Instance Method Details
#tfoot_attributes ⇒ Object
20 21 22 23 24 |
# File 'app/components/better_ui/general/table/tfoot_component.rb', line 20 def tfoot_attributes attrs = .except(:class) attrs[:class] = tfoot_classes attrs end |
#tfoot_classes ⇒ Object
13 14 15 16 17 18 |
# File 'app/components/better_ui/general/table/tfoot_component.rb', line 13 def tfoot_classes [ "bg-gray-50 border-t border-gray-200", [:class] ].compact.join(" ") end |