playbook_ui_docs 14.21.0.pre.alpha.renovatenpmtrixvulnerability8103 → 14.21.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/pb_advanced_table/docs/_advanced_table_no_subrows.jsx +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +2 -6
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +1 -3
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_indeterminate.html.erb +48 -2
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_dropdown/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_only_countries.jsx +1 -1
- data/app/pb_kits/playbook/pb_phone_number_input/docs/example.yml +3 -4
- data/app/pb_kits/playbook/pb_phone_number_input/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_with_selectable_rows.html.erb +51 -3
- data/dist/playbook-doc.js +1 -1
- metadata +2 -14
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_no_subrows.html.erb +0 -33
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows.jsx +0 -57
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_react.md +0 -5
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_scrollbar_none.html.erb +0 -33
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_scrollbar_none.jsx +0 -53
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_indeterminate_rails.md +0 -1
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_date_display.html.erb +0 -13
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_close_on_select.jsx +0 -42
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_close_on_select.md +0 -1
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_exclude_countries.html.erb +0 -4
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_exclude_countries.jsx +0 -15
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_exclude_countries.md +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7dce2e69208f1f0ba3457fd7ebf594e71cf22c2a95c20df36b66063c21117829
|
4
|
+
data.tar.gz: 9d53ddfa9bc5554aaeffbc7921c4cfae4f2955edaa1d22db523974e5ed421731
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5deb4d9f7734a92b25ee57ebab8318b45704f6699287cf3969fafa99d4268da5a02e7bc818b1d9c33bab8d01a21dbbaf227503091e26a939e2c1c63130424308
|
7
|
+
data.tar.gz: 882ba26a22a8c031accdfe58cc7304145b433e9dbdb5e9ec53b95d4d2a064508eb46367f7fd79cc165624bcee63baf17f41ac3d2694987eb22ed5089102ed413
|
@@ -13,12 +13,10 @@ examples:
|
|
13
13
|
- advanced_table_column_headers: Multi-Header Columns
|
14
14
|
- advanced_table_column_headers_multiple: Multi-Header Columns (Multiple Levels)
|
15
15
|
- advanced_table_column_border_color_rails: Column Group Border Color
|
16
|
-
- advanced_table_no_subrows: Table with No Subrows or Expansion
|
17
16
|
- advanced_table_selectable_rows_rails: Selectable Rows
|
18
17
|
- advanced_table_selectable_rows_no_subrows_rails: Selectable Rows (No Subrows)
|
19
18
|
- advanced_table_selectable_rows_actions_rails: Selectable Rows (With Actions)
|
20
19
|
- advanced_table_selectable_rows_header_rails: Selectable Rows (No Actions Bar)
|
21
|
-
- advanced_table_scrollbar_none: Advanced Table Scrollbar None
|
22
20
|
|
23
21
|
react:
|
24
22
|
- advanced_table_default: Default (Required Props)
|
@@ -44,7 +42,7 @@ examples:
|
|
44
42
|
- advanced_table_column_headers_multiple: Multi-Header Columns (Multiple Levels)
|
45
43
|
- advanced_table_column_headers_custom_cell: Multi-Header Columns with Custom Cells
|
46
44
|
- advanced_table_column_border_color: Column Group Border Color
|
47
|
-
- advanced_table_no_subrows: Table with No Subrows
|
45
|
+
# - advanced_table_no_subrows: Table with No Subrows
|
48
46
|
- advanced_table_selectable_rows: Selectable Rows
|
49
47
|
- advanced_table_selectable_rows_no_subrows_react: Selectable Rows (No Subrows)
|
50
48
|
- advanced_table_selectable_rows_actions: Selectable Rows (With Actions)
|
@@ -54,6 +52,4 @@ examples:
|
|
54
52
|
- advanced_table_column_visibility: Column Visibility Control
|
55
53
|
- advanced_table_column_visibility_with_state: Column Visibility Control With State
|
56
54
|
- advanced_table_column_visibility_custom: Column Visibility Control with Custom Dropdown
|
57
|
-
- advanced_table_column_visibility_multi: Column Visibility Control with Multi-Header Columns
|
58
|
-
- advanced_table_pinned_rows: Pinned Rows
|
59
|
-
- advanced_table_scrollbar_none: Advanced Table Scrollbar None
|
55
|
+
- advanced_table_column_visibility_multi: Column Visibility Control with Multi-Header Columns
|
@@ -31,6 +31,4 @@ export { default as AdvancedTableColumnBorderColor} from './_advanced_table_colu
|
|
31
31
|
export { default as AdvancedTableColumnVisibility } from './_advanced_table_column_visibility.jsx'
|
32
32
|
export { default as AdvancedTableColumnVisibilityCustom } from './_advanced_table_column_visibility_custom.jsx'
|
33
33
|
export { default as AdvancedTableColumnVisibilityMulti } from './_advanced_table_column_visibility_multi.jsx'
|
34
|
-
export { default as AdvancedTableColumnVisibilityWithState } from './_advanced_table_column_visibility_with_state.jsx'
|
35
|
-
export { default as AdvancedTablePinnedRows } from './_advanced_table_pinned_rows.jsx'
|
36
|
-
export { default as AdvancedTableScrollbarNone} from './_advanced_table_scrollbar_none.jsx'
|
34
|
+
export { default as AdvancedTableColumnVisibilityWithState } from './_advanced_table_column_visibility_with_state.jsx'
|
@@ -9,10 +9,11 @@
|
|
9
9
|
<tr>
|
10
10
|
<th>
|
11
11
|
<%= pb_rails("checkbox", props: {
|
12
|
+
checked: true,
|
12
13
|
text: "Uncheck All",
|
13
14
|
value: "checkbox-value",
|
14
15
|
name: "main-checkbox",
|
15
|
-
|
16
|
+
indeterminate: true,
|
16
17
|
id: "indeterminate-checkbox"
|
17
18
|
}) %>
|
18
19
|
</th>
|
@@ -29,10 +30,55 @@
|
|
29
30
|
value: checkbox[:id],
|
30
31
|
name: "#{checkbox[:id]}-indeterminate-checkbox",
|
31
32
|
id: "#{checkbox[:id]}-indeterminate-checkbox",
|
32
|
-
indeterminate_parent: "indeterminate-checkbox",
|
33
33
|
}) %>
|
34
34
|
</td>
|
35
35
|
</tr>
|
36
36
|
<% end %>
|
37
37
|
</tbody>
|
38
38
|
<% end %>
|
39
|
+
|
40
|
+
<script>
|
41
|
+
document.addEventListener('DOMContentLoaded', function() {
|
42
|
+
const mainCheckboxWrapper = document.getElementById('indeterminate-checkbox');
|
43
|
+
const mainCheckbox = document.getElementsByName("main-checkbox")[0];
|
44
|
+
const childCheckboxes = document.querySelectorAll('input[type="checkbox"][id$="indeterminate-checkbox"]');
|
45
|
+
|
46
|
+
const updateMainCheckbox = () => {
|
47
|
+
// Count the number of checked child checkboxes
|
48
|
+
const checkedCount = Array.from(childCheckboxes).filter(cb => cb.checked).length;
|
49
|
+
// Determine if the main checkbox should be in an indeterminate state
|
50
|
+
const indeterminate = checkedCount > 0 && checkedCount < childCheckboxes.length;
|
51
|
+
|
52
|
+
// Set the main checkbox states
|
53
|
+
mainCheckbox.indeterminate = indeterminate;
|
54
|
+
mainCheckbox.checked = checkedCount > 0;
|
55
|
+
|
56
|
+
// Determine the main checkbox label based on the number of checked checkboxes
|
57
|
+
const text = checkedCount === 0 ? 'Check All' : 'Uncheck All';
|
58
|
+
|
59
|
+
// Determine the icon class to add and remove based on the number of checked checkboxes
|
60
|
+
const iconClassToAdd = checkedCount === 0 ? 'pb_checkbox_checkmark' : 'pb_checkbox_indeterminate';
|
61
|
+
const iconClassToRemove = checkedCount === 0 ? 'pb_checkbox_indeterminate' : 'pb_checkbox_checkmark';
|
62
|
+
|
63
|
+
// Update main checkbox label
|
64
|
+
mainCheckboxWrapper.getElementsByClassName('pb_body_kit')[0].textContent = text;
|
65
|
+
|
66
|
+
// Add and remove the icon class to the main checkbox wrapper
|
67
|
+
mainCheckboxWrapper.querySelector('[data-pb-checkbox-icon-span]').classList.add(iconClassToAdd);
|
68
|
+
mainCheckboxWrapper.querySelector('[data-pb-checkbox-icon-span]').classList.remove(iconClassToRemove);
|
69
|
+
|
70
|
+
// Toggle the visibility of the checkbox icon based on the indeterminate state
|
71
|
+
mainCheckboxWrapper.getElementsByClassName("indeterminate_icon")[0].classList.toggle('hidden', !indeterminate);
|
72
|
+
mainCheckboxWrapper.getElementsByClassName("check_icon")[0].classList.toggle('hidden', indeterminate);
|
73
|
+
};
|
74
|
+
|
75
|
+
mainCheckbox.addEventListener('change', function() {
|
76
|
+
childCheckboxes.forEach(cb => cb.checked = this.checked);
|
77
|
+
updateMainCheckbox();
|
78
|
+
});
|
79
|
+
|
80
|
+
childCheckboxes.forEach(cb => {
|
81
|
+
cb.addEventListener('change', updateMainCheckbox);
|
82
|
+
});
|
83
|
+
});
|
84
|
+
</script>
|
@@ -19,5 +19,4 @@ export { default as DropdownMultiSelect } from './_dropdown_multi_select.jsx'
|
|
19
19
|
export { default as DropdownMultiSelectDisplay } from './_dropdown_multi_select_display.jsx'
|
20
20
|
export { default as DropdownMultiSelectWithAutocomplete } from './_dropdown_multi_select_with_autocomplete.jsx'
|
21
21
|
export { default as DropdownMultiSelectWithDefault } from './_dropdown_multi_select_with_default.jsx'
|
22
|
-
export { default as DropdownMultiSelectWithCustomOptions } from './_dropdown_multi_select_with_custom_options.jsx'
|
23
|
-
export { default as DropdownCloseOnSelect } from './_dropdown_close_on_select.jsx'
|
22
|
+
export { default as DropdownMultiSelectWithCustomOptions } from './_dropdown_multi_select_with_custom_options.jsx'
|
@@ -4,8 +4,7 @@ examples:
|
|
4
4
|
- phone_number_input_default: Default
|
5
5
|
- phone_number_input_preferred_countries: Preferred Countries
|
6
6
|
- phone_number_input_initial_country: Initial Country
|
7
|
-
- phone_number_input_only_countries:
|
8
|
-
- phone_number_input_exclude_countries: Exclude Countries
|
7
|
+
- phone_number_input_only_countries: Limited Countries
|
9
8
|
- phone_number_input_validation: Form Validation
|
10
9
|
- phone_number_input_clear_field: Clearing the Input Field
|
11
10
|
- phone_number_input_access_input_element: Accessing the Input Element
|
@@ -16,9 +15,9 @@ examples:
|
|
16
15
|
- phone_number_input_default: Default
|
17
16
|
- phone_number_input_preferred_countries: Preferred Countries
|
18
17
|
- phone_number_input_initial_country: Initial Country
|
19
|
-
- phone_number_input_only_countries:
|
20
|
-
- phone_number_input_exclude_countries: Exclude Countries
|
18
|
+
- phone_number_input_only_countries: Limited Countries
|
21
19
|
- phone_number_input_validation: Form Validation
|
22
20
|
- phone_number_input_format: Format as You Type
|
23
21
|
- phone_number_input_hidden_inputs: Hidden Inputs
|
24
22
|
- phone_number_input_country_search: Country Search
|
23
|
+
|
@@ -2,7 +2,6 @@ export { default as PhoneNumberInputDefault } from './_phone_number_input_defaul
|
|
2
2
|
export { default as PhoneNumberInputPreferredCountries } from './_phone_number_input_preferred_countries'
|
3
3
|
export { default as PhoneNumberInputInitialCountry } from './_phone_number_input_initial_country'
|
4
4
|
export { default as PhoneNumberInputOnlyCountries } from './_phone_number_input_only_countries'
|
5
|
-
export { default as PhoneNumberInputExcludeCountries } from './_phone_number_input_exclude_countries'
|
6
5
|
export { default as PhoneNumberInputValidation } from './_phone_number_input_validation'
|
7
6
|
export { default as PhoneNumberInputClearField } from './_phone_number_input_clear_field'
|
8
7
|
export { default as PhoneNumberInputAccessInputElement } from './_phone_number_input_access_input_element'
|
@@ -18,7 +18,7 @@
|
|
18
18
|
checked: true,
|
19
19
|
value: "checkbox-value",
|
20
20
|
name: "main-checkbox-selectable",
|
21
|
-
|
21
|
+
indeterminate: true,
|
22
22
|
id: "checkbox-selectable"
|
23
23
|
}) %>
|
24
24
|
<% end %>
|
@@ -33,7 +33,7 @@
|
|
33
33
|
<% checkboxes.each_with_index do |checkbox, index| %>
|
34
34
|
<%= pb_rails("table/table_row") do %>
|
35
35
|
<%= pb_rails("table/table_cell") do %>
|
36
|
-
<%= pb_rails("checkbox", props: { checked: checkbox[:checked], id: "#{checkbox[:id]}-selectable-checkbox", name: "#{checkbox[:id]}-selectable-checkbox", on_change: "updateCheckboxes(#{index})", value: "check-box value"
|
36
|
+
<%= pb_rails("checkbox", props: { checked: checkbox[:checked], id: "#{checkbox[:id]}-selectable-checkbox", name: "#{checkbox[:id]}-selectable-checkbox", on_change: "updateCheckboxes(#{index})", value: "check-box value" }) %>
|
37
37
|
<% end %>
|
38
38
|
<%= pb_rails("table/table_cell") do %>
|
39
39
|
<%= pb_rails("image", props: { alt: "picture of a misty forest", size: "xs", url: "https://unsplash.it/500/400/?image=634" }) %>
|
@@ -45,4 +45,52 @@
|
|
45
45
|
<% end %>
|
46
46
|
<% end %>
|
47
47
|
<% end %>
|
48
|
-
<% end %>
|
48
|
+
<% end %>
|
49
|
+
|
50
|
+
<script>
|
51
|
+
document.addEventListener('DOMContentLoaded', function() {
|
52
|
+
const mainCheckboxWrapper = document.getElementById('checkbox-selectable');
|
53
|
+
const mainCheckbox = document.getElementsByName("main-checkbox-selectable")[0];
|
54
|
+
const childCheckboxes = document.querySelectorAll('input[type="checkbox"][id$="selectable-checkbox"]');
|
55
|
+
const deleteButton = document.getElementById('delete-button');
|
56
|
+
|
57
|
+
const updateDeleteButton = () => {
|
58
|
+
const anyChecked = Array.from(childCheckboxes).some(checkbox => checkbox.checked);
|
59
|
+
deleteButton.style.display = anyChecked ? 'block' : 'none';
|
60
|
+
};
|
61
|
+
|
62
|
+
const updateMainCheckbox = () => {
|
63
|
+
// Count the number of checked child checkboxes
|
64
|
+
const checkedCount = Array.from(childCheckboxes).filter(cb => cb.checked).length;
|
65
|
+
// Determine if the main checkbox should be in an indeterminate state
|
66
|
+
const indeterminate = checkedCount > 0 && checkedCount < childCheckboxes.length;
|
67
|
+
|
68
|
+
// Set the main checkbox states
|
69
|
+
mainCheckbox.indeterminate = indeterminate;
|
70
|
+
mainCheckbox.checked = checkedCount > 0;
|
71
|
+
|
72
|
+
// Determine the icon class to add and remove based on the number of checked checkboxes
|
73
|
+
const iconClassToAdd = checkedCount === 0 ? 'pb_checkbox_checkmark' : 'pb_checkbox_indeterminate';
|
74
|
+
const iconClassToRemove = checkedCount === 0 ? 'pb_checkbox_indeterminate' : 'pb_checkbox_checkmark';
|
75
|
+
|
76
|
+
// Add and remove the icon class to the main checkbox wrapper
|
77
|
+
mainCheckboxWrapper.querySelector('[data-pb-checkbox-icon-span]').classList.add(iconClassToAdd);
|
78
|
+
mainCheckboxWrapper.querySelector('[data-pb-checkbox-icon-span]').classList.remove(iconClassToRemove);
|
79
|
+
|
80
|
+
// Toggle the visibility of the checkbox icon based on the indeterminate state
|
81
|
+
mainCheckboxWrapper.getElementsByClassName("indeterminate_icon")[0].classList.toggle('hidden', !indeterminate);
|
82
|
+
mainCheckboxWrapper.getElementsByClassName("check_icon")[0].classList.toggle('hidden', indeterminate);
|
83
|
+
|
84
|
+
updateDeleteButton();
|
85
|
+
};
|
86
|
+
|
87
|
+
mainCheckbox.addEventListener('change', function() {
|
88
|
+
childCheckboxes.forEach(cb => cb.checked = this.checked);
|
89
|
+
updateMainCheckbox();
|
90
|
+
});
|
91
|
+
|
92
|
+
childCheckboxes.forEach(cb => {
|
93
|
+
cb.addEventListener('change', updateMainCheckbox);
|
94
|
+
});
|
95
|
+
});
|
96
|
+
</script>
|