Class: Protos::Drawer
- Inherits:
-
Component
show all
- Defined in:
- lib/protos/drawer.rb,
lib/protos/drawer/side.rb,
lib/protos/drawer/content.rb,
lib/protos/drawer/trigger.rb
Defined Under Namespace
Classes: Content, Side, Trigger
Instance Method Summary
collapse
Methods inherited from Component
#initialize
Instance Method Details
#content ⇒ Object
28
|
# File 'lib/protos/drawer.rb', line 28
def content(...) = render Content.new(...)
|
#side ⇒ Object
30
|
# File 'lib/protos/drawer.rb', line 30
def side(*, **, &) = render Side.new(*, input_id: @id, **, &)
|
#trigger ⇒ Object
32
|
# File 'lib/protos/drawer.rb', line 32
def trigger(*, **, &) = render Trigger.new(*, input_id: @id, **, &)
|
#view_template ⇒ Object
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/protos/drawer.rb', line 15
def view_template
div(**attrs) do
input(
id: @id,
type: :checkbox,
class: css[:toggle],
autocomplete: :off,
form: ""
)
yield if block_given?
end
end
|