Class: Plutonium::UI::Panel

Inherits:
Component::Base show all
Defined in:
lib/plutonium/ui/panel.rb

Overview

A lightweight panel: optional title + action items rendered as a small floating cluster in the top-right of the panel; content fills the panel body. No outer card chrome — the panel sits flush in its host.

Instance Method Summary collapse

Methods included from Component::Behaviour

#around_template

Methods included from Component::Tokens

#classes, #tokens

Methods included from Component::Kit

#BuildActionButton, #BuildActionsDropdown, #BuildBlock, #BuildBreadcrumbs, #BuildBulkActionsToolbar, #BuildColorModeSelector, #BuildDynaFrameContent, #BuildDynaFrameHost, #BuildEmptyCard, #BuildFrameNavigatorPanel, #BuildModalCentered, #BuildModalSlideover, #BuildPageHeader, #BuildPanel, #BuildRowActionsDropdown, #BuildSkeletonTable, #BuildTabList, #BuildTableFilterPills, #BuildTableInfo, #BuildTablePagination, #BuildTableScopesBar, #BuildTableScopesPills, #BuildTableSearchBar, #BuildTableToolbar, #BuildTableViewSwitcher, #method_missing, #respond_to_missing?

Constructor Details

#initializePanel

Returns a new instance of Panel.



7
8
9
# File 'lib/plutonium/ui/panel.rb', line 7

def initialize
  @items = []
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Plutonium::UI::Component::Kit

Instance Method Details

#before_templateObject



23
24
25
26
# File 'lib/plutonium/ui/panel.rb', line 23

def before_template(&)
  vanish(&)
  super
end

#view_templateObject



28
29
30
31
# File 'lib/plutonium/ui/panel.rb', line 28

def view_template
  render_toolbar if render_toolbar?
  render_content if render_content?
end

#with_content(content) ⇒ Object



19
20
21
# File 'lib/plutonium/ui/panel.rb', line 19

def with_content(content)
  @content = content
end

#with_item(item) ⇒ Object



15
16
17
# File 'lib/plutonium/ui/panel.rb', line 15

def with_item(item)
  @items << item
end

#with_title(title) ⇒ Object



11
12
13
# File 'lib/plutonium/ui/panel.rb', line 11

def with_title(title)
  @title = title
end