Class: Ariadne::TableNavComponent::BaseCellItem

Inherits:
Ariadne::TableNavComponent show all
Defined in:
app/components/ariadne/table_nav_component.rb

Overview

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

Direct Known Subclasses

CellItem, HeaderCellItem

Defined Under Namespace

Classes: CellItem, HeaderCellItem

Constant Summary collapse

DEFAULT_CELL_CLASSES =
"ariadne-py-3.5 ariadne-pl-4 ariadne-pr-3 ariadne-text-left ariadne-text-sm ariadne-text-gray-900"

Constants inherited from Ariadne::TableNavComponent

DEFAULT_CLASSES, DEFAULT_TAG

Constants inherited from Component

Component::BASE_HIDDEN_CLASS, 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 Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Ariadne::TableNavComponent

#has_footer?, #has_header_row?

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: {}) ⇒ BaseCellItem

Returns a new instance of BaseCellItem.



183
184
185
186
187
188
189
190
# File 'app/components/ariadne/table_nav_component.rb', line 183

def initialize(classes: "", attributes: {})
  @classes = class_names(
    DEFAULT_CELL_CLASSES,
    classes,
  )

  @attributes = attributes
end

Instance Attribute Details

#first=(value) ⇒ Object (writeonly)

Sets the attribute first

Parameters:

  • value

    the value to set the attribute first to.



181
182
183
# File 'app/components/ariadne/table_nav_component.rb', line 181

def first=(value)
  @first = value
end

#last=(value) ⇒ Object (writeonly)

Sets the attribute last

Parameters:

  • value

    the value to set the attribute last to.



181
182
183
# File 'app/components/ariadne/table_nav_component.rb', line 181

def last=(value)
  @last = value
end

Instance Method Details

#callObject



192
193
194
195
196
# File 'app/components/ariadne/table_nav_component.rb', line 192

def call
  render(Ariadne::BaseComponent.new(tag: @tag, classes: @classes, attributes: @attributes)) do
    content
  end
end