Module: UI::TableHeaderBehavior

Included in:
TableHeader, TableHeaderComponent
Defined in:
app/behaviors/ui/table_header_behavior.rb

Overview

HeaderBehavior

Shared behavior for Table Header (thead) component.

Instance Method Summary collapse

Instance Method Details

#header_classesObject



16
17
18
19
20
21
# File 'app/behaviors/ui/table_header_behavior.rb', line 16

def header_classes
  TailwindMerge::Merger.new.merge([
    header_base_classes,
    @classes
  ].compact.join(" "))
end

#header_html_attributesObject



12
13
14
# File 'app/behaviors/ui/table_header_behavior.rb', line 12

def header_html_attributes
  {class: header_classes}
end

#render_header(&content_block) ⇒ Object



7
8
9
10
# File 'app/behaviors/ui/table_header_behavior.rb', line 7

def render_header(&content_block)
  all_attributes = header_html_attributes.deep_merge(@attributes)
  (:thead, **all_attributes, &content_block)
end