playbook_ui 14.18.0.pre.alpha.PLAY20397473 → 14.18.0.pre.alpha.PLAY20787400
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_beta.md +6 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_selectable_rows_no_subrows_react.jsx → _advanced_table_selectable_rows_no_subrows.jsx} +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows_rails.md +1 -5
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_rails.md +2 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +3 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/index.js +11 -228
- data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +1 -9
- data/app/pb_kits/playbook/pb_advanced_table/table_header.rb +3 -0
- data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +2 -1
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_error.jsx +1 -4
- data/app/pb_kits/playbook/pb_draggable/docs/example.yml +1 -2
- data/app/pb_kits/playbook/pb_draggable/draggable.rb +1 -9
- data/app/pb_kits/playbook/pb_draggable/index.js +142 -139
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx +1 -4
- data/app/pb_kits/playbook/pb_filter/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_form_group/_error_state_mixin.scss +18 -22
- data/app/pb_kits/playbook/pb_line_graph/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_line_graph/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.scss +0 -13
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +1 -3
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_validation.jsx +1 -8
- data/app/pb_kits/playbook/pb_phone_number_input/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_phone_number_input/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.rb +0 -3
- data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.test.js +0 -19
- data/app/pb_kits/playbook/pb_popover/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_popover/index.ts +1 -13
- data/app/pb_kits/playbook/pb_popover/popover.rb +0 -2
- data/app/pb_kits/playbook/pb_select/docs/_select_error.jsx +2 -7
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_error.jsx +1 -9
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_error.jsx +1 -7
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_error_state.jsx +2 -6
- data/dist/chunks/{_typeahead-D8CsVBZO.js → _typeahead-BX8IifKY.js} +2 -2
- data/dist/chunks/{_weekday_stacked-CHQsoCdP.js → _weekday_stacked-DfMD7HJz.js} +1 -1
- data/dist/chunks/{lib-BmTAc7Nc.js → lib-96_ZmvAo.js} +1 -1
- data/dist/chunks/{pb_form_validation-BWjy4bFn.js → pb_form_validation-Vv2TqXVC.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/playbook-doc.js +2 -2
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +12 -26
- data/app/pb_kits/playbook/pb_advanced_table/flat_advanced_table.js +0 -106
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones.html.erb +0 -43
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors.html.erb +0 -55
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors_rails.md +0 -1
- data/app/pb_kits/playbook/pb_filter/docs/_filter_within_turbo_frames.html.erb +0 -41
- data/app/pb_kits/playbook/pb_filter/docs/_filter_within_turbo_frames.md +0 -1
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_pb_styles.jsx +0 -52
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_pb_styles.md +0 -1
- data/app/pb_kits/playbook/pb_line_graph/lineGraphTheme.ts +0 -110
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_country_search.html.erb +0 -10
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_country_search.jsx +0 -20
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_country_search.md +0 -1
- data/app/pb_kits/playbook/pb_popover/docs/_popover_append_to.html.erb +0 -46
- data/app/pb_kits/playbook/pb_popover/docs/_popover_append_to.md +0 -1
- /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_selectable_rows_rails.html.erb → _advanced_table_selectable_rows.html.erb} +0 -0
- /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_selectable_rows_no_subrows_rails.html.erb → _advanced_table_selectable_rows_no_subrows.html.erb} +0 -0
- /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_selectable_rows.md → _advanced_table_selectable_rows_react.md} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_drop_zones_react.md → _draggable_drop_zones.md} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_drop_zones_colors_react.md → _draggable_drop_zones_colors.md} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eaa89f27b581b891e8f2e308b3c2878cae2b2073485c731ab1f2143ce5201c43
|
4
|
+
data.tar.gz: 43c6a430f135f407da1de984fc6eb79d4aad2c5ca6e3228e22648c7a5df640b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03ec5e9d380203c29d2ec6335961b6bbdc600b5f52186145a4dfc8a57bbb470d12bccb0b720a56620418236b945a488ad04b3421d865d4039e656ac88e2a8e45
|
7
|
+
data.tar.gz: 40f77a4576409998dff40d9ef56b172aa09b891ec42db213cf14f11ce31659cd1ec89135e2ed8b803f52318ba7c9556846e16aa9d10bde2569c78a7ee3bf13f7
|
@@ -1,3 +1,9 @@
|
|
1
|
+
**BETA VERSION**
|
2
|
+
This kit's Rails version is currently under development. Some features may not work as expected, and breaking changes may still occur; use with caution.
|
3
|
+
<br />
|
4
|
+
<br />
|
5
|
+
<br />
|
6
|
+
|
1
7
|
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__:
|
2
8
|
|
3
9
|
### table_data
|
@@ -2,7 +2,7 @@ import React from "react"
|
|
2
2
|
import AdvancedTable from '../../pb_advanced_table/_advanced_table'
|
3
3
|
import MOCK_DATA from "./advanced_table_mock_data_no_subrows.json"
|
4
4
|
|
5
|
-
const
|
5
|
+
const AdvancedTableSelectableRowsNoSubrows = (props) => {
|
6
6
|
const columnDefinitions = [
|
7
7
|
{
|
8
8
|
accessor: "year",
|
@@ -49,4 +49,4 @@ const AdvancedTableSelectableRowsNoSubrowsReact = (props) => {
|
|
49
49
|
)
|
50
50
|
}
|
51
51
|
|
52
|
-
export default
|
52
|
+
export default AdvancedTableSelectableRowsNoSubrows
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows_rails.md
CHANGED
@@ -1,5 +1 @@
|
|
1
|
-
`selectable_rows` can also be used with tables without nested row data. Set `enable_toggle_expansion: none` to adjust the Advanced Table styling to fit a table without subrows.
|
2
|
-
|
3
|
-
The data attribute `data-selected-rows` on the parent `pb_advanced_table` div will update dynamically with each selection to show an array of ids corresponding to the current selection.
|
4
|
-
|
5
|
-
__NOTE__: Each object within the `table_data` Array must contain a unique id in order to attach an id to all Rows for this to function.
|
1
|
+
`selectable_rows` can also be used with tables without nested row data. Set `enable_toggle_expansion: none` to adjust the Advanced Table styling to fit a table without subrows.
|
@@ -2,6 +2,5 @@
|
|
2
2
|
|
3
3
|
When a parent row is clicked, it will check all nested children rows, Children rows can be manually checked or unchecked as well.
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
__NOTE__: Each object within the `table_data` Array must contain a unique id in order to attach an id to all Rows for this to function.
|
5
|
+
__ALERT TO DEVS__: UPDATE THIS PARAGRAPH IN THE FOLLOW UP STORY WHEN CHECKBOX FUNCTIONALITY IS SET PLEASE
|
6
|
+
The `onRowSelectionChange` prop returns an array of ids of all Rows that have been selected. Open the console on this example and check and uncheck checkboxes to see this is action! __NOTE__: Each object within the `tableData`Array must contain a unique id in order to attach an id to all Rows for this to function.
|
@@ -12,8 +12,8 @@ examples:
|
|
12
12
|
- advanced_table_custom_cell_rails: Custom Components for Cells
|
13
13
|
- advanced_table_column_headers: Multi-Header Columns
|
14
14
|
- advanced_table_column_headers_multiple: Multi-Header Columns (Multiple Levels)
|
15
|
-
-
|
16
|
-
-
|
15
|
+
# - advanced_table_selectable_rows: Selectable Rows
|
16
|
+
# - advanced_table_selectable_rows_no_subrows: Selectable Rows (No Subrows)
|
17
17
|
|
18
18
|
|
19
19
|
react:
|
@@ -41,7 +41,7 @@ examples:
|
|
41
41
|
- advanced_table_column_headers_custom_cell: Multi-Header Columns with Custom Cells
|
42
42
|
# - advanced_table_no_subrows: Table with No Subrows
|
43
43
|
- advanced_table_selectable_rows: Selectable Rows
|
44
|
-
-
|
44
|
+
- advanced_table_selectable_rows_no_subrows: Selectable Rows (No Subrows)
|
45
45
|
- advanced_table_selectable_rows_actions: Selectable Rows (With Actions)
|
46
46
|
- advanced_table_selectable_rows_header: Selectable Rows (No Actions Bar)
|
47
47
|
- advanced_table_inline_editing: Inline Cell Editing
|
@@ -15,7 +15,7 @@ export { default as AdvancedTablePaginationWithProps } from './_advanced_table_p
|
|
15
15
|
export { default as AdvancedTableColumnHeaders } from './_advanced_table_column_headers.jsx'
|
16
16
|
export { default as AdvancedTableColumnHeadersMultiple } from './_advanced_table_column_headers_multiple.jsx'
|
17
17
|
export { default as AdvancedTableSelectableRows } from './_advanced_table_selectable_rows.jsx'
|
18
|
-
export { default as
|
18
|
+
export { default as AdvancedTableSelectableRowsNoSubrows } from './_advanced_table_selectable_rows_no_subrows.jsx'
|
19
19
|
export { default as AdvancedTableNoSubrows } from './_advanced_table_no_subrows.jsx'
|
20
20
|
export { default as AdvancedTableSelectableRowsHeader } from './_advanced_table_selectable_rows_header.jsx'
|
21
21
|
export { default as AdvancedTableSelectableRowsActions } from './_advanced_table_selectable_rows_actions.jsx'
|
@@ -9,182 +9,12 @@ export default class PbAdvancedTable extends PbEnhancedElement {
|
|
9
9
|
return ADVANCED_TABLE_SELECTOR;
|
10
10
|
}
|
11
11
|
|
12
|
-
updateTableSelectedRowsAttribute() {
|
13
|
-
const mainTable = this.element.closest(".pb_advanced_table");
|
14
|
-
mainTable.dataset.selectedRows = JSON.stringify(Array.from(PbAdvancedTable.selectedRows));
|
15
|
-
}
|
16
|
-
|
17
|
-
// Check if the row is expanded or collapsed
|
18
|
-
// This is used to determine the background color of the row
|
19
|
-
// when the checkbox is checked or unchecked
|
20
|
-
isRowExpanded(rowEl) {
|
21
|
-
const closeIcon = rowEl.querySelector(UP_ARROW_SELECTOR);
|
22
|
-
return closeIcon?.style.display === "none" || !closeIcon;
|
23
|
-
}
|
24
|
-
|
25
|
-
updateParentCheckboxes(checkbox) {
|
26
|
-
const rowEl = checkbox.closest("tr");
|
27
|
-
if (!rowEl) return;
|
28
|
-
|
29
|
-
const table = rowEl.closest("table");
|
30
|
-
if (!table) return;
|
31
|
-
|
32
|
-
const contentTrail = rowEl.dataset.advancedTableContent;
|
33
|
-
if (!contentTrail) return;
|
34
|
-
|
35
|
-
const ancestorIds = contentTrail.split("-").slice(0, -1);
|
36
|
-
|
37
|
-
ancestorIds.reverse();
|
38
|
-
ancestorIds.forEach((ancestorId) => {
|
39
|
-
const parentRowSelector = `[data-advanced-table-content$="${ancestorId}"]`;
|
40
|
-
const parentRow = table.querySelector(parentRowSelector);
|
41
|
-
if (!parentRow) return;
|
42
|
-
|
43
|
-
const parentLabel = parentRow.querySelector("label[data-row-id]");
|
44
|
-
if (!parentLabel) return;
|
45
|
-
|
46
|
-
const parentCheckbox = parentLabel.querySelector(
|
47
|
-
"input[type='checkbox']"
|
48
|
-
);
|
49
|
-
if (!parentCheckbox) return;
|
50
|
-
|
51
|
-
// Find all immediate children of parent linked to ancestor Id, filter our subrow headers
|
52
|
-
const children = Array.from(
|
53
|
-
table.querySelectorAll(`tr[data-row-parent$="_${ancestorId}"]`)
|
54
|
-
).filter((child) => {
|
55
|
-
const content = child.dataset.advancedTableContent;
|
56
|
-
return !(content && content.endsWith("sr"));
|
57
|
-
});
|
58
|
-
|
59
|
-
const allChildrenChecked = Array.from(children).every((child) => {
|
60
|
-
const childLabel = child.querySelector("label[data-row-id]");
|
61
|
-
if (!childLabel) return false;
|
62
|
-
const childCheckbox = childLabel.querySelector(
|
63
|
-
"input[type='checkbox']"
|
64
|
-
);
|
65
|
-
if (!childCheckbox) return false;
|
66
|
-
return childCheckbox.checked;
|
67
|
-
});
|
68
|
-
|
69
|
-
// Update parent checkbox
|
70
|
-
parentCheckbox.checked = allChildrenChecked;
|
71
|
-
|
72
|
-
const parentCheckboxId = parentCheckbox.id;
|
73
|
-
if (allChildrenChecked) {
|
74
|
-
PbAdvancedTable.selectedRows.add(parentCheckboxId);
|
75
|
-
parentRow.classList.add("bg-row-selection");
|
76
|
-
parentRow.classList.remove("bg-white", "bg-silver");
|
77
|
-
} else {
|
78
|
-
PbAdvancedTable.selectedRows.delete(parentCheckboxId);
|
79
|
-
}
|
80
|
-
if (!allChildrenChecked) {
|
81
|
-
parentRow.classList.remove("bg-row-selection");
|
82
|
-
|
83
|
-
if (this.isRowExpanded(parentRow)) {
|
84
|
-
parentRow.classList.remove("bg-silver");
|
85
|
-
parentRow.classList.add("bg-white");
|
86
|
-
} else {
|
87
|
-
parentRow.classList.remove("bg-white");
|
88
|
-
parentRow.classList.add("bg-silver");
|
89
|
-
}
|
90
|
-
}
|
91
|
-
});
|
92
|
-
}
|
93
|
-
|
94
|
-
handleCheckboxClick(event) {
|
95
|
-
const checkbox = event.currentTarget;
|
96
|
-
const rowId = checkbox.id;
|
97
|
-
const isChecked = checkbox.checked;
|
98
|
-
const rowEl = checkbox.closest("tr");
|
99
|
-
|
100
|
-
if (isChecked) {
|
101
|
-
PbAdvancedTable.selectedRows.add(rowId);
|
102
|
-
rowEl.classList.add("bg-row-selection");
|
103
|
-
rowEl.classList.remove("bg-white", "bg-silver");
|
104
|
-
} else {
|
105
|
-
PbAdvancedTable.selectedRows.delete(rowId);
|
106
|
-
}
|
107
|
-
// Update background color on row
|
108
|
-
if (!isChecked) {
|
109
|
-
rowEl.classList.remove("bg-row-selection");
|
110
|
-
|
111
|
-
if (this.isRowExpanded(rowEl)) {
|
112
|
-
rowEl.classList.remove("bg-silver");
|
113
|
-
rowEl.classList.add("bg-white");
|
114
|
-
} else {
|
115
|
-
rowEl.classList.remove("bg-white");
|
116
|
-
rowEl.classList.add("bg-silver");
|
117
|
-
}
|
118
|
-
}
|
119
|
-
if (rowEl) {
|
120
|
-
const table = rowEl.closest("table");
|
121
|
-
const rowContent = rowEl.dataset.advancedTableContent;
|
122
|
-
|
123
|
-
if (rowContent) {
|
124
|
-
const childRows = table.querySelectorAll(
|
125
|
-
`[data-advanced-table-content^="${rowContent}-"]`
|
126
|
-
);
|
127
|
-
|
128
|
-
childRows.forEach((childRow) => {
|
129
|
-
const label = childRow.querySelector("label[data-row-id]");
|
130
|
-
if (!label) return;
|
131
|
-
|
132
|
-
const childCheckbox = label.querySelector("input[type='checkbox']");
|
133
|
-
if (!childCheckbox) return;
|
134
|
-
|
135
|
-
childCheckbox.checked = isChecked;
|
136
|
-
|
137
|
-
const childRowId = childCheckbox.id;
|
138
|
-
const childRowEl = childCheckbox.closest("tr");
|
139
|
-
if (isChecked) {
|
140
|
-
PbAdvancedTable.selectedRows.add(childRowId);
|
141
|
-
childRowEl?.classList.add("bg-row-selection");
|
142
|
-
childRowEl?.classList.remove("bg-white", "bg-silver");
|
143
|
-
} else {
|
144
|
-
PbAdvancedTable.selectedRows.delete(childRowId);
|
145
|
-
}
|
146
|
-
if (!isChecked) {
|
147
|
-
childRowEl?.classList.remove("bg-row-selection");
|
148
|
-
|
149
|
-
if (this.isRowExpanded(childRowEl)) {
|
150
|
-
childRowEl?.classList.remove("bg-silver");
|
151
|
-
childRowEl?.classList.add("bg-white");
|
152
|
-
} else {
|
153
|
-
childRowEl?.classList.remove("bg-white");
|
154
|
-
childRowEl?.classList.add("bg-silver");
|
155
|
-
}
|
156
|
-
}
|
157
|
-
});
|
158
|
-
}
|
159
|
-
}
|
160
|
-
|
161
|
-
this.updateParentCheckboxes(checkbox);
|
162
|
-
|
163
|
-
this.updateTableSelectedRowsAttribute();
|
164
|
-
|
165
|
-
const table = checkbox.closest("table");
|
166
|
-
const selectAllCheckbox = table.querySelector("#select-all-rows");
|
167
|
-
|
168
|
-
if (selectAllCheckbox) {
|
169
|
-
const allCheckboxes = table.querySelectorAll(
|
170
|
-
"label[data-row-id] input[type='checkbox']"
|
171
|
-
);
|
172
|
-
const allChecked = Array.from(allCheckboxes).every((cb) => cb.checked);
|
173
|
-
|
174
|
-
const selectAllInput = selectAllCheckbox.querySelector(
|
175
|
-
'input[type="checkbox"]'
|
176
|
-
);
|
177
|
-
selectAllInput.checked = allChecked;
|
178
|
-
}
|
179
|
-
}
|
180
|
-
|
181
12
|
get target() {
|
182
13
|
const table = this.element.closest("table");
|
183
14
|
return table.querySelectorAll(`[data-row-parent="${this.element.id}"]`);
|
184
15
|
}
|
185
16
|
|
186
17
|
static expandedRows = new Set();
|
187
|
-
static selectedRows = new Set();
|
188
18
|
static isCollapsing = false;
|
189
19
|
|
190
20
|
connect() {
|
@@ -201,31 +31,17 @@ export default class PbAdvancedTable extends PbEnhancedElement {
|
|
201
31
|
this.toggleElement(this.target);
|
202
32
|
}
|
203
33
|
});
|
204
|
-
|
205
|
-
this.hideCloseIcon()
|
206
|
-
|
207
|
-
const
|
208
|
-
|
209
|
-
|
210
|
-
if (table.dataset.pbAdvancedTableInitialized) return;
|
211
|
-
table.dataset.pbAdvancedTableInitialized = "true";
|
212
|
-
|
213
|
-
// Bind checkbox change handlers for all row checkboxes
|
214
|
-
const checkboxLabels = table.querySelectorAll("label[data-row-id]");
|
215
|
-
checkboxLabels.forEach((label) => {
|
216
|
-
const checkbox = label.querySelector("input[type='checkbox']");
|
217
|
-
if (!checkbox) return;
|
218
|
-
checkbox.addEventListener("change", (event) => {
|
219
|
-
this.handleCheckboxClick(event);
|
220
|
-
});
|
221
|
-
});
|
222
|
-
|
223
|
-
// Bind nested row expansion logic
|
224
|
-
const nestedButtons = table.querySelectorAll("[data-advanced-table]");
|
34
|
+
|
35
|
+
this.hideCloseIcon()
|
36
|
+
|
37
|
+
const nestedButtons = this.element
|
38
|
+
.closest("table")
|
39
|
+
.querySelectorAll("[data-advanced-table]");
|
225
40
|
nestedButtons.forEach((button) => {
|
226
41
|
button.addEventListener("click", () => {
|
227
42
|
const isExpanded =
|
228
|
-
button.querySelector(UP_ARROW_SELECTOR).style.display ===
|
43
|
+
button.querySelector(UP_ARROW_SELECTOR).style.display ===
|
44
|
+
"inline-block";
|
229
45
|
if (isExpanded) {
|
230
46
|
PbAdvancedTable.expandedRows.add(button.id);
|
231
47
|
} else {
|
@@ -233,46 +49,12 @@ export default class PbAdvancedTable extends PbEnhancedElement {
|
|
233
49
|
}
|
234
50
|
});
|
235
51
|
});
|
236
|
-
|
237
|
-
// Bind select-all logic for this table
|
238
|
-
const selectAllCheckbox = table.querySelector("#select-all-rows");
|
239
|
-
if (selectAllCheckbox) {
|
240
|
-
selectAllCheckbox.addEventListener("change", () => {
|
241
|
-
const checkboxInput = selectAllCheckbox.querySelector('input[type="checkbox"]');
|
242
|
-
const checkAll = checkboxInput.checked;
|
243
|
-
|
244
|
-
const checkboxes = Array.from(
|
245
|
-
table.querySelectorAll("label[data-row-id] input[type='checkbox']")
|
246
|
-
);
|
247
|
-
|
248
|
-
checkboxes.forEach((cb) => {
|
249
|
-
cb.checked = checkAll;
|
250
|
-
const rowId = cb.id;
|
251
|
-
const rowEl = cb.closest("tr");
|
252
|
-
|
253
|
-
if (checkAll) {
|
254
|
-
PbAdvancedTable.selectedRows.add(rowId);
|
255
|
-
rowEl?.classList.add("bg-row-selection");
|
256
|
-
rowEl?.classList.remove("bg-white", "bg-silver");
|
257
|
-
} else {
|
258
|
-
PbAdvancedTable.selectedRows.delete(rowId);
|
259
|
-
rowEl?.classList.remove("bg-row-selection");
|
260
|
-
rowEl?.classList.add("bg-white");
|
261
|
-
}
|
262
|
-
});
|
263
|
-
|
264
|
-
checkboxes.forEach((cb) => this.updateParentCheckboxes(cb));
|
265
|
-
|
266
|
-
this.updateTableSelectedRowsAttribute();
|
267
|
-
});
|
268
|
-
}
|
269
52
|
}
|
270
|
-
|
271
53
|
|
272
54
|
hideCloseIcon() {
|
273
55
|
const closeIcon = this.element.querySelector(UP_ARROW_SELECTOR);
|
274
56
|
closeIcon.style.display = "none";
|
275
|
-
|
57
|
+
}
|
276
58
|
|
277
59
|
showElement(elements) {
|
278
60
|
elements.forEach((elem) => {
|
@@ -369,6 +151,7 @@ export default class PbAdvancedTable extends PbEnhancedElement {
|
|
369
151
|
}
|
370
152
|
}
|
371
153
|
|
154
|
+
|
372
155
|
displayDownArrow() {
|
373
156
|
this.element.querySelector(DOWN_ARROW_SELECTOR).style.display =
|
374
157
|
"inline-block";
|
@@ -455,4 +238,4 @@ window.expandAllRows = (element) => {
|
|
455
238
|
|
456
239
|
window.expandAllSubRows = (element, rowDepth) => {
|
457
240
|
PbAdvancedTable.handleToggleAllSubRows(element, rowDepth);
|
458
|
-
};
|
241
|
+
};
|
@@ -55,15 +55,7 @@ module Playbook
|
|
55
55
|
# Subrow header if applicable
|
56
56
|
output << pb_rails("advanced_table/table_subrow_header", props: { row: row, column_definitions: leaf_columns, depth: current_depth, subrow_header: subrow_headers[current_depth - 1], collapsible_trail: collapsible_trail, classname: "toggle-content", responsive: responsive, subrow_data_attributes: subrow_data_attributes }) if is_first_child_of_subrow && enable_toggle_expansion == "all"
|
57
57
|
|
58
|
-
current_data_attributes =
|
59
|
-
{
|
60
|
-
row_depth: 0,
|
61
|
-
advanced_table_content: row.object_id.to_s,
|
62
|
-
row_parent: nil,
|
63
|
-
}
|
64
|
-
else
|
65
|
-
table_data_attributes
|
66
|
-
end
|
58
|
+
current_data_attributes = current_depth.zero? ? { row_depth: 0 } : table_data_attributes
|
67
59
|
|
68
60
|
# Additional class and data attributes needed for toggle logic
|
69
61
|
output << pb_rails("advanced_table/table_row", props: { id: id, row: row, column_definitions: leaf_columns, depth: current_depth, collapsible_trail: collapsible_trail, classname: additional_classes, table_data_attributes: current_data_attributes, responsive: responsive, loading: loading, selectable_rows: selectable_rows, row_id: row[:id], enable_toggle_expansion: enable_toggle_expansion })
|
@@ -60,7 +60,7 @@ module Playbook
|
|
60
60
|
name: "select-row-#{row_id || row.object_id}",
|
61
61
|
data: {
|
62
62
|
row_id: row_id || row.object_id.to_s,
|
63
|
-
|
63
|
+
action: "click->pb-advanced-table#toggleRowSelection",
|
64
64
|
},
|
65
65
|
})
|
66
66
|
end
|
@@ -75,6 +75,7 @@ module Playbook
|
|
75
75
|
name: "select-row-#{row_id || row.object_id}",
|
76
76
|
data: {
|
77
77
|
row_id: row_id || row.object_id.to_s,
|
78
|
+
action: "click->pb-advanced-table#toggleRowSelection",
|
78
79
|
},
|
79
80
|
})
|
80
81
|
end
|
@@ -1,14 +1,11 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
|
3
3
|
import DatePicker from '../_date_picker'
|
4
|
-
import Icon from '../../pb_icon/_icon'
|
5
4
|
|
6
5
|
const DatePickerError = (props) => (
|
7
6
|
<div>
|
8
7
|
<DatePicker
|
9
|
-
error=
|
10
|
-
<Icon icon="warning" /> Invalid date. Please pick a valid date.
|
11
|
-
</>}
|
8
|
+
error="Invalid date. Please pick a valid date."
|
12
9
|
pickerId="date-picker-error"
|
13
10
|
{...props}
|
14
11
|
/>
|
@@ -17,6 +17,5 @@ examples:
|
|
17
17
|
- draggable_with_cards: Draggable with Cards
|
18
18
|
- draggable_with_table: Draggable with Table
|
19
19
|
- draggable_multiple_containers: Dragging Across Multiple Containers
|
20
|
-
- draggable_drop_zones: Draggable Drop Zones
|
21
|
-
- draggable_drop_zones_colors: Draggable Drop Zones Colors
|
22
20
|
- draggable_event_listeners: Draggable Event Listeners
|
21
|
+
|
@@ -5,17 +5,9 @@ module Playbook
|
|
5
5
|
class Draggable < ::Playbook::KitBase
|
6
6
|
prop :initial_items, type: Playbook::Props::Array,
|
7
7
|
default: []
|
8
|
-
prop :drop_zone_type, type: Playbook::Props::Enum,
|
9
|
-
values: %w[ghost shadow outline line],
|
10
|
-
default: "ghost"
|
11
|
-
prop :drop_zone_color, type: Playbook::Props::Enum,
|
12
|
-
values: %w[neutral primary purple],
|
13
|
-
default: "neutral"
|
14
8
|
|
15
9
|
def data
|
16
|
-
Hash(prop(:data)).merge(pb_draggable: true
|
17
|
-
drop_zone_type: drop_zone_type,
|
18
|
-
drop_zone_color: drop_zone_color)
|
10
|
+
Hash(prop(:data)).merge(pb_draggable: true)
|
19
11
|
end
|
20
12
|
|
21
13
|
def classname
|