playbook_ui 14.20.0.pre.alpha.play2168firstcolumnborderbug7988 → 14.20.0.pre.alpha.play2212tablekitstickycolumnswithresponsivenone7979
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/_advanced_table.scss +0 -18
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +0 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_default.jsx +1 -5
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.html.erb +1 -1
- data/app/pb_kits/playbook/pb_checkbox/checkbox.html.erb +12 -8
- data/app/pb_kits/playbook/pb_checkbox/checkbox.rb +6 -3
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_indeterminate.html.erb +48 -2
- data/app/pb_kits/playbook/pb_dropdown/index.js +0 -24
- data/app/pb_kits/playbook/pb_table/styles/_mobile_collapse.scss +1 -1
- data/dist/chunks/{_weekday_stacked-DoXl8xrB.js → _weekday_stacked-C4d17aYW.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +1 -1
- data/dist/playbook-doc.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +3 -5
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_indeterminate_rails.md +0 -1
- data/app/pb_kits/playbook/pb_checkbox/index.js +0 -56
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4e9f81a39e99264f7447b0889451c36c4676c33f5f8c836d785432d0e9b4496
|
4
|
+
data.tar.gz: c870628692d424816911bdaa0c05517e26c05731a5d01e12e1de2b5a80720a87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 827b59f32cbf03452c6fe62dd227dced2681eaf6d38fe7c1832b338b6909886f613ca5e7d7743c43073474642bdf7c6ed7a688ec0dbe679358f330f646c9c037
|
7
|
+
data.tar.gz: fed471e895d0f88a489c629f74b6fd49b318ca7e063e200522264433aac2b3b4628265cde7884b75549bfd462498aa058f00af42fa32eaaab7ad15d02924da03
|
@@ -87,16 +87,6 @@
|
|
87
87
|
}
|
88
88
|
}
|
89
89
|
|
90
|
-
&.advanced-table-hide-scrollbar {
|
91
|
-
&::-webkit-scrollbar {
|
92
|
-
display: none !important;
|
93
|
-
}
|
94
|
-
|
95
|
-
-ms-overflow-style: none !important;
|
96
|
-
scrollbar-width: none !important;
|
97
|
-
}
|
98
|
-
|
99
|
-
|
100
90
|
.row-selection-actions-card {
|
101
91
|
border-bottom-right-radius: 0px !important;
|
102
92
|
border-bottom-left-radius: 0px !important;
|
@@ -378,10 +368,6 @@
|
|
378
368
|
box-shadow: 1px 0px 0px 0px var(--column-border-color) !important;
|
379
369
|
}
|
380
370
|
|
381
|
-
.pb_table_td:nth-child(2) {
|
382
|
-
box-shadow: inset 1px 0px 0px 0px var(--column-border-color) !important;
|
383
|
-
}
|
384
|
-
|
385
371
|
// Color for collapsible trail
|
386
372
|
.collapsible-trail {
|
387
373
|
background-color: $border_light !important;
|
@@ -578,10 +564,6 @@
|
|
578
564
|
box-shadow: $shadow_deep !important;
|
579
565
|
}
|
580
566
|
|
581
|
-
.pb_table_td:nth-child(2) {
|
582
|
-
box-shadow: 0 0 0 0 !important;
|
583
|
-
}
|
584
|
-
|
585
567
|
.pb_advanced_table_header,
|
586
568
|
.pb_advanced_table_body {
|
587
569
|
th.sticky-left,
|
@@ -53,7 +53,6 @@ type AdvancedTableProps = {
|
|
53
53
|
pagination?: boolean,
|
54
54
|
paginationProps?: GenericObject
|
55
55
|
responsive?: "scroll" | "none",
|
56
|
-
scrollBarNone?: boolean,
|
57
56
|
selectableRows?: boolean,
|
58
57
|
showActionsBar?: boolean,
|
59
58
|
sortControl?: GenericObject
|
@@ -93,7 +92,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
93
92
|
pagination = false,
|
94
93
|
paginationProps,
|
95
94
|
responsive = "scroll",
|
96
|
-
scrollBarNone= false,
|
97
95
|
showActionsBar = true,
|
98
96
|
selectableRows,
|
99
97
|
sortControl,
|
@@ -247,7 +245,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
247
245
|
},
|
248
246
|
{'advanced-table-sticky-left-columns': stickyLeftColumn && stickyLeftColumn.length > 0},
|
249
247
|
columnGroupBorderColor ? `column-group-border-${columnGroupBorderColor}` : '',
|
250
|
-
scrollBarNone ? 'advanced-table-hide-scrollbar' : '',
|
251
248
|
globalProps(props),
|
252
249
|
className
|
253
250
|
);
|
@@ -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
|
}
|
@@ -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
|
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 }}) %>
|
@@ -1,12 +1,16 @@
|
|
1
|
-
<%= pb_content_tag(:label
|
2
|
-
pb_checkbox_indeterminate_main: object.indeterminate_main,
|
3
|
-
pb_checkbox_indeterminate_parent: object.indeterminate_parent,
|
4
|
-
}) do %>
|
1
|
+
<%= pb_content_tag(:label) do %>
|
5
2
|
<%= content.presence || object.input %>
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
3
|
+
<% if object.indeterminate %>
|
4
|
+
<span data-pb-checkbox-icon-span="true" class="pb_checkbox_indeterminate">
|
5
|
+
<%= pb_rails("icon", props: { icon: "minus", classname: "indeterminate_icon", fixed_width: true}) %>
|
6
|
+
<%= pb_rails("icon", props: { icon: "check", classname: "check_icon hidden", fixed_width: true}) %>
|
7
|
+
</span>
|
8
|
+
<% else %>
|
9
|
+
<span data-pb-checkbox-icon-span="true" class="pb_checkbox_checkmark">
|
10
|
+
<%= pb_rails("icon", props: { icon: "check", classname: "check_icon", fixed_width: true}) %>
|
11
|
+
<%= pb_rails("icon", props: { icon: "minus", classname: "indeterminate_icon hidden", fixed_width: true}) %>
|
12
|
+
</span>
|
13
|
+
<% end %>
|
10
14
|
<span class="pb_checkbox_label">
|
11
15
|
<%= pb_rails("body", props: { status: object.checkbox_label_status, text: object.text, dark: object.dark, margin_right: object.form_spacing ? "xs" : "" }) %>
|
12
16
|
</span>
|
@@ -5,8 +5,7 @@ module Playbook
|
|
5
5
|
class Checkbox < Playbook::KitBase
|
6
6
|
prop :error, type: Playbook::Props::Boolean, default: false
|
7
7
|
prop :checked, type: Playbook::Props::Boolean, default: false
|
8
|
-
prop :
|
9
|
-
prop :indeterminate_parent
|
8
|
+
prop :indeterminate, type: Playbook::Props::Boolean, default: false
|
10
9
|
prop :text
|
11
10
|
prop :value
|
12
11
|
prop :name
|
@@ -20,7 +19,7 @@ module Playbook
|
|
20
19
|
default: false
|
21
20
|
|
22
21
|
def classname
|
23
|
-
generate_classname("pb_checkbox_kit", checked_class) + error_class
|
22
|
+
generate_classname("pb_checkbox_kit", checked_class) + indeterminate_class + error_class
|
24
23
|
end
|
25
24
|
|
26
25
|
def input
|
@@ -40,6 +39,10 @@ module Playbook
|
|
40
39
|
def checked_class
|
41
40
|
checked ? "on" : "off"
|
42
41
|
end
|
42
|
+
|
43
|
+
def indeterminate_class
|
44
|
+
indeterminate ? " indeterminate" : ""
|
45
|
+
end
|
43
46
|
end
|
44
47
|
end
|
45
48
|
end
|
@@ -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>
|
@@ -115,7 +115,6 @@ export default class PbDropdown extends PbEnhancedElement {
|
|
115
115
|
|
116
116
|
handleSearch(term = "") {
|
117
117
|
const lcTerm = term.toLowerCase();
|
118
|
-
let hasMatch = false
|
119
118
|
this.element.querySelectorAll(OPTION_SELECTOR).forEach((opt) => {
|
120
119
|
//make it so that if the option is selected, it will not show up in the search results
|
121
120
|
if (this.isMultiSelect && this.selectedOptions.has(opt.dataset.dropdownOptionLabel)) {
|
@@ -129,32 +128,9 @@ export default class PbDropdown extends PbEnhancedElement {
|
|
129
128
|
// hide or show option
|
130
129
|
const match = label.includes(lcTerm);
|
131
130
|
opt.style.display = match ? "" : "none";
|
132
|
-
if (match) hasMatch = true
|
133
131
|
});
|
134
132
|
|
135
133
|
this.adjustDropdownHeight();
|
136
|
-
|
137
|
-
this.removeNoOptionsMessage()
|
138
|
-
if (!hasMatch) {
|
139
|
-
this.showNoOptionsMessage()
|
140
|
-
}
|
141
|
-
}
|
142
|
-
|
143
|
-
showNoOptionsMessage() {
|
144
|
-
if (this.element.querySelector(".dropdown_no_options")) return;
|
145
|
-
|
146
|
-
const noOptionElement = document.createElement("div");
|
147
|
-
noOptionElement.className = "pb_body_kit_light dropdown_no_options pb_item_kit p_xs display_flex justify_content_center";
|
148
|
-
noOptionElement.textContent = "no option";
|
149
|
-
|
150
|
-
this.target.appendChild(noOptionElement);
|
151
|
-
}
|
152
|
-
|
153
|
-
removeNoOptionsMessage() {
|
154
|
-
const existing = this.element.querySelector(".dropdown_no_options");
|
155
|
-
if (existing) {
|
156
|
-
existing.remove();
|
157
|
-
}
|
158
134
|
}
|
159
135
|
|
160
136
|
handleOptionClick(event) {
|
@@ -3,7 +3,7 @@
|
|
3
3
|
@import "../../pb_caption/caption_mixin";
|
4
4
|
|
5
5
|
@media only screen and (max-width: $screen-xs-max) {
|
6
|
-
[class^=pb_table] {
|
6
|
+
[class^=pb_table]:not(.table-responsive-scroll) {
|
7
7
|
&.table-sm.table-collapse-sm,
|
8
8
|
&.table-md.table-collapse-sm,
|
9
9
|
&.table-lg.table-collapse-sm {
|