playbook_ui 14.14.0.pre.alpha.PBNTR894allowingcurrencyzero6405 → 14.14.0.pre.alpha.pbntr500currencykithandlingofnullvalues6275
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/pb_currency/_currency.tsx +2 -1
- data/app/pb_kits/playbook/pb_currency/currency.html.erb +1 -1
- data/app/pb_kits/playbook/pb_currency/currency.rb +2 -14
- data/app/pb_kits/playbook/pb_currency/docs/_currency_null_display.html.erb +1 -3
- data/app/pb_kits/playbook/pb_drawer/_drawer.scss +8 -32
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_default.html.erb +1 -20
- data/app/pb_kits/playbook/pb_drawer/docs/example.yml +0 -5
- data/app/pb_kits/playbook/pb_drawer/drawer.html.erb +12 -20
- data/app/pb_kits/playbook/pb_drawer/drawer.rb +1 -49
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +1 -1
- data/app/pb_kits/playbook/pb_icon_button/docs/example.yml +0 -4
- data/app/pb_kits/playbook/pb_overlay/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_overlay/overlay.html.erb +3 -5
- data/app/pb_kits/playbook/pb_overlay/overlay.rb +0 -9
- data/app/pb_kits/playbook/pb_progress_step/progress_step_item.html.erb +2 -2
- data/app/pb_kits/playbook/pb_select/select.rb +0 -8
- data/app/pb_kits/playbook/pb_text_input/inputMask.ts +3 -2
- data/app/pb_kits/playbook/pb_tooltip/_tooltip.scss +3 -0
- data/app/pb_kits/playbook/pb_tooltip/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_tooltip/index.js +2 -2
- data/app/pb_kits/playbook/pb_tooltip/tooltip.rb +2 -10
- data/dist/chunks/{_typeahead-DXmDhfga.js → _typeahead-PqkcDf1H.js} +2 -2
- data/dist/chunks/{_weekday_stacked-Cb1DOlft.js → _weekday_stacked-BhC8Xp9l.js} +3 -3
- data/dist/chunks/{lib-Fr78pbpF.js → lib-D3us1bGD.js} +1 -1
- data/dist/chunks/{pb_form_validation-CN51bfsD.js → pb_form_validation-BpihMSOQ.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +3 -3
- 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 +6 -29
- data/app/pb_kits/playbook/pb_currency/docs/_currency_null_display_rails.md +0 -1
- data/app/pb_kits/playbook/pb_currency/docs/_currency_null_display_react.md +0 -1
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_behavior.html.erb +0 -8
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_borders.html.erb +0 -33
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.html.erb +0 -0
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.html.erb +0 -24
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.html.erb +0 -21
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.md +0 -1
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_sizes.html.erb +0 -49
- data/app/pb_kits/playbook/pb_drawer/index.js +0 -257
- data/app/pb_kits/playbook/pb_icon_button/_icon_button.tsx +0 -71
- data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_default.jsx +0 -17
- data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_sizes.jsx +0 -61
- data/app/pb_kits/playbook/pb_icon_button/docs/index.js +0 -2
- data/app/pb_kits/playbook/pb_icon_button/icon_button.test.jsx +0 -39
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.html.erb +0 -11
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.md +0 -1
- data/app/pb_kits/playbook/pb_overlay/index.js +0 -61
- data/app/pb_kits/playbook/pb_select/index.js +0 -38
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_delay_rails.html.erb +0 -39
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_delay_rails.md +0 -3
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_interaction.html.erb +0 -26
- data/app/pb_kits/playbook/pb_tooltip/floating_ui.js +0 -282
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c6ef102f160200110b47477b34a9a06798b4ef4f1122151a12341775c20c9a5
|
4
|
+
data.tar.gz: 14eb41101975901c5f557d1d8b6721fc9301e9b54a30ec0c335b8717dccbe508
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 301d0b715331e1e388be9b554865dc59f79b88f5ef11f3a7f038554f215c7b72d6541465d027adcf0c8f9a0fea2dd4e9e1e6f608c6b0d9b9f5360fc52a70ffc8
|
7
|
+
data.tar.gz: 6e1bc33d1fbe6b1bebe4b112b42c73107685786fbc7ddd01df4f95fe302d015e1225edcfbe042e2931728dcd655fe97a9d3629417c639392fa3753a7cb533ee6
|
@@ -120,6 +120,7 @@ const Currency = (props: CurrencyProps): React.ReactElement => {
|
|
120
120
|
id={id}
|
121
121
|
>
|
122
122
|
<Caption dark={dark}>{label}</Caption>
|
123
|
+
|
123
124
|
<div className={`pb_currency_wrapper${variantClass || emphasizedClass}`}>
|
124
125
|
{unstyled ? (
|
125
126
|
nullDisplay && !amount ? (
|
@@ -174,7 +175,7 @@ const Currency = (props: CurrencyProps): React.ReactElement => {
|
|
174
175
|
)}
|
175
176
|
</div>
|
176
177
|
</div>
|
177
|
-
)
|
178
|
+
);
|
178
179
|
}
|
179
180
|
|
180
181
|
export default Currency
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<% end %>
|
12
12
|
<% else %>
|
13
13
|
<% if object.null_display && object.amount.blank? %>
|
14
|
-
<%= pb_rails("title", props: object.
|
14
|
+
<%= pb_rails("title", props: {text: object.null_display}) %>
|
15
15
|
<% else %>
|
16
16
|
<%= pb_rails("body", props: object.currency_wrapper_props) do %>
|
17
17
|
<%= object.negative_sign %><%= object.symbol %>
|
@@ -68,20 +68,10 @@ module Playbook
|
|
68
68
|
}
|
69
69
|
end
|
70
70
|
|
71
|
-
def title_text
|
72
|
-
if null_display
|
73
|
-
null_display
|
74
|
-
elsif swap_negative
|
75
|
-
absolute_amount(abbr_or_format_amount)
|
76
|
-
else
|
77
|
-
abbr_or_format_amount
|
78
|
-
end
|
79
|
-
end
|
80
|
-
|
81
71
|
def title_props
|
82
72
|
{
|
83
73
|
size: size_value,
|
84
|
-
text:
|
74
|
+
text: swap_negative ? absolute_amount(abbr_or_format_amount) : abbr_or_format_amount,
|
85
75
|
classname: "pb_currency_value",
|
86
76
|
dark: dark,
|
87
77
|
}
|
@@ -158,10 +148,8 @@ module Playbook
|
|
158
148
|
1
|
159
149
|
when "md"
|
160
150
|
3
|
161
|
-
when "sm"
|
162
|
-
4
|
163
151
|
else
|
164
|
-
|
152
|
+
4
|
165
153
|
end
|
166
154
|
end
|
167
155
|
|
@@ -3,7 +3,6 @@
|
|
3
3
|
label: "Nil",
|
4
4
|
margin_bottom: "md",
|
5
5
|
null_display: "--",
|
6
|
-
size: "sm"
|
7
6
|
}) %>
|
8
7
|
|
9
8
|
<%= pb_rails("currency", props: {
|
@@ -11,12 +10,11 @@
|
|
11
10
|
label: "Nil",
|
12
11
|
margin_bottom: "md",
|
13
12
|
null_display: "$0.00",
|
14
|
-
size: "sm"
|
15
13
|
}) %>
|
16
14
|
|
17
15
|
<%= pb_rails("currency", props: {
|
18
16
|
amount: "",
|
19
17
|
label: "Nil",
|
18
|
+
margin_bottom: "md",
|
20
19
|
null_display: " ",
|
21
|
-
size: "sm"
|
22
20
|
}) %>
|
@@ -134,6 +134,14 @@ body.PBDrawer__Body--close {
|
|
134
134
|
transition: margin-left $animation-duration ease-out, margin-right $animation-duration ease-out;
|
135
135
|
}
|
136
136
|
|
137
|
+
.pb_drawer_lg_left.pb_drawer {
|
138
|
+
transform: translateX(-100%);
|
139
|
+
}
|
140
|
+
|
141
|
+
.pb_drawer_lg_right.pb_drawer {
|
142
|
+
transform: translateX(100%);
|
143
|
+
}
|
144
|
+
|
137
145
|
.pb_drawer.pb_drawer_after_open {
|
138
146
|
pointer-events: auto;
|
139
147
|
transform: translate3d(0, 0, 0);
|
@@ -149,34 +157,6 @@ body.PBDrawer__Body--close {
|
|
149
157
|
animation-duration: $animation-duration;
|
150
158
|
outline: none;
|
151
159
|
|
152
|
-
&.pb_drawer_within_element_rails {
|
153
|
-
position: relative;
|
154
|
-
width: 100%;
|
155
|
-
display: block;
|
156
|
-
background-color: $white;
|
157
|
-
overflow: hidden;
|
158
|
-
|
159
|
-
// Use max-height for a smooth accordion-like animation
|
160
|
-
max-height: 0;
|
161
|
-
transition: max-height $animation-duration ease-in-out;
|
162
|
-
z-index: 1;
|
163
|
-
|
164
|
-
&.open {
|
165
|
-
max-height: 1000px;
|
166
|
-
}
|
167
|
-
|
168
|
-
&::before {
|
169
|
-
content: '';
|
170
|
-
position: absolute;
|
171
|
-
top: 0;
|
172
|
-
left: 0;
|
173
|
-
right: 0;
|
174
|
-
bottom: 0;
|
175
|
-
background-color: inherit;
|
176
|
-
z-index: -1;
|
177
|
-
}
|
178
|
-
}
|
179
|
-
|
180
160
|
&.pb_drawer_within_element {
|
181
161
|
position: relative;
|
182
162
|
width: 100%;
|
@@ -349,10 +329,6 @@ body.PBDrawer__Body--close {
|
|
349
329
|
opacity: 1;
|
350
330
|
pointer-events: none;
|
351
331
|
|
352
|
-
& .pb_drawer {
|
353
|
-
pointer-events: auto;
|
354
|
-
}
|
355
|
-
|
356
332
|
&_before_close {
|
357
333
|
height: 0;
|
358
334
|
}
|
@@ -1,20 +1 @@
|
|
1
|
-
<%= pb_rails("
|
2
|
-
<%= pb_rails("button", props: { text: "Left Drawer", margin_right: "sm", data: {"open-drawer": "drawer-1"} }) %>
|
3
|
-
|
4
|
-
<%= pb_rails("drawer", props: {
|
5
|
-
id:"drawer-1",
|
6
|
-
}) do %>
|
7
|
-
Test me (Left Drawer)
|
8
|
-
<% end %>
|
9
|
-
|
10
|
-
|
11
|
-
<%= pb_rails("button", props: { text: "Right Drawer", data: {"open-drawer": "drawer-2"} }) %>
|
12
|
-
|
13
|
-
<%= pb_rails("drawer", props: {
|
14
|
-
id:"drawer-2",
|
15
|
-
placement: "right"
|
16
|
-
}) do %>
|
17
|
-
Test me (Right Drawer)
|
18
|
-
<% end %>
|
19
|
-
<% end %>
|
20
|
-
|
1
|
+
<%= pb_rails("drawer") %>
|
@@ -1,20 +1,12 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
>
|
14
|
-
<div class="<%= overlay_classes %>" style="display:none;" id="drawer-overlay-<%= object.id %>">
|
15
|
-
<%= pb_content_tag do %>
|
16
|
-
<%= content %>
|
17
|
-
<% end %>
|
18
|
-
</div>
|
19
|
-
</div>
|
20
|
-
<% end %>
|
1
|
+
<!-- Go to pb_content_tag definition in kit_base.rb for usage information. Commented out options are default (showing the default shape), and each can be deleted if not customizing that param. -->
|
2
|
+
<!-- If using nonstandard params please un-comment out and replace with your custom params. -->
|
3
|
+
<%= pb_content_tag(
|
4
|
+
# :div,
|
5
|
+
# aria: object.aria,
|
6
|
+
# class: object.classname,
|
7
|
+
# data: object.data,
|
8
|
+
# id: object.id,
|
9
|
+
# **combined_html_options
|
10
|
+
) do %>
|
11
|
+
<span>DRAWER CONTENT</span>
|
12
|
+
<% end %>
|
@@ -2,55 +2,7 @@
|
|
2
2
|
|
3
3
|
module Playbook
|
4
4
|
module PbDrawer
|
5
|
-
class Drawer < Playbook::KitBase
|
6
|
-
prop :size, type: Playbook::Props::Enum,
|
7
|
-
values: %w[xs sm md lg xl full],
|
8
|
-
default: "md"
|
9
|
-
prop :placement, type: Playbook::Props::Enum,
|
10
|
-
values: %w[left right bottom],
|
11
|
-
default: "left"
|
12
|
-
prop :behavior, type: Playbook::Props::Enum,
|
13
|
-
values: %w[floating push],
|
14
|
-
default: "floating"
|
15
|
-
prop :overlay, type: Playbook::Props::Boolean,
|
16
|
-
default: true
|
17
|
-
prop :within_element, type: Playbook::Props::Boolean,
|
18
|
-
default: false
|
19
|
-
prop :border, type: Playbook::Props::Enum,
|
20
|
-
values: %w[full none right left],
|
21
|
-
default: "none"
|
22
|
-
prop :breakpoint, type: Playbook::Props::Enum,
|
23
|
-
values: %w[none xs sm md lg xl],
|
24
|
-
default: "none"
|
25
|
-
|
26
|
-
def classname
|
27
|
-
generate_classname("pb_drawer pb_drawer_#{size}_#{placement} #{within_class} #{border_classes}")
|
28
|
-
end
|
29
|
-
|
30
|
-
def border_classes
|
31
|
-
case border
|
32
|
-
when "full"
|
33
|
-
"drawer_border-full"
|
34
|
-
when "right"
|
35
|
-
"drawer_border-right"
|
36
|
-
when "left"
|
37
|
-
"drawer_border-left"
|
38
|
-
else
|
39
|
-
""
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
def overlay_close
|
44
|
-
!should_close_on_overlay_click ? "overlay_close" : ""
|
45
|
-
end
|
46
|
-
|
47
|
-
def within_class
|
48
|
-
within_element ? "pb_drawer_within_element_rails" : ""
|
49
|
-
end
|
50
|
-
|
51
|
-
def overlay_classes
|
52
|
-
"pb_drawer_#{overlay ? '' : 'no_'}overlay drawer_content_#{placement} pb_drawer_overlay_after_open #{overlay ? '' : 'no-background'}"
|
53
|
-
end
|
5
|
+
class Drawer < ::Playbook::KitBase
|
54
6
|
end
|
55
7
|
end
|
56
8
|
end
|
@@ -32,7 +32,7 @@
|
|
32
32
|
<%= form.url_field :example_url_field_validation, props: { label: true, required: true } %>
|
33
33
|
<%= form.text_area :example_text_area_validation, props: { label: true, required: true } %>
|
34
34
|
<%= form.dropdown_field :example_dropdown_validation, props: { label: true, options: example_dropdown_options, required: true } %>
|
35
|
-
<%= form.select :example_select_validation, [ ["Yes", 1], ["No", 2] ], props: { label: true, blank_selection: "Select One...", required: true
|
35
|
+
<%= form.select :example_select_validation, [ ["Yes", 1], ["No", 2] ], props: { label: true, blank_selection: "Select One...", required: true } %>
|
36
36
|
<%= form.collection_select :example_collection_select_validation, example_collection, :value, :name, props: { label: true, blank_selection: "Select One...", required: true } %>
|
37
37
|
<%= form.check_box :example_checkbox, props: { text: "Example Checkbox", label: true, required: true } %>
|
38
38
|
<%= form.date_picker :example_date_picker_2, props: { label: true, required: true } %>
|
@@ -16,14 +16,12 @@ id: object.id,
|
|
16
16
|
<% end %>
|
17
17
|
|
18
18
|
<% else %>
|
19
|
-
<div class="<%= previous_overlay_class_name %>"
|
19
|
+
<div class="<%= previous_overlay_class_name %>"></div>
|
20
20
|
|
21
|
-
|
22
|
-
<%= content.presence %>
|
23
|
-
</div>
|
21
|
+
<%= content.presence %>
|
24
22
|
|
25
23
|
<% if has_subsequent_overlay %>
|
26
|
-
<div class="<%= subsequent_overlay_class_name %>"
|
24
|
+
<div class="<%= subsequent_overlay_class_name %>"></div>
|
27
25
|
<% end %>
|
28
26
|
<% end %>
|
29
27
|
<% end %>
|
@@ -8,8 +8,6 @@ module Playbook
|
|
8
8
|
default: "card_light"
|
9
9
|
prop :layout, type: Playbook::Props::HashProp,
|
10
10
|
default: { "bottom": "full" }
|
11
|
-
prop :dynamic, type: Playbook::Props::Boolean,
|
12
|
-
default: false
|
13
11
|
|
14
12
|
def classname
|
15
13
|
generate_classname("pb_overlay")
|
@@ -107,13 +105,6 @@ module Playbook
|
|
107
105
|
"bg_dark": "#0a0527",
|
108
106
|
}
|
109
107
|
end
|
110
|
-
|
111
|
-
def data_attributes
|
112
|
-
data ||= {}
|
113
|
-
data.merge!("data-pb-overlay" => true)
|
114
|
-
data.merge!("data-overlay-dynamic" => true) if dynamic
|
115
|
-
data
|
116
|
-
end
|
117
108
|
end
|
118
109
|
end
|
119
110
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<%= pb_content_tag(:li) do %>
|
2
|
-
<div class="box" style="max-width: min-content;">
|
3
|
-
<div class="circle"
|
2
|
+
<div class="box" style="max-width: min-content;" id="<%= object.tooltip_trigger_class %>">
|
3
|
+
<div class="circle">
|
4
4
|
<%= pb_rails("icon", props: { icon: object.icon, size: "xs" }) if object.icon.present? %>
|
5
5
|
</div>
|
6
6
|
<% if object.tooltip.present? %>
|
@@ -21,7 +21,6 @@ module Playbook
|
|
21
21
|
prop :options, type: Playbook::Props::HashArray, required: false, default: []
|
22
22
|
prop :show_arrow, type: Playbook::Props::Boolean, default: false
|
23
23
|
prop :required, type: Playbook::Props::Boolean, default: false
|
24
|
-
prop :validation_message, type: Playbook::Props::String, default: ""
|
25
24
|
|
26
25
|
def classnames
|
27
26
|
classname + inline_class + compact_class + show_arrow_class
|
@@ -89,13 +88,6 @@ module Playbook
|
|
89
88
|
"app/pb_kits/playbook/utilities/icons/angle-down.svg"
|
90
89
|
end
|
91
90
|
|
92
|
-
def data_attributes
|
93
|
-
data = attributes[:data] || {}
|
94
|
-
data.merge!("data-pb-select" => true)
|
95
|
-
data.merge!("data-validation-message" => validation_message) if validation_message.present?
|
96
|
-
data
|
97
|
-
end
|
98
|
-
|
99
91
|
private
|
100
92
|
|
101
93
|
def error_class
|
@@ -17,7 +17,7 @@ const formatCurrencyDefaultValue = (value: string): string => {
|
|
17
17
|
|
18
18
|
// Parse the numeric value as a float to handle decimals
|
19
19
|
const dollars = parseFloat(numericValue)
|
20
|
-
if (isNaN(dollars)) return ''
|
20
|
+
if (isNaN(dollars) || dollars === 0) return ''
|
21
21
|
|
22
22
|
// Format as currency
|
23
23
|
return new Intl.NumberFormat('en-US', {
|
@@ -30,9 +30,10 @@ const formatCurrencyDefaultValue = (value: string): string => {
|
|
30
30
|
const formatCurrency = (value: string): string => {
|
31
31
|
const numericValue = value.replace(/[^0-9]/g, '').slice(0, 15)
|
32
32
|
|
33
|
-
if (!numericValue
|
33
|
+
if (!numericValue) return ''
|
34
34
|
|
35
35
|
const dollars = parseFloat((parseInt(numericValue) / 100).toFixed(2))
|
36
|
+
if (dollars === 0) return ''
|
36
37
|
|
37
38
|
return new Intl.NumberFormat('en-US', {
|
38
39
|
style: 'currency',
|
@@ -141,6 +141,7 @@ $tooltip_shadow: rgba(60, 106, 172, 0.18);
|
|
141
141
|
|
142
142
|
&[data-popper-placement="right"] {
|
143
143
|
box-shadow: -8px 0 28px 0 $tooltip_shadow;
|
144
|
+
margin: 0 0 0 $space_sm;
|
144
145
|
.arrow {
|
145
146
|
left: -18px;
|
146
147
|
right: auto;
|
@@ -155,6 +156,7 @@ $tooltip_shadow: rgba(60, 106, 172, 0.18);
|
|
155
156
|
|
156
157
|
&[data-popper-placement="bottom"] {
|
157
158
|
box-shadow: 0 -12px 28px 0 $tooltip_shadow;
|
159
|
+
margin: $space_sm 0 0 0;
|
158
160
|
.arrow {
|
159
161
|
top: -18px;
|
160
162
|
margin-bottom: 0;
|
@@ -167,6 +169,7 @@ $tooltip_shadow: rgba(60, 106, 172, 0.18);
|
|
167
169
|
|
168
170
|
&[data-popper-placement="left"] {
|
169
171
|
box-shadow: 8px 0 28px 0 $tooltip_shadow;
|
172
|
+
margin: 0 $space_sm 0 0;
|
170
173
|
.arrow {
|
171
174
|
margin-bottom: 0;
|
172
175
|
right: -18px;
|
@@ -2,10 +2,8 @@ examples:
|
|
2
2
|
|
3
3
|
rails:
|
4
4
|
- tooltip_default: Default
|
5
|
-
- tooltip_interaction: Content Interaction
|
6
5
|
- tooltip_selectors: Using Common Selectors
|
7
6
|
- tooltip_with_icon_circle: Icon Circle Tooltip
|
8
|
-
- tooltip_delay_rails: Delay
|
9
7
|
- tooltip_show_tooltip: Show Tooltip
|
10
8
|
|
11
9
|
react:
|
@@ -11,7 +11,7 @@ const TOOLTIP_TIMEOUT = 250
|
|
11
11
|
|
12
12
|
export default class PbTooltip extends PbEnhancedElement {
|
13
13
|
static get selector() {
|
14
|
-
return '[data-pb-tooltip-kit
|
14
|
+
return '[data-pb-tooltip-kit]'
|
15
15
|
}
|
16
16
|
|
17
17
|
connect() {
|
@@ -152,4 +152,4 @@ export default class PbTooltip extends PbEnhancedElement {
|
|
152
152
|
get triggerMethod() {
|
153
153
|
return this.element.dataset.pbTooltipTriggerMethod || 'hover'
|
154
154
|
}
|
155
|
-
}
|
155
|
+
}
|
@@ -7,10 +7,6 @@ module Playbook
|
|
7
7
|
prop :trigger_element_selector
|
8
8
|
prop :trigger_element_id, deprecated: true
|
9
9
|
prop :tooltip_id
|
10
|
-
prop :interaction, type: Playbook::Props::Boolean,
|
11
|
-
default: false
|
12
|
-
prop :delay_open
|
13
|
-
prop :delay_close
|
14
10
|
prop :dark, type: Playbook::Props::Boolean,
|
15
11
|
default: false
|
16
12
|
prop :trigger_method, type: Playbook::Props::Enum,
|
@@ -22,19 +18,15 @@ module Playbook
|
|
22
18
|
end
|
23
19
|
|
24
20
|
def data
|
25
|
-
|
21
|
+
Hash(values[:data]).merge(
|
26
22
|
pb_tooltip_kit: true,
|
27
23
|
pb_tooltip_position: position,
|
28
24
|
pb_tooltip_trigger_element_selector: trigger_element_selector,
|
29
25
|
pb_tooltip_trigger_element_id: trigger_element_id,
|
30
26
|
pb_tooltip_tooltip_id: tooltip_id,
|
31
27
|
pb_tooltip_show_tooltip: true,
|
32
|
-
pb_tooltip_trigger_method: trigger_method
|
33
|
-
pb_tooltip_interaction: interaction
|
28
|
+
pb_tooltip_trigger_method: trigger_method
|
34
29
|
)
|
35
|
-
data = data.merge(pb_tooltip_delay_open: delay_open) if delay_open
|
36
|
-
data = data.merge(pb_tooltip_delay_close: delay_close) if delay_close
|
37
|
-
data
|
38
30
|
end
|
39
31
|
|
40
32
|
private
|