Class: BetterUi::Dialog::ConfirmComponent
- Inherits:
-
ApplicationComponent
- Object
- ViewComponent::Base
- ApplicationComponent
- BetterUi::Dialog::ConfirmComponent
- Defined in:
- app/components/better_ui/dialog/confirm_component.rb
Constant Summary collapse
- ICON_VARIANTS =
{ success: :check_circle, danger: :exclamation_circle, warning: :exclamation_triangle, info: :information_circle, primary: :information_circle, secondary: :information_circle, accent: :information_circle, light: :information_circle, dark: :information_circle }.freeze
Constants inherited from ApplicationComponent
ApplicationComponent::SHADOWS, ApplicationComponent::VARIANTS, ApplicationComponent::VARIANT_BODY_DIVIDE, ApplicationComponent::VARIANT_DIVIDE, ApplicationComponent::VARIANT_HEADER_BG, ApplicationComponent::VARIANT_HEADER_TEXT, ApplicationComponent::VARIANT_HIGHLIGHTED, ApplicationComponent::VARIANT_HOVERABLE, ApplicationComponent::VARIANT_RING, ApplicationComponent::VARIANT_SORT_ICON, ApplicationComponent::VARIANT_STRIPED
Instance Method Summary collapse
-
#initialize(variant: :warning, title: nil, text: nil, icon: true, confirm_label: "Confirm", cancel_label: "Cancel", size: :sm, close_on_backdrop: false, close_on_escape: false, **options) ⇒ ConfirmComponent
constructor
A new instance of ConfirmComponent.
Constructor Details
#initialize(variant: :warning, title: nil, text: nil, icon: true, confirm_label: "Confirm", cancel_label: "Cancel", size: :sm, close_on_backdrop: false, close_on_escape: false, **options) ⇒ ConfirmComponent
Returns a new instance of ConfirmComponent.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'app/components/better_ui/dialog/confirm_component.rb', line 20 def initialize( variant: :warning, title: nil, text: nil, icon: true, confirm_label: "Confirm", cancel_label: "Cancel", size: :sm, close_on_backdrop: false, close_on_escape: false, ** ) @variant = validate_variant(normalize_symbol(variant, :warning)) @title = title @text = text @icon = icon @confirm_label = confirm_label @cancel_label = cancel_label @size = normalize_symbol(size, :sm) @close_on_backdrop = close_on_backdrop @close_on_escape = close_on_escape = end |