Class: Daisy::Feedback::AlertComponent
- Inherits:
-
LocoMotion::BaseComponent
- Object
- ViewComponent::Base
- LocoMotion::BaseComponent
- Daisy::Feedback::AlertComponent
- Defined in:
- app/components/daisy/feedback/alert_component.rb
Constant Summary
Constants inherited from LocoMotion::BaseComponent
LocoMotion::BaseComponent::EMPTY_PART_IGNORED_TAGS, LocoMotion::BaseComponent::SELF_CLOSING_TAGS
Instance Attribute Summary collapse
-
#closable ⇒ Boolean
(also: #closable?)
readonly
Whether or not this alert can be closed.
Attributes inherited from LocoMotion::BaseComponent
Instance Method Summary collapse
- #before_render ⇒ Object
- #default_icon_size ⇒ Object
-
#initialize(*args, **kws, &block) ⇒ AlertComponent
constructor
Creates a new Alert component.
Methods included from LocoMotion::Concerns::IconableComponent
#has_icons?, #left_icon_html, #render_left_icon, #render_right_icon, #right_icon_html
Methods inherited from LocoMotion::BaseComponent
build, #component_ref, #config_option, #cssify, define_modifier, define_modifiers, define_part, define_parts, define_size, define_sizes, #empty_part_content, #inspect, #part, register_component_initializer, register_component_setup, #rendered_css, #rendered_data, #rendered_html, #rendered_stimulus_controllers, #rendered_tag_name, renders_many, renders_one, set_component_name, #set_loco_parent, #strip_spaces
Methods included from LocoMotion::Concerns::InspectableComponent
Constructor Details
#initialize(*args, **kws, &block) ⇒ AlertComponent
Creates a new Alert component.
177 178 179 180 181 182 183 184 185 |
# File 'app/components/daisy/feedback/alert_component.rb', line 177 def initialize(*args, **kws, &block) super @icon = config_option(:icon) @timeout = config_option(:timeout) @autoclose = config_option(:autoclose) @action = config_option(:action) @closable = config_option(:closable, false) end |
Instance Attribute Details
#closable ⇒ Boolean (readonly) Also known as: closable?
Returns Whether or not this alert can be closed.
144 145 146 |
# File 'app/components/daisy/feedback/alert_component.rb', line 144 def closable @closable end |
Instance Method Details
#before_render ⇒ Object
191 192 193 194 195 |
# File 'app/components/daisy/feedback/alert_component.rb', line 191 def before_render setup_component super end |
#default_icon_size ⇒ Object
187 188 189 |
# File 'app/components/daisy/feedback/alert_component.rb', line 187 def default_icon_size "where:size-6" end |