Class: StimulusPlumbers::Components::PasswordStrength
Constant Summary
collapse
- LEVEL_KEYS =
%i[weak fine strong].freeze
Instance Attribute Summary
#template
Class Method Summary
collapse
Instance Method Summary
collapse
#initialize, #theme
#set_slots, #slot_block_for, #slot_kwargs_for, #slot_renderable?
#labelled_aria
#merge_html_options
Class Method Details
.meter_id_for(input_id) ⇒ Object
9
10
11
|
# File 'lib/stimulus_plumbers/components/password_strength.rb', line 9
def meter_id_for(input_id)
"#{input_id}_meter"
end
|
.rules_id_for(input_id) ⇒ Object
13
14
15
|
# File 'lib/stimulus_plumbers/components/password_strength.rb', line 13
def rules_id_for(input_id)
"#{input_id}_rules"
end
|
Instance Method Details
#render(input:, input_id:, config:) ⇒ Object
18
19
20
21
22
23
|
# File 'lib/stimulus_plumbers/components/password_strength.rb', line 18
def render(input:, input_id:, config:)
@config = config
template.content_tag(:div, **wrapper_options(config, input_id)) do
template.safe_join([input, render_meter(input_id), render_level, render_rules_heading, render_rules(input_id)])
end
end
|