Class: Playbook::PbSelectableCard::SelectableCard
- Inherits:
-
KitBase
- Object
- ViewComponent::Base
- KitBase
- Playbook::PbSelectableCard::SelectableCard
show all
- Defined in:
- app/pb_kits/playbook/pb_selectable_card/selectable_card.rb
Instance Method Summary
collapse
Methods inherited from KitBase
#object
Methods included from ZIndex
included
Methods included from Spacing
included, #max_width_options, #max_width_props, #max_width_values, #spacing_options, #spacing_props, #spacing_values
Methods included from Classnames
#generate_classname, #generate_classname_without_spacing, included
#initialize, #prop
#pb_rails
#pb_form_with
Instance Method Details
42
43
44
45
46
47
|
# File 'app/pb_kits/playbook/pb_selectable_card/selectable_card.rb', line 42
def additional_input_options
input_options.merge(
id: input_id_present,
disabled: disabled
)
end
|
#classname ⇒ Object
26
27
28
29
30
31
32
|
# File 'app/pb_kits/playbook/pb_selectable_card/selectable_card.rb', line 26
def classname
[
generate_classname_without_spacing("pb_selectable_card_kit", checked_class, enable_disabled_class),
error_class,
dark_props,
].compact.join(" ")
end
|
49
50
51
|
# File 'app/pb_kits/playbook/pb_selectable_card/selectable_card.rb', line 49
def input
multi ? "checkbox" : "radio"
end
|
38
39
40
|
# File 'app/pb_kits/playbook/pb_selectable_card/selectable_card.rb', line 38
def input_id_present
input_id.present? ? input_id : name
end
|
#is_checked ⇒ Object
57
58
59
|
# File 'app/pb_kits/playbook/pb_selectable_card/selectable_card.rb', line 57
def is_checked
checked ? "checked" : ""
end
|
#is_disabled ⇒ Object
61
62
63
|
# File 'app/pb_kits/playbook/pb_selectable_card/selectable_card.rb', line 61
def is_disabled
disabled ? "disabled" : ""
end
|
#label_class ⇒ Object
53
54
55
|
# File 'app/pb_kits/playbook/pb_selectable_card/selectable_card.rb', line 53
def label_class
variant == "display_input" ? "p_none" : spacing_classname
end
|
#spacing_classname ⇒ Object
34
35
36
|
# File 'app/pb_kits/playbook/pb_selectable_card/selectable_card.rb', line 34
def spacing_classname
generate_classname
end
|
#status ⇒ Object
65
66
67
|
# File 'app/pb_kits/playbook/pb_selectable_card/selectable_card.rb', line 65
def status
error ? "negative" : nil
end
|