playbook_ui_docs 14.21.0.pre.rc.1 → 14.21.0.pre.rc.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3d3136526d850ebca501cfacadcef39aa64713246cbaa942eee8565f5c8f0648
4
- data.tar.gz: 0a4d92499c7fae7f3a373216e929cf56854c7adfda88dee02c8f27e92d478482
3
+ metadata.gz: 54482cd9b345026db8ec02d853abb2a14ef109bd819acf0109a7477743e0ba1a
4
+ data.tar.gz: 480b28777b97c0a3d4ed00b9624eba547a3b12366119be3833505c73f75dac4c
5
5
  SHA512:
6
- metadata.gz: 934d6e9fa201011761ffafe0af67f45352482e89eda715ae7e5b3c43d647cfcd8b309618bc3de3e065b1aaff4d37238d767df93885d68a16888425d562c42994
7
- data.tar.gz: 883fedb61dc7c9318bb452641992740c60ba22a3ba4b191a490f4e8500521d4ba009a24a335f6620884d992387e251a1a85fa0399eb33e858efbbe0558598939
6
+ metadata.gz: dd73ac1cbafe0bed9dacf92d74d98ee927cb437b5b432cd484b6180d3df3413e9968f56b5f71551ba132ae75c6b81f5a963b844e7c7da99689ca62512753e818
7
+ data.tar.gz: bc975080506feea78e5ff2103f7e3ca7895a26f91e31f0402cf165a4faeb3d93729189d978f21c6552fea1e15dff9b972e496f7332119028a7d2c56d8ea6b0c5
@@ -18,7 +18,7 @@
18
18
  checked: true,
19
19
  value: "checkbox-value",
20
20
  name: "main-checkbox-selectable",
21
- indeterminate: true,
21
+ indeterminate_main: 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", indeterminate_parent: "checkbox-selectable" }) %>
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,52 +45,4 @@
45
45
  <% end %>
46
46
  <% end %>
47
47
  <% 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>
48
+ <% end %>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playbook_ui_docs
3
3
  version: !ruby/object:Gem::Version
4
- version: 14.21.0.pre.rc.1
4
+ version: 14.21.0.pre.rc.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX