Class: BetterUi::General::Table::TheadComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- BetterUi::General::Table::TheadComponent
- Defined in:
- app/components/better_ui/general/table/thead_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) ⇒ TheadComponent
constructor
A new instance of TheadComponent.
- #thead_attributes ⇒ Object
- #thead_classes ⇒ Object
Constructor Details
#initialize(theme: :default, bordered: false, **html_options) ⇒ TheadComponent
Returns a new instance of TheadComponent.
7 8 9 10 11 |
# File 'app/components/better_ui/general/table/thead_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/thead_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/thead_component.rb', line 5 def theme @theme end |
Instance Method Details
#thead_attributes ⇒ Object
20 21 22 23 24 |
# File 'app/components/better_ui/general/table/thead_component.rb', line 20 def thead_attributes attrs = .except(:class) attrs[:class] = thead_classes attrs end |
#thead_classes ⇒ Object
13 14 15 16 17 18 |
# File 'app/components/better_ui/general/table/thead_component.rb', line 13 def thead_classes [ "bg-gray-100 border-b border-gray-200", [:class] ].compact.join(" ") end |