Class: PhlexKit::DialogClose
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::DialogClose
- Defined in:
- app/components/phlex_kit/dialog/dialog_close.rb
Overview
Wraps any element (typically a Button) so clicking it dismisses the enclosing dialog, mirroring shadcn/ui's DialogClose. See dialog.rb.
Instance Method Summary collapse
-
#initialize(**attrs) ⇒ DialogClose
constructor
A new instance of DialogClose.
- #view_template ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(**attrs) ⇒ DialogClose
Returns a new instance of DialogClose.
5 6 7 |
# File 'app/components/phlex_kit/dialog/dialog_close.rb', line 5 def initialize(**attrs) @attrs = attrs end |
Instance Method Details
#view_template ⇒ Object
9 10 11 |
# File 'app/components/phlex_kit/dialog/dialog_close.rb', line 9 def view_template(&) span(**mix({ style: "display: contents", data: { action: "click->phlex-kit--dialog#dismiss" } }, @attrs), &) end |