playbook_ui 2.8.3 → 2.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/packs/examples.js +15 -0
- data/app/pb_kits/playbook/packs/kits.js +5 -0
- data/app/pb_kits/playbook/packs/pb_label_pill.js +4 -0
- data/app/pb_kits/playbook/packs/pb_owner.js +4 -0
- data/app/pb_kits/playbook/packs/pb_owner_phone.js +4 -0
- data/app/pb_kits/playbook/packs/pb_phone.js +4 -0
- data/app/pb_kits/playbook/packs/pb_toggle.js +4 -0
- data/app/pb_kits/playbook/packs/site_styles/_kit_style_index.scss +5 -0
- data/app/pb_kits/playbook/pb_label_pill/_label_pill.html.erb +7 -0
- data/app/pb_kits/playbook/pb_label_pill/_label_pill.jsx +21 -0
- data/app/pb_kits/playbook/pb_label_pill/_label_pill.scss +11 -0
- data/app/pb_kits/playbook/pb_label_pill/docs/_label_pill_default.html.erb +34 -0
- data/app/pb_kits/playbook/pb_label_pill/docs/_label_pill_default.jsx +12 -0
- data/app/pb_kits/playbook/pb_label_pill/docs/example.yml +9 -0
- data/app/pb_kits/playbook/pb_label_pill/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_label_pill/label_pill.rb +58 -0
- data/app/pb_kits/playbook/pb_list/_list.html.erb +1 -1
- data/app/pb_kits/playbook/pb_list/_list.jsx +3 -3
- data/app/pb_kits/playbook/pb_list/_list.scss +1 -1
- data/app/pb_kits/playbook/pb_list/docs/_list_dark_lg.html.erb +1 -1
- data/app/pb_kits/playbook/pb_list/docs/_list_lg.html.erb +1 -1
- data/app/pb_kits/playbook/pb_list/list.rb +8 -7
- data/app/pb_kits/playbook/pb_owner/_owner.html.erb +7 -0
- data/app/pb_kits/playbook/pb_owner/_owner.jsx +21 -0
- data/app/pb_kits/playbook/pb_owner/_owner.scss +11 -0
- data/app/pb_kits/playbook/pb_owner/docs/_owner_default.html.erb +1 -0
- data/app/pb_kits/playbook/pb_owner/docs/_owner_default.jsx +12 -0
- data/app/pb_kits/playbook/pb_owner/docs/example.yml +9 -0
- data/app/pb_kits/playbook/pb_owner/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_owner/owner.rb +52 -0
- data/app/pb_kits/playbook/pb_owner_phone/_owner_phone.html.erb +7 -0
- data/app/pb_kits/playbook/pb_owner_phone/_owner_phone.jsx +21 -0
- data/app/pb_kits/playbook/pb_owner_phone/_owner_phone.scss +9 -0
- data/app/pb_kits/playbook/pb_owner_phone/docs/_owner_phone_default.html.erb +6 -0
- data/app/pb_kits/playbook/pb_owner_phone/docs/_owner_phone_default.jsx +12 -0
- data/app/pb_kits/playbook/pb_owner_phone/docs/example.yml +9 -0
- data/app/pb_kits/playbook/pb_owner_phone/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_owner_phone/owner_phone.rb +64 -0
- data/app/pb_kits/playbook/pb_phone/_phone.html.erb +6 -0
- data/app/pb_kits/playbook/pb_phone/_phone.jsx +21 -0
- data/app/pb_kits/playbook/pb_phone/_phone.scss +2 -0
- data/app/pb_kits/playbook/pb_phone/docs/_phone_default.html.erb +4 -0
- data/app/pb_kits/playbook/pb_phone/docs/_phone_default.jsx +12 -0
- data/app/pb_kits/playbook/pb_phone/docs/example.yml +9 -0
- data/app/pb_kits/playbook/pb_phone/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_phone/phone.rb +69 -0
- data/app/pb_kits/playbook/pb_toggle/_toggle.html.erb +12 -0
- data/app/pb_kits/playbook/pb_toggle/_toggle.jsx +21 -0
- data/app/pb_kits/playbook/pb_toggle/_toggle.scss +57 -0
- data/app/pb_kits/playbook/pb_toggle/docs/_toggle_checked.html.erb +11 -0
- data/app/pb_kits/playbook/pb_toggle/docs/_toggle_default.html.erb +11 -0
- data/app/pb_kits/playbook/pb_toggle/docs/_toggle_default.jsx +13 -0
- data/app/pb_kits/playbook/pb_toggle/docs/example.yml +9 -0
- data/app/pb_kits/playbook/pb_toggle/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_toggle/toggle.rb +59 -0
- data/lib/generators/kit/kit_generator.rb +13 -9
- data/lib/generators/kit/templates/kit_ruby.erb.tt +3 -1
- data/lib/playbook/engine.rb +1 -0
- data/lib/playbook/version.rb +1 -1
- data/lib/tasks/pb_release.rake +69 -0
- metadata +92 -44
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8103129ad1d322c76959bc5b98dbc4a3095e6ab93f8b6ce108c3397d99d3e7da
|
|
4
|
+
data.tar.gz: 39bfc2b2780273550f8ad5038e51f561d695fafecf2785a49631932c9ed06bb0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c1af634076f6e690736128754f66c197790f27a4db4b58f7afe0e8f3bb0e22e43b1c3f822fdbfb607466c47e7652a40c00319499146e6f6f06191e7029a30098
|
|
7
|
+
data.tar.gz: aee625c328eb90beec7784d2de3169da58c3ff6c73492e728a0bb605b06ba04a7e9eec1882468f19a7452723d8ad216a89d94baf5f01a0a5d51327a0846a731f
|
|
@@ -95,3 +95,18 @@ WebpackerReact.setup (Timestamp);
|
|
|
95
95
|
|
|
96
96
|
import * as OnlineStatus from "pb_online_status/docs";
|
|
97
97
|
WebpackerReact.setup (OnlineStatus);
|
|
98
|
+
|
|
99
|
+
import * as LabelPill from "pb_label_pill/docs";
|
|
100
|
+
WebpackerReact.setup (LabelPill);
|
|
101
|
+
|
|
102
|
+
import * as Phone from "pb_phone/docs";
|
|
103
|
+
WebpackerReact.setup (Phone);
|
|
104
|
+
|
|
105
|
+
import * as OwnerPhone from "pb_owner_phone/docs";
|
|
106
|
+
WebpackerReact.setup (OwnerPhone);
|
|
107
|
+
|
|
108
|
+
import * as Owner from "pb_owner/docs";
|
|
109
|
+
WebpackerReact.setup (Owner);
|
|
110
|
+
|
|
111
|
+
import * as Toggle from "pb_toggle/docs";
|
|
112
|
+
WebpackerReact.setup (Toggle);
|
|
@@ -27,3 +27,8 @@ import "./pb_label_value.js";
|
|
|
27
27
|
import "./pb_message.js";
|
|
28
28
|
import "./pb_timestamp.js";
|
|
29
29
|
import "./pb_online_status.js";
|
|
30
|
+
import "./pb_label_pill.js";
|
|
31
|
+
import "./pb_phone.js";
|
|
32
|
+
import "./pb_owner_phone.js";
|
|
33
|
+
import "./pb_owner.js";
|
|
34
|
+
import "./pb_toggle.js";
|
|
@@ -29,3 +29,8 @@
|
|
|
29
29
|
@import '../../pb_message/message';
|
|
30
30
|
@import '../../pb_timestamp/timestamp';
|
|
31
31
|
@import '../../pb_online_status/online_status';
|
|
32
|
+
@import '../../pb_label_pill/label_pill';
|
|
33
|
+
@import '../../pb_phone/phone';
|
|
34
|
+
@import '../../pb_owner_phone/owner_phone';
|
|
35
|
+
@import '../../pb_owner/owner';
|
|
36
|
+
@import '../../pb_toggle/toggle';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
|
|
4
|
+
const propTypes = {
|
|
5
|
+
className: PropTypes.string,
|
|
6
|
+
id: PropTypes.string
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
class LabelPill extends React.Component {
|
|
10
|
+
render() {
|
|
11
|
+
return (
|
|
12
|
+
<div className="pb_label_pill">
|
|
13
|
+
<span>LABEL PILL CONTENT</span>
|
|
14
|
+
</div>
|
|
15
|
+
)
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
LabelPill.propTypes = propTypes;
|
|
20
|
+
|
|
21
|
+
export default LabelPill;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<%= pb_rails("label_pill", props: {
|
|
2
|
+
label: "Service Needed",
|
|
3
|
+
pill_value: "76",
|
|
4
|
+
}) %>
|
|
5
|
+
|
|
6
|
+
<%= pb_rails("label_pill", props: {
|
|
7
|
+
label: "Waiting",
|
|
8
|
+
pill_value: "69",
|
|
9
|
+
variant: "success"
|
|
10
|
+
}) %>
|
|
11
|
+
|
|
12
|
+
<%= pb_rails("label_pill", props: {
|
|
13
|
+
label: "In Service",
|
|
14
|
+
pill_value: "28",
|
|
15
|
+
variant: "error"
|
|
16
|
+
}) %>
|
|
17
|
+
|
|
18
|
+
<%= pb_rails("label_pill", props: {
|
|
19
|
+
label: "Fully Serviced",
|
|
20
|
+
pill_value: "198",
|
|
21
|
+
variant: "warning"
|
|
22
|
+
}) %>
|
|
23
|
+
|
|
24
|
+
<%= pb_rails("label_pill", props: {
|
|
25
|
+
label: "Inbox",
|
|
26
|
+
pill_value: "198",
|
|
27
|
+
variant: "info"
|
|
28
|
+
}) %>
|
|
29
|
+
|
|
30
|
+
<%= pb_rails("label_pill", props: {
|
|
31
|
+
label: "Outbox",
|
|
32
|
+
pill_value: "198",
|
|
33
|
+
variant: "neutral"
|
|
34
|
+
}) %>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {default as LabelPillDefault} from './_label_pill_default.jsx';
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
module Playbook
|
|
2
|
+
module PbLabelPill
|
|
3
|
+
class LabelPill < Playbook::PbKit::Base
|
|
4
|
+
PROPS = [:configured_classname,
|
|
5
|
+
:configured_data,
|
|
6
|
+
:configured_id,
|
|
7
|
+
:configured_label,
|
|
8
|
+
:configured_pill_value,
|
|
9
|
+
:configured_variant].freeze
|
|
10
|
+
|
|
11
|
+
def initialize(classname: default_configuration,
|
|
12
|
+
data: default_configuration,
|
|
13
|
+
id: default_configuration,
|
|
14
|
+
label: default_configuration,
|
|
15
|
+
pill_value: default_configuration,
|
|
16
|
+
variant: default_configuration
|
|
17
|
+
)
|
|
18
|
+
self.configured_classname = classname
|
|
19
|
+
self.configured_data = data
|
|
20
|
+
self.configured_id = id
|
|
21
|
+
self.configured_label = label
|
|
22
|
+
self.configured_pill_value = pill_value
|
|
23
|
+
self.configured_variant = variant
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def label
|
|
27
|
+
if is_set? configured_label
|
|
28
|
+
pb_caption = Playbook::PbCaption::Caption.new(text: configured_label, classname: "pb_label_pill_label")
|
|
29
|
+
ApplicationController.renderer.render(partial: pb_caption, as: :object)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def pill
|
|
34
|
+
if is_set? configured_pill_value
|
|
35
|
+
pb_pill = Playbook::PbPill::Pill.new(text: configured_pill_value, variant: variant, classname: "pb_label_pill_pill")
|
|
36
|
+
ApplicationController.renderer.render(partial: pb_pill, as: :object)
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def variant
|
|
41
|
+
default_value(configured_variant, "")
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def to_partial_path
|
|
45
|
+
"pb_label_pill/label_pill"
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
private
|
|
49
|
+
|
|
50
|
+
DEFAULT = Object.new
|
|
51
|
+
private_constant :DEFAULT
|
|
52
|
+
def default_configuration
|
|
53
|
+
DEFAULT
|
|
54
|
+
end
|
|
55
|
+
attr_accessor(*PROPS)
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%= content_tag(:div,
|
|
2
|
-
class: "pb_list#{object.xpadding}#{object.borderless}#{object.dark}#{object.
|
|
2
|
+
class: "pb_list#{object.xpadding}#{object.borderless}#{object.dark}#{object.size}#{object.layout}") do %>
|
|
3
3
|
<%= content_tag(:"#{object.ordered}",
|
|
4
4
|
id: object.id,
|
|
5
5
|
data: object.data,
|
|
@@ -4,7 +4,7 @@ import PropTypes from "prop-types";
|
|
|
4
4
|
const propTypes = {
|
|
5
5
|
dark:PropTypes.bool,
|
|
6
6
|
borderless:PropTypes.bool,
|
|
7
|
-
size:PropTypes.
|
|
7
|
+
size:PropTypes.oneOf(["", "large"]),
|
|
8
8
|
ordered:PropTypes.bool,
|
|
9
9
|
layout: PropTypes.oneOf(["", "left", "right"]),
|
|
10
10
|
xpadding:PropTypes.bool,
|
|
@@ -17,7 +17,7 @@ const propTypes = {
|
|
|
17
17
|
const defaultProps = {
|
|
18
18
|
dark:false,
|
|
19
19
|
borderless:false,
|
|
20
|
-
size:
|
|
20
|
+
size:"",
|
|
21
21
|
ordered:false,
|
|
22
22
|
layout:"",
|
|
23
23
|
xpadding:false
|
|
@@ -36,7 +36,7 @@ class List extends Component {
|
|
|
36
36
|
} = this.props;
|
|
37
37
|
const dark_class = dark === true ? "_dark" : ""
|
|
38
38
|
const borderless_class = borderless === true ? "list_borderless" : ""
|
|
39
|
-
const size_class =
|
|
39
|
+
const size_class = "_" + size
|
|
40
40
|
const ordered_class = ordered === true ? "_ordered" : ""
|
|
41
41
|
const layout_class = "_"+ layout
|
|
42
42
|
const xpadding_class = xpadding === true ? "_xpadding" : ""
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<%= pb_rails("list", props: {ordered: false, dark: true, borderless: false,
|
|
1
|
+
<%= pb_rails("list", props: {ordered: false, dark: true, borderless: false, size: "large"}) do %>
|
|
2
2
|
<%= pb_rails("list/item") do %> List Item <% end %>
|
|
3
3
|
<%= pb_rails("list/item") do %> List Item <% end %>
|
|
4
4
|
<%= pb_rails("list/item") do %> List Item <% end %>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<%= pb_rails("list", props: {ordered: false, dark: false, borderless: false,
|
|
1
|
+
<%= pb_rails("list", props: {ordered: false, dark: false, borderless: false, size: "large"}) do %>
|
|
2
2
|
<%= pb_rails("list/item") do %> List Item <% end %>
|
|
3
3
|
<%= pb_rails("list/item") do %> List Item <% end %>
|
|
4
4
|
<%= pb_rails("list/item") do %> List Item <% end %>
|
|
@@ -9,7 +9,7 @@ module Playbook
|
|
|
9
9
|
configured_data
|
|
10
10
|
configured_id
|
|
11
11
|
configured_layout
|
|
12
|
-
|
|
12
|
+
configured_size
|
|
13
13
|
configured_ordered
|
|
14
14
|
configured_xpadding
|
|
15
15
|
block].freeze
|
|
@@ -20,7 +20,7 @@ module Playbook
|
|
|
20
20
|
data: default_configuration,
|
|
21
21
|
id: default_configuration,
|
|
22
22
|
layout: default_configuration,
|
|
23
|
-
|
|
23
|
+
size: default_configuration,
|
|
24
24
|
ordered: default_configuration,
|
|
25
25
|
xpadding: default_configuration,
|
|
26
26
|
&block)
|
|
@@ -30,7 +30,7 @@ module Playbook
|
|
|
30
30
|
self.configured_data = data
|
|
31
31
|
self.configured_id = id
|
|
32
32
|
self.configured_layout = layout
|
|
33
|
-
self.
|
|
33
|
+
self.configured_size = size
|
|
34
34
|
self.configured_ordered = ordered
|
|
35
35
|
self.configured_xpadding = xpadding
|
|
36
36
|
self.block = block_given? ? block : nil
|
|
@@ -62,11 +62,12 @@ module Playbook
|
|
|
62
62
|
end
|
|
63
63
|
end
|
|
64
64
|
|
|
65
|
-
def
|
|
66
|
-
|
|
65
|
+
def size
|
|
66
|
+
case configured_size
|
|
67
|
+
when default_configuration
|
|
67
68
|
""
|
|
68
|
-
|
|
69
|
-
"
|
|
69
|
+
when "large"
|
|
70
|
+
"_large"
|
|
70
71
|
end
|
|
71
72
|
end
|
|
72
73
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
|
|
4
|
+
const propTypes = {
|
|
5
|
+
className: PropTypes.string,
|
|
6
|
+
id: PropTypes.string
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
class Owner extends React.Component {
|
|
10
|
+
render() {
|
|
11
|
+
return (
|
|
12
|
+
<div className="pb_owner">
|
|
13
|
+
<span>OWNER CONTENT</span>
|
|
14
|
+
</div>
|
|
15
|
+
)
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
Owner.propTypes = propTypes;
|
|
20
|
+
|
|
21
|
+
export default Owner;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<%= pb_rails("owner", props: { first_name: "Kyle", last_name: "Fadigan" }) %>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {default as OwnerDefault} from './_owner_default.jsx';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Playbook
|
|
4
|
+
module PbOwner
|
|
5
|
+
class Owner < Playbook::PbKit::Base
|
|
6
|
+
PROPS = [:configured_classname,
|
|
7
|
+
:configured_data,
|
|
8
|
+
:configured_id,
|
|
9
|
+
:configured_first_name,
|
|
10
|
+
:configured_last_name].freeze
|
|
11
|
+
|
|
12
|
+
def initialize(classname: default_configuration,
|
|
13
|
+
data: default_configuration,
|
|
14
|
+
id: default_configuration,
|
|
15
|
+
first_name: default_configuration,
|
|
16
|
+
last_name: default_configuration)
|
|
17
|
+
self.configured_classname = classname
|
|
18
|
+
self.configured_data = data
|
|
19
|
+
self.configured_id = id
|
|
20
|
+
self.configured_first_name = first_name
|
|
21
|
+
self.configured_last_name = last_name
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def first_name
|
|
25
|
+
pb_first_name = Playbook::PbBody::Body.new(classname: "pb_owner_first") do
|
|
26
|
+
default_value(configured_first_name, "")
|
|
27
|
+
end
|
|
28
|
+
ApplicationController.renderer.render(partial: pb_first_name, as: :object)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def last_name
|
|
32
|
+
if is_set? configured_last_name
|
|
33
|
+
pb_last_name = Playbook::PbTitle::Title.new(text: configured_last_name, size: 4)
|
|
34
|
+
ApplicationController.renderer.render(partial: pb_last_name, as: :object)
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def to_partial_path
|
|
39
|
+
"pb_owner/owner"
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
private
|
|
43
|
+
|
|
44
|
+
DEFAULT = Object.new
|
|
45
|
+
private_constant :DEFAULT
|
|
46
|
+
def default_configuration
|
|
47
|
+
DEFAULT
|
|
48
|
+
end
|
|
49
|
+
attr_accessor(*PROPS)
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
|
|
4
|
+
const propTypes = {
|
|
5
|
+
className: PropTypes.string,
|
|
6
|
+
id: PropTypes.string
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
class OwnerPhone extends React.Component {
|
|
10
|
+
render() {
|
|
11
|
+
return (
|
|
12
|
+
<div className="pb_owner_phone">
|
|
13
|
+
<span>OWNER PHONE CONTENT</span>
|
|
14
|
+
</div>
|
|
15
|
+
)
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
OwnerPhone.propTypes = propTypes;
|
|
20
|
+
|
|
21
|
+
export default OwnerPhone;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {default as OwnerPhoneDefault} from './_owner_phone_default.jsx';
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
module Playbook
|
|
2
|
+
module PbOwnerPhone
|
|
3
|
+
class OwnerPhone < Playbook::PbKit::Base
|
|
4
|
+
PROPS = [:configured_classname,
|
|
5
|
+
:configured_data,
|
|
6
|
+
:configured_id,
|
|
7
|
+
:configured_first_name,
|
|
8
|
+
:configured_last_name,
|
|
9
|
+
:configured_number,
|
|
10
|
+
:configured_icon].freeze
|
|
11
|
+
|
|
12
|
+
def initialize(classname: default_configuration,
|
|
13
|
+
data: default_configuration,
|
|
14
|
+
id: default_configuration,
|
|
15
|
+
first_name: default_configuration,
|
|
16
|
+
last_name: default_configuration,
|
|
17
|
+
number: default_configuration,
|
|
18
|
+
icon: default_configuration)
|
|
19
|
+
self.configured_classname = classname
|
|
20
|
+
self.configured_data = data
|
|
21
|
+
self.configured_id = id
|
|
22
|
+
self.configured_first_name = first_name
|
|
23
|
+
self.configured_last_name = last_name
|
|
24
|
+
self.configured_number = number
|
|
25
|
+
self.configured_icon = icon
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def icon
|
|
29
|
+
if is_set? configured_icon
|
|
30
|
+
configured_icon
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def phone
|
|
35
|
+
phone = Playbook::PbPhone::Phone.new({ icon: configured_icon, number: configured_number })
|
|
36
|
+
ApplicationController.renderer.render(partial: phone, as: :object)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def name
|
|
40
|
+
owner = Playbook::PbOwner::Owner.new({ first_name: configured_first_name, last_name: configured_last_name })
|
|
41
|
+
ApplicationController.renderer.render(partial: owner, as: :object)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def number
|
|
45
|
+
if is_set? configured_number
|
|
46
|
+
configured_number
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def to_partial_path
|
|
51
|
+
"pb_owner_phone/owner_phone"
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
private
|
|
55
|
+
|
|
56
|
+
DEFAULT = Object.new
|
|
57
|
+
private_constant :DEFAULT
|
|
58
|
+
def default_configuration
|
|
59
|
+
DEFAULT
|
|
60
|
+
end
|
|
61
|
+
attr_accessor(*PROPS)
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
|
|
4
|
+
const propTypes = {
|
|
5
|
+
className: PropTypes.string,
|
|
6
|
+
id: PropTypes.string
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
class Phone extends React.Component {
|
|
10
|
+
render() {
|
|
11
|
+
return (
|
|
12
|
+
<div className="pb_phone">
|
|
13
|
+
<span>PHONE CONTENT</span>
|
|
14
|
+
</div>
|
|
15
|
+
)
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
Phone.propTypes = propTypes;
|
|
20
|
+
|
|
21
|
+
export default Phone;
|