Class: Playbook::PbPopover::Popover
- Inherits:
-
Object
- Object
- Playbook::PbPopover::Popover
show all
- Includes:
- Playbook::Props
- Defined in:
- app/pb_kits/playbook/pb_popover/popover.rb
Instance Method Summary
collapse
#dark_props, #generate_classname, #generate_classname_without_spacing, #initialize, #prop, #spacing_options, #spacing_props, #spacing_values
Instance Method Details
#classname ⇒ Object
24
25
26
|
# File 'app/pb_kits/playbook/pb_popover/popover.rb', line 24
def classname
generate_classname_without_spacing("pb_popover_kit")
end
|
#data ⇒ Object
49
50
51
52
53
54
55
56
57
58
|
# File 'app/pb_kits/playbook/pb_popover/popover.rb', line 49
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
28
29
30
|
# File 'app/pb_kits/playbook/pb_popover/popover.rb', line 28
def popover_spacing_helper
generate_classname(spacing_props.nil? ? "p_sm" : spacing_props)
end
|
#width_height_class_helper ⇒ Object
45
46
47
|
# File 'app/pb_kits/playbook/pb_popover/popover.rb', line 45
def width_height_class_helper
"overflow_handling" if max_height || max_width
end
|
#width_height_helper ⇒ Object
36
37
38
39
40
41
42
43
|
# File 'app/pb_kits/playbook/pb_popover/popover.rb', line 36
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
32
33
34
|
# File 'app/pb_kits/playbook/pb_popover/popover.rb', line 32
def z_index_helper
z_index.present? ? "z-index: #{z_index}" : ""
end
|