Class: PhlexKit::ResizablePanel
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::ResizablePanel
- Defined in:
- app/components/phlex_kit/resizable/resizable_panel.rb
Overview
One pane of a ResizablePanelGroup. default_size: is a percentage.
See resizable_panel_group.rb.
Instance Method Summary collapse
-
#initialize(default_size: nil, **attrs) ⇒ ResizablePanel
constructor
A new instance of ResizablePanel.
- #view_template ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(default_size: nil, **attrs) ⇒ ResizablePanel
Returns a new instance of ResizablePanel.
5 6 7 8 |
# File 'app/components/phlex_kit/resizable/resizable_panel.rb', line 5 def initialize(default_size: nil, **attrs) @default_size = default_size @attrs = attrs end |
Instance Method Details
#view_template ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'app/components/phlex_kit/resizable/resizable_panel.rb', line 10 def view_template(&) style = @default_size ? "flex-grow: #{@default_size}" : nil div(**mix({ class: "pk-resizable-panel", style: style, data: { phlex_kit__resizable_target: "panel" } }.compact, @attrs), &) end |