playbook_ui 2.9.2 → 2.9.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/images/pb.logo.svg +28 -0
- data/app/helpers/playbook/pb_doc_helper.rb +9 -12
- data/app/helpers/playbook/pb_kit_helper.rb +12 -30
- data/app/pb_kits/playbook/_playbook.scss +50 -0
- data/app/pb_kits/playbook/index.js +10 -9
- data/app/pb_kits/playbook/kits/pb_contact.js +4 -0
- data/app/pb_kits/playbook/kits/pb_person.js +4 -0
- data/app/pb_kits/playbook/kits/pb_person_contact.js +4 -0
- data/app/pb_kits/playbook/packs/application.js +3 -3
- data/app/pb_kits/playbook/packs/examples.js +85 -127
- data/app/pb_kits/playbook/packs/kits.js +36 -36
- data/app/pb_kits/playbook/packs/main.scss +1 -1
- data/app/pb_kits/playbook/packs/site_styles/_site-style.scss +7 -0
- data/app/pb_kits/playbook/pb_bar_graph/barGraphSettings.js +1 -1
- data/app/pb_kits/playbook/pb_button/_button.jsx +48 -49
- data/app/pb_kits/playbook/pb_button/docs/_button_default.jsx +8 -2
- data/app/pb_kits/playbook/pb_card/_card.html.erb +2 -2
- data/app/pb_kits/playbook/pb_card/child_kits/_card_body.html.erb +1 -1
- data/app/pb_kits/playbook/pb_contact/_contact.html.erb +6 -0
- data/app/pb_kits/playbook/pb_contact/_contact.jsx +72 -0
- data/app/pb_kits/playbook/{pb_phone/_phone.scss → pb_contact/_contact.scss} +0 -0
- data/app/pb_kits/playbook/pb_contact/contact.rb +78 -0
- data/app/pb_kits/playbook/pb_contact/docs/_contact_default.html.erb +18 -0
- data/app/pb_kits/playbook/pb_contact/docs/_contact_default.jsx +26 -0
- data/app/pb_kits/playbook/pb_contact/docs/example.yml +8 -0
- data/app/pb_kits/playbook/pb_contact/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_dashboard/commonSettings.js +16 -13
- data/app/pb_kits/playbook/pb_hashtag/_hashtag.html.erb +2 -2
- data/app/pb_kits/playbook/pb_hashtag/hashtag.rb +20 -59
- data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.html.erb +3 -3
- data/app/pb_kits/playbook/pb_home_address_street/home_address_street.rb +18 -61
- data/app/pb_kits/playbook/pb_input/_input.html.erb +1 -1
- data/app/pb_kits/playbook/pb_input/_input.jsx +2 -2
- data/app/pb_kits/playbook/pb_input/_input.scss +1 -1
- data/app/pb_kits/playbook/pb_input/input.rb +10 -79
- data/app/pb_kits/playbook/pb_line_graph/lineGraphSettings.js +1 -1
- data/app/pb_kits/playbook/{pb_owner/_owner.html.erb → pb_person/_person.html.erb} +1 -1
- data/app/pb_kits/playbook/pb_person/_person.jsx +36 -0
- data/app/pb_kits/playbook/{pb_owner/_owner.scss → pb_person/_person.scss} +2 -2
- data/app/pb_kits/playbook/pb_person/docs/_person_default.html.erb +1 -0
- data/app/pb_kits/playbook/pb_person/docs/_person_default.jsx +13 -0
- data/app/pb_kits/playbook/pb_person/docs/example.yml +9 -0
- data/app/pb_kits/playbook/pb_person/docs/index.js +1 -0
- data/app/pb_kits/playbook/{pb_owner/owner.rb → pb_person/person.rb} +18 -14
- data/app/pb_kits/playbook/pb_person_contact/_person_contact.html.erb +12 -0
- data/app/pb_kits/playbook/pb_person_contact/_person_contact.jsx +49 -0
- data/app/pb_kits/playbook/{pb_owner_phone/_owner_phone.scss → pb_person_contact/_person_contact.scss} +3 -3
- data/app/pb_kits/playbook/pb_person_contact/docs/_person_contact_default.html.erb +21 -0
- data/app/pb_kits/playbook/pb_person_contact/docs/_person_contact_default.jsx +34 -0
- data/app/pb_kits/playbook/pb_person_contact/docs/example.yml +8 -0
- data/app/pb_kits/playbook/pb_person_contact/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_person_contact/person_contact.rb +55 -0
- data/app/pb_kits/playbook/props.rb +4 -4
- data/app/pb_kits/playbook/props/base.rb +7 -3
- data/app/pb_kits/playbook/props/number.rb +11 -0
- data/app/pb_kits/playbook/props/proc.rb +11 -0
- data/app/pb_kits/playbook/tokens/_colors.scss +12 -8
- data/app/views/layouts/playbook/_nav.html.slim +2 -2
- data/app/views/playbook/pages/principles.html.slim +0 -2
- data/fonts/fontawesome.min.js +5 -0
- data/fonts/regular.min.js +5 -0
- data/lib/generators/kit/kit_generator.rb +2 -2
- data/lib/playbook/version.rb +1 -1
- metadata +35 -32
- data/app/pb_kits/playbook/kits/pb_owner.js +0 -4
- data/app/pb_kits/playbook/kits/pb_owner_phone.js +0 -4
- data/app/pb_kits/playbook/kits/pb_phone.js +0 -4
- data/app/pb_kits/playbook/packs/site_styles/_kit_style_index.scss +0 -50
- data/app/pb_kits/playbook/pb_owner/_owner.jsx +0 -21
- data/app/pb_kits/playbook/pb_owner/docs/_owner_default.html.erb +0 -1
- data/app/pb_kits/playbook/pb_owner/docs/_owner_default.jsx +0 -10
- data/app/pb_kits/playbook/pb_owner/docs/example.yml +0 -9
- data/app/pb_kits/playbook/pb_owner/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_owner_phone/_owner_phone.html.erb +0 -7
- data/app/pb_kits/playbook/pb_owner_phone/_owner_phone.jsx +0 -21
- data/app/pb_kits/playbook/pb_owner_phone/docs/_owner_phone_default.html.erb +0 -6
- data/app/pb_kits/playbook/pb_owner_phone/docs/_owner_phone_default.jsx +0 -10
- data/app/pb_kits/playbook/pb_owner_phone/docs/example.yml +0 -9
- data/app/pb_kits/playbook/pb_owner_phone/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_owner_phone/owner_phone.rb +0 -62
- data/app/pb_kits/playbook/pb_phone/_phone.html.erb +0 -6
- data/app/pb_kits/playbook/pb_phone/_phone.jsx +0 -21
- data/app/pb_kits/playbook/pb_phone/docs/_phone_default.html.erb +0 -4
- data/app/pb_kits/playbook/pb_phone/docs/_phone_default.jsx +0 -10
- data/app/pb_kits/playbook/pb_phone/docs/example.yml +0 -9
- data/app/pb_kits/playbook/pb_phone/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_phone/phone.rb +0 -70
- data/fonts/fontawesome.js +0 -1978
- data/fonts/regular.js +0 -1217
@@ -1,49 +1,49 @@
|
|
1
|
+
import "../kits/pb_avatar.js";
|
2
|
+
import "../kits/pb_badge.js";
|
3
|
+
import "../kits/pb_bar_graph.js";
|
1
4
|
import "../kits/pb_body.js";
|
2
5
|
import "../kits/pb_button.js";
|
3
6
|
import "../kits/pb_caption.js";
|
4
7
|
import "../kits/pb_card.js";
|
5
|
-
import "../kits/
|
6
|
-
import "../kits/
|
7
|
-
import "../kits/
|
8
|
-
import "../kits/pb_image.js";
|
9
|
-
import "../kits/pb_table.js";
|
10
|
-
import "../kits/pb_avatar.js";
|
11
|
-
import "../kits/pb_input.js";
|
12
|
-
import "../kits/pb_bar_graph.js";
|
13
|
-
import "../kits/pb_line_graph.js";
|
14
|
-
import "../kits/pb_icon.js";
|
8
|
+
import "../kits/pb_checkbox.js";
|
9
|
+
import "../kits/pb_contact.js";
|
10
|
+
import "../kits/pb_currency.js";
|
15
11
|
import "../kits/pb_dashboard_value.js";
|
16
|
-
import "../kits/pb_time.js";
|
17
|
-
import "../kits/pb_pill.js";
|
18
|
-
import "../kits/pb_user_badge.js";
|
19
12
|
import "../kits/pb_date.js";
|
20
|
-
import "../kits/
|
13
|
+
import "../kits/pb_date_range_inline.js";
|
14
|
+
import "../kits/pb_date_year_stacked.js";
|
15
|
+
import "../kits/pb_distribution_bar.js";
|
16
|
+
import "../kits/pb_fixed_confirmation_toast.js";
|
17
|
+
import "../kits/pb_hashtag.js";
|
18
|
+
import "../kits/pb_home_address_street.js";
|
19
|
+
import "../kits/pb_icon.js";
|
21
20
|
import "../kits/pb_icon_circle.js";
|
22
21
|
import "../kits/pb_icon_value.js";
|
23
|
-
import "../kits/
|
24
|
-
import "../kits/
|
25
|
-
import "../kits/
|
26
|
-
import "../kits/pb_user.js";
|
22
|
+
import "../kits/pb_image.js";
|
23
|
+
import "../kits/pb_input.js";
|
24
|
+
import "../kits/pb_label_pill.js";
|
27
25
|
import "../kits/pb_label_value.js";
|
26
|
+
import "../kits/pb_layout.js";
|
27
|
+
import "../kits/pb_line_graph.js";
|
28
|
+
import "../kits/pb_loading_inline.js";
|
28
29
|
import "../kits/pb_message.js";
|
29
|
-
import "../kits/pb_timestamp.js";
|
30
30
|
import "../kits/pb_online_status.js";
|
31
|
+
import "../kits/pb_person.js";
|
32
|
+
import "../kits/pb_person_contact.js";
|
33
|
+
import "../kits/pb_pill.js";
|
34
|
+
import "../kits/pb_progress_simple.js";
|
35
|
+
import "../kits/pb_section_separator.js";
|
31
36
|
import "../kits/pb_source.js";
|
32
|
-
import "../kits/
|
33
|
-
import "../kits/pb_phone.js";
|
34
|
-
import "../kits/pb_owner_phone.js";
|
35
|
-
import "../kits/pb_owner.js";
|
36
|
-
import "../kits/pb_toggle.js";
|
37
|
-
import "../kits/pb_stat_value.js";
|
37
|
+
import "../kits/pb_star_rating.js";
|
38
38
|
import "../kits/pb_stat_change.js";
|
39
|
-
import "../kits/
|
40
|
-
import "../kits/
|
41
|
-
import "../kits/
|
42
|
-
import "../kits/
|
43
|
-
import "../kits/
|
44
|
-
import "../kits/
|
45
|
-
import "../kits/
|
46
|
-
import "../kits/
|
47
|
-
import "../kits/
|
48
|
-
import "../kits/
|
49
|
-
import "../kits/
|
39
|
+
import "../kits/pb_stat_value.js";
|
40
|
+
import "../kits/pb_table.js";
|
41
|
+
import "../kits/pb_time.js";
|
42
|
+
import "../kits/pb_timestamp.js";
|
43
|
+
import "../kits/pb_title.js";
|
44
|
+
import "../kits/pb_title_count.js";
|
45
|
+
import "../kits/pb_title_detail.js";
|
46
|
+
import "../kits/pb_toggle.js";
|
47
|
+
import "../kits/pb_user.js";
|
48
|
+
import "../kits/pb_user_badge.js";
|
49
|
+
import "../kits/pb_vertical_nav.js";
|
@@ -1,8 +1,9 @@
|
|
1
1
|
/* @flow */
|
2
2
|
|
3
|
-
import React
|
3
|
+
import React from 'react'
|
4
4
|
import classnames from 'classnames'
|
5
5
|
|
6
|
+
type EventHandler = (SyntheticInputEvent<HTMLInputElement>) => void
|
6
7
|
type ButtonPropTypes = {
|
7
8
|
aria?: {
|
8
9
|
label: String,
|
@@ -16,6 +17,7 @@ type ButtonPropTypes = {
|
|
16
17
|
icon?: String,
|
17
18
|
loading?: Boolean,
|
18
19
|
newWindow?: Boolean,
|
20
|
+
onClick?: EventHandler,
|
19
21
|
size: 'large' | 'medium' | 'small',
|
20
22
|
text?: String,
|
21
23
|
type: 'inline' | null,
|
@@ -27,62 +29,64 @@ type ButtonPropTypes = {
|
|
27
29
|
|
28
30
|
const buttonClassName = (props: ButtonPropTypes) => {
|
29
31
|
const {
|
30
|
-
dark=false,
|
31
|
-
disabled=false,
|
32
|
-
fullWidth=false,
|
33
|
-
loading=false,
|
34
|
-
size=null,
|
35
|
-
type='inline',
|
36
|
-
variant='primary',
|
32
|
+
dark = false,
|
33
|
+
disabled = false,
|
34
|
+
fullWidth = false,
|
35
|
+
loading = false,
|
36
|
+
size = null,
|
37
|
+
type = 'inline',
|
38
|
+
variant = 'primary',
|
37
39
|
} = props
|
38
40
|
|
39
41
|
let className = 'pb_button_kit'
|
40
42
|
|
41
|
-
className
|
42
|
-
className
|
43
|
-
className
|
44
|
-
className
|
45
|
-
className
|
46
|
-
className
|
47
|
-
className
|
43
|
+
className += `${variant !== null ? `_${variant}` : ''}`
|
44
|
+
className += `${type !== null ? `_${type}` : ''}`
|
45
|
+
className += `${size !== null ? `_${size}` : ''}`
|
46
|
+
className += `${dark === true ? '_dark' : ''}`
|
47
|
+
className += `${fullWidth ? '_block' : ''}`
|
48
|
+
className += disabled ? '_disabled' : '_enabled'
|
49
|
+
className += loading ? '_loading' : ''
|
48
50
|
|
49
51
|
return className
|
50
52
|
}
|
51
53
|
|
52
54
|
const buttonAriaProps = (props: ButtonPropTypes) => {
|
53
|
-
const { aria }
|
54
|
-
if(typeof aria !==
|
55
|
+
const { aria } = props
|
56
|
+
if (typeof aria !== 'object') return {}
|
55
57
|
const { label } = aria
|
56
58
|
|
57
59
|
let ariaProps = {}
|
58
60
|
|
59
|
-
if(label !== null) ariaProps['aria-label'] = label
|
61
|
+
if (label !== null) ariaProps['aria-label'] = label
|
60
62
|
|
61
63
|
return ariaProps
|
62
64
|
}
|
63
65
|
|
64
|
-
const Button = (props
|
66
|
+
const Button = (props: ButtonPropTypes) => {
|
65
67
|
const {
|
66
|
-
aria={},
|
67
68
|
children,
|
68
69
|
className,
|
69
|
-
icon=null,
|
70
|
-
loading=false,
|
71
|
-
|
72
|
-
|
70
|
+
icon = null,
|
71
|
+
loading = false,
|
72
|
+
onClick = () => {},
|
73
|
+
link = null,
|
74
|
+
newWindow = false,
|
73
75
|
text,
|
74
|
-
htmlType='button',
|
75
|
-
value
|
76
|
+
htmlType = 'button',
|
77
|
+
value,
|
76
78
|
} = props
|
77
79
|
|
78
|
-
const buttonAria
|
79
|
-
const css
|
80
|
-
const loadingIcon =
|
80
|
+
const buttonAria = buttonAriaProps(props)
|
81
|
+
const css = classnames(buttonClassName(props), className)
|
82
|
+
const loadingIcon = (
|
83
|
+
<i className='pb_icon_kit far fa-spinner fa-fw fa-pulse loading-icon' />
|
84
|
+
)
|
81
85
|
|
82
|
-
const content
|
83
|
-
<span className=
|
86
|
+
const content = (
|
87
|
+
<span className='pb_button_content'>
|
84
88
|
<If condition={icon !== null}>
|
85
|
-
<i className={`pb_icon_kit far fa-${icon} fa-fw`}/>
|
89
|
+
<i className={`pb_icon_kit far fa-${icon} fa-fw`} />
|
86
90
|
</If>
|
87
91
|
<span>{text || children}</span>
|
88
92
|
</span>
|
@@ -91,26 +95,21 @@ const Button = (props : ButtonPropTypes) => {
|
|
91
95
|
return (
|
92
96
|
<If condition={link !== null}>
|
93
97
|
<a
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
<If condition={loading}>
|
100
|
-
{loadingIcon}
|
101
|
-
</If>
|
98
|
+
{...buttonAria}
|
99
|
+
className={css}
|
100
|
+
href={link}
|
101
|
+
target={newWindow ? '_blank' : null}>
|
102
|
+
<If condition={loading}>{loadingIcon}</If>
|
102
103
|
{content}
|
103
104
|
</a>
|
104
|
-
|
105
|
+
<Else />
|
105
106
|
<button
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
<If condition={loading}>
|
112
|
-
{loadingIcon}
|
113
|
-
</If>
|
107
|
+
{...buttonAria}
|
108
|
+
className={css}
|
109
|
+
onClick={onClick}
|
110
|
+
type={htmlType}
|
111
|
+
value={value}>
|
112
|
+
<If condition={loading}>{loadingIcon}</If>
|
114
113
|
{content}
|
115
114
|
</button>
|
116
115
|
</If>
|
@@ -3,18 +3,24 @@ import {Button} from '../../'
|
|
3
3
|
|
4
4
|
const ButtonDefault = () => (
|
5
5
|
<div>
|
6
|
-
<Button text="Button Primary" />
|
7
6
|
<Button
|
7
|
+
onClick={() => console.log("button clicked!")}
|
8
|
+
text="Button Primary"
|
9
|
+
/>
|
10
|
+
<Button
|
11
|
+
onClick={() => console.log("button clicked!")}
|
8
12
|
text="Button Secondary"
|
9
13
|
variant="secondary"
|
10
14
|
/>
|
11
15
|
<Button
|
16
|
+
onClick={() => console.log("button clicked!")}
|
12
17
|
text="Button Link"
|
13
18
|
variant="link"
|
14
19
|
/>
|
15
20
|
<Button
|
16
|
-
text="Button Disabled"
|
17
21
|
disabled
|
22
|
+
onClick={() => console.log("button clicked!")}
|
23
|
+
text="Button Disabled"
|
18
24
|
/>
|
19
25
|
</div>
|
20
26
|
)
|
@@ -3,7 +3,7 @@
|
|
3
3
|
data: object.data,
|
4
4
|
class: object.classname,
|
5
5
|
aria: object.aria) do %>
|
6
|
-
<% if object.
|
7
|
-
<%= pb_rails("card/card_body", props: { padding: object.padding
|
6
|
+
<% if object.children %>
|
7
|
+
<%= pb_rails("card/card_body", props: { padding: object.padding, children: object.children }) %>
|
8
8
|
<% end %>
|
9
9
|
<% end %>
|
@@ -0,0 +1,72 @@
|
|
1
|
+
/* @flow */
|
2
|
+
/*eslint-disable react/no-multi-comp, flowtype/space-before-type-colon */
|
3
|
+
|
4
|
+
import React from 'react'
|
5
|
+
import classnames from 'classnames'
|
6
|
+
|
7
|
+
import {
|
8
|
+
Body,
|
9
|
+
Icon,
|
10
|
+
} from '../'
|
11
|
+
|
12
|
+
type ContactProps = {
|
13
|
+
contactType?: 'cell' | 'home' | 'work' | 'email',
|
14
|
+
className?: String | Array<String>,
|
15
|
+
dark?: Boolean,
|
16
|
+
contactValue: String,
|
17
|
+
}
|
18
|
+
|
19
|
+
const kitClasses = ({}: ContactProps) => {
|
20
|
+
let classname = 'pb_contact_kit'
|
21
|
+
return classname
|
22
|
+
}
|
23
|
+
|
24
|
+
const Contact = ({
|
25
|
+
contactType,
|
26
|
+
className,
|
27
|
+
dark=false,
|
28
|
+
contactValue,
|
29
|
+
}: ContactProps) => {
|
30
|
+
|
31
|
+
const css = classnames(kitClasses({contactType}), className)
|
32
|
+
|
33
|
+
const formatPhoneNumber = (phoneNumberString, contactType) => {
|
34
|
+
if (contactType == "email") {
|
35
|
+
return phoneNumberString
|
36
|
+
} else {
|
37
|
+
let cleaned = ('' + phoneNumberString).replace(/\D/g, '')
|
38
|
+
let match = cleaned.match(/^(1|)?(\d{3})(\d{3})(\d{4})$/)
|
39
|
+
if (match) {
|
40
|
+
let intlCode = (match[1] ? '+1 ' : '')
|
41
|
+
return [intlCode, '(', match[2], ') ', match[3], '-', match[4]].join('')
|
42
|
+
}
|
43
|
+
return null
|
44
|
+
}
|
45
|
+
}
|
46
|
+
|
47
|
+
const contactTypeIcon = (function(contactType) {
|
48
|
+
switch(contactType) {
|
49
|
+
case 'cell':
|
50
|
+
return 'mobile';
|
51
|
+
case 'home':
|
52
|
+
return 'phone';
|
53
|
+
case 'work':
|
54
|
+
return 'phone-office';
|
55
|
+
case 'email':
|
56
|
+
return 'envelope';
|
57
|
+
default:
|
58
|
+
return 'phone';
|
59
|
+
}
|
60
|
+
})(contactType)
|
61
|
+
|
62
|
+
return (
|
63
|
+
<div className={css}>
|
64
|
+
<Body dark={dark} color="light" >
|
65
|
+
<Icon icon={contactTypeIcon} fixedWidth="true" />
|
66
|
+
{` ${formatPhoneNumber(contactValue, contactType)}`}
|
67
|
+
</Body>
|
68
|
+
</div>
|
69
|
+
)
|
70
|
+
}
|
71
|
+
|
72
|
+
export default Contact
|
File without changes
|
@@ -0,0 +1,78 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "action_view"
|
4
|
+
|
5
|
+
module Playbook
|
6
|
+
module PbContact
|
7
|
+
class Contact < Playbook::PbKit::Base
|
8
|
+
include ActionView::Helpers::NumberHelper
|
9
|
+
|
10
|
+
PROPS = %i[configured_classname
|
11
|
+
configured_data
|
12
|
+
configured_id
|
13
|
+
configured_contact_type
|
14
|
+
configured_contact_value].freeze
|
15
|
+
|
16
|
+
def initialize(classname: default_configuration,
|
17
|
+
data: default_configuration,
|
18
|
+
id: default_configuration,
|
19
|
+
contact_type: default_configuration,
|
20
|
+
contact_value: default_configuration)
|
21
|
+
self.configured_classname = classname
|
22
|
+
self.configured_data = data
|
23
|
+
self.configured_id = id
|
24
|
+
self.configured_contact_type = contact_type
|
25
|
+
self.configured_contact_value = contact_value
|
26
|
+
end
|
27
|
+
|
28
|
+
def contact_type
|
29
|
+
case configured_contact_type
|
30
|
+
when "cell"
|
31
|
+
icon = "mobile"
|
32
|
+
when "home"
|
33
|
+
icon = "phone"
|
34
|
+
when "work"
|
35
|
+
icon = "phone-office"
|
36
|
+
when "email"
|
37
|
+
icon = "envelope"
|
38
|
+
else # "unknown" || "other"
|
39
|
+
icon = "phone"
|
40
|
+
end
|
41
|
+
contact_type_props = { icon: icon, fixed_width: true }
|
42
|
+
pb_contact_type = Playbook::PbIcon::Icon.new(contact_type_props)
|
43
|
+
ApplicationController.renderer.render(partial: pb_contact_type, as: :object)
|
44
|
+
end
|
45
|
+
|
46
|
+
def contact_value
|
47
|
+
if is_set? configured_contact_value
|
48
|
+
unless configured_contact_type == "email"
|
49
|
+
new_value = number_to_phone(formatted_value, area_code: true) if formatted_value
|
50
|
+
else
|
51
|
+
new_value = configured_contact_value
|
52
|
+
end
|
53
|
+
pb_body = Playbook::PbBody::Body.new(color: "light") do
|
54
|
+
contact_type + new_value
|
55
|
+
end
|
56
|
+
ApplicationController.renderer.render(partial: pb_body, as: :object)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def formatted_value
|
61
|
+
configured_contact_value.to_s.gsub(/\D/, "")
|
62
|
+
end
|
63
|
+
|
64
|
+
def to_partial_path
|
65
|
+
"pb_contact/contact"
|
66
|
+
end
|
67
|
+
|
68
|
+
private
|
69
|
+
|
70
|
+
DEFAULT = Object.new
|
71
|
+
private_constant :DEFAULT
|
72
|
+
def default_configuration
|
73
|
+
DEFAULT
|
74
|
+
end
|
75
|
+
attr_accessor(*PROPS)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|