playbook_ui_docs 14.8.0.pre.alpha.pbntr661createstickyleftprop4612 → 14.8.0.pre.alpha.play1648heightglobalprops4559

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: 565d4df4e7478be967957422514a5bb206717fcae3a3fbabc62a7d2c164fb726
4
- data.tar.gz: ec4515ee5746bdc4ef5e0c23150ab07bdb0d4e7691acd45546c64f3e954346da
3
+ metadata.gz: 283df541c54972c110f04130b281c8fbe1655601de850ca98cb601b54b778937
4
+ data.tar.gz: 80c554bed326488d73a14394efe0a66f98fcd91e4c47735d18b62b43017f3d30
5
5
  SHA512:
6
- metadata.gz: 9448c1505f3e171b124c3baca81f5dbe4d70651e96034355ae7e787207aa04876f0a10b1e42da372bdbed17f744eaaeb27935c9be2896b91704111705fa5dcc4
7
- data.tar.gz: 007b78a2168f4fd314c12b584934e05895753129af01320c4d1a03e142eb75ee1c25f3b896451c9fb5938f57bebec082dccca486e55444793ba6302fbcf0334d
6
+ metadata.gz: 310126391946beff5960edf22970adc0accda3a24b85fd0355b859915782cea3ee17fda2726e65cce36f493501adfb9ebd964458ab917480af7e44cdf9eb67d8
7
+ data.tar.gz: 87c73e139f82f5fa03e2cb00292cf27e6efb9b8cdebc41b614eed5879320c9bf831abdf61e2f3f72394a98b69e2de3ba7c2f0c513c6e986b2314683211957af5
@@ -1,84 +1,7 @@
1
- <% checkboxes = [
2
- { name: 'Coffee', id: 'coffee', checked: false },
3
- { name: 'Ice Cream', id: 'ice-cream', checked: false },
4
- { name: 'Chocolate', id: 'chocolate', checked: true }
5
- ] %>
6
-
7
- <%= pb_rails("table", props: { container: false, size: "md" }) do %>
8
- <thead>
9
- <tr>
10
- <th>
11
- <%= pb_rails("checkbox", props: {
12
- checked: true,
13
- text: "Uncheck All",
14
- value: "checkbox-value",
15
- name: "main-checkbox",
16
- indeterminate: true,
17
- id: "indeterminate-checkbox"
18
- }) %>
19
- </th>
20
- </tr>
21
- </thead>
22
-
23
- <tbody>
24
- <% checkboxes.each do |checkbox| %>
25
- <tr>
26
- <td>
27
- <%= pb_rails("checkbox", props: {
28
- checked: checkbox[:checked],
29
- text: checkbox[:name],
30
- value: checkbox[:id],
31
- name: "#{checkbox[:id]}-indeterminate-checkbox",
32
- id: "#{checkbox[:id]}-indeterminate-checkbox",
33
- }) %>
34
- </td>
35
- </tr>
36
- <% end %>
37
- </tbody>
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>
1
+ <%= pb_rails("checkbox" , props: {
2
+ text: "Select ",
3
+ value: "checkbox-value",
4
+ name: "main",
5
+ indeterminate: true,
6
+ id: "test-indeterminate-js"
7
+ }) %>
@@ -6,6 +6,7 @@
6
6
  value: "selected_with_icon",
7
7
  checked: true,
8
8
  icon: true,
9
+
9
10
  }) do %>
10
11
  Selected, with icon
11
12
  <% end %>
@@ -36,4 +37,4 @@
36
37
  Disabled
37
38
  <% end %>
38
39
 
39
- </div>
40
+ </div>
@@ -33,7 +33,6 @@ examples:
33
33
  - table_md: Medium
34
34
  - table_lg: Large
35
35
  - table_sticky: Sticky Header
36
- - table_sticky_left_columns: Sticky Left Column
37
36
  - table_alignment_row: Row Alignment
38
37
  - table_alignment_column: Cell Alignment
39
38
  - table_alignment_shift_row: Row Shift
@@ -25,4 +25,3 @@ export { default as TableDiv } from './_table_div.jsx'
25
25
  export { default as TableWithSubcomponents } from './_table_with_subcomponents.jsx'
26
26
  export { default as TableWithSubcomponentsAsDivs } from './_table_with_subcomponents_as_divs.jsx'
27
27
  export { default as TableOuterPadding } from './_table_outer_padding.jsx'
28
- export { default as TableStickyLeftColumns } from './_table_sticky_left_columns.jsx'