playbook_ui 14.24.0.pre.alpha.testingwithoutlazyload9529 → 14.24.0.pre.rc.0
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/_playbook.scss +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/Components/CustomCell.tsx +6 -7
- data/app/pb_kits/playbook/pb_advanced_table/Components/RegularTableView.tsx +1 -4
- data/app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx +25 -24
- data/app/pb_kits/playbook/pb_advanced_table/Components/TableActionBar.tsx +10 -10
- data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +13 -11
- data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableState.ts +4 -7
- data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableHeader.tsx +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +2 -112
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +7 -13
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +2 -12
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +0 -90
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table_action_bar.js +0 -16
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_header_rails.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_rails.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -7
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +0 -6
- data/app/pb_kits/playbook/pb_advanced_table/flat_advanced_table.js +11 -4
- data/app/pb_kits/playbook/pb_advanced_table/index.js +125 -108
- data/app/pb_kits/playbook/pb_advanced_table/scss_partials/advanced_table_sticky_mixin.scss +1 -7
- data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +4 -5
- data/app/pb_kits/playbook/pb_advanced_table/table_header.rb +4 -10
- data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +5 -22
- data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb +1 -1
- data/app/pb_kits/playbook/pb_checkbox/checkbox.rb +1 -12
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_indeterminate.html.erb +1 -1
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_indeterminate_rails.md +1 -2
- data/app/pb_kits/playbook/pb_checkbox/index.js +26 -218
- data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.html.erb +1 -10
- data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.rb +0 -2
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_date/_date.tsx +3 -5
- data/app/pb_kits/playbook/pb_date/date.html.erb +6 -6
- data/app/pb_kits/playbook/pb_date/date.rb +0 -2
- data/app/pb_kits/playbook/pb_date/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_date/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +1 -17
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +0 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_radio_options.jsx +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_radio_options_react.md +1 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +2 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_dropdown/dropdown.test.jsx +0 -24
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownOption.tsx +1 -11
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +2 -2
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.html.erb +1 -2
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb +1 -1
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.test.js +0 -6
- data/app/pb_kits/playbook/pb_multi_level_select/_helper_functions.tsx +9 -18
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +1 -3
- data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +1 -1
- data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.rb +0 -3
- data/app/pb_kits/playbook/pb_pagination/_pagination.tsx +1 -12
- data/app/pb_kits/playbook/pb_pagination/docs/_pagination_default_rails.md +1 -3
- data/app/pb_kits/playbook/pb_pagination/docs/_pagination_default_react.md +1 -3
- data/app/pb_kits/playbook/pb_pagination/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_pagination/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +1 -11
- data/app/pb_kits/playbook/pb_select/select.rb +2 -4
- data/app/pb_kits/playbook/pb_table/docs/_table_with_selectable_rows.html.erb +0 -1
- data/app/pb_kits/playbook/pb_table/styles/_vertical_border.scss +1 -49
- data/app/pb_kits/playbook/pb_walkthrough/_walkthrough.scss +0 -0
- data/app/pb_kits/playbook/pb_walkthrough/_walkthrough.tsx +202 -0
- data/app/pb_kits/playbook/pb_walkthrough/docs/_walkthrough_continuous.jsx +69 -0
- data/app/pb_kits/playbook/pb_walkthrough/docs/_walkthrough_default.jsx +71 -0
- data/app/pb_kits/playbook/pb_walkthrough/docs/_walkthrough_multi_beacon.jsx +110 -0
- data/app/pb_kits/playbook/pb_walkthrough/docs/_walkthrough_no_beacon.jsx +76 -0
- data/app/pb_kits/playbook/pb_walkthrough/docs/_walkthrough_no_overlay.jsx +76 -0
- data/app/pb_kits/playbook/pb_walkthrough/docs/_walkthrough_styled.jsx +76 -0
- data/app/pb_kits/playbook/pb_walkthrough/docs/example.yml +10 -0
- data/app/pb_kits/playbook/pb_walkthrough/docs/index.js +6 -0
- data/app/pb_kits/playbook/pb_walkthrough/walkthrough.test.jsx +34 -0
- data/dist/chunks/{_line_graph-qk_BN_J0.js → _line_graph-BfCo79KE.js} +1 -1
- data/dist/chunks/{_typeahead-ZLTFtAoW.js → _typeahead-Db4YQA5c.js} +2 -2
- data/dist/chunks/_weekday_stacked-DhFTG-Jt.js +61 -0
- data/dist/chunks/lazysizes-B7xYodB-.js +1 -0
- data/dist/chunks/{lib-CY5ZPzic.js → lib-DnQyMxO1.js} +2 -2
- data/dist/chunks/{pb_form_validation-D3b0JKHH.js → pb_form_validation-kl-4Jv4t.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +11 -4
- data/dist/playbook-doc.js +2 -2
- 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 +2 -2
- metadata +19 -36
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_vertical_border.html.erb +0 -43
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_vertical_border.jsx +0 -64
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control.jsx +0 -60
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control.md +0 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control_per_row.jsx +0 -57
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control_per_row.md +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_per_column.jsx +0 -55
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_per_column.md +0 -6
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_per_column_for_multi_column.jsx +0 -80
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_per_column_for_multi_column.md +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header_multi_header.jsx +0 -107
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header_multi_header.md +0 -1
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_input_options.html.erb +0 -24
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_input_options.md +0 -3
- data/app/pb_kits/playbook/pb_date/docs/_date_with_show_current_year.html.erb +0 -4
- data/app/pb_kits/playbook/pb_date/docs/_date_with_show_current_year.jsx +0 -17
- data/app/pb_kits/playbook/pb_date/docs/_date_with_show_current_year.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/_dropdown_mixin.scss +0 -36
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_active_style_options.jsx +0 -90
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_active_style_options_react.md +0 -4
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_no_icon.html.erb +0 -22
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_no_icon.jsx +0 -43
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_no_icon.md +0 -1
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_show_checked_children.html.erb +0 -75
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_show_checked_children.jsx +0 -94
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_show_checked_children.md +0 -3
- data/app/pb_kits/playbook/pb_pagination/_pagination.test.jsx +0 -212
- data/app/pb_kits/playbook/pb_pagination/docs/_pagination_external_control.jsx +0 -112
- data/app/pb_kits/playbook/pb_pagination/docs/_pagination_external_control_react.md +0 -3
- data/dist/chunks/_weekday_stacked-rU5SIBAO.js +0 -37
@@ -369,28 +369,4 @@ test("defaultValue works with multiSelect", () => {
|
|
369
369
|
const option2 = Array.from(kit.querySelectorAll(".pb_dropdown_option_list"));
|
370
370
|
const firstOpt = options[0].label
|
371
371
|
expect(option2[0]).not.toHaveTextContent(firstOpt)
|
372
|
-
})
|
373
|
-
|
374
|
-
test("applies activeStyle backgroundColor and fontColor when selected", () => {
|
375
|
-
render(
|
376
|
-
<Dropdown
|
377
|
-
activeStyle={{
|
378
|
-
backgroundColor: "bg_light",
|
379
|
-
fontColor: "primary",
|
380
|
-
}}
|
381
|
-
data={{ testid: testId }}
|
382
|
-
options={options}
|
383
|
-
/>
|
384
|
-
)
|
385
|
-
|
386
|
-
const kit = screen.getByTestId(testId)
|
387
|
-
const option = kit.querySelectorAll(".pb_dropdown_option_list")[1]
|
388
|
-
|
389
|
-
fireEvent.click(option)
|
390
|
-
|
391
|
-
const selected = kit.querySelector(".pb_dropdown_option_selected")
|
392
|
-
|
393
|
-
expect(selected).toBeInTheDocument()
|
394
|
-
expect(selected).toHaveClass("bg-bg_light")
|
395
|
-
expect(selected).toHaveClass("font-primary")
|
396
372
|
})
|
@@ -41,7 +41,6 @@ const DropdownOption = (props: DropdownOptionProps) => {
|
|
41
41
|
} = props;
|
42
42
|
|
43
43
|
const {
|
44
|
-
activeStyle,
|
45
44
|
filteredOptions,
|
46
45
|
filterItem,
|
47
46
|
focusedOptionIndex,
|
@@ -60,6 +59,7 @@ const DropdownOption = (props: DropdownOptionProps) => {
|
|
60
59
|
? selected.some((item) => item.label === option?.label)
|
61
60
|
: (selected as GenericObject)?.label === option?.label;
|
62
61
|
|
62
|
+
|
63
63
|
if (!isItemMatchingFilter(option) || (multiSelect && isSelected)) {
|
64
64
|
return null;
|
65
65
|
}
|
@@ -70,14 +70,6 @@ const DropdownOption = (props: DropdownOptionProps) => {
|
|
70
70
|
|
71
71
|
const selectedClass = isSelected ? "selected" : "list";
|
72
72
|
|
73
|
-
|
74
|
-
const bgTokenClass = activeStyle?.backgroundColor
|
75
|
-
? `bg-${activeStyle.backgroundColor}`
|
76
|
-
: "";
|
77
|
-
const fontTokenClass = activeStyle?.fontColor
|
78
|
-
? `font-${activeStyle.fontColor}`
|
79
|
-
: "";
|
80
|
-
|
81
73
|
const ariaProps = buildAriaProps(aria);
|
82
74
|
const dataProps = buildDataProps(data);
|
83
75
|
const htmlProps = buildHtmlProps(htmlOptions);
|
@@ -87,8 +79,6 @@ const DropdownOption = (props: DropdownOptionProps) => {
|
|
87
79
|
selectedClass,
|
88
80
|
focusedClass,
|
89
81
|
),
|
90
|
-
bgTokenClass,
|
91
|
-
fontTokenClass,
|
92
82
|
globalProps(props),
|
93
83
|
className
|
94
84
|
);
|
@@ -52,7 +52,7 @@ const FixedConfirmationToast = (props: FixedConfirmationToastProps): React.React
|
|
52
52
|
} = props;
|
53
53
|
|
54
54
|
const returnedIcon = icon || iconMap[status]
|
55
|
-
const iconClass = icon
|
55
|
+
const iconClass = icon ? "custom_icon" : ""
|
56
56
|
|
57
57
|
const css = classnames(
|
58
58
|
`pb_fixed_confirmation_toast_kit_${status}`,
|
@@ -92,7 +92,7 @@ const FixedConfirmationToast = (props: FixedConfirmationToastProps): React.React
|
|
92
92
|
onClick={handleClick}
|
93
93
|
{...htmlProps}
|
94
94
|
>
|
95
|
-
{returnedIcon &&
|
95
|
+
{returnedIcon && (
|
96
96
|
<Icon
|
97
97
|
className="pb_icon"
|
98
98
|
fixedWidth
|
@@ -8,7 +8,6 @@ examples:
|
|
8
8
|
- fixed_confirmation_toast_auto_close: Click to Show Auto Close
|
9
9
|
- fixed_confirmation_toast_children: Children
|
10
10
|
- fixed_confirmation_toast_custom_icon: Custom Icon
|
11
|
-
- fixed_confirmation_toast_no_icon: No Icon
|
12
11
|
|
13
12
|
react:
|
14
13
|
- fixed_confirmation_toast_default: Default
|
@@ -18,7 +17,6 @@ examples:
|
|
18
17
|
- fixed_confirmation_toast_auto_close: Click to Show Auto Close
|
19
18
|
- fixed_confirmation_toast_children: Children
|
20
19
|
- fixed_confirmation_toast_custom_icon: Custom Icon
|
21
|
-
- fixed_confirmation_toast_no_icon: No Icon
|
22
20
|
|
23
21
|
swift:
|
24
22
|
- fixed_confirmation_toast_default_swift: Default
|
@@ -5,4 +5,3 @@ export { default as FixedConfirmationToastPositions } from './_fixed_confirmatio
|
|
5
5
|
export { default as FixedConfirmationToastAutoClose } from './_fixed_confirmation_toast_auto_close.jsx'
|
6
6
|
export { default as FixedConfirmationToastChildren } from './_fixed_confirmation_toast_children.jsx'
|
7
7
|
export { default as FixedConfirmationToastCustomIcon } from './_fixed_confirmation_toast_custom_icon.jsx'
|
8
|
-
export { default as FixedConfirmationToastNoIcon } from './_fixed_confirmation_toast_no_icon.jsx'
|
@@ -1,7 +1,6 @@
|
|
1
1
|
<%= pb_content_tag do %>
|
2
|
-
<% if object.icon_value && object.icon_value != "none" %>
|
3
2
|
<%= pb_rails("icon", props: { icon: object.icon_value, classname: "pb_icon", fixed_width: true }) %>
|
4
|
-
|
3
|
+
|
5
4
|
<% if content %>
|
6
5
|
<%= content %>
|
7
6
|
<% elsif object.show_text? %>
|
@@ -56,12 +56,6 @@ test('renders custom icon when provided', () => {
|
|
56
56
|
expect(container.querySelector('.custom_icon')).toBeInTheDocument();
|
57
57
|
});
|
58
58
|
|
59
|
-
test("renders no icon when icon prop is 'none'", () => {
|
60
|
-
const { container } = render(<FixedConfirmationToast icon="none" />);
|
61
|
-
expect(container.querySelector('.pb_icon')).not.toBeInTheDocument();
|
62
|
-
expect(container.querySelector('.custom_icon')).not.toBeInTheDocument();
|
63
|
-
});
|
64
|
-
|
65
59
|
test('renders correctly with multiLine prop', () => {
|
66
60
|
const { container } = render(<FixedConfirmationToast multiLine />);
|
67
61
|
expect(container.querySelector('._multi_line')).toBeInTheDocument();
|
@@ -143,8 +143,7 @@ export const recursiveCheckParent = (
|
|
143
143
|
|
144
144
|
export const getExpandedItems = (
|
145
145
|
treeData: { [key: string]: string }[],
|
146
|
-
selectedIds: string[]
|
147
|
-
showCheckedChildren = true
|
146
|
+
selectedIds: string[]
|
148
147
|
): any[] => {
|
149
148
|
const expandedItems: any[] = [];
|
150
149
|
|
@@ -153,27 +152,19 @@ export const getExpandedItems = (
|
|
153
152
|
const item = items[i];
|
154
153
|
const itemAncestors = [...ancestors, item];
|
155
154
|
|
156
|
-
// Always honor explicit expanded: true
|
157
155
|
if (item.expanded) {
|
158
156
|
expandedItems.push(item.id);
|
159
157
|
}
|
160
|
-
|
161
|
-
|
162
|
-
if (showCheckedChildren) {
|
163
|
-
if (selectedIds && selectedIds.length && selectedIds.includes(item.id)) {
|
164
|
-
expandedItems.push(...itemAncestors.map((ancestor: any) => ancestor.id));
|
165
|
-
}
|
166
|
-
if (Array.isArray(item.children)) {
|
167
|
-
const hasCheckedChildren = item.children.some(
|
168
|
-
(child: { [key: string]: string }) => child.checked
|
169
|
-
);
|
170
|
-
if (hasCheckedChildren) {
|
171
|
-
expandedItems.push(...itemAncestors.map((ancestor: any) => ancestor.id));
|
172
|
-
}
|
173
|
-
}
|
158
|
+
if (selectedIds && selectedIds.length && selectedIds.includes(item.id)) {
|
159
|
+
expandedItems.push(...itemAncestors.map((ancestor) => ancestor.id));
|
174
160
|
}
|
175
|
-
|
176
161
|
if (Array.isArray(item.children)) {
|
162
|
+
const hasCheckedChildren = item.children.some(
|
163
|
+
(child: { [key: string]: string }) => child.checked
|
164
|
+
);
|
165
|
+
if (hasCheckedChildren) {
|
166
|
+
expandedItems.push(...itemAncestors.map((ancestor) => ancestor.id));
|
167
|
+
}
|
177
168
|
traverse(item.children, itemAncestors);
|
178
169
|
}
|
179
170
|
}
|
@@ -47,7 +47,6 @@ type MultiLevelSelectProps = {
|
|
47
47
|
name?: string
|
48
48
|
required?: boolean
|
49
49
|
returnAllSelected?: boolean
|
50
|
-
showCheckedChildren?: boolean
|
51
50
|
treeData?: { [key: string]: string; }[] | any
|
52
51
|
onChange?: (event: { target: { name?: string; value: any } }) => void
|
53
52
|
onSelect?: (prop: { [key: string]: any }) => void
|
@@ -72,7 +71,6 @@ const MultiLevelSelect = forwardRef<HTMLInputElement, MultiLevelSelectProps>((pr
|
|
72
71
|
label,
|
73
72
|
required = false,
|
74
73
|
returnAllSelected = false,
|
75
|
-
showCheckedChildren = true,
|
76
74
|
treeData,
|
77
75
|
onChange = () => null,
|
78
76
|
onSelect = () => null,
|
@@ -106,7 +104,7 @@ const MultiLevelSelect = forwardRef<HTMLInputElement, MultiLevelSelectProps>((pr
|
|
106
104
|
// State for default return
|
107
105
|
const [defaultReturn, setDefaultReturn] = useState([]);
|
108
106
|
// Get expanded items from treeData
|
109
|
-
const initialExpandedItems = getExpandedItems(treeData, selectedIds
|
107
|
+
const initialExpandedItems = getExpandedItems(treeData, selectedIds);
|
110
108
|
// Initialize state with expanded items
|
111
109
|
const [expanded, setExpanded] = useState(initialExpandedItems);
|
112
110
|
|
@@ -13,4 +13,4 @@ export { default as MultiLevelSelectDisabledOptions } from './_multi_level_selec
|
|
13
13
|
export { default as MultiLevelSelectDisabledOptionsParent } from './_multi_level_select_disabled_options_parent.jsx'
|
14
14
|
export { default as MultiLevelSelectDisabledOptionsParentDefault } from './_multi_level_select_disabled_options_parent_default.jsx'
|
15
15
|
export { default as MultiLevelSelectDisabledOptionsDefault } from './_multi_level_select_disabled_options_default.jsx'
|
16
|
-
export { default as MultiLevelSelectLabel } from './_multi_level_select_label.jsx'
|
16
|
+
export { default as MultiLevelSelectLabel } from './_multi_level_select_label.jsx'
|
@@ -32,8 +32,6 @@ module Playbook
|
|
32
32
|
default: ""
|
33
33
|
prop :label, type: Playbook::Props::String,
|
34
34
|
default: ""
|
35
|
-
prop :show_checked_children, type: Playbook::Props::Boolean,
|
36
|
-
default: true
|
37
35
|
|
38
36
|
def classname
|
39
37
|
generate_classname("pb_multi_level_select")
|
@@ -56,7 +54,6 @@ module Playbook
|
|
56
54
|
variant: variant,
|
57
55
|
pillColor: pill_color,
|
58
56
|
wrapped: wrapped,
|
59
|
-
showCheckedChildren: show_checked_children,
|
60
57
|
}
|
61
58
|
end
|
62
59
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React, { useState
|
1
|
+
import React, { useState } from "react";
|
2
2
|
import classnames from 'classnames'
|
3
3
|
import { GlobalProps, globalProps } from '../utilities/globalProps'
|
4
4
|
import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
|
@@ -123,13 +123,6 @@ const Pagination = ( props: PaginationProps) => {
|
|
123
123
|
|
124
124
|
return buttons;
|
125
125
|
};
|
126
|
-
|
127
|
-
// Sync internal state with external current prop
|
128
|
-
useEffect(() => {
|
129
|
-
if (current >= 1 && current <= total) {
|
130
|
-
setCurrentPage(current);
|
131
|
-
}
|
132
|
-
}, [current, total]);
|
133
126
|
|
134
127
|
|
135
128
|
const ariaProps = buildAriaProps(aria)
|
@@ -141,10 +134,6 @@ const Pagination = ( props: PaginationProps) => {
|
|
141
134
|
className
|
142
135
|
)
|
143
136
|
|
144
|
-
if (total <= 1) {
|
145
|
-
return null;
|
146
|
-
}
|
147
|
-
|
148
137
|
return (
|
149
138
|
<div
|
150
139
|
{...ariaProps}
|
@@ -3,6 +3,4 @@ Our Pagination kit depends on the <a href="https://github.com/mislav/will_pagina
|
|
3
3
|
|
4
4
|
Once you have perfomed the paginated query in your controller file you can use our kit (see code example below) instead of `<%= will_paginate @users %>` in your view file.
|
5
5
|
|
6
|
-
You need to add: <code>require "playbook/pagination_renderer"</code> in your apps controller file.
|
7
|
-
|
8
|
-
Note: If the total page count is 0 or 1, the Pagination kit will not be displayed as there aren't multiple pages to navigate.
|
6
|
+
You need to add: <code>require "playbook/pagination_renderer"</code> in your apps controller file.
|
@@ -1,3 +1 @@
|
|
1
|
-
The `range` prop determines how many pages to display in the Pagination component. Regardless of this value, the first two and last two pages are always visible to facilitate navigation to the beginning and end of the pagination. If these always-visible pages fall within the specified range, they are included in the display. If they fall outside the range, the pagination will show additional pages up to the number defined by the `range` prop.
|
2
|
-
|
3
|
-
Note: If the `total` pages prop is 0 or 1, the Pagination component will not be displayed, as there aren't multiple pages to navigate.
|
1
|
+
The `range` prop determines how many pages to display in the Pagination component. Regardless of this value, the first two and last two pages are always visible to facilitate navigation to the beginning and end of the pagination. If these always-visible pages fall within the specified range, they are included in the display. If they fall outside the range, the pagination will show additional pages up to the number defined by the `range` prop.
|
@@ -197,22 +197,13 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.Ref<unknown>
|
|
197
197
|
}
|
198
198
|
|
199
199
|
const validateMissingAreaCode = (itiInit: any) => {
|
200
|
-
if (!itiInit) return
|
200
|
+
if (!required || !itiInit) return
|
201
201
|
if (itiInit.getValidationError() === ValidationError.MissingAreaCode) {
|
202
202
|
showFormattedError('missing area code')
|
203
203
|
return true
|
204
204
|
}
|
205
205
|
}
|
206
206
|
|
207
|
-
const validateRepeatCountryCode = (itiInit: any) => {
|
208
|
-
if (!itiInit) return
|
209
|
-
const countryDialCode = itiInit.getSelectedCountryData().dialCode;
|
210
|
-
if (unformatNumber(inputValue).startsWith(countryDialCode)) {
|
211
|
-
return showFormattedError('repeat country code')
|
212
|
-
}
|
213
|
-
}
|
214
|
-
|
215
|
-
|
216
207
|
const validateErrors = () => {
|
217
208
|
if (!hasTyped && !error) return
|
218
209
|
|
@@ -222,7 +213,6 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.Ref<unknown>
|
|
222
213
|
if (validateTooShortNumber(itiRef.current)) return
|
223
214
|
if (validateUnhandledError(itiRef.current)) return
|
224
215
|
if (validateMissingAreaCode(itiRef.current)) return
|
225
|
-
if (validateRepeatCountryCode(itiRef.current)) return
|
226
216
|
}
|
227
217
|
|
228
218
|
const getCurrentSelectedData = (itiInit: any, inputValue: string) => {
|
@@ -24,9 +24,7 @@ module Playbook
|
|
24
24
|
prop :validation_message, type: Playbook::Props::String, default: ""
|
25
25
|
|
26
26
|
def classnames
|
27
|
-
|
28
|
-
.reject(&:empty?)
|
29
|
-
.join(" ")
|
27
|
+
classname + inline_class + compact_class + show_arrow_class
|
30
28
|
end
|
31
29
|
|
32
30
|
def all_attributes
|
@@ -46,7 +44,7 @@ module Playbook
|
|
46
44
|
end
|
47
45
|
|
48
46
|
def inline_class
|
49
|
-
inline ? "inline" : ""
|
47
|
+
inline ? " inline " : " "
|
50
48
|
end
|
51
49
|
|
52
50
|
def compact_class
|
@@ -7,7 +7,7 @@
|
|
7
7
|
thead tr:not(:first-child) th {
|
8
8
|
border-right: 1px solid $border_light !important;
|
9
9
|
}
|
10
|
-
|
10
|
+
|
11
11
|
@media screen and (min-width: $screen-xs-min) {
|
12
12
|
tr:hover, .pb_table_tr:hover {
|
13
13
|
td:last-child, .pb_table_td:last-child {
|
@@ -15,53 +15,5 @@
|
|
15
15
|
}
|
16
16
|
}
|
17
17
|
}
|
18
|
-
|
19
|
-
// Firefox-specific fix for sticky elements
|
20
|
-
@-moz-document url-prefix() {
|
21
|
-
// Target sticky headers
|
22
|
-
&.sticky-header {
|
23
|
-
th:not(:last-child) {
|
24
|
-
border-right: none !important;
|
25
|
-
box-shadow: 1px 0 0 0 $border_light !important;
|
26
|
-
}
|
27
|
-
|
28
|
-
.pb_advanced_table_body {
|
29
|
-
.pinned-row {
|
30
|
-
td:not(:first-child):not(:last-child) {
|
31
|
-
border-right: none !important;
|
32
|
-
box-shadow: 1px 0 0 0 $border_light !important;
|
33
|
-
}
|
34
|
-
}
|
35
|
-
}
|
36
|
-
}
|
37
|
-
|
38
|
-
// Target sticky left columns
|
39
|
-
&.sticky-left-column {
|
40
|
-
td[style="left"], th[style="left"] {
|
41
|
-
border-right: none !important;
|
42
|
-
box-shadow: 1px 0 0 0 $border_light !important;
|
43
|
-
}
|
44
|
-
}
|
45
|
-
|
46
|
-
// Target sticky right columns
|
47
|
-
&.sticky-right-column {
|
48
|
-
td[style="right"], th[style="right"] {
|
49
|
-
border-right: none !important;
|
50
|
-
box-shadow: 1px 0 0 0 $border_light !important;
|
51
|
-
}
|
52
|
-
}
|
53
|
-
|
54
|
-
// Handle hover states in Firefox
|
55
|
-
@media screen and (min-width: $screen-xs-min) {
|
56
|
-
tr:hover, .pb_table_tr:hover {
|
57
|
-
td:last-child, .pb_table_td:last-child {
|
58
|
-
&[style="left"], &[style="right"] {
|
59
|
-
border-right: none !important;
|
60
|
-
box-shadow: 1px 0 0 0 darken($border_light, 10%) !important;
|
61
|
-
}
|
62
|
-
}
|
63
|
-
}
|
64
|
-
}
|
65
|
-
}
|
66
18
|
}
|
67
19
|
}
|
File without changes
|
@@ -0,0 +1,202 @@
|
|
1
|
+
/* eslint-disable react/no-multi-comp */
|
2
|
+
|
3
|
+
import React from 'react'
|
4
|
+
import classnames from 'classnames'
|
5
|
+
import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
|
6
|
+
import { globalProps } from '../utilities/globalProps'
|
7
|
+
import Joyride, { TooltipRenderProps } from 'react-joyride'
|
8
|
+
import Button from '../pb_button/_button'
|
9
|
+
import Flex from '../pb_flex/_flex'
|
10
|
+
import SectionSeparator from '../pb_section_separator/_section_separator'
|
11
|
+
import Title from '../pb_title/_title'
|
12
|
+
|
13
|
+
type WalkthroughProps = {
|
14
|
+
aria?: { [key: string]: string },
|
15
|
+
callback?: () => void,
|
16
|
+
className?: string,
|
17
|
+
continuous?: boolean,
|
18
|
+
data?: { [key: string]: string },
|
19
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
20
|
+
id?: string,
|
21
|
+
run?: boolean,
|
22
|
+
steps?: [],
|
23
|
+
stepIndex?: number,
|
24
|
+
debug?: boolean,
|
25
|
+
disableCloseOnEsc?: boolean,
|
26
|
+
disableOverlay?: boolean,
|
27
|
+
disableOverlayClose?: boolean,
|
28
|
+
disableScrolling?: boolean,
|
29
|
+
floaterProps?: Record<string, unknown>,
|
30
|
+
hideBackButton?: boolean,
|
31
|
+
hideCloseButton?: boolean,
|
32
|
+
showProgress?: boolean,
|
33
|
+
showSkipButton?: boolean,
|
34
|
+
spotlightClicks?: boolean,
|
35
|
+
spotlightPadding?: number,
|
36
|
+
styles?: {
|
37
|
+
options: {
|
38
|
+
beaconSize?: number,
|
39
|
+
arrowColor?: string,
|
40
|
+
backgroundColor?: string,
|
41
|
+
primaryColor?: string,
|
42
|
+
overlayColor?: string,
|
43
|
+
spotlightShadow?: string,
|
44
|
+
width?: number,
|
45
|
+
zIndex?: number,
|
46
|
+
},
|
47
|
+
},
|
48
|
+
}
|
49
|
+
|
50
|
+
type TooltipProps = {
|
51
|
+
continuous?: boolean,
|
52
|
+
className?: string,
|
53
|
+
index?: number,
|
54
|
+
isLastStep?: boolean,
|
55
|
+
size?: number,
|
56
|
+
step: {
|
57
|
+
title?: string,
|
58
|
+
content?: React.ReactNode[] | React.ReactNode | string,
|
59
|
+
target: string,
|
60
|
+
disableBeacon?: boolean,
|
61
|
+
},
|
62
|
+
skip?: boolean,
|
63
|
+
backProps?: Record<string, unknown>,
|
64
|
+
closeProps?: Record<string, unknown>,
|
65
|
+
primaryProps?: Record<string, unknown>,
|
66
|
+
skipProps?: Record<string, unknown>,
|
67
|
+
tooltipProps?: Record<string, unknown>,
|
68
|
+
}
|
69
|
+
|
70
|
+
// eslint-disable-next-line react/display-name
|
71
|
+
const Tooltip = React.forwardRef((props: TooltipProps) => (
|
72
|
+
<div
|
73
|
+
className="pb_card_kit_border_none p_none"
|
74
|
+
{...props.tooltipProps}
|
75
|
+
>
|
76
|
+
{props.step.title && <div>
|
77
|
+
<Flex
|
78
|
+
align="center"
|
79
|
+
justify="between"
|
80
|
+
padding="xs"
|
81
|
+
>
|
82
|
+
<Title
|
83
|
+
paddingLeft="xs"
|
84
|
+
size={4}
|
85
|
+
>
|
86
|
+
{props.step.title}
|
87
|
+
</Title>
|
88
|
+
{props.skip && (
|
89
|
+
<Button
|
90
|
+
{...props.skipProps}
|
91
|
+
id="skip"
|
92
|
+
text="Skip Tour"
|
93
|
+
variant="link"
|
94
|
+
/>
|
95
|
+
)}
|
96
|
+
<Button
|
97
|
+
{...props.skipProps}
|
98
|
+
id="skip"
|
99
|
+
text="Skip Tour"
|
100
|
+
variant="link"
|
101
|
+
/>
|
102
|
+
</Flex>
|
103
|
+
<SectionSeparator />
|
104
|
+
</div>}
|
105
|
+
|
106
|
+
<Flex padding="sm">{props.step.content}</Flex>
|
107
|
+
<SectionSeparator />
|
108
|
+
<Flex
|
109
|
+
justify={props.index == 0 ? 'end' : 'between'}
|
110
|
+
padding="xs"
|
111
|
+
>
|
112
|
+
|
113
|
+
{props.index > 0 && (
|
114
|
+
<Button
|
115
|
+
{...props.backProps}
|
116
|
+
id="back"
|
117
|
+
text="Back"
|
118
|
+
/>
|
119
|
+
)}
|
120
|
+
|
121
|
+
{props.continuous && !props.isLastStep &&
|
122
|
+
<Button
|
123
|
+
{...props.primaryProps}
|
124
|
+
id="next"
|
125
|
+
text="Next"
|
126
|
+
/>
|
127
|
+
}
|
128
|
+
|
129
|
+
{!props.continuous &&
|
130
|
+
<Button
|
131
|
+
{...props.closeProps}
|
132
|
+
id="close"
|
133
|
+
text="Close"
|
134
|
+
/>
|
135
|
+
}
|
136
|
+
|
137
|
+
{!((props.continuous && !props.isLastStep) || (!props.continuous)) &&
|
138
|
+
<Button
|
139
|
+
{...props.closeProps}
|
140
|
+
id="close"
|
141
|
+
text="Close"
|
142
|
+
/>
|
143
|
+
}
|
144
|
+
</Flex>
|
145
|
+
</div>
|
146
|
+
)) as unknown as React.ForwardRefRenderFunction<HTMLDivElement, TooltipRenderProps>
|
147
|
+
|
148
|
+
const Walkthrough = (props: WalkthroughProps): React.ReactElement => {
|
149
|
+
const {
|
150
|
+
aria = {},
|
151
|
+
callback,
|
152
|
+
className,
|
153
|
+
continuous = false,
|
154
|
+
data = {},
|
155
|
+
disableOverlay,
|
156
|
+
floaterProps = {
|
157
|
+
offset: 50,
|
158
|
+
},
|
159
|
+
htmlOptions = {},
|
160
|
+
id,
|
161
|
+
run = false,
|
162
|
+
steps,
|
163
|
+
styles = {
|
164
|
+
options: {
|
165
|
+
zIndex: 20000,
|
166
|
+
},
|
167
|
+
},
|
168
|
+
showSkipButton,
|
169
|
+
} = props
|
170
|
+
|
171
|
+
const ariaProps = buildAriaProps(aria)
|
172
|
+
const dataProps = buildDataProps(data)
|
173
|
+
const htmlProps = buildHtmlProps(htmlOptions)
|
174
|
+
const classes = classnames(buildCss('pb_walkthrough'), globalProps(props), className)
|
175
|
+
|
176
|
+
return (
|
177
|
+
<div
|
178
|
+
{...ariaProps}
|
179
|
+
{...dataProps}
|
180
|
+
{...htmlProps}
|
181
|
+
className={classes}
|
182
|
+
id={id}
|
183
|
+
>
|
184
|
+
<Joyride
|
185
|
+
callback={callback}
|
186
|
+
continuous={continuous}
|
187
|
+
disableOverlay={disableOverlay}
|
188
|
+
disableScrolling
|
189
|
+
floaterProps={floaterProps}
|
190
|
+
run={run}
|
191
|
+
showSkipButton={showSkipButton}
|
192
|
+
steps={steps}
|
193
|
+
styles={styles}
|
194
|
+
tooltipComponent={Tooltip}
|
195
|
+
{...props}
|
196
|
+
/>
|
197
|
+
</div>
|
198
|
+
|
199
|
+
)
|
200
|
+
}
|
201
|
+
|
202
|
+
export default Walkthrough
|