Class: UI::AlertDialog
- Inherits:
-
Phlex::HTML
- Object
- Phlex::HTML
- UI::AlertDialog
- Includes:
- AlertDialogBehavior
- Defined in:
- app/components/ui/alert_dialog.rb
Overview
AlertDialog - Phlex implementation
A modal alert dialog component for important confirmations and alerts. Uses AlertDialogBehavior module for shared styling logic.
Instance Method Summary collapse
-
#initialize(open: false, close_on_escape: true, classes: "", **attributes) ⇒ AlertDialog
constructor
A new instance of AlertDialog.
- #view_template(&block) ⇒ Object
Methods included from AlertDialogBehavior
#alert_dialog_base_classes, #alert_dialog_classes, #alert_dialog_data_attributes, #alert_dialog_html_attributes, #merged_alert_dialog_data_attributes
Constructor Details
#initialize(open: false, close_on_escape: true, classes: "", **attributes) ⇒ AlertDialog
Returns a new instance of AlertDialog.
21 22 23 24 25 26 |
# File 'app/components/ui/alert_dialog.rb', line 21 def initialize(open: false, close_on_escape: true, classes: "", **attributes) @open = open @close_on_escape = close_on_escape @classes = classes @attributes = attributes end |
Instance Method Details
#view_template(&block) ⇒ Object
28 29 30 31 32 |
# File 'app/components/ui/alert_dialog.rb', line 28 def view_template(&block) div(**alert_dialog_html_attributes) do yield if block_given? end end |