Class: Polaris::IndexTable::CellComponent

Inherits:
Component
  • Object
show all
Defined in:
app/components/polaris/index_table/cell_component.rb

Instance Method Summary collapse

Constructor Details

#initialize(flush: false, **system_arguments) ⇒ CellComponent

Returns a new instance of CellComponent.



2
3
4
5
# File 'app/components/polaris/index_table/cell_component.rb', line 2

def initialize(flush: false, **system_arguments)
  @flush = flush
  @system_arguments = system_arguments
end

Instance Method Details

#callObject



17
18
19
20
21
# File 'app/components/polaris/index_table/cell_component.rb', line 17

def call
  render(Polaris::BaseComponent.new(**system_arguments)) do
    content
  end
end

#system_argumentsObject



7
8
9
10
11
12
13
14
15
# File 'app/components/polaris/index_table/cell_component.rb', line 7

def system_arguments
  {tag: "td"}.deep_merge(@system_arguments).tap do |args|
    args[:classes] = class_names(
      args[:classes],
      "Polaris-IndexTable__TableCell",
      "Polaris-IndexTable__TableCell--flush": @flush
    )
  end
end