playbook_ui 2.9.6 → 2.9.7
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_avatar/_avatar.html.erb +1 -1
- data/app/pb_kits/playbook/pb_avatar/avatar.rb +1 -1
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_default.html.erb +5 -5
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_status.html.erb +4 -4
- data/app/pb_kits/playbook/pb_button/_button.html.erb +3 -21
- data/app/pb_kits/playbook/pb_button/button.rb +47 -124
- data/app/pb_kits/playbook/pb_caption/caption.rb +1 -1
- data/app/pb_kits/playbook/pb_contact/_contact.html.erb +1 -1
- data/app/pb_kits/playbook/pb_contact/_contact.jsx +18 -8
- data/app/pb_kits/playbook/pb_contact/contact.rb +11 -2
- data/app/pb_kits/playbook/pb_contact/docs/_contact_default.html.erb +4 -1
- data/app/pb_kits/playbook/pb_contact/docs/_contact_default.jsx +3 -0
- data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.html.erb +12 -4
- data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.jsx +2 -4
- data/app/pb_kits/playbook/pb_dashboard_value/dashboard_value.rb +13 -70
- data/app/pb_kits/playbook/pb_dashboard_value/docs/_dashboard_value_align.html.erb +6 -6
- data/app/pb_kits/playbook/pb_dashboard_value/docs/_dashboard_value_align.jsx +6 -6
- data/app/pb_kits/playbook/pb_dashboard_value/docs/_dashboard_value_default.html.erb +6 -6
- data/app/pb_kits/playbook/pb_dashboard_value/docs/_dashboard_value_default.jsx +6 -6
- data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.html.erb +3 -3
- data/app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb +12 -33
- data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.html.erb +4 -2
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_modified.html.erb +0 -1
- data/app/pb_kits/playbook/pb_layout/_body.html.erb +2 -2
- data/app/pb_kits/playbook/pb_layout/_layout.html.erb +2 -2
- data/app/pb_kits/playbook/pb_layout/_sidebar.html.erb +2 -2
- data/app/pb_kits/playbook/pb_layout/body.rb +5 -29
- data/app/pb_kits/playbook/pb_layout/layout.rb +31 -76
- data/app/pb_kits/playbook/pb_layout/sidebar.rb +5 -29
- data/app/pb_kits/playbook/pb_list/_item.html.erb +1 -1
- data/app/pb_kits/playbook/pb_list/_list.html.erb +3 -4
- data/app/pb_kits/playbook/pb_list/item.rb +5 -29
- data/app/pb_kits/playbook/pb_list/list.rb +41 -90
- data/app/pb_kits/playbook/pb_message/_message.html.erb +18 -5
- data/app/pb_kits/playbook/pb_message/docs/_message_default.html.erb +10 -20
- data/app/pb_kits/playbook/pb_message/message.rb +15 -72
- data/app/pb_kits/playbook/pb_person_contact/_person_contact.html.erb +1 -0
- data/app/pb_kits/playbook/pb_person_contact/_person_contact.jsx +2 -1
- data/app/pb_kits/playbook/pb_person_contact/docs/_person_contact_default.html.erb +4 -1
- data/app/pb_kits/playbook/pb_person_contact/docs/_person_contact_default.jsx +4 -1
- data/app/pb_kits/playbook/pb_person_contact/docs/_person_contact_single_person.html.erb +4 -1
- data/app/pb_kits/playbook/pb_person_contact/docs/_person_contact_single_person.jsx +4 -1
- data/app/pb_kits/playbook/pb_section_separator/_section_separator.html.erb +2 -2
- data/app/pb_kits/playbook/pb_section_separator/section_separator.rb +6 -35
- data/app/pb_kits/playbook/pb_star_rating/_star_rating.html.erb +11 -11
- data/app/pb_kits/playbook/pb_star_rating/_star_rating.scss +5 -5
- data/app/pb_kits/playbook/pb_star_rating/star_rating.rb +9 -51
- data/app/pb_kits/playbook/pb_stat_change/_stat_change.html.erb +5 -2
- data/app/pb_kits/playbook/pb_stat_change/_stat_change.jsx +1 -1
- data/app/pb_kits/playbook/pb_stat_change/docs/_stat_change_default.html.erb +3 -3
- data/app/pb_kits/playbook/pb_stat_change/docs/_stat_change_default.jsx +3 -3
- data/app/pb_kits/playbook/pb_stat_change/stat_change.rb +10 -60
- data/app/pb_kits/playbook/pb_timestamp/_timestamp.html.erb +2 -2
- data/app/pb_kits/playbook/pb_timestamp/timestamp.rb +6 -39
- data/app/pb_kits/playbook/pb_toggle/_toggle.jsx +1 -1
- data/app/pb_kits/playbook/pb_user/_user.html.erb +13 -4
- data/app/pb_kits/playbook/pb_user/docs/_user_default.html.erb +3 -6
- data/app/pb_kits/playbook/pb_user/docs/_user_size.html.erb +3 -6
- data/app/pb_kits/playbook/pb_user/docs/_user_vertical_size.html.erb +3 -6
- data/app/pb_kits/playbook/pb_user/user.rb +23 -95
- data/app/pb_kits/playbook/pb_user_badge/_user_badge.html.erb +1 -1
- data/app/pb_kits/playbook/pb_user_badge/user_badge.rb +13 -49
- data/app/pb_kits/playbook/pb_vertical_nav/_item.html.erb +4 -2
- data/app/pb_kits/playbook/pb_vertical_nav/_vertical_nav.html.erb +9 -5
- data/app/pb_kits/playbook/pb_vertical_nav/item.rb +10 -49
- data/app/pb_kits/playbook/pb_vertical_nav/vertical_nav.rb +7 -58
- data/app/pb_kits/playbook/props.rb +1 -0
- data/app/pb_kits/playbook/props/date.rb +11 -0
- data/lib/playbook/version.rb +1 -1
- metadata +3 -2
@@ -2,88 +2,31 @@
|
|
2
2
|
|
3
3
|
module Playbook
|
4
4
|
module PbMessage
|
5
|
-
class Message
|
6
|
-
|
7
|
-
configured_classname
|
8
|
-
configured_data
|
9
|
-
configured_id
|
10
|
-
configured_label
|
11
|
-
configured_message
|
12
|
-
configured_timestamp].freeze
|
5
|
+
class Message
|
6
|
+
include Playbook::Props
|
13
7
|
|
14
|
-
|
15
|
-
classname: default_configuration,
|
16
|
-
data: default_configuration,
|
17
|
-
id: default_configuration,
|
18
|
-
label: default_configuration,
|
19
|
-
message: default_configuration,
|
20
|
-
timestamp: default_configuration)
|
21
|
-
self.configured_avatar = avatar
|
22
|
-
self.configured_classname = classname
|
23
|
-
self.configured_data = data
|
24
|
-
self.configured_id = id
|
25
|
-
self.configured_label = label
|
26
|
-
self.configured_message = message
|
27
|
-
self.configured_timestamp = timestamp
|
28
|
-
end
|
29
|
-
|
30
|
-
def avatar
|
31
|
-
if is_set? configured_avatar
|
32
|
-
configured_avatar[:size] = "sm"
|
33
|
-
pb_avatar = Playbook::PbAvatar::Avatar.new(configured_avatar)
|
34
|
-
ApplicationController.renderer.render(partial: pb_avatar, as: :object)
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
def avatar_class
|
39
|
-
"avatar" if is_set? configured_avatar
|
40
|
-
end
|
8
|
+
partial "pb_message/message"
|
41
9
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
end
|
49
|
-
|
50
|
-
def message
|
51
|
-
if is_set? configured_message
|
52
|
-
pb_message = Playbook::PbBody::Body.new(classname: "message_text") do
|
53
|
-
configured_message
|
54
|
-
end
|
55
|
-
ApplicationController.renderer.render(partial: pb_message, as: :object)
|
56
|
-
end
|
57
|
-
end
|
10
|
+
prop :avatar_name
|
11
|
+
prop :avatar_status
|
12
|
+
prop :avatar_url
|
13
|
+
prop :label
|
14
|
+
prop :message
|
15
|
+
prop :timestamp
|
58
16
|
|
59
|
-
def
|
60
|
-
|
61
|
-
timestamp_props = { text: configured_timestamp }
|
62
|
-
pb_timestamp = Playbook::PbTimestamp::Timestamp.new(timestamp_props)
|
63
|
-
ApplicationController.renderer.render(partial: pb_timestamp, as: :object)
|
64
|
-
end
|
17
|
+
def classname
|
18
|
+
generate_classname("pb_message_kit", avatar_class)
|
65
19
|
end
|
66
20
|
|
67
|
-
def
|
68
|
-
|
69
|
-
"pb_message_kit",
|
70
|
-
avatar_class,
|
71
|
-
]
|
72
|
-
kit_options.compact.join("_")
|
73
|
-
end
|
74
|
-
|
75
|
-
def to_partial_path
|
76
|
-
"pb_message/message"
|
21
|
+
def valid?
|
22
|
+
avatar_url.present? || avatar_name
|
77
23
|
end
|
78
24
|
|
79
25
|
private
|
80
26
|
|
81
|
-
|
82
|
-
|
83
|
-
def default_configuration
|
84
|
-
DEFAULT
|
27
|
+
def avatar_class
|
28
|
+
avatar_name ? "avatar" : nil
|
85
29
|
end
|
86
|
-
attr_accessor(*PROPS)
|
87
30
|
end
|
88
31
|
end
|
89
32
|
end
|
@@ -13,7 +13,7 @@ type PersonContactProps = {
|
|
13
13
|
className?: String | Array<String>,
|
14
14
|
dark?: Boolean,
|
15
15
|
people?: Array<{firstName: String, lastName: String}>,
|
16
|
-
contacts?: Array<{contactType: String, contactValue: String}>,
|
16
|
+
contacts?: Array<{contactType: String, contactValue: String, contactDetail: String}>,
|
17
17
|
}
|
18
18
|
|
19
19
|
const contactsArray = ({contacts=[]}: PersonContactProps) => {
|
@@ -22,6 +22,7 @@ const contactsArray = ({contacts=[]}: PersonContactProps) => {
|
|
22
22
|
<Contact
|
23
23
|
contactType={contactObject.contactType}
|
24
24
|
contactValue={contactObject.contactValue}
|
25
|
+
contactDetail={contactObject.contactDetail}
|
25
26
|
/>
|
26
27
|
);
|
27
28
|
})
|
@@ -12,10 +12,12 @@
|
|
12
12
|
contacts: [
|
13
13
|
{
|
14
14
|
contact_type: "email",
|
15
|
-
contact_value: "email@example.com"
|
15
|
+
contact_value: "email@example.com",
|
16
|
+
contact_detail: "Pauline's Email"
|
16
17
|
},
|
17
18
|
{
|
18
19
|
contact_value: 5555555555,
|
20
|
+
contact_detail: "Home"
|
19
21
|
},
|
20
22
|
{
|
21
23
|
contact_type: "email",
|
@@ -24,6 +26,7 @@
|
|
24
26
|
{
|
25
27
|
contact_type: "work",
|
26
28
|
contact_value: "3245627482",
|
29
|
+
contact_detail: "Harvey's Work"
|
27
30
|
}
|
28
31
|
]
|
29
32
|
}) %>
|
@@ -18,10 +18,12 @@ function PersonContactDefault() {
|
|
18
18
|
contacts={[
|
19
19
|
{
|
20
20
|
contactType: "email",
|
21
|
-
contactValue: "email@example.com"
|
21
|
+
contactValue: "email@example.com",
|
22
|
+
contactDetail: "Pauline's Email",
|
22
23
|
},
|
23
24
|
{
|
24
25
|
contactValue: "5555555555",
|
26
|
+
contactDetail: "Home",
|
25
27
|
},
|
26
28
|
{
|
27
29
|
contactType: "email",
|
@@ -30,6 +32,7 @@ function PersonContactDefault() {
|
|
30
32
|
{
|
31
33
|
contactType: "work",
|
32
34
|
contactValue: "3245627482",
|
35
|
+
contactDetail: "Harvey's Work"
|
33
36
|
}
|
34
37
|
]}
|
35
38
|
/>
|
@@ -8,14 +8,17 @@
|
|
8
8
|
contacts: [
|
9
9
|
{
|
10
10
|
contact_type: "email",
|
11
|
-
contact_value: "email@example.com"
|
11
|
+
contact_value: "email@example.com",
|
12
|
+
contact_detail: "Harvey's Email"
|
12
13
|
},
|
13
14
|
{
|
14
15
|
contact_value: 5555555555,
|
16
|
+
contact_detail: "Home",
|
15
17
|
},
|
16
18
|
{
|
17
19
|
contact_type: "work",
|
18
20
|
contact_value: "3245627482",
|
21
|
+
contact_detail: "Harvey's Work"
|
19
22
|
}
|
20
23
|
]
|
21
24
|
}) %>
|
@@ -14,14 +14,17 @@ function PersonContactSinglePerson() {
|
|
14
14
|
contacts={[
|
15
15
|
{
|
16
16
|
contactType: "email",
|
17
|
-
contactValue: "email@example.com"
|
17
|
+
contactValue: "email@example.com",
|
18
|
+
contactDetail: "Harvey's Email",
|
18
19
|
},
|
19
20
|
{
|
20
21
|
contactValue: "5555555555",
|
22
|
+
contactDetail: "Home",
|
21
23
|
},
|
22
24
|
{
|
23
25
|
contactType: "work",
|
24
26
|
contactValue: "3245627482",
|
27
|
+
contactDetail: "Harvey's Work",
|
25
28
|
}
|
26
29
|
]}
|
27
30
|
/>
|
@@ -2,45 +2,16 @@
|
|
2
2
|
|
3
3
|
module Playbook
|
4
4
|
module PbSectionSeparator
|
5
|
-
class SectionSeparator
|
6
|
-
|
7
|
-
configured_data
|
8
|
-
configured_id
|
9
|
-
configured_text].freeze
|
5
|
+
class SectionSeparator
|
6
|
+
include Playbook::Props
|
10
7
|
|
11
|
-
|
12
|
-
data: default_configuration,
|
13
|
-
id: default_configuration,
|
14
|
-
text: default_configuration)
|
15
|
-
self.configured_classname = classname
|
16
|
-
self.configured_data = data
|
17
|
-
self.configured_id = id
|
18
|
-
self.configured_text = text
|
19
|
-
end
|
20
|
-
|
21
|
-
def text
|
22
|
-
if is_set? configured_text
|
23
|
-
pb_text = Playbook::PbCaption::Caption.new(text: configured_text)
|
24
|
-
ApplicationController.renderer.render(partial: pb_text, as: :object)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
def kit_class
|
29
|
-
"pb_section_separator_kit"
|
30
|
-
end
|
31
|
-
|
32
|
-
def to_partial_path
|
33
|
-
"pb_section_separator/section_separator"
|
34
|
-
end
|
8
|
+
partial "pb_section_separator/section_separator"
|
35
9
|
|
36
|
-
|
10
|
+
prop :text
|
37
11
|
|
38
|
-
|
39
|
-
|
40
|
-
def default_configuration
|
41
|
-
DEFAULT
|
12
|
+
def classname
|
13
|
+
generate_classname("pb_section_separator_kit")
|
42
14
|
end
|
43
|
-
attr_accessor(*PROPS)
|
44
15
|
end
|
45
16
|
end
|
46
17
|
end
|
@@ -1,23 +1,23 @@
|
|
1
1
|
<%= content_tag(:div,
|
2
2
|
id: object.id,
|
3
3
|
data: object.data,
|
4
|
-
class: object.classname
|
4
|
+
class: object.classname) do %>
|
5
5
|
<%# Rating value %>
|
6
|
-
<%= content_tag(:div, object.rating, class: "
|
6
|
+
<%= content_tag(:div, object.rating, class: "pb_star_rating_number") %>
|
7
7
|
|
8
|
-
<%= content_tag(:div, class: "
|
8
|
+
<%= content_tag(:div, class: "pb_star_rating_wrapper") do %>
|
9
9
|
<%# Gold stars generated by rating value %>
|
10
|
-
<%= content_tag(:div, class: "
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
10
|
+
<%= content_tag(:div, class: "pb_star_rating_highlight") do %>
|
11
|
+
<% object.star_count.each do %>
|
12
|
+
<%= pb_rails("icon", props: { icon: "star", fixed_width: true }) %>
|
13
|
+
<% end %>
|
14
|
+
<% unless object.star_full %>
|
15
|
+
<%= pb_rails("icon", props: { icon: "star-half", fixed_width: true }) %>
|
16
|
+
<% end %>
|
17
17
|
<% end %>
|
18
18
|
|
19
19
|
<%# Grey background stars as base %>
|
20
|
-
<%= content_tag(:div, class: "
|
20
|
+
<%= content_tag(:div, class: "pb_star_rating_base") do %>
|
21
21
|
<%= pb_rails("icon", props: { icon: "star", fixed_width: true }) %>
|
22
22
|
<%= pb_rails("icon", props: { icon: "star", fixed_width: true }) %>
|
23
23
|
<%= pb_rails("icon", props: { icon: "star", fixed_width: true }) %>
|
@@ -12,7 +12,7 @@ $pb_star_rating_height: 26px;
|
|
12
12
|
justify-content: flex-start;
|
13
13
|
align-items: flex-start;
|
14
14
|
|
15
|
-
.
|
15
|
+
.pb_star_rating_number {
|
16
16
|
flex-shrink: 0;
|
17
17
|
flex-grow: 0;
|
18
18
|
flex-basis: $pb_star_rating_number_width;
|
@@ -26,7 +26,7 @@ $pb_star_rating_height: 26px;
|
|
26
26
|
align-items: center;
|
27
27
|
}
|
28
28
|
|
29
|
-
.
|
29
|
+
.pb_star_rating_wrapper {
|
30
30
|
position: relative;
|
31
31
|
width: $pb_star_rating_wrapper_width;
|
32
32
|
flex-basis: $pb_star_rating_wrapper_width;
|
@@ -34,7 +34,7 @@ $pb_star_rating_height: 26px;
|
|
34
34
|
flex-grow: 1;
|
35
35
|
min-height: $pb_star_rating_height;
|
36
36
|
|
37
|
-
.
|
37
|
+
.pb_star_rating_highlight {
|
38
38
|
position: absolute;
|
39
39
|
top: 0;
|
40
40
|
left: 0;
|
@@ -42,7 +42,7 @@ $pb_star_rating_height: 26px;
|
|
42
42
|
color: $yellow;
|
43
43
|
line-height: $pb_star_rating_height;
|
44
44
|
}
|
45
|
-
.
|
45
|
+
.pb_star_rating_base {
|
46
46
|
position: absolute;
|
47
47
|
top: 0;
|
48
48
|
left: 0;
|
@@ -53,7 +53,7 @@ $pb_star_rating_height: 26px;
|
|
53
53
|
}
|
54
54
|
|
55
55
|
&[class*=_hide_rating] {
|
56
|
-
.
|
56
|
+
.pb_star_rating_number {
|
57
57
|
display: none;
|
58
58
|
}
|
59
59
|
}
|
@@ -2,36 +2,15 @@
|
|
2
2
|
|
3
3
|
module Playbook
|
4
4
|
module PbStarRating
|
5
|
-
class StarRating
|
6
|
-
|
7
|
-
configured_data
|
8
|
-
configured_hide_rating
|
9
|
-
configured_id
|
10
|
-
configured_rating].freeze
|
5
|
+
class StarRating
|
6
|
+
include Playbook::Props
|
11
7
|
|
12
|
-
|
13
|
-
data: default_configuration,
|
14
|
-
hide_rating: default_configuration,
|
15
|
-
id: default_configuration,
|
16
|
-
rating: default_configuration)
|
17
|
-
self.configured_classname = classname
|
18
|
-
self.configured_data = data
|
19
|
-
self.configured_hide_rating = hide_rating
|
20
|
-
self.configured_id = id
|
21
|
-
self.configured_rating = rating
|
22
|
-
end
|
23
|
-
|
24
|
-
def hide_rating
|
25
|
-
true_value(configured_hide_rating, "hide_rating", nil)
|
26
|
-
end
|
8
|
+
partial "pb_star_rating/star_rating"
|
27
9
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
end
|
33
|
-
one_of_value(configured_rating.to_s, rating_options, "0")
|
34
|
-
end
|
10
|
+
prop :hide_rating, type: Playbook::Props::Boolean,
|
11
|
+
default: false
|
12
|
+
prop :rating, type: Playbook::Props::Numeric,
|
13
|
+
default: 0
|
35
14
|
|
36
15
|
def star_count
|
37
16
|
[*1..rating.to_f]
|
@@ -41,30 +20,9 @@ module Playbook
|
|
41
20
|
(rating.to_f % 1).zero?
|
42
21
|
end
|
43
22
|
|
44
|
-
def
|
45
|
-
|
46
|
-
"pb_star_rating_kit",
|
47
|
-
hide_rating,
|
48
|
-
]
|
49
|
-
kit_options.compact.join("_")
|
50
|
-
end
|
51
|
-
|
52
|
-
def to_partial_path
|
53
|
-
"pb_star_rating/star_rating"
|
54
|
-
end
|
55
|
-
|
56
|
-
private
|
57
|
-
|
58
|
-
def strip_trailing_zero(number)
|
59
|
-
number.to_s.sub(/\.?0+$/, "")
|
60
|
-
end
|
61
|
-
|
62
|
-
DEFAULT = Object.new
|
63
|
-
private_constant :DEFAULT
|
64
|
-
def default_configuration
|
65
|
-
DEFAULT
|
23
|
+
def classname
|
24
|
+
generate_classname("pb_star_rating_kit")
|
66
25
|
end
|
67
|
-
attr_accessor(*PROPS)
|
68
26
|
end
|
69
27
|
end
|
70
28
|
end
|
@@ -1,6 +1,9 @@
|
|
1
1
|
<%= content_tag(:div,
|
2
2
|
id: object.id,
|
3
3
|
data: object.data,
|
4
|
-
class: object.classname
|
5
|
-
|
4
|
+
class: object.classname) do %>
|
5
|
+
<%= pb_rails("body", props: { status: object.status }) do %>
|
6
|
+
<%= pb_rails("icon", props: { fixed_width: true, icon: object.icon }) if object.icon %>
|
7
|
+
<%= "#{object.value}%" if object.value %>
|
8
|
+
<% end %>
|
6
9
|
<% end %>
|