Class: PhlexKit::Sheet

Inherits:
BaseComponent show all
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

Methods inherited from BaseComponent

#on

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_templateObject



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