playbook_ui 13.0.0.pre.alpha.PLAY966collapsiblenav41129 → 13.0.0.pre.alpha.salesbookmismatchingdate1120
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleMain.tsx +1 -1
- data/app/pb_kits/playbook/pb_kit/dateTime.ts +55 -48
- data/app/pb_kits/playbook/pb_nav/_bold_mixin.scss +14 -16
- data/app/pb_kits/playbook/pb_nav/_collapsible_nav.scss +115 -86
- data/app/pb_kits/playbook/pb_nav/_horizontal_nav.scss +58 -58
- data/app/pb_kits/playbook/pb_nav/_item.tsx +138 -234
- data/app/pb_kits/playbook/pb_nav/_mixins.scss +5 -0
- data/app/pb_kits/playbook/pb_nav/_nav.scss +0 -38
- data/app/pb_kits/playbook/pb_nav/_nav.tsx +1 -17
- data/app/pb_kits/playbook/pb_nav/_subtle_mixin.scss +11 -9
- data/app/pb_kits/playbook/pb_nav/_vertical_nav.scss +59 -50
- data/app/pb_kits/playbook/pb_nav/docs/_block_no_title_nav.jsx +1 -1
- data/app/pb_kits/playbook/pb_nav/docs/_borderless_nav.jsx +1 -4
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav.html.erb +4 -4
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav.jsx +10 -4
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_custom.jsx +1 -5
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_emphasize.html.erb +12 -12
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_emphasize.jsx +1 -13
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_emphasize.md +1 -1
- data/app/pb_kits/playbook/pb_nav/docs/_no_highlight_nav.jsx +1 -4
- data/app/pb_kits/playbook/pb_nav/docs/_subtle_nav.jsx +1 -4
- data/app/pb_kits/playbook/pb_nav/docs/_subtle_with_icons_nav.jsx +1 -4
- data/app/pb_kits/playbook/pb_nav/docs/example.yml +5 -5
- data/app/pb_kits/playbook/pb_nav/item.html.erb +12 -19
- data/app/pb_kits/playbook/pb_nav/item.rb +14 -55
- data/app/pb_kits/playbook/pb_nav/nav.html.erb +1 -3
- data/app/pb_kits/playbook/pb_time/_time.tsx +1 -1
- data/dist/playbook-rails.js +5 -5
- data/lib/playbook/version.rb +1 -1
- metadata +3 -4
- data/app/pb_kits/playbook/pb_nav/_collapsible_trail_mixin.scss +0 -14
- data/app/pb_kits/playbook/pb_nav/navTypes.ts +0 -25
@@ -22,72 +22,31 @@ module Playbook
|
|
22
22
|
default: "_self"
|
23
23
|
def classname
|
24
24
|
if collapsible
|
25
|
-
"#{generate_classname('pb_nav_list_kit_item', active_class)} #{generate_classname('pb_collapsible_nav_item', active_class, collapsible_trail_class)} #{font_size_class} #{font_weight_class}
|
25
|
+
"#{generate_classname('pb_nav_list_kit_item', active_class)} #{generate_classname('pb_collapsible_nav_item', active_class, collapsible_trail_class)} #{font_size_class} #{font_weight_class}"
|
26
26
|
else
|
27
|
-
"#{generate_classname('pb_nav_list_kit_item', active_class)} #{font_size_class} #{font_weight_class}
|
27
|
+
"#{generate_classname('pb_nav_list_kit_item', active_class)} #{font_size_class} #{font_weight_class}"
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
|
-
def
|
32
|
-
|
33
|
-
if object.margin || object.margin_x || object.margin_y || object.margin_bottom || object.margin_top || object.margin_right || object.margin_left
|
34
|
-
# Call the original method
|
35
|
-
original_result = super
|
36
|
-
|
37
|
-
# Remove p_value, px_value, py_value, etc. based on the object's properties
|
38
|
-
margin_classes_to_remove = []
|
39
|
-
margin_classes_to_remove << "m_#{object.margin}" if object.margin
|
40
|
-
margin_classes_to_remove << "mx_#{object.margin_x}" if object.margin_x
|
41
|
-
margin_classes_to_remove << "my_#{object.margin_y}" if object.margin_y
|
42
|
-
margin_classes_to_remove << "mb_#{object.margin_bottom}" if object.margin_bottom
|
43
|
-
margin_classes_to_remove << "mt_#{object.margin_top}" if object.margin_top
|
44
|
-
margin_classes_to_remove << "mr_#{object.margin_right}" if object.margin_right
|
45
|
-
margin_classes_to_remove << "ml_#{object.margin_left}" if object.margin_left
|
46
|
-
|
47
|
-
margin_classes_to_remove.each do |class_to_remove|
|
48
|
-
original_result.gsub!(class_to_remove, "")
|
49
|
-
end
|
50
|
-
|
51
|
-
original_result.strip
|
52
|
-
else
|
53
|
-
super
|
54
|
-
end
|
55
|
-
else
|
56
|
-
super
|
57
|
-
end
|
31
|
+
def tag
|
32
|
+
link ? "a" : "div"
|
58
33
|
end
|
59
34
|
|
60
|
-
def
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
margin_y: "my",
|
65
|
-
margin_bottom: "mb",
|
66
|
-
margin_top: "mt",
|
67
|
-
margin_right: "mr",
|
68
|
-
margin_left: "ml",
|
69
|
-
}
|
70
|
-
|
71
|
-
# rubocop:disable Style/RedundantAssignment
|
72
|
-
margin_classes = margin_attributes.map do |attr, class_prefix|
|
73
|
-
# rubocop:enable Style/RedundantAssignment
|
74
|
-
value = object.public_send(attr)
|
75
|
-
" #{class_prefix}_#{value}" if value
|
76
|
-
end.compact.join
|
77
|
-
|
78
|
-
margin_classes
|
35
|
+
def options
|
36
|
+
{
|
37
|
+
class: collapsible ? "pb_nav_list_item_link_collapsible" : "pb_nav_list_item_link",
|
38
|
+
}.compact
|
79
39
|
end
|
80
40
|
|
81
|
-
def
|
82
|
-
|
41
|
+
def link_options
|
42
|
+
options.merge(
|
43
|
+
href: link,
|
44
|
+
target: target
|
45
|
+
)
|
83
46
|
end
|
84
47
|
|
85
48
|
def collapsible_icons
|
86
|
-
icon_right.present?
|
87
|
-
end
|
88
|
-
|
89
|
-
def collapsible_nav_classname
|
90
|
-
"collapsible_nav_wrapper_#{active_class}_#{collapsible_trail_class}"
|
49
|
+
icon_right.present? ? icon_right : %w[plus minus]
|
91
50
|
end
|
92
51
|
|
93
52
|
private
|