Class: PhlexKit::ClipboardPopover
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::ClipboardPopover
- Defined in:
- app/components/phlex_kit/clipboard/clipboard_popover.rb
Constant Summary collapse
- TARGETS =
{ success: "successPopover", error: "errorPopover" }.freeze
Instance Method Summary collapse
-
#initialize(type:, **attrs) ⇒ ClipboardPopover
constructor
A new instance of ClipboardPopover.
- #view_template(&block) ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(type:, **attrs) ⇒ ClipboardPopover
Returns a new instance of ClipboardPopover.
4 5 6 7 |
# File 'app/components/phlex_kit/clipboard/clipboard_popover.rb', line 4 def initialize(type:, **attrs) @type = type.to_sym @attrs = attrs end |
Instance Method Details
#view_template(&block) ⇒ Object
8 9 10 11 12 |
# File 'app/components/phlex_kit/clipboard/clipboard_popover.rb', line 8 def view_template(&block) div(class: "pk-clipboard-popover pk-hidden", data: { phlex_kit__clipboard_target: fetch_option(TARGETS, @type, :target) }) do div(**mix({ class: "pk-clipboard-popover-inner" }, @attrs), &block) end end |