Class: FoxTail::BaseComponent
- Inherits:
-
Base
- Object
- ViewComponent::Base
- Base
- FoxTail::BaseComponent
show all
- Includes:
- Concerns::HasOptions, Concerns::HasTheme
- Defined in:
- app/components/fox_tail/base_component.rb
Direct Known Subclasses
Accordion::ItemComponent, AccordionComponent, AutocompleteComponent, AvatarComponent, AvatarStackComponent, BadgeComponent, BreadcrumbComponent, ButtonGroupComponent, CarouselComponent, CheckboxComponent, ClickableComponent, CollapsibleComponent, DismissibleComponent, DotIndicatorComponent, DrawerComponent, Dropdown::InputItemComponent, Dropdown::MenuComponent, DropdownComponent, DropzoneComponent, FABComponent, FilterBarComponent, FilterSummaryComponent, HelperTextComponent, HrComponent, InlineSvgComponent, InputBaseComponent, InputErrorListComponent, InputGroupComponent, LabelComponent, ListGroupComponent, ModalComponent, PaginationComponent, PopoverComponent, ProgressBarComponent, RadioButtonComponent, RangeComponent, Select::OptionComponent, Select::OptionGroupComponent, ShowPasswordComponent, Sidebar::MenuComponent, SidebarComponent, Stepper::StepComponent, StepperComponent, Table::ColumnComponent, Table::HeaderComponent, Table::RowComponent, TableComponent, TabsComponent, Timeline::EntryComponent, TimelineComponent, TooltipComponent, TriggerBaseComponent, WrapperComponent
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
fox_tail_config
Constructor Details
#initialize(html_attributes = {}) ⇒ BaseComponent
Returns a new instance of BaseComponent.
13
14
15
16
17
18
19
20
21
|
# File 'app/components/fox_tail/base_component.rb', line 13
def initialize(html_attributes = {})
super
html_attributes = ActiveSupport::HashWithIndifferentAccess.new html_attributes
theme = html_attributes.delete :theme
self.theme.merge! theme if theme.present?
html_attributes
@html_attributes = html_attributes
end
|
Instance Attribute Details
#html_attributes ⇒ Object
Returns the value of attribute html_attributes.
7
8
9
|
# File 'app/components/fox_tail/base_component.rb', line 7
def html_attributes
@html_attributes
end
|
Class Method Details
.classname_merger ⇒ Object
48
49
50
|
# File 'app/components/fox_tail/base_component.rb', line 48
def classname_merger
FoxTail::Base.fox_tail_config.classname_merger
end
|
.stimulus_merger ⇒ Object
56
57
58
|
# File 'app/components/fox_tail/base_component.rb', line 56
def stimulus_merger
FoxTail::Base.fox_tail_config.stimulus_merger
end
|
.use_stimulus? ⇒ Boolean
52
53
54
|
# File 'app/components/fox_tail/base_component.rb', line 52
def use_stimulus?
!!FoxTail::Base.fox_tail_config.use_stimulus
end
|
Instance Method Details
#with_html_attributes(attributes = {}) ⇒ Object
23
24
25
26
|
# File 'app/components/fox_tail/base_component.rb', line 23
def with_html_attributes(attributes = {})
@html_attributes.merge! attributes if attributes.present?
self
end
|
#with_html_class(classes) ⇒ Object
28
29
30
31
|
# File 'app/components/fox_tail/base_component.rb', line 28
def with_html_class(classes)
options[:class] = classnames html_class, classes
self
end
|