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
@@ -7,9 +7,11 @@ function ContactDefault() {
|
|
7
7
|
<Contact
|
8
8
|
contactType="cell"
|
9
9
|
contactValue="349-185-9988"
|
10
|
+
contactDetail="John's Cell"
|
10
11
|
/>
|
11
12
|
<Contact
|
12
13
|
contactValue="5555555555"
|
14
|
+
contactDetail="Home"
|
13
15
|
/>
|
14
16
|
<Contact
|
15
17
|
contactType="email"
|
@@ -18,6 +20,7 @@ function ContactDefault() {
|
|
18
20
|
<Contact
|
19
21
|
contactType="work"
|
20
22
|
contactValue="3245627482"
|
23
|
+
contactDetail="John's Work"
|
21
24
|
/>
|
22
25
|
</div>
|
23
26
|
)
|
@@ -1,8 +1,16 @@
|
|
1
1
|
<%= content_tag(:div,
|
2
2
|
id: object.id,
|
3
3
|
data: object.data,
|
4
|
-
class: object.classname
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
class: object.classname) do %>
|
5
|
+
<% if object.stat_label.present? %>
|
6
|
+
<%= pb_rails("body", props: { color: "light", text: object.stat_label } ) %>
|
7
|
+
<% end %>
|
8
|
+
|
9
|
+
<% if object.stat_value.present? %>
|
10
|
+
<%= pb_rails("stat_value", props: object.stat_value) %>
|
11
|
+
<% end %>
|
12
|
+
|
13
|
+
<% if object.stat_change.present? %>
|
14
|
+
<%= pb_rails("stat_change", props: object.stat_change) %>
|
15
|
+
<% end %>
|
8
16
|
<% end %>
|
@@ -17,9 +17,7 @@ type DashboardValueProps = {
|
|
17
17
|
change?: String,
|
18
18
|
value?: String | Number
|
19
19
|
},
|
20
|
-
stat_label?:
|
21
|
-
label?: String
|
22
|
-
},
|
20
|
+
stat_label?: String,
|
23
21
|
stat_value?: {
|
24
22
|
unit?: String,
|
25
23
|
value?: String | Number
|
@@ -49,7 +47,7 @@ const DashboardValue = (props: DashboardValueProps) => {
|
|
49
47
|
const statLabel = function(stat_label) {
|
50
48
|
if (stat_label) {
|
51
49
|
return (
|
52
|
-
<Body color="light">{stat_label
|
50
|
+
<Body color="light">{stat_label}</Body>
|
53
51
|
)
|
54
52
|
}
|
55
53
|
}
|
@@ -2,80 +2,23 @@
|
|
2
2
|
|
3
3
|
module Playbook
|
4
4
|
module PbDashboardValue
|
5
|
-
class DashboardValue
|
6
|
-
|
7
|
-
configured_classname
|
8
|
-
configured_data
|
9
|
-
configured_id
|
10
|
-
configured_stat_change
|
11
|
-
configured_stat_label
|
12
|
-
configured_stat_value].freeze
|
5
|
+
class DashboardValue
|
6
|
+
include Playbook::Props
|
13
7
|
|
14
|
-
|
15
|
-
classname: default_configuration,
|
16
|
-
data: default_configuration,
|
17
|
-
id: default_configuration,
|
18
|
-
stat_change: default_configuration,
|
19
|
-
stat_label: default_configuration,
|
20
|
-
stat_value: default_configuration)
|
8
|
+
partial "pb_dashboard_value/dashboard_value"
|
21
9
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
def align
|
32
|
-
align_options = %w[left center right]
|
33
|
-
one_of_value(configured_align, align_options, "left")
|
34
|
-
end
|
35
|
-
|
36
|
-
def stat_label
|
37
|
-
if is_set? configured_stat_label
|
38
|
-
pb_label = Playbook::PbBody::Body.new(color: "light") do
|
39
|
-
configured_stat_label[:label]
|
40
|
-
end
|
41
|
-
ApplicationController.renderer.render(partial: pb_label, as: :object)
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
def stat_value
|
46
|
-
if is_set? configured_stat_value
|
47
|
-
pb_value = Playbook::PbStatValue::StatValue.new(configured_stat_value)
|
48
|
-
ApplicationController.renderer.render(partial: pb_value, as: :object)
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
def stat_change
|
53
|
-
if is_set? configured_stat_change
|
54
|
-
pb_change = Playbook::PbStatChange::StatChange.new(configured_stat_change)
|
55
|
-
ApplicationController.renderer.render(partial: pb_change, as: :object)
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
def kit_class
|
60
|
-
kit_options = [
|
61
|
-
"pb_dashboard_value_kit",
|
62
|
-
align,
|
63
|
-
]
|
64
|
-
kit_options.join("_")
|
65
|
-
end
|
66
|
-
|
67
|
-
def to_partial_path
|
68
|
-
"pb_dashboard_value/dashboard_value"
|
69
|
-
end
|
70
|
-
|
71
|
-
private
|
10
|
+
prop :align, type: Playbook::Props::Enum,
|
11
|
+
values: %w[left center right],
|
12
|
+
default: "left"
|
13
|
+
prop :stat_change, type: Playbook::Props::Hash,
|
14
|
+
default: {}
|
15
|
+
prop :stat_label
|
16
|
+
prop :stat_value, type: Playbook::Props::Hash,
|
17
|
+
default: {}
|
72
18
|
|
73
|
-
|
74
|
-
|
75
|
-
def default_configuration
|
76
|
-
DEFAULT
|
19
|
+
def classname
|
20
|
+
generate_classname("pb_dashboard_value_kit", align)
|
77
21
|
end
|
78
|
-
attr_accessor(*PROPS)
|
79
22
|
end
|
80
23
|
end
|
81
24
|
end
|
@@ -1,23 +1,23 @@
|
|
1
1
|
<%= pb_rails("dashboard_value", props: {
|
2
|
-
stat_label:
|
2
|
+
stat_label: "Top Title Value",
|
3
3
|
stat_value: {value: 1428, unit: "appts"},
|
4
|
-
stat_change: {change: "decrease", value:
|
4
|
+
stat_change: {change: "decrease", value: 26.1}
|
5
5
|
}) %>
|
6
6
|
|
7
7
|
<br><br>
|
8
8
|
|
9
9
|
<%= pb_rails("dashboard_value", props: {
|
10
10
|
align: "center",
|
11
|
-
stat_label:
|
11
|
+
stat_label: "Top Title Value",
|
12
12
|
stat_value: {value: 1428, unit: "appts"},
|
13
|
-
stat_change: {change: "decrease", value:
|
13
|
+
stat_change: {change: "decrease", value: 56 }
|
14
14
|
}) %>
|
15
15
|
|
16
16
|
<br><br>
|
17
17
|
|
18
18
|
<%= pb_rails("dashboard_value", props: {
|
19
19
|
align: "right",
|
20
|
-
stat_label:
|
20
|
+
stat_label: "Top Title Value",
|
21
21
|
stat_value: {value: 1428, unit: "appts"},
|
22
|
-
stat_change: {change: "decrease", value:
|
22
|
+
stat_change: {change: "decrease", value: 86.1 }
|
23
23
|
}) %>
|
@@ -5,25 +5,25 @@ function DashboardValueAlign() {
|
|
5
5
|
return (
|
6
6
|
<div>
|
7
7
|
<DashboardValue
|
8
|
-
stat_label=
|
8
|
+
stat_label="Top Title Value"
|
9
9
|
stat_value={{value: "1,428", unit: "appts"}}
|
10
|
-
stat_change={{change: "decrease", value: "26.1
|
10
|
+
stat_change={{change: "decrease", value: "26.1"}} />
|
11
11
|
|
12
12
|
<br/><br/>
|
13
13
|
|
14
14
|
<DashboardValue
|
15
15
|
align="center"
|
16
|
-
stat_label=
|
16
|
+
stat_label="Top Title Value"
|
17
17
|
stat_value={{value: "1,428", unit: "appts"}}
|
18
|
-
stat_change={{change: "decrease", value:
|
18
|
+
stat_change={{change: "decrease", value: 56.1}} />
|
19
19
|
|
20
20
|
<br/><br/>
|
21
21
|
|
22
22
|
<DashboardValue
|
23
23
|
align="right"
|
24
|
-
stat_label=
|
24
|
+
stat_label="Top Title Value"
|
25
25
|
stat_value={{value: "1,428", unit: "appts"}}
|
26
|
-
stat_change={{change: "decrease", value:
|
26
|
+
stat_change={{change: "decrease", value: 86}} />
|
27
27
|
</div>
|
28
28
|
)
|
29
29
|
}
|
@@ -1,21 +1,21 @@
|
|
1
1
|
<%= pb_rails("dashboard_value", props: {
|
2
|
-
stat_label:
|
2
|
+
stat_label: "Decreased Value",
|
3
3
|
stat_value: {value: 1428, unit: "appts"},
|
4
|
-
stat_change: {change: "decrease", value:
|
4
|
+
stat_change: {change: "decrease", value: 26.1}
|
5
5
|
}) %>
|
6
6
|
|
7
7
|
<br><br>
|
8
8
|
|
9
9
|
<%= pb_rails("dashboard_value", props: {
|
10
|
-
stat_label:
|
10
|
+
stat_label: "Increased Value",
|
11
11
|
stat_value: {value: 938, unit: "homes"},
|
12
|
-
stat_change: {change: "increase", value:
|
12
|
+
stat_change: {change: "increase", value: 56.1}
|
13
13
|
}) %>
|
14
14
|
|
15
15
|
<br><br>
|
16
16
|
|
17
17
|
<%= pb_rails("dashboard_value", props: {
|
18
|
-
stat_label:
|
18
|
+
stat_label: "Neutral Value",
|
19
19
|
stat_value: {value: 261, unit: "windows"},
|
20
|
-
stat_change: {value:
|
20
|
+
stat_change: {value: 86}
|
21
21
|
}) %>
|
@@ -5,23 +5,23 @@ function DashboardValueDefault() {
|
|
5
5
|
return (
|
6
6
|
<div>
|
7
7
|
<DashboardValue
|
8
|
-
stat_label=
|
8
|
+
stat_label="Decreased Value"
|
9
9
|
stat_value={{value: "1,428", unit: "appts"}}
|
10
|
-
stat_change={{change: "decrease", value: "26.1
|
10
|
+
stat_change={{change: "decrease", value: "26.1"}} />
|
11
11
|
|
12
12
|
<br/><br/>
|
13
13
|
|
14
14
|
<DashboardValue
|
15
|
-
stat_label=
|
15
|
+
stat_label="Increased Value"
|
16
16
|
stat_value={{value: "938", unit: "homes"}}
|
17
|
-
stat_change={{change: "increase", value:
|
17
|
+
stat_change={{change: "increase", value: 56.1}} />
|
18
18
|
|
19
19
|
<br/><br/>
|
20
20
|
|
21
21
|
<DashboardValue
|
22
|
-
stat_label=
|
22
|
+
stat_label="Neutral Value"
|
23
23
|
stat_value={{value: "261", unit: "windows"}}
|
24
|
-
stat_change={{value:
|
24
|
+
stat_change={{value: 86}} />
|
25
25
|
</div>
|
26
26
|
)
|
27
27
|
}
|
@@ -1,14 +1,14 @@
|
|
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
|
|
6
6
|
<%= pb_rails("body", props: { tag: "span", color: "light" }) do %>
|
7
7
|
<%= pb_rails("icon", props: { icon: "calendar-alt", fixed_width: true }) %>
|
8
8
|
<% end %>
|
9
9
|
|
10
10
|
<%= pb_rails("body", props: { tag: "span"}) do %>
|
11
|
-
<%= object.
|
11
|
+
<%= object.start_date_display %>
|
12
12
|
<% end %>
|
13
13
|
|
14
14
|
<%= pb_rails("body", props: { tag: "span", color: "light" }) do %>
|
@@ -16,7 +16,7 @@
|
|
16
16
|
<% end %>
|
17
17
|
|
18
18
|
<%= pb_rails("body", props: { tag: "span"}) do %>
|
19
|
-
<%= object.
|
19
|
+
<%= object.end_date_display %>
|
20
20
|
<% end %>
|
21
21
|
|
22
22
|
<% end %>
|
@@ -2,54 +2,33 @@
|
|
2
2
|
|
3
3
|
module Playbook
|
4
4
|
module PbDateRangeInline
|
5
|
-
class DateRangeInline
|
5
|
+
class DateRangeInline
|
6
6
|
include ActionView::Helpers::TagHelper
|
7
7
|
include ActionView::Context
|
8
|
+
include Playbook::Props
|
8
9
|
|
9
|
-
|
10
|
-
configured_data
|
11
|
-
configured_end_date
|
12
|
-
configured_id
|
13
|
-
configured_start_date].freeze
|
10
|
+
partial "pb_date_range_inline/date_range_inline"
|
14
11
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
self.configured_classname = classname
|
21
|
-
self.configured_data = data
|
22
|
-
self.configured_id = id
|
23
|
-
self.configured_end_date = end_date
|
24
|
-
self.configured_start_date = start_date
|
12
|
+
prop :end_date, type: Playbook::Props::Date, required: true
|
13
|
+
prop :start_date, type: Playbook::Props::Date, required: true
|
14
|
+
|
15
|
+
def classname
|
16
|
+
generate_classname("pb_date_range_inline_kit")
|
25
17
|
end
|
26
18
|
|
27
|
-
def
|
28
|
-
date_time = Playbook::PbKit::PbDateTime.new(
|
19
|
+
def end_date_display
|
20
|
+
date_time = Playbook::PbKit::PbDateTime.new(end_date)
|
29
21
|
content_tag(:time, datetime: date_time.to_iso) do
|
30
22
|
"#{date_time.to_day} #{date_time.to_month_downcase} #{date_time.to_year}"
|
31
23
|
end
|
32
24
|
end
|
33
25
|
|
34
|
-
def
|
35
|
-
date_time = Playbook::PbKit::PbDateTime.new(
|
26
|
+
def start_date_display
|
27
|
+
date_time = Playbook::PbKit::PbDateTime.new(start_date)
|
36
28
|
content_tag(:time, datetime: date_time.to_iso) do
|
37
29
|
"#{date_time.to_day} #{date_time.to_month_downcase} #{date_time.to_year}"
|
38
30
|
end
|
39
31
|
end
|
40
|
-
|
41
|
-
def to_partial_path
|
42
|
-
"pb_date_range_inline/date_range_inline"
|
43
|
-
end
|
44
|
-
|
45
|
-
private
|
46
|
-
|
47
|
-
DEFAULT = Object.new
|
48
|
-
private_constant :DEFAULT
|
49
|
-
def default_configuration
|
50
|
-
DEFAULT
|
51
|
-
end
|
52
|
-
attr_accessor(*PROPS)
|
53
32
|
end
|
54
33
|
end
|
55
34
|
end
|
@@ -20,8 +20,10 @@
|
|
20
20
|
text: object.city_state_zip,
|
21
21
|
} %>
|
22
22
|
|
23
|
-
|
24
|
-
|
23
|
+
<% if object.home_id %>
|
24
|
+
<%= pb_rails "body", props: { classname: "home-hashtag", tag: "span" } do %>
|
25
|
+
H#<%= object.home_id %>
|
26
|
+
<% end %>
|
25
27
|
<% end %>
|
26
28
|
|
27
29
|
<%= pb_rails "body", props: { color: "light", tag: "span" } do %>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<%= content_tag(:div,
|
2
2
|
id: object.id,
|
3
3
|
data: object.data,
|
4
|
-
class: object.classname
|
5
|
-
<%= object.
|
4
|
+
class: object.classname) do %>
|
5
|
+
<%= capture(&object.children) %>
|
6
6
|
<% end %>
|
@@ -2,38 +2,14 @@
|
|
2
2
|
|
3
3
|
module Playbook
|
4
4
|
module PbLayout
|
5
|
-
class Body
|
6
|
-
|
7
|
-
configured_data
|
8
|
-
configured_id
|
9
|
-
block].freeze
|
5
|
+
class Body
|
6
|
+
include Playbook::Props
|
10
7
|
|
11
|
-
|
12
|
-
data: default_configuration,
|
13
|
-
id: default_configuration,
|
14
|
-
&block)
|
15
|
-
self.configured_classname = classname
|
16
|
-
self.configured_data = data
|
17
|
-
self.configured_id = id
|
18
|
-
self.block = block_given? ? block : nil
|
19
|
-
end
|
20
|
-
|
21
|
-
def yield(context:)
|
22
|
-
context.capture(&block)
|
23
|
-
end
|
24
|
-
|
25
|
-
def to_partial_path
|
26
|
-
"pb_layout/body"
|
27
|
-
end
|
28
|
-
|
29
|
-
private
|
8
|
+
partial "pb_layout/body"
|
30
9
|
|
31
|
-
|
32
|
-
|
33
|
-
def default_configuration
|
34
|
-
DEFAULT
|
10
|
+
def classname
|
11
|
+
generate_classname("layout_body")
|
35
12
|
end
|
36
|
-
attr_accessor(*PROPS)
|
37
13
|
end
|
38
14
|
end
|
39
15
|
end
|