Class: FoxTail::ShowPasswordComponent
- Inherits:
-
BaseComponent
show all
- Includes:
- Concerns::Formable
- Defined in:
- app/components/fox_tail/show_password_component.rb
Instance Attribute Summary
#html_attributes
Instance Method Summary
collapse
classname_merger, #initialize, stimulus_merger, use_stimulus?, #with_html_attributes, #with_html_class
Methods inherited from Base
fox_tail_config
Instance Method Details
#before_render ⇒ Object
12
13
14
15
16
|
# File 'app/components/fox_tail/show_password_component.rb', line 12
def before_render
super
html_attributes[:class] = classnames theme.apply(:root, self), html_class
end
|
#call ⇒ Object
18
19
20
21
22
23
24
25
|
# File 'app/components/fox_tail/show_password_component.rb', line 18
def call
render FoxTail::PasswordInputTriggerComponent.new("##{input_id}", html_attributes) do |trigger|
content_tag :button, trigger.html_attributes.merge(type: :button) do
concat render_content(:hidden, text(:show), :eye)
concat render_content(:visible, text(:hide), :eye_slash)
end
end
end
|
8
9
10
|
# File 'app/components/fox_tail/show_password_component.rb', line 8
def input_id
options[:input_id] ||= tag_id
end
|