playbook_ui 14.12.0.pre.alpha.PBNTR8335906 → 14.12.0.pre.alpha.PLAY1602lightboxoverlapnitrobugzindextoken5751
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_advanced_table/Components/TableHeaderCell.tsx +3 -10
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +10 -9
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +21 -34
- data/app/pb_kits/playbook/pb_advanced_table/index.js +6 -9
- data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +5 -8
- data/app/pb_kits/playbook/pb_avatar/_avatar.scss +0 -9
- data/app/pb_kits/playbook/pb_avatar/_avatar.tsx +7 -11
- data/app/pb_kits/playbook/pb_avatar/avatar.html.erb +7 -6
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_badge_component_overlay.jsx +3 -9
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_circle_icon_component_overlay.jsx +2 -6
- data/app/pb_kits/playbook/pb_button/button.rb +1 -1
- data/app/pb_kits/playbook/pb_copy_button/_copy_button.scss +1 -2
- data/app/pb_kits/playbook/pb_copy_button/docs/example.yml +3 -3
- data/app/pb_kits/playbook/pb_date/_date.tsx +4 -14
- data/app/pb_kits/playbook/pb_date/docs/_date_default.jsx +1 -2
- data/app/pb_kits/playbook/pb_date/docs/_date_unstyled.jsx +5 -13
- data/app/pb_kits/playbook/pb_file_upload/file_upload.html.erb +6 -1
- data/app/pb_kits/playbook/pb_filter/filter.html.erb +5 -1
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/index.js +5 -7
- data/app/pb_kits/playbook/pb_form_group/form_group.html.erb +6 -1
- data/app/pb_kits/playbook/pb_form_pill/form_pill.html.erb +1 -1
- data/app/pb_kits/playbook/pb_lightbox/lightbox.scss +7 -6
- data/app/pb_kits/playbook/pb_link/_link.tsx +0 -18
- data/app/pb_kits/playbook/pb_link/docs/example.yml +3 -5
- data/app/pb_kits/playbook/pb_link/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_link/link.html.erb +1 -1
- data/app/pb_kits/playbook/pb_link/link.rb +0 -6
- data/app/pb_kits/playbook/pb_link/link.test.jsx +0 -30
- data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_tooltip.html.erb +6 -6
- data/app/pb_kits/playbook/pb_table/docs/_table_with_background_kit.html.erb +9 -6
- data/app/pb_kits/playbook/pb_table/docs/_table_with_background_kit.jsx +9 -6
- data/app/pb_kits/playbook/pb_table/styles/_desktop_collapse.scss +0 -26
- data/app/pb_kits/playbook/pb_table/styles/_mobile.scss +1 -0
- data/app/pb_kits/playbook/pb_table/styles/_mobile_collapse.scss +0 -25
- data/app/pb_kits/playbook/pb_table/styles/_tablet_collapse.scss +0 -25
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_default.html.erb +1 -1
- data/app/pb_kits/playbook/pb_tooltip/index.js +27 -45
- data/app/pb_kits/playbook/pb_tooltip/tooltip.rb +1 -5
- data/app/pb_kits/playbook/pb_user/_user.tsx +0 -3
- data/app/pb_kits/playbook/pb_user/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_user/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_user/user.html.erb +1 -1
- data/app/pb_kits/playbook/pb_user/user.rb +0 -1
- data/app/pb_kits/playbook/pb_user/user.test.js +0 -14
- data/dist/chunks/{_typeahead-CkemExmL.js → _typeahead-BIhRQo8Q.js} +3 -3
- data/dist/chunks/_weekday_stacked-VKMYuo6-.js +45 -0
- data/dist/chunks/{lib-DjpLC8uO.js → lib-kMuhBuU7.js} +1 -1
- data/dist/chunks/{pb_form_validation-S56UaHZl.js → pb_form_validation-DBJ0wZuS.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +2 -2
- data/dist/playbook-doc.js +1 -1
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +7 -20
- data/app/pb_kits/playbook/pb_advanced_table/Utilities/ActionBarAnimationHelper.ts +0 -26
- data/app/pb_kits/playbook/pb_copy_button/copy_button.html.erb +0 -15
- data/app/pb_kits/playbook/pb_copy_button/copy_button.rb +0 -28
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_default.html.erb +0 -2
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.html.erb +0 -5
- data/app/pb_kits/playbook/pb_copy_button/index.js +0 -47
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close.html.erb +0 -58
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close_rails.md +0 -3
- data/app/pb_kits/playbook/pb_link/docs/_link_target.html.erb +0 -15
- data/app/pb_kits/playbook/pb_link/docs/_link_target.jsx +0 -29
- data/app/pb_kits/playbook/pb_user/docs/_user_light_weight.html.erb +0 -42
- data/app/pb_kits/playbook/pb_user/docs/_user_light_weight.jsx +0 -59
- data/app/pb_kits/playbook/pb_user/docs/_user_light_weight.md +0 -2
- data/dist/chunks/_weekday_stacked-CtSzPEH0.js +0 -45
- /data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/{_fixed_confirmation_toast_auto_close_react.md → _fixed_confirmation_toast_auto_close.md} +0 -0
@@ -2,18 +2,16 @@ import PbEnhancedElement from '../pb_enhanced_element'
|
|
2
2
|
|
3
3
|
export default class PbFixedConfirmationToast extends PbEnhancedElement {
|
4
4
|
static get selector() {
|
5
|
-
return '
|
5
|
+
return '.remove_toast'
|
6
6
|
}
|
7
7
|
|
8
8
|
connect() {
|
9
9
|
this.self = this.element
|
10
10
|
this.autoCloseToast(this.self)
|
11
11
|
|
12
|
-
|
13
|
-
this.self
|
14
|
-
|
15
|
-
})
|
16
|
-
}
|
12
|
+
this.self.addEventListener('click', () => {
|
13
|
+
this.removeToast(this.self)
|
14
|
+
})
|
17
15
|
}
|
18
16
|
|
19
17
|
removeToast(elem) {
|
@@ -34,4 +32,4 @@ export default class PbFixedConfirmationToast extends PbEnhancedElement {
|
|
34
32
|
}, autoCloseIntValue)
|
35
33
|
}
|
36
34
|
}
|
37
|
-
}
|
35
|
+
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<%=
|
1
|
+
<%= content_tag(:div, id: object.id, data: object.data, class: object.classname + object.size_class, tabindex: object.tabindex, **combined_html_options) do %>
|
2
2
|
<% if object.name.present? %>
|
3
3
|
<%= pb_rails("avatar", props: { name: object.name, image_url: object.avatar_url, size: "xxs" }) %>
|
4
4
|
<% if object.truncate %>
|
@@ -2,6 +2,7 @@
|
|
2
2
|
@import "../tokens/screen_sizes";
|
3
3
|
|
4
4
|
$slides-margin: $space-md;
|
5
|
+
$lightbox-z-index-floor: $z_10 !default;
|
5
6
|
|
6
7
|
.carousel {
|
7
8
|
|
@@ -13,7 +14,7 @@ $slides-margin: $space-md;
|
|
13
14
|
top: 0;
|
14
15
|
left: 0;
|
15
16
|
right: 0;
|
16
|
-
z-index:
|
17
|
+
z-index: $lightbox-z-index-floor + 99;
|
17
18
|
align-items: center;
|
18
19
|
transition: all .5s;
|
19
20
|
|
@@ -55,7 +56,7 @@ $slides-margin: $space-md;
|
|
55
56
|
justify-content: space-between;
|
56
57
|
flex-direction: column;
|
57
58
|
background-color: black;
|
58
|
-
z-index: 1;
|
59
|
+
z-index: $lightbox-z-index-floor + 1;
|
59
60
|
overflow: hidden;
|
60
61
|
}
|
61
62
|
|
@@ -63,7 +64,7 @@ $slides-margin: $space-md;
|
|
63
64
|
display: flex;
|
64
65
|
height: calc(100% - 120px);
|
65
66
|
width: 100%;
|
66
|
-
z-index: 1;
|
67
|
+
z-index: $lightbox-z-index-floor + 1;
|
67
68
|
|
68
69
|
[class^="react-transform-wrapper"] {
|
69
70
|
flex-shrink: 0;
|
@@ -87,7 +88,7 @@ $slides-margin: $space-md;
|
|
87
88
|
.carousel-arrow-left {
|
88
89
|
display: block;
|
89
90
|
position: absolute;
|
90
|
-
z-index: 4;
|
91
|
+
z-index: $lightbox-z-index-floor + 4;
|
91
92
|
top: 50%;
|
92
93
|
@media only screen and (max-width: $screen-xs-max) {
|
93
94
|
display: none;
|
@@ -97,7 +98,7 @@ $slides-margin: $space-md;
|
|
97
98
|
.carousel-arrow-right {
|
98
99
|
display: block;
|
99
100
|
position: absolute;
|
100
|
-
z-index: 4;
|
101
|
+
z-index: $lightbox-z-index-floor + 4;
|
101
102
|
top: 50%;
|
102
103
|
right: 0;
|
103
104
|
@media only screen and (max-width: $screen-xs-max) {
|
@@ -140,7 +141,7 @@ $slides-margin: $space-md;
|
|
140
141
|
width: 100vw;
|
141
142
|
padding: 3px;
|
142
143
|
overflow: scroll;
|
143
|
-
z-index: 20;
|
144
|
+
z-index: $lightbox-z-index-floor + 20;
|
144
145
|
&.centered {
|
145
146
|
justify-content: center;
|
146
147
|
}
|
@@ -19,9 +19,7 @@ type LinkProps = {
|
|
19
19
|
icon?: string,
|
20
20
|
iconRight?: string,
|
21
21
|
id?: string,
|
22
|
-
tabIndex?: number,
|
23
22
|
tag?: 'a' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'div',
|
24
|
-
target?: string,
|
25
23
|
text?: string,
|
26
24
|
underline?: boolean,
|
27
25
|
} & GlobalProps
|
@@ -39,9 +37,7 @@ const Link = (props: LinkProps): React.ReactElement => {
|
|
39
37
|
icon = '',
|
40
38
|
iconRight = '',
|
41
39
|
id = '',
|
42
|
-
tabIndex,
|
43
40
|
tag = 'a',
|
44
|
-
target = '',
|
45
41
|
text = '',
|
46
42
|
underline = false,
|
47
43
|
} = props
|
@@ -56,14 +52,6 @@ const Link = (props: LinkProps): React.ReactElement => {
|
|
56
52
|
)
|
57
53
|
const Tag = tag as keyof JSX.IntrinsicElements
|
58
54
|
|
59
|
-
const getTargetAttribute = () => {
|
60
|
-
if (target && href) {
|
61
|
-
return target
|
62
|
-
}
|
63
|
-
|
64
|
-
return undefined
|
65
|
-
}
|
66
|
-
|
67
55
|
const renderContent = () => (
|
68
56
|
<>
|
69
57
|
{icon && (
|
@@ -99,9 +87,6 @@ const Link = (props: LinkProps): React.ReactElement => {
|
|
99
87
|
<a
|
100
88
|
{...commonProps}
|
101
89
|
href={href}
|
102
|
-
rel={target !== 'child' ? 'noreferrer' : undefined}
|
103
|
-
tabIndex={tabIndex}
|
104
|
-
target={getTargetAttribute()}
|
105
90
|
>
|
106
91
|
{renderContent()}
|
107
92
|
</a>
|
@@ -111,9 +96,6 @@ const Link = (props: LinkProps): React.ReactElement => {
|
|
111
96
|
<a
|
112
97
|
{...commonProps}
|
113
98
|
href={href}
|
114
|
-
rel={target !== 'child' ? 'noreferrer' : undefined}
|
115
|
-
tabIndex={tabIndex}
|
116
|
-
target={getTargetAttribute()}
|
117
99
|
>
|
118
100
|
<Tag>{renderContent()}</Tag>
|
119
101
|
</a>
|
@@ -1,18 +1,16 @@
|
|
1
1
|
examples:
|
2
|
-
|
2
|
+
|
3
3
|
rails:
|
4
4
|
- link_color: Color
|
5
5
|
- link_underline: Underline
|
6
6
|
- link_icon: Icon
|
7
7
|
- link_disabled: Disabled
|
8
8
|
- link_tag: Tag
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
|
10
|
+
|
12
11
|
react:
|
13
12
|
- link_color: Color
|
14
13
|
- link_underline: Underline
|
15
14
|
- link_icon: Icon
|
16
15
|
- link_disabled: Disabled
|
17
16
|
- link_tag: Tag
|
18
|
-
- link_target: Target
|
@@ -2,5 +2,4 @@ export { default as LinkColor } from './_link_color.jsx'
|
|
2
2
|
export { default as LinkUnderline } from './_link_underline.jsx'
|
3
3
|
export { default as LinkIcon } from './_link_icon.jsx'
|
4
4
|
export { default as LinkDisabled } from './_link_disabled.jsx'
|
5
|
-
export { default as LinkTag } from './_link_tag.jsx'
|
6
|
-
export { default as LinkTarget } from './_link_target.jsx'
|
5
|
+
export { default as LinkTag } from './_link_tag.jsx'
|
@@ -11,11 +11,9 @@ module Playbook
|
|
11
11
|
prop :href
|
12
12
|
prop :icon
|
13
13
|
prop :icon_right
|
14
|
-
prop :tabindex
|
15
14
|
prop :tag, type: Playbook::Props::Enum,
|
16
15
|
values: %w[a h1 h2 h3 h4 h5 h6 p span div],
|
17
16
|
default: "a"
|
18
|
-
prop :target
|
19
17
|
prop :text
|
20
18
|
prop :underline, type: Playbook::Props::Boolean,
|
21
19
|
default: false
|
@@ -28,10 +26,6 @@ module Playbook
|
|
28
26
|
text
|
29
27
|
end
|
30
28
|
|
31
|
-
def target_attribute
|
32
|
-
target if target && href
|
33
|
-
end
|
34
|
-
|
35
29
|
private
|
36
30
|
|
37
31
|
def color_class
|
@@ -90,33 +90,3 @@ test('adds icon right', () => {
|
|
90
90
|
const icon = kit.querySelector('.pb_icon_kit')
|
91
91
|
expect(icon).toBeInTheDocument();
|
92
92
|
})
|
93
|
-
|
94
|
-
test('should render target prop', () => {
|
95
|
-
render(
|
96
|
-
<Link
|
97
|
-
data={{ testid: 'target-test' }}
|
98
|
-
href="https://playbook.powerapp.cloud/"
|
99
|
-
target="blank"
|
100
|
-
/>
|
101
|
-
)
|
102
|
-
|
103
|
-
const kit = screen.getByTestId('target-test')
|
104
|
-
|
105
|
-
expect(kit).toHaveAttribute('target', 'blank')
|
106
|
-
})
|
107
|
-
|
108
|
-
|
109
|
-
test('should render child target prop', () => {
|
110
|
-
render(
|
111
|
-
<Link
|
112
|
-
data={{ testid: 'target-test' }}
|
113
|
-
href="https://playbook.powerapp.cloud/"
|
114
|
-
tabIndex={0}
|
115
|
-
target="child"
|
116
|
-
/>
|
117
|
-
)
|
118
|
-
|
119
|
-
const kit = screen.getByTestId('target-test')
|
120
|
-
|
121
|
-
expect(kit).toHaveAttribute('target', 'child')
|
122
|
-
})
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<%= pb_rails("progress_step/progress_step_item", props: {status: "complete", classname: "tooltip-trigger-1", tooltip: "Tooltip for step 1", tooltip_position: "right", step_direction: "horizontal" }) do %>
|
3
3
|
step 1
|
4
4
|
<% end %>
|
5
|
-
<%= pb_rails("progress_step/progress_step_item", props: {status: "complete", classname: "tooltip-trigger-2", tooltip: "Tooltip for step 2",
|
5
|
+
<%= pb_rails("progress_step/progress_step_item", props: {status: "complete", classname: "tooltip-trigger-2", tooltip: "Tooltip for step 2", step_direction: "horizontal" }) do %>
|
6
6
|
step 2
|
7
7
|
<% end %>
|
8
8
|
<%= pb_rails("progress_step/progress_step_item", props: {status: "active", classname: "tooltip-trigger-3", tooltip: "Tooltip for step 3", tooltip_position: "left", step_direction: "horizontal" }) do %>
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<%= pb_rails("progress_step/progress_step_item", props: {status: "inactive", classname: "tooltip-trigger-4", tooltip: "Tooltip for step 4", tooltip_position: "bottom" }) do %>
|
12
12
|
step 4
|
13
13
|
<% end %>
|
14
|
-
<%= pb_rails("progress_step/progress_step_item", props: {status: "inactive", classname: "tooltip-trigger-5", tooltip: "Tooltip for step 5"
|
14
|
+
<%= pb_rails("progress_step/progress_step_item", props: {status: "inactive", classname: "tooltip-trigger-5", tooltip: "Tooltip for step 5" }) do %>
|
15
15
|
step 5
|
16
16
|
<% end %>
|
17
17
|
<% end %>
|
@@ -19,7 +19,7 @@
|
|
19
19
|
<br /><br />
|
20
20
|
|
21
21
|
<%= pb_rails("progress_step", props: {orientation: "vertical"}) do %>
|
22
|
-
<%= pb_rails("progress_step/progress_step_item", props: {status: "complete", classname: "tooltip-trigger-6", tooltip: "Tooltip step 1", step_direction: "vertical"
|
22
|
+
<%= pb_rails("progress_step/progress_step_item", props: {status: "complete", classname: "tooltip-trigger-6", tooltip: "Tooltip step 1", step_direction: "vertical" }) do %>
|
23
23
|
<% end %>
|
24
24
|
<%= pb_rails("progress_step/progress_step_item", props: {status: "active", classname: "tooltip-trigger-7", tooltip: "Tooltip step 2", tooltip_position: "left"}) do %>
|
25
25
|
<% end %>
|
@@ -31,10 +31,10 @@
|
|
31
31
|
|
32
32
|
<br /><br>
|
33
33
|
<%= pb_rails("progress_step",props:{ variant:"tracker", icon:true}) do %>
|
34
|
-
<%= pb_rails("progress_step/progress_step_item", props: {status: "complete", classname: "tooltip-trigger-10", tooltip: "The order has been received", step_direction: "horizontal" , tooltip_position: "right"
|
34
|
+
<%= pb_rails("progress_step/progress_step_item", props: {status: "complete", classname: "tooltip-trigger-10", tooltip: "The order has been received", step_direction: "horizontal" , tooltip_position: "right" }) do %>
|
35
35
|
<%= pb_rails("caption", props:{text: "Ordered"})%>
|
36
36
|
<% end %>
|
37
|
-
<%= pb_rails("progress_step/progress_step_item", props: {status: "active", classname: "tooltip-trigger-11", tooltip:"Item(s) have been shipped"
|
37
|
+
<%= pb_rails("progress_step/progress_step_item", props: {status: "active", classname: "tooltip-trigger-11", tooltip:"Item(s) have been shipped" }) do %>
|
38
38
|
<%= pb_rails("caption", props:{text: "Shipped"})%>
|
39
39
|
<% end %>
|
40
40
|
<%= pb_rails("progress_step/progress_step_item", props: {status: "inactive", classname: "tooltip-trigger-12", tooltip:"This step has not been reached", tooltip_position: "left" }) do %>
|
@@ -50,7 +50,7 @@
|
|
50
50
|
<%= pb_rails("progress_step/progress_step_item", props: {status: "active", icon: "exclamation-triangle", classname: "tooltip-trigger-14", tooltip: "More details needed before shipment", tooltip_position: "bottom" }) do %>
|
51
51
|
<%= pb_rails("caption", props:{text: "Shipped"})%>
|
52
52
|
<% end %>
|
53
|
-
<%= pb_rails("progress_step/progress_step_item", props: {status: "inactive", classname: "tooltip-trigger-15", tooltip: "This step is inactive"
|
53
|
+
<%= pb_rails("progress_step/progress_step_item", props: {status: "inactive", classname: "tooltip-trigger-15", tooltip: "This step is inactive"}) do %>
|
54
54
|
<%= pb_rails("caption", props:{text: "Out for Delivery"})%>
|
55
55
|
<% end %>
|
56
56
|
<%= pb_rails("progress_step/progress_step_item", props: {status: "inactive", classname: "tooltip-trigger-16", tooltip: "Estimated delivery: Jun 27", tooltip_position: "left"}) do %>
|
@@ -39,17 +39,20 @@
|
|
39
39
|
</tr>
|
40
40
|
</tbody>
|
41
41
|
<% end %>
|
42
|
+
|
42
43
|
<%= pb_rails("table", props: { size: "sm", margin_bottom: "lg" }) do %>
|
43
44
|
<colgroup>
|
44
45
|
<%= pb_rails("background", props: { background_color: "error_subtle", tag: "col" }) %>
|
45
|
-
<%= pb_rails("background", props: { background_color: "
|
46
|
+
<%= pb_rails("background", props: { background_color: "card_light", tag: "col" }) %>
|
46
47
|
<%= pb_rails("background", props: { background_color: "warning_subtle", tag: "col" }) %>
|
47
48
|
</colgroup>
|
48
|
-
|
49
|
-
<
|
50
|
-
|
51
|
-
|
52
|
-
|
49
|
+
<%= pb_rails("background", props: { background_color: "card_light", tag: "thead" }) do %>
|
50
|
+
<tr>
|
51
|
+
<th>Column 1</th>
|
52
|
+
<th>Column 2</th>
|
53
|
+
<th>Column 3</th>
|
54
|
+
</tr>
|
55
|
+
<% end %>
|
53
56
|
<tbody>
|
54
57
|
<tr>
|
55
58
|
<td>Value 1</td>
|
@@ -68,7 +68,7 @@ const TableWithBackgroundKit = (props) => {
|
|
68
68
|
tag='col'
|
69
69
|
/>
|
70
70
|
<Background
|
71
|
-
backgroundColor="
|
71
|
+
backgroundColor="card_light"
|
72
72
|
tag='col'
|
73
73
|
/>
|
74
74
|
<Background
|
@@ -76,13 +76,16 @@ const TableWithBackgroundKit = (props) => {
|
|
76
76
|
tag='col'
|
77
77
|
/>
|
78
78
|
</colgroup>
|
79
|
-
<
|
79
|
+
<Background
|
80
|
+
backgroundColor="card_light"
|
81
|
+
tag='thead'
|
82
|
+
>
|
80
83
|
<tr>
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
+
<th>{'Column 1'}</th>
|
85
|
+
<th>{'Column 2'}</th>
|
86
|
+
<th>{'Column 3'}</th>
|
84
87
|
</tr>
|
85
|
-
</
|
88
|
+
</Background>
|
86
89
|
<tbody>
|
87
90
|
<tr>
|
88
91
|
<td>{'Value 1'}</td>
|
@@ -74,31 +74,6 @@
|
|
74
74
|
&.table-card {
|
75
75
|
background: none !important;
|
76
76
|
|
77
|
-
&.dark {
|
78
|
-
tbody, .pb_table_tbody {
|
79
|
-
tr, .pb_table_tr {
|
80
|
-
td, .pb_table_td {
|
81
|
-
background: $bg_dark_card !important;
|
82
|
-
border-color: $border_dark !important;
|
83
|
-
&:before {
|
84
|
-
color: $text_dk_light !important;
|
85
|
-
}
|
86
|
-
&:after {
|
87
|
-
height: 0;
|
88
|
-
background-color: transparent;
|
89
|
-
}
|
90
|
-
|
91
|
-
&:first-child {
|
92
|
-
border-radius: $border_rad_light $border_rad_light 0 0 !important;
|
93
|
-
}
|
94
|
-
&:last-child {
|
95
|
-
border-radius: 0 0 $border_rad_light $border_rad_light !important;
|
96
|
-
}
|
97
|
-
}
|
98
|
-
}
|
99
|
-
}
|
100
|
-
}
|
101
|
-
|
102
77
|
tbody, .pb_table_tbody {
|
103
78
|
tr, .pb_table_tr {
|
104
79
|
td, .pb_table_td {
|
@@ -106,7 +81,6 @@
|
|
106
81
|
border-left-width: 1px !important;
|
107
82
|
border-right-width: 1px !important;
|
108
83
|
border-top-width: 1px !important;
|
109
|
-
|
110
84
|
&:after {
|
111
85
|
height: 0;
|
112
86
|
background-color: transparent;
|
@@ -74,31 +74,6 @@
|
|
74
74
|
&.table-card {
|
75
75
|
background: none !important;
|
76
76
|
|
77
|
-
&.dark {
|
78
|
-
tbody, .pb_table_tbody {
|
79
|
-
tr, .pb_table_tr {
|
80
|
-
td, .pb_table_td {
|
81
|
-
background: $bg_dark_card !important;
|
82
|
-
border-color: $border_dark !important;
|
83
|
-
&:before {
|
84
|
-
color: $text_dk_light !important;
|
85
|
-
}
|
86
|
-
&:after {
|
87
|
-
height: 0;
|
88
|
-
background-color: transparent;
|
89
|
-
}
|
90
|
-
|
91
|
-
&:first-child {
|
92
|
-
border-radius: $border_rad_light $border_rad_light 0 0 !important;
|
93
|
-
}
|
94
|
-
&:last-child {
|
95
|
-
border-radius: 0 0 $border_rad_light $border_rad_light !important;
|
96
|
-
}
|
97
|
-
}
|
98
|
-
}
|
99
|
-
}
|
100
|
-
}
|
101
|
-
|
102
77
|
tbody, .pb_table_tbody {
|
103
78
|
tr, .pb_table_tr {
|
104
79
|
td, .pb_table_td {
|
@@ -74,31 +74,6 @@
|
|
74
74
|
&.table-card {
|
75
75
|
background: none !important;
|
76
76
|
|
77
|
-
&.dark {
|
78
|
-
tbody, .pb_table_tbody {
|
79
|
-
tr, .pb_table_tr {
|
80
|
-
td, .pb_table_td {
|
81
|
-
background: $bg_dark_card !important;
|
82
|
-
border-color: $border_dark !important;
|
83
|
-
&:before {
|
84
|
-
color: $text_dk_light !important;
|
85
|
-
}
|
86
|
-
&:after {
|
87
|
-
height: 0;
|
88
|
-
background-color: transparent;
|
89
|
-
}
|
90
|
-
|
91
|
-
&:first-child {
|
92
|
-
border-radius: $border_rad_light $border_rad_light 0 0 !important;
|
93
|
-
}
|
94
|
-
&:last-child {
|
95
|
-
border-radius: 0 0 $border_rad_light $border_rad_light !important;
|
96
|
-
}
|
97
|
-
}
|
98
|
-
}
|
99
|
-
}
|
100
|
-
}
|
101
|
-
|
102
77
|
tbody, .pb_table_tbody {
|
103
78
|
tr, .pb_table_tr {
|
104
79
|
td, .pb_table_td {
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import PbEnhancedElement from '../pb_enhanced_element'
|
2
|
+
|
2
3
|
import {
|
3
4
|
createPopperLite as createPopper,
|
4
5
|
flip,
|
@@ -16,34 +17,27 @@ export default class PbTooltip extends PbEnhancedElement {
|
|
16
17
|
|
17
18
|
connect() {
|
18
19
|
this.triggerElements.forEach((trigger) => {
|
19
|
-
|
20
|
-
|
21
|
-
if (method === 'click') {
|
22
|
-
trigger.addEventListener('click', () => {
|
20
|
+
trigger.addEventListener('mouseenter', () => {
|
21
|
+
this.mouseenterTimeout = setTimeout(() => {
|
23
22
|
this.showTooltip(trigger)
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
this.showTooltip(trigger)
|
29
|
-
this.checkCloseTooltip(trigger)
|
30
|
-
}, TOOLTIP_TIMEOUT)
|
31
|
-
|
32
|
-
trigger.addEventListener('mouseleave', () => {
|
33
|
-
clearTimeout(this.mouseenterTimeout)
|
34
|
-
setTimeout(() => {
|
35
|
-
this.hideTooltip()
|
36
|
-
}, 0)
|
37
|
-
}, { once: true })
|
38
|
-
})
|
39
|
-
|
40
|
-
this.tooltip.addEventListener('mouseenter', () => {
|
23
|
+
this.checkCloseTooltip(trigger)
|
24
|
+
}, TOOLTIP_TIMEOUT)
|
25
|
+
|
26
|
+
trigger.addEventListener('mouseleave', () => {
|
41
27
|
clearTimeout(this.mouseenterTimeout)
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
28
|
+
|
29
|
+
setTimeout(() => {
|
30
|
+
this.hideTooltip()
|
31
|
+
}, 0)
|
32
|
+
}, { once: true })
|
33
|
+
})
|
34
|
+
})
|
35
|
+
|
36
|
+
this.tooltip.addEventListener('mouseenter', () => {
|
37
|
+
clearTimeout(this.mouseenterTimeout)
|
38
|
+
})
|
39
|
+
this.tooltip.addEventListener('mouseleave', () => {
|
40
|
+
this.hideTooltip()
|
47
41
|
})
|
48
42
|
}
|
49
43
|
|
@@ -60,7 +54,7 @@ export default class PbTooltip extends PbEnhancedElement {
|
|
60
54
|
}
|
61
55
|
|
62
56
|
showTooltip(trigger) {
|
63
|
-
if (this.shouldShowTooltip ===
|
57
|
+
if (this.shouldShowTooltip === "false") return
|
64
58
|
|
65
59
|
this.popper = createPopper(trigger, this.tooltip, {
|
66
60
|
placement: this.position,
|
@@ -84,13 +78,6 @@ export default class PbTooltip extends PbEnhancedElement {
|
|
84
78
|
],
|
85
79
|
})
|
86
80
|
this.tooltip.classList.add('show')
|
87
|
-
|
88
|
-
if (this.triggerMethod === 'click') {
|
89
|
-
clearTimeout(this.autoHideTimeout)
|
90
|
-
this.autoHideTimeout = setTimeout(() => {
|
91
|
-
this.hideTooltip()
|
92
|
-
}, 1000)
|
93
|
-
}
|
94
81
|
}
|
95
82
|
|
96
83
|
hideTooltip() {
|
@@ -107,26 +94,25 @@ export default class PbTooltip extends PbEnhancedElement {
|
|
107
94
|
let triggerEl
|
108
95
|
|
109
96
|
if (this.triggerElementId) {
|
110
|
-
triggerEl = document.querySelector(`#${this.triggerElementId}`)
|
97
|
+
triggerEl = document.querySelector(`#${this.triggerElementId}`) //deprecated
|
111
98
|
} else {
|
112
99
|
const selectorIsId = this.triggerElementSelector.indexOf('#') > -1
|
113
|
-
triggerEl = selectorIsId
|
114
|
-
|
115
|
-
: document.querySelectorAll(`${this.triggerElementSelector}`)
|
100
|
+
triggerEl = selectorIsId ? document.querySelector(`${this.triggerElementSelector}`) :
|
101
|
+
document.querySelectorAll(`${this.triggerElementSelector}`)
|
116
102
|
}
|
117
103
|
|
118
104
|
if (!triggerEl) {
|
105
|
+
/* eslint no-console: ["error", { allow: ["warn", "error"] }] */
|
119
106
|
console.error('Tooltip Kit: an invalid or unavailable DOM reference was provided!')
|
120
107
|
return []
|
121
108
|
}
|
122
109
|
|
123
110
|
if (!triggerEl.length) triggerEl = [triggerEl]
|
124
|
-
return
|
111
|
+
return this._triggerElements = (this._triggerElements || triggerEl)
|
125
112
|
}
|
126
113
|
|
127
114
|
get tooltip() {
|
128
|
-
return (this._tooltip
|
129
|
-
this._tooltip || this.element.querySelector(`#${this.tooltipId}`))
|
115
|
+
return this._tooltip = (this._tooltip || this.element.querySelector(`#${this.tooltipId}`))
|
130
116
|
}
|
131
117
|
|
132
118
|
get position() {
|
@@ -148,8 +134,4 @@ export default class PbTooltip extends PbEnhancedElement {
|
|
148
134
|
get shouldShowTooltip() {
|
149
135
|
return this.element.dataset.pbTooltipShowTooltip
|
150
136
|
}
|
151
|
-
|
152
|
-
get triggerMethod() {
|
153
|
-
return this.element.dataset.pbTooltipTriggerMethod || 'hover'
|
154
|
-
}
|
155
137
|
}
|
@@ -9,9 +9,6 @@ module Playbook
|
|
9
9
|
prop :tooltip_id
|
10
10
|
prop :dark, type: Playbook::Props::Boolean,
|
11
11
|
default: false
|
12
|
-
prop :trigger_method, type: Playbook::Props::Enum,
|
13
|
-
values: %w[hover click],
|
14
|
-
default: "hover"
|
15
12
|
|
16
13
|
def classname
|
17
14
|
generate_classname("pb_tooltip_kit", dark_class)
|
@@ -24,8 +21,7 @@ module Playbook
|
|
24
21
|
pb_tooltip_trigger_element_selector: trigger_element_selector,
|
25
22
|
pb_tooltip_trigger_element_id: trigger_element_id,
|
26
23
|
pb_tooltip_tooltip_id: tooltip_id,
|
27
|
-
pb_tooltip_show_tooltip: true
|
28
|
-
pb_tooltip_trigger_method: trigger_method
|
24
|
+
pb_tooltip_show_tooltip: true
|
29
25
|
)
|
30
26
|
end
|
31
27
|
|
@@ -13,7 +13,6 @@ type UserProps = {
|
|
13
13
|
aria?: {[key: string]: string},
|
14
14
|
avatar?: boolean,
|
15
15
|
avatarUrl?: string,
|
16
|
-
bold?: boolean,
|
17
16
|
className?: string,
|
18
17
|
dark?: boolean,
|
19
18
|
data?: {[key: string]: string},
|
@@ -33,7 +32,6 @@ const User = (props: UserProps): React.ReactElement => {
|
|
33
32
|
aria = {},
|
34
33
|
avatar = false,
|
35
34
|
avatarUrl,
|
36
|
-
bold = true,
|
37
35
|
className,
|
38
36
|
dark = false,
|
39
37
|
data = {},
|
@@ -77,7 +75,6 @@ const User = (props: UserProps): React.ReactElement => {
|
|
77
75
|
}
|
78
76
|
<div className="content_wrapper">
|
79
77
|
<Title
|
80
|
-
bold={bold}
|
81
78
|
dark={dark}
|
82
79
|
size={size == 'lg' ? 3 : 4}
|
83
80
|
text={name}
|