Sha256: 20d2095f848640da6ababfc7450d2fd59b9e351b8aad27c4720faac6950563ea
Contents?: true
Size: 1.01 KB
Versions: 7
Compression:
Stored size: 1.01 KB
Contents
# frozen_string_literal: true module Katalyst module Tables class HeaderRowComponent < ViewComponent::Base # :nodoc: include Katalyst::HtmlAttributes renders_many :columns, ->(component) { component } def initialize(table, link: {}) super() @table = table @link_attributes = link end def call content # generate content before rendering tag.tr(**html_attributes) do columns.each do |column| concat(column.to_s) end end end def cell(attribute, **options, &block) with_column(@table.header_cell_component.new(@table, attribute, link: @link_attributes, **options), &block) end def header? true end def body? false end def inspect "#<#{self.class.name} link_attributes: #{@link_attributes.inspect}>" end # Backwards compatibility with tables 1.0 alias_method :options, :html_attributes= end end end
Version data entries
7 entries across 7 versions & 1 rubygems