playbook_ui_docs 14.20.0.pre.alpha.play2224scrollbarfix7991 → 14.20.0.pre.alpha.revert4453PBNTR933reactdraggablebugdragbtwnexamples7854

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.
Files changed (25) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta.md +2 -6
  3. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_default.jsx +1 -5
  4. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_default.md +1 -1
  5. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.html.erb +1 -1
  6. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -2
  7. data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_indeterminate.html.erb +48 -2
  8. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_only_countries.jsx +1 -1
  9. data/app/pb_kits/playbook/pb_phone_number_input/docs/example.yml +3 -4
  10. data/app/pb_kits/playbook/pb_phone_number_input/docs/index.js +0 -1
  11. data/app/pb_kits/playbook/pb_select/docs/example.yml +0 -2
  12. data/app/pb_kits/playbook/pb_select/docs/index.js +0 -1
  13. data/dist/playbook-doc.js +2 -2
  14. metadata +2 -13
  15. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions_rails.html.erb +0 -137
  16. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions_rails.md +0 -3
  17. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_header_rails.html.erb +0 -40
  18. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_header_rails.md +0 -1
  19. data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_indeterminate_rails.md +0 -1
  20. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_exclude_countries.html.erb +0 -4
  21. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_exclude_countries.jsx +0 -15
  22. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_exclude_countries.md +0 -1
  23. data/app/pb_kits/playbook/pb_select/docs/_select_custom_select_subheaders.html.erb +0 -12
  24. data/app/pb_kits/playbook/pb_select/docs/_select_custom_select_subheaders.jsx +0 -31
  25. data/app/pb_kits/playbook/pb_select/docs/_select_custom_select_subheaders.md +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ccc5387ecd2a070c70429190bca16437420dc0061a045268fa5912b95d5531e9
4
- data.tar.gz: b4cbe12442d914c752157b5e908305ad6da102e6a0ab7877b9e6e0d169588fca
3
+ metadata.gz: 362372958ccc7f058b2ea26993671410d4022c1e36f432aecc9d4d9069acdddd
4
+ data.tar.gz: a5653acda5e67571212067467a6d9c08e332267c9ba6acdd49f1a33f2cde835a
5
5
  SHA512:
6
- metadata.gz: ece16a760e155494bfbaa5c1f5caf5d9182b0071cca508d179fe4337b98b1123de06fd28ccc495bd18d4ee86bcde7be3d7fc8dcacd3fd29a042dfb550bb4f7f3
7
- data.tar.gz: 0c52f59b69572c9b361e2548737545052fa5001357a4747ff50846554dcb924301b41c3482449ec2e91a9a96f0532ef985364e309d83f2b5835410a690e192a3
6
+ metadata.gz: ebb22edd40dfaa14eedd91f339ee1d6f422cd34bcc998d509484f6f77525d8be224ab015026ad998591cb18e4908e847f73c6bfc1ae2db21039437c6479ce377
7
+ data.tar.gz: 03eb92091dd232460185a6c64168a963319f4996977838a11efc83a37a84722b95830f885fec804124e47d1bbd7e9a614dde361b7f9f35b228372a4c146fd304
@@ -1,8 +1,4 @@
1
- The AdvancedTable kit accepts tree data and automatically renders expansion controls for nested subrows, to any depth, based on the data it is given. In it's simplest form, __the kit has three required props__:
2
-
3
- ### id
4
-
5
- A unique `id` is required to allow the table functionality to work properly. Without it, certain functions like the action bar will not be able to properly reference the correct table.
1
+ The AdvancedTable kit accepts tree data and automatically renders expansion controls for nested subrows, to any depth, based on the data it is given. In it's simplest form, __the kit has two required props__:
6
2
 
7
3
  ### table_data
8
4
 
@@ -17,6 +13,6 @@ Column definitions are the single most important part of building a table as the
17
13
  - `accessor`: this is the key from your data for the value you want rendered in that column
18
14
  - `label`: this is what will be rendered as the column header label
19
15
 
20
- There is also one optional item that is only required if the table has nested data:
16
+ There is also one optional item that is only required if the table has nested data:
21
17
 
22
18
  - `cellAccessors`: This is an array of strings that represent keys from your data object. This is only required for the first column in case of nested data. If you have nested data, the AdvancedTable needs to know what to render in that first column for nested items. This array represents the nested data in the order you want it rendered.
@@ -39,13 +39,9 @@ const AdvancedTableDefault = (props) => {
39
39
  <div>
40
40
  <AdvancedTable
41
41
  columnDefinitions={columnDefinitions}
42
- maxHeight="xs"
43
- overflow="auto"
44
- responsive="scroll"
45
- scrollBarNone
46
42
  tableData={MOCK_DATA}
47
43
  {...props}
48
- />
44
+ />
49
45
  </div>
50
46
  )
51
47
  }
@@ -3,7 +3,7 @@
3
3
  <br />
4
4
  <br />
5
5
 
6
- The AdvancedTable kit accepts tree data and automatically renders expansion controls for nested subrows, to any depth, based on the data it is given. In it's simplest form, __the kit has two required props__:
6
+ The AdvancedTable kit accepts tree data and automatically renders expansion controls for nested subrows, to any depth, based on the data it is given. In it's simplest form, __the kit has two required props__:
7
7
 
8
8
  ### tableData
9
9
 
@@ -30,4 +30,4 @@
30
30
  }
31
31
  ] %>
32
32
 
33
- <%= pb_rails("advanced_table", props: { id: "table_props_table", table_data: @table_data, column_definitions: column_definitions responsive }) %>
33
+ <%= pb_rails("advanced_table", props: { id: "table_props_table", table_data: @table_data, column_definitions: column_definitions, table_props: { vertical_border: true, container: false }}) %>
@@ -15,8 +15,6 @@ examples:
15
15
  - advanced_table_column_border_color_rails: Column Group Border Color
16
16
  - advanced_table_selectable_rows_rails: Selectable Rows
17
17
  - advanced_table_selectable_rows_no_subrows_rails: Selectable Rows (No Subrows)
18
- - advanced_table_selectable_rows_actions_rails: Selectable Rows (With Actions)
19
- - advanced_table_selectable_rows_header_rails: Selectable Rows (No Actions Bar)
20
18
 
21
19
  react:
22
20
  - advanced_table_default: Default (Required Props)
@@ -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
- indeterminate_main: true,
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>
@@ -6,7 +6,7 @@ const PhoneNumberInputOnlyCountries = (props) => (
6
6
  <PhoneNumberInput
7
7
  id='only'
8
8
  onlyCountries={['us', 'br']}
9
- {...props}
9
+ {...props}
10
10
  />
11
11
  </>
12
12
  )
@@ -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: 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: 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'
@@ -8,7 +8,6 @@ examples:
8
8
  - select_required: Required Select Field
9
9
  - select_value_text_same: Equal option value and value text
10
10
  - select_custom_select: Custom Select
11
- - select_custom_select_subheaders: Custom Select Subheaders
12
11
  - select_error: Select w/ Error
13
12
  - select_inline: Select Inline
14
13
  - select_inline_show_arrow: Select Inline (Always Show Arrow)
@@ -26,7 +25,6 @@ examples:
26
25
  - select_required: Required Select Field
27
26
  - select_value_text_same: Equal option value and value text
28
27
  - select_custom_select: Custom Select
29
- - select_custom_select_subheaders: Custom Select Subheaders
30
28
  - select_error: Select w/ Error
31
29
  - select_inline: Select Inline
32
30
  - select_inline_show_arrow: Select Inline (Always Show Arrow)
@@ -11,4 +11,3 @@ export { default as SelectInlineShowArrow } from './_select_inline_show_arrow.js
11
11
  export { default as SelectInlineCompact } from './_select_inline_compact.jsx'
12
12
  export { default as SelectMultiple } from './_select_multiple.jsx'
13
13
  export { default as SelectReactHook } from './_select_react_hook.jsx'
14
- export { default as SelectCustomSelectSubheaders } from './_select_custom_select_subheaders.jsx'