Class: Playbook::PbPopover::Popover
- Inherits:
-
KitBase
- Object
- ViewComponent::Base
- KitBase
- Playbook::PbPopover::Popover
show all
- Defined in:
- app/pb_kits/playbook/pb_popover/popover.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
#classname ⇒ Object
21
22
23
|
# File 'app/pb_kits/playbook/pb_popover/popover.rb', line 21
def classname
generate_classname_without_spacing("pb_popover_kit")
end
|
#data ⇒ Object
46
47
48
49
50
51
52
53
54
55
|
# File 'app/pb_kits/playbook/pb_popover/popover.rb', line 46
def data
Hash(values[:data]).merge(
pb_popover_kit: true,
pb_popover_position: position,
pb_popover_trigger_element_id: trigger_element_id,
pb_popover_tooltip_id: tooltip_id,
pb_popover_offset: offset,
pb_popover_close_on_click: close_on_click
)
end
|
#popover_spacing_helper ⇒ Object
25
26
27
|
# File 'app/pb_kits/playbook/pb_popover/popover.rb', line 25
def popover_spacing_helper
generate_classname(spacing_props.nil? ? "p_sm" : spacing_props)
end
|
#width_height_class_helper ⇒ Object
42
43
44
|
# File 'app/pb_kits/playbook/pb_popover/popover.rb', line 42
def width_height_class_helper
"overflow_handling" if max_height || max_width
end
|
#width_height_helper ⇒ Object
33
34
35
36
37
38
39
40
|
# File 'app/pb_kits/playbook/pb_popover/popover.rb', line 33
def width_height_helper
out = ""
out += "max-height: #{max_height}; " if max_height.present?
out += "max-width: #{max_width}; " if max_width.present?
out += "min-height: #{min_height}; " if min_height.present?
out += "min-width: #{min_width};" if min_width.present?
out
end
|
#z_index_helper ⇒ Object
29
30
31
|
# File 'app/pb_kits/playbook/pb_popover/popover.rb', line 29
def z_index_helper
z_index.present? ? "z-index: #{z_index}" : ""
end
|