Class: PhlexKit::Sheet
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::Sheet
- Defined in:
- app/components/phlex_kit/sheet/sheet.rb
Overview
Side panel (drawer). Ported from ruby_ui's RubyUI::Sheet. Compose Sheet > (SheetTrigger + SheetContent(side:) > SheetHeader/Title/Description/Footer). On open the content template is cloned into
. phlex-kit--sheet.Instance Method Summary collapse
-
#initialize(open: false, **attrs) ⇒ Sheet
constructor
A new instance of Sheet.
- #view_template ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(open: false, **attrs) ⇒ Sheet
Returns a new instance of Sheet.
6 7 8 9 |
# File 'app/components/phlex_kit/sheet/sheet.rb', line 6 def initialize(open: false, **attrs) @open = open @attrs = attrs end |
Instance Method Details
#view_template ⇒ Object
10 11 12 |
# File 'app/components/phlex_kit/sheet/sheet.rb', line 10 def view_template(&) div(**mix({ data: { controller: "phlex-kit--sheet", phlex_kit__sheet_open_value: @open.to_s } }, @attrs), &) end |