Class: Ariadne::TableComponent::HeaderRowItem

Inherits:
RowItem
  • Object
show all
Defined in:
app/components/ariadne/table_component.rb

Overview

This component is part of TableComponent and should not be used as a standalone component.

Constant Summary collapse

DEFAULT_HEADER_CLASSES =
"ariadne-bg-gray-50 flex flex-row"

Constants inherited from RowItem

RowItem::DEFAULT_ROW_CLASSES

Constants inherited from Component

Component::BASE_BODY_CLASSES, Component::BASE_HTML_CLASSES, Component::BASE_MAIN_CLASSES, Component::BASE_WRAPPER_CLASSES, Component::INVALID_ARIA_LABEL_TAGS

Constants included from ActionViewExtensions::FormHelper

ActionViewExtensions::FormHelper::DEFAULT_FORM_CLASSES

Constants included from Status::Dsl

Status::Dsl::STATUSES

Constants included from ViewHelper

ViewHelper::HELPERS

Constants included from FetchOrFallbackHelper

FetchOrFallbackHelper::INTEGER_TYPES, FetchOrFallbackHelper::InvalidValueError, FetchOrFallbackHelper::TRUE_OR_FALSE

Instance Method Summary collapse

Methods included from ActionViewExtensions::FormHelper

#ariadne_form_with

Methods included from ClassNameHelper

#class_names

Methods included from LoggerHelper

#logger, #silence_deprecations?, #silence_warnings?

Methods included from FetchOrFallbackHelper

#check_incoming_attribute, #check_incoming_tag, #check_incoming_value, #fetch_or_raise, #fetch_or_raise_boolean, #fetch_or_raise_integer

Constructor Details

#initialize(classes: "", attributes: {}) ⇒ HeaderRowItem

Returns a new instance of HeaderRowItem.



158
159
160
161
162
163
164
165
166
167
# File 'app/components/ariadne/table_component.rb', line 158

def initialize(classes: "", attributes: {})
  @header = true

  @classes = class_names(
    DEFAULT_HEADER_CLASSES,
    classes,
  )

  @attributes = attributes
end

Instance Method Details

#callObject



169
170
171
172
173
174
175
# File 'app/components/ariadne/table_component.rb', line 169

def call
  render(Ariadne::BaseComponent.new(tag: :div, classes: @classes, attributes: @attributes)) do
    cells.each do |cell|
      concat(cell)
    end
  end
end