Class: PhlexKit::DrawerContent
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::DrawerContent
- Defined in:
- app/components/phlex_kit/drawer/drawer_content.rb
Overview
holding the drawer overlay + bottom panel (cloned into on open, like SheetContent). See drawer.rb.
Instance Method Summary collapse
-
#initialize(**attrs) ⇒ DrawerContent
constructor
A new instance of DrawerContent.
- #view_template(&block) ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(**attrs) ⇒ DrawerContent
Returns a new instance of DrawerContent.
5 6 7 |
# File 'app/components/phlex_kit/drawer/drawer_content.rb', line 5 def initialize(**attrs) @attrs = attrs end |
Instance Method Details
#view_template(&block) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'app/components/phlex_kit/drawer/drawer_content.rb', line 9 def view_template(&block) template(data: { phlex_kit__sheet_target: "content" }) do div(data: { controller: "phlex-kit--sheet-content" }) do div(class: "pk-drawer-overlay", data: { action: "click->phlex-kit--sheet-content#close" }) div(**mix({ class: "pk-drawer", role: "dialog", aria: { modal: "true" } }, @attrs)) do div(class: "pk-drawer-handle", aria: { hidden: "true" }) yield if block end end end end |