Class: StimulusPlumbers::Components::Timeline::Event
- Inherits:
-
Plumber::Base
- Object
- Plumber::Base
- StimulusPlumbers::Components::Timeline::Event
- Defined in:
- lib/stimulus_plumbers/components/timeline/event.rb,
lib/stimulus_plumbers/components/timeline/event/slots.rb
Defined Under Namespace
Classes: Slots
Instance Attribute Summary collapse
-
#interactive ⇒ Object
readonly
Returns the value of attribute interactive.
Attributes inherited from Plumber::Base
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Plumber::Base
Methods included from Plumber::Renderer
#set_slots, #slot_block_for, #slot_kwargs_for, #slot_renderable?
Methods included from Plumber::Options::Aria
Methods included from Plumber::Options::Html
Constructor Details
This class inherits a constructor from StimulusPlumbers::Plumber::Base
Instance Attribute Details
#interactive ⇒ Object (readonly)
Returns the value of attribute interactive.
7 8 9 |
# File 'lib/stimulus_plumbers/components/timeline/event.rb', line 7 def interactive @interactive end |
Class Method Details
.detail_id_for(event_id) ⇒ Object
9 10 11 |
# File 'lib/stimulus_plumbers/components/timeline/event.rb', line 9 def self.detail_id_for(event_id) [event_id, "detail"].compact.join("_") end |
Instance Method Details
#render(datetime: nil, id: nil, interactive: false, orientation: :vertical, **kwargs) {|slots| ... } ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/stimulus_plumbers/components/timeline/event.rb', line 13 def render(datetime: nil, id: nil, interactive: false, orientation: :vertical, **kwargs, &block) @detail_id = self.class.detail_id_for(id || template.sp_dom_id) slots = Timeline::Event::Slots.new yield slots if block_given? validate_slots!(slots, datetime: datetime) @orientation = orientation @interactive = interactive || slots.trigger? = (theme.resolve(:timeline_item, orientation: orientation), kwargs) render_event(slots, datetime: datetime, html_options: ) end |