Class: Polaris::FormLayout::GroupComponent

Inherits:
Component
  • Object
show all
Defined in:
app/components/polaris/form_layout/group_component.rb

Defined Under Namespace

Classes: GroupItemComponent

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(position:, condensed: false, **system_arguments) ⇒ GroupComponent

Returns a new instance of GroupComponent.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'app/components/polaris/form_layout/group_component.rb', line 6

def initialize(position:, condensed: false, **system_arguments)
  @position = position

  @system_arguments = system_arguments
  @system_arguments[:tag] = "div"
  @system_arguments[:classes] = class_names(
    @system_arguments[:classes],
    "Polaris-FormLayout__Items"
  )

  @wrapper_arguments = {}
  @wrapper_arguments[:tag] = "div"
  @wrapper_arguments[:role] = "group"
  @wrapper_arguments[:classes] = class_names(
    "Polaris-FormLayout--grouped": !condensed,
    "Polaris-FormLayout--condensed": condensed
  )
end

Instance Attribute Details

#positionObject (readonly)

Returns the value of attribute position.



2
3
4
# File 'app/components/polaris/form_layout/group_component.rb', line 2

def position
  @position
end