playbook_ui 14.15.0.pre.alpha.play1757pbcontenttag6677 → 14.15.0.pre.alpha.play1854reacthookmultilvlselect6572
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_advanced_table/_advanced_table.scss +0 -7
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +1 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +1 -1
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +1 -1
- data/app/pb_kits/playbook/pb_icon_button/_icon_button.tsx +1 -1
- data/app/pb_kits/playbook/pb_icon_button/icon_button.html.erb +1 -1
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +0 -12
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_react_hook.md +1 -1
- data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.rb +1 -1
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +0 -6
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_default.html.erb +1 -1
- data/app/pb_kits/playbook/pb_phone_number_input/docs/example.yml +1 -3
- data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.rb +0 -3
- data/app/pb_kits/playbook/pb_popover/_popover.tsx +1 -1
- data/app/pb_kits/playbook/pb_popover/popover.test.js +1 -1
- data/app/pb_kits/playbook/pb_text_input/inputMask.ts +3 -2
- data/app/pb_kits/playbook/pb_textarea/textarea.html.erb +5 -1
- data/app/pb_kits/playbook/pb_time/time.html.erb +5 -1
- data/app/pb_kits/playbook/pb_title/title.html.erb +6 -1
- data/app/pb_kits/playbook/pb_toggle/toggle.html.erb +6 -1
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_icon.erb +10 -0
- data/app/pb_kits/playbook/pb_tooltip/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +4 -16
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async_custom_options.jsx +1 -1
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async_users.jsx +1 -1
- data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_typeahead/docs/index.js +0 -1
- data/dist/chunks/_typeahead-DKSD8vAY.js +36 -0
- data/dist/chunks/{_weekday_stacked-BVO5G6au.js → _weekday_stacked-C-GXG8yh.js} +2 -2
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +1 -1
- 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 +5 -11
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_inline_editing.jsx +0 -102
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_inline_editing.md +0 -4
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_hidden_inputs.html.erb +0 -5
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_hidden_inputs.md +0 -1
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_icon_rails.html.erb +0 -22
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_react_hook.jsx +0 -66
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_react_hook.md +0 -1
- data/dist/chunks/_typeahead-B8f4HM8I.js +0 -36
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 490e06dd4cafd132cf385ecbb9c648ba507870bc063cbcd04f3c079be70dad6e
|
4
|
+
data.tar.gz: 5bdf49498aca37b53ca14af0895ad20676e22bebdb97d988c8f2e9f9ed8e300a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b7ba9cdef8ac50cb46523b4f9f12273639fcfc389641803959b5a231633346336ca90bea21e72601528b80a3122fffb22865f5542b5c41a23c3b8ddc01a3e23
|
7
|
+
data.tar.gz: 3d2a14ba0096a4cf98b164ffa456168834219f9d087b22d3067939237d021e7f9726238c4e51319f63c9a63645cff456a54aa12a4b0da703117b9c9da20e7e8b
|
@@ -36,5 +36,4 @@ examples:
|
|
36
36
|
- advanced_table_selectable_rows: Selectable Rows
|
37
37
|
- advanced_table_selectable_rows_no_subrows: Selectable Rows (No Subrows)
|
38
38
|
- advanced_table_selectable_rows_actions: Selectable Rows (With Actions)
|
39
|
-
- advanced_table_selectable_rows_header: Selectable Rows (No Actions Bar)
|
40
|
-
- advanced_table_inline_editing: Inline Cell Editing
|
39
|
+
- advanced_table_selectable_rows_header: Selectable Rows (No Actions Bar)
|
@@ -20,5 +20,4 @@ export { default as AdvancedTableNoSubrows } from './_advanced_table_no_subrows.
|
|
20
20
|
export { default as AdvancedTableSelectableRowsHeader } from './_advanced_table_selectable_rows_header.jsx'
|
21
21
|
export { default as AdvancedTableSelectableRowsActions } from './_advanced_table_selectable_rows_actions.jsx'
|
22
22
|
export { default as AdvancedTableTablePropsStickyHeader } from './_advanced_table_table_props_sticky_header.jsx'
|
23
|
-
export { default as AdvancedTableColumnHeadersCustomCell } from './_advanced_table_column_headers_custom_cell.jsx'
|
24
|
-
export { default as AdvancedTableInlineEditing } from './_advanced_table_inline_editing.jsx'
|
23
|
+
export { default as AdvancedTableColumnHeadersCustomCell } from './_advanced_table_column_headers_custom_cell.jsx'
|
@@ -25,7 +25,7 @@
|
|
25
25
|
<%= pb_form_with(scope: :example, url: "", method: :get) do |form| %>
|
26
26
|
<%= form.typeahead :example_typeahead, props: { data: { typeahead_example1: true, user: {} }, label: true, placeholder: "Search for a user" } %>
|
27
27
|
<%= form.text_field :example_text_field, props: { label: true } %>
|
28
|
-
<%= form.phone_number_field :example_phone_number_field, props: { label: "Example phone field"
|
28
|
+
<%= form.phone_number_field :example_phone_number_field, props: { label: "Example phone field" } %>
|
29
29
|
<%= form.email_field :example_email_field, props: { label: true } %>
|
30
30
|
<%= form.number_field :example_number_field, props: { label: true } %>
|
31
31
|
<%= form.search_field :example_search_field, props: { label: true } %>
|
@@ -24,7 +24,7 @@
|
|
24
24
|
<%= pb_form_with(scope: :example, method: :get, url: "", validate: true) do |form| %>
|
25
25
|
<%= form.typeahead :example_typeahead_validation, props: { data: { typeahead_example2: true, user: {} }, label: true, placeholder: "Search for a user", required: true, validation: { message: "Please select a user." } } %>
|
26
26
|
<%= form.text_field :example_text_field_validation, props: { label: true, required: true } %>
|
27
|
-
<%= form.phone_number_field :example_phone_number_field_validation, props: { label: "Example phone field"
|
27
|
+
<%= form.phone_number_field :example_phone_number_field_validation, props: { label: "Example phone field" } %>
|
28
28
|
<%= form.email_field :example_email_field_validation, props: { label: true, required: true } %>
|
29
29
|
<%= form.number_field :example_number_field_validation, props: { label: true, required: true } %>
|
30
30
|
<%= form.search_field :example_project_number_validation, props: { label: true, required: true, validation: { pattern: "[0-9]{2}-[0-9]{5}", message: "Please enter a valid project number (example: 33-12345)." } } %>
|
@@ -473,18 +473,6 @@ const MultiLevelSelect = forwardRef<HTMLInputElement, MultiLevelSelectProps>((pr
|
|
473
473
|
))
|
474
474
|
: null}
|
475
475
|
|
476
|
-
{!returnAllSelected
|
477
|
-
? defaultReturn.map((item) => (
|
478
|
-
<input
|
479
|
-
disabled={disabled}
|
480
|
-
key={item.id}
|
481
|
-
name={`${name}[]`}
|
482
|
-
type="hidden"
|
483
|
-
value={item.id}
|
484
|
-
/>
|
485
|
-
))
|
486
|
-
: null}
|
487
|
-
|
488
476
|
{returnAllSelected &&
|
489
477
|
returnedArray.length !== 0 &&
|
490
478
|
inputDisplay === "pills"
|
@@ -1 +1 @@
|
|
1
|
-
You can pass `react-hook-form` props to the
|
1
|
+
You can pass `react-hook-form` props to the Typeahead kit. Check your console to see the full data selected from this example.
|
@@ -23,7 +23,6 @@ type PhoneNumberInputProps = {
|
|
23
23
|
data?: { [key: string]: string },
|
24
24
|
disabled?: boolean,
|
25
25
|
error?: string,
|
26
|
-
hiddenInputs?: boolean,
|
27
26
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
28
27
|
id?: string,
|
29
28
|
initialCountry?: string,
|
@@ -73,7 +72,6 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.MutableRefOb
|
|
73
72
|
dark = false,
|
74
73
|
data = {},
|
75
74
|
disabled = false,
|
76
|
-
hiddenInputs = false,
|
77
75
|
htmlOptions = {},
|
78
76
|
id = "",
|
79
77
|
initialCountry = "",
|
@@ -245,10 +243,6 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.MutableRefOb
|
|
245
243
|
countrySearch: false,
|
246
244
|
fixDropdownWidth: false,
|
247
245
|
formatAsYouType: formatAsYouType,
|
248
|
-
hiddenInput: hiddenInputs ? () => ({
|
249
|
-
phone: `${name}_full`,
|
250
|
-
country: `${name}_country_code`,
|
251
|
-
}) : null,
|
252
246
|
})
|
253
247
|
|
254
248
|
itiRef.current = telInputInit;
|
@@ -16,6 +16,4 @@ examples:
|
|
16
16
|
- phone_number_input_initial_country: Initial Country
|
17
17
|
- phone_number_input_only_countries: Limited Countries
|
18
18
|
- phone_number_input_validation: Form Validation
|
19
|
-
- phone_number_input_format: Format as You Type
|
20
|
-
- phone_number_input_hidden_inputs: Hidden Inputs
|
21
|
-
|
19
|
+
- phone_number_input_format: Format as You Type
|
@@ -23,8 +23,6 @@ module Playbook
|
|
23
23
|
default: ""
|
24
24
|
prop :format_as_you_type, type: Playbook::Props::Boolean,
|
25
25
|
default: false
|
26
|
-
prop :hidden_inputs, type: Playbook::Props::Boolean,
|
27
|
-
default: false
|
28
26
|
|
29
27
|
def classname
|
30
28
|
generate_classname("pb_phone_number_input")
|
@@ -37,7 +35,6 @@ module Playbook
|
|
37
35
|
disabled: disabled,
|
38
36
|
error: error,
|
39
37
|
formatAsYouType: format_as_you_type,
|
40
|
-
hiddenInputs: hidden_inputs,
|
41
38
|
initialCountry: initial_country,
|
42
39
|
label: label,
|
43
40
|
name: name,
|
@@ -84,7 +84,7 @@ const Popover = (props: PbPopoverProps) => {
|
|
84
84
|
} = props;
|
85
85
|
|
86
86
|
const items = globalProps(props).split(' ')
|
87
|
-
const filteredItems = items.filter(item => !item.includes('
|
87
|
+
const filteredItems = items.filter(item => !item.includes('min_width'))
|
88
88
|
const filteredGlobalProps = filteredItems.join(' ')
|
89
89
|
const popoverSpacing =
|
90
90
|
filteredGlobalProps.includes("dark") || !filteredGlobalProps
|
@@ -181,7 +181,7 @@ const PopoverTestClicktoClose3 = () => {
|
|
181
181
|
const btn = screen.getByText(/click me/i)
|
182
182
|
fireEvent.click(btn);
|
183
183
|
const kit = screen.getByText("Click Anywhere");
|
184
|
-
expect(kit).toHaveClass("pb_popover_body
|
184
|
+
expect(kit).toHaveClass("pb_popover_body max_width_240px overflow_handling");
|
185
185
|
});
|
186
186
|
|
187
187
|
test("closes Popover on click anywhere", async () => {
|
@@ -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',
|
@@ -1,4 +1,8 @@
|
|
1
|
-
<%=
|
1
|
+
<%= content_tag(:div,
|
2
|
+
id: object.id,
|
3
|
+
data: object.data,
|
4
|
+
class: object.classname,
|
5
|
+
**combined_html_options) do %>
|
2
6
|
<% if object.label.present? %>
|
3
7
|
<%= pb_rails("caption", props: {text: object.label, dark: object.dark}) %>
|
4
8
|
<% end %>
|
@@ -1,2 +1,7 @@
|
|
1
|
-
<%=
|
1
|
+
<%= content_tag(object.tag,
|
2
|
+
aria: object.aria,
|
3
|
+
id: object.id,
|
4
|
+
data: object.data,
|
5
|
+
class: object.classname,
|
6
|
+
**combined_html_options) do %><%= content.presence || object.text %><% end %>
|
2
7
|
|
@@ -1,4 +1,9 @@
|
|
1
|
-
<%=
|
1
|
+
<%= content_tag(:div,
|
2
|
+
id: object.id,
|
3
|
+
data: object.data,
|
4
|
+
aria: object.aria,
|
5
|
+
class: object.classname,
|
6
|
+
**combined_html_options) do %>
|
2
7
|
<label class="pb_toggle_wrapper">
|
3
8
|
<%= content.presence || object.input %>
|
4
9
|
<div class="pb_toggle_control"></div>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<%= pb_rails("icon_circle", props: { icon: "paper-plane", id: "result-1-sample-email-link" }) %>
|
2
|
+
|
3
|
+
<%= pb_rails("tooltip", props: {
|
4
|
+
trigger_element_id: "result-1-sample-email-link",
|
5
|
+
tooltip_id: "sample-email-tooltip-result-1",
|
6
|
+
position: "top",
|
7
|
+
dark: true
|
8
|
+
}) do %>
|
9
|
+
Send Email
|
10
|
+
<% end %>
|
@@ -4,7 +4,6 @@ examples:
|
|
4
4
|
- tooltip_default: Default
|
5
5
|
- tooltip_interaction: Content Interaction
|
6
6
|
- tooltip_selectors: Using Common Selectors
|
7
|
-
- tooltip_icon_rails: Tooltip with Icon
|
8
7
|
- tooltip_with_icon_circle: Icon Circle Tooltip
|
9
8
|
- tooltip_delay_rails: Delay
|
10
9
|
- tooltip_show_tooltip: Show Tooltip
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React, { useState, useEffect
|
1
|
+
import React, { useState, useEffect} from 'react'
|
2
2
|
import Select from 'react-select'
|
3
3
|
import AsyncSelect from 'react-select/async'
|
4
4
|
import CreateableSelect from 'react-select/creatable'
|
@@ -49,7 +49,6 @@ type TypeaheadProps = {
|
|
49
49
|
options?: Array<{ label: string; value?: string }>,
|
50
50
|
marginBottom?: "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl",
|
51
51
|
pillColor?: "primary" | "neutral" | "success" | "warning" | "error" | "info" | "data_1" | "data_2" | "data_3" | "data_4" | "data_5" | "data_6" | "data_7" | "data_8" | "windows" | "siding" | "roofing" | "doors" | "gutters" | "solar" | "insulation" | "accessories",
|
52
|
-
onChange?: any,
|
53
52
|
optionsByContext?: Record<string, Array<{ label: string; value?: string }>>
|
54
53
|
searchContextSelector?: string,
|
55
54
|
clearOnContextChange?: boolean,
|
@@ -72,7 +71,8 @@ type TagOnChangeValues = {
|
|
72
71
|
* @constant {React.ReactComponent} Typeahead
|
73
72
|
* @param {TypeaheadProps} props - props as described at https://react-select.com/props
|
74
73
|
*/
|
75
|
-
|
74
|
+
|
75
|
+
const Typeahead = ({
|
76
76
|
async,
|
77
77
|
className,
|
78
78
|
components = {},
|
@@ -83,11 +83,9 @@ const Typeahead = forwardRef<HTMLInputElement, TypeaheadProps>(({
|
|
83
83
|
getOptionValue,
|
84
84
|
htmlOptions = {},
|
85
85
|
id,
|
86
|
-
name,
|
87
86
|
loadOptions = noop,
|
88
87
|
marginBottom = "sm",
|
89
88
|
pillColor,
|
90
|
-
onChange,
|
91
89
|
optionsByContext = {},
|
92
90
|
searchContextSelector,
|
93
91
|
clearOnContextChange = false,
|
@@ -158,15 +156,6 @@ const Typeahead = forwardRef<HTMLInputElement, TypeaheadProps>(({
|
|
158
156
|
)
|
159
157
|
|
160
158
|
const handleOnChange = (_data: SelectValueType, { action, option, removedValue }: TagOnChangeValues) => {
|
161
|
-
if (onChange) {
|
162
|
-
const isReactHookForm = onChange.toString().includes("target")
|
163
|
-
if (isReactHookForm) {
|
164
|
-
onChange({ target: { name, value: _data } })
|
165
|
-
} else {
|
166
|
-
onChange(_data)
|
167
|
-
}
|
168
|
-
}
|
169
|
-
|
170
159
|
if (action === 'select-option') {
|
171
160
|
if (selectProps.onMultiValueClick) selectProps.onMultiValueClick(option)
|
172
161
|
const multiValueClearEvent = new CustomEvent(`pb-typeahead-kit-${selectProps.id}-result-option-select`, { detail: option ? option : _data })
|
@@ -210,11 +199,10 @@ const Typeahead = forwardRef<HTMLInputElement, TypeaheadProps>(({
|
|
210
199
|
/>
|
211
200
|
</div>
|
212
201
|
)
|
213
|
-
}
|
202
|
+
}
|
214
203
|
|
215
204
|
Object.keys(kitComponents).forEach((k) => {
|
216
205
|
(Typeahead as GenericObject)[k] = (kitComponents as {[key: string]: unknown})[k]
|
217
206
|
})
|
218
207
|
|
219
|
-
Typeahead.displayName = 'Typeahead'
|
220
208
|
export default Typeahead
|
@@ -49,7 +49,7 @@ const TypeaheadWithPillsAsyncCustomOptions = (props) => {
|
|
49
49
|
* @summary - for doc example purposes only
|
50
50
|
*/
|
51
51
|
const handleOnMultiValueClick = (value) => {
|
52
|
-
alert(`You
|
52
|
+
alert(`You removed the user: "${value.label}"`)
|
53
53
|
}
|
54
54
|
|
55
55
|
return (
|
@@ -56,7 +56,7 @@ const TypeaheadWithPillsAsyncUsers = (props) => {
|
|
56
56
|
* @summary - for doc example purposes only
|
57
57
|
*/
|
58
58
|
const handleOnMultiValueClick = (value) => {
|
59
|
-
alert(`You
|
59
|
+
alert(`You removed the user: "${value.label}"`)
|
60
60
|
}
|
61
61
|
|
62
62
|
return (
|
@@ -13,4 +13,3 @@ export { default as TypeaheadCustomMenuList } from './_typeahead_custom_menu_lis
|
|
13
13
|
export { default as TypeaheadMarginBottom } from './_typeahead_margin_bottom.jsx'
|
14
14
|
export { default as TypeaheadWithPillsColor } from './_typeahead_with_pills_color.jsx'
|
15
15
|
export { default as TypeaheadTruncatedText } from './_typeahead_truncated_text.jsx'
|
16
|
-
export { default as TypeaheadReactHook } from './_typeahead_react_hook.jsx'
|