playbook_ui 14.23.0.pre.alpha.PLAY2205atborderbug9085 → 14.23.0.pre.alpha.PLAY2243customindeterminatemaincheckboxlabels9046
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/Components/TableActionBar.tsx +10 -10
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +1 -53
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +6 -9
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +1 -13
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table_action_bar.js +0 -16
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_advanced_table/scss_partials/advanced_table_sticky_mixin.scss +1 -7
- data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +1 -3
- data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +1 -5
- data/app/pb_kits/playbook/pb_advanced_table/table_header.rb +0 -36
- data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +2 -11
- data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +0 -2
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_position.md +1 -1
- data/app/pb_kits/playbook/pb_checkbox/checkbox.rb +12 -1
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_indeterminate.html.erb +1 -1
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_indeterminate_rails.md +2 -1
- data/app/pb_kits/playbook/pb_checkbox/index.js +3 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.md +1 -1
- data/app/pb_kits/playbook/pb_line_graph/docs/_description.md +3 -1
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_colors.jsx +17 -36
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_default.jsx +16 -31
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_height.jsx +31 -63
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend.jsx +16 -35
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_nonclickable.jsx +16 -41
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_position.jsx +62 -107
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_position.md +7 -4
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_pb_styles.jsx +52 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_pb_styles.md +1 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_line_graph/lineGraphTheme.ts +1 -16
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +0 -3
- 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_table/docs/_table_with_selectable_rows.html.erb +1 -0
- data/dist/chunks/_gauge-BUpiCaK5.js +1 -0
- data/dist/chunks/_typeahead-ITbXBlyi.js +6 -0
- data/dist/chunks/{_weekday_stacked-BNHSKTSw.js → _weekday_stacked-BIEMUAn8.js} +2 -2
- data/dist/chunks/{lib-DnQyMxO1.js → lib-AStGp3dD.js} +1 -1
- data/dist/chunks/{pb_form_validation-kl-4Jv4t.js → pb_form_validation-DF742j1h.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/playbook-doc.js +1 -1
- 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 +11 -18
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_row_styling.html.erb +0 -46
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_row_styling_rails.md +0 -7
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header_rails.html.erb +0 -51
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header_rails.md +0 -1
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_colors_react.md +0 -3
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_height.md +0 -3
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_strict_mode.html.erb +0 -10
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_strict_mode.jsx +0 -26
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_strict_mode.md +0 -3
- data/dist/chunks/_line_graph-BfCo79KE.js +0 -1
- data/dist/chunks/_typeahead-Db4YQA5c.js +0 -6
- /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_row_styling_react.md → _advanced_table_row_styling.md} +0 -0
- /data/app/pb_kits/playbook/pb_line_graph/docs/{_line_graph_colors_rails.md → _line_graph_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: fbf9a417a4f6e2dcdf093c538efc5d3be6aa9a5bfdeaef160a8dc27e10bc6071
|
4
|
+
data.tar.gz: 90c1022791a95512530ab08978a544b5cd1bd716a4ecd70a5dd6b480e853d6f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 983c01db202cb88494f13e2a1c7593d7cf01c6d655ff89a78ca1f085f78bd5a79a393c05f1a8a05d2e024999e4bcc8e4843d0f7004649d3f1cb05a72228cd641
|
7
|
+
data.tar.gz: 44eda0c8b056f6998518bf9bde3b3bb5e721df6cb47739b17f1053464a7d594352c26d3005e0b0d2a3e3209ed02ae2f4287233822919a43d9aef256548c3f768
|
@@ -112,7 +112,7 @@ const TableActionBar: React.FC<TableActionBarProps> = ({
|
|
112
112
|
paddingBottom="xs"
|
113
113
|
text={node.label}
|
114
114
|
/>
|
115
|
-
<Flex flexDirection="column"
|
115
|
+
<Flex flexDirection="column"
|
116
116
|
paddingLeft="lg"
|
117
117
|
>
|
118
118
|
{node?.children?.map((child) =>
|
@@ -141,8 +141,8 @@ const TableActionBar: React.FC<TableActionBarProps> = ({
|
|
141
141
|
setShowPopover(!shouldClose)
|
142
142
|
|
143
143
|
const popoverReference = (
|
144
|
-
<Tooltip
|
145
|
-
placement="top"
|
144
|
+
<Tooltip
|
145
|
+
placement="top"
|
146
146
|
text="Column Configuration"
|
147
147
|
>
|
148
148
|
<div onClick={togglePopover}>
|
@@ -170,8 +170,8 @@ const TableActionBar: React.FC<TableActionBarProps> = ({
|
|
170
170
|
>
|
171
171
|
{type === "row-selection" ? (
|
172
172
|
<>
|
173
|
-
<Caption color="light"
|
174
|
-
paddingLeft="xs"
|
173
|
+
<Caption color="light"
|
174
|
+
paddingLeft="xs"
|
175
175
|
size="xs"
|
176
176
|
>
|
177
177
|
{selectedCount} Selected
|
@@ -188,15 +188,15 @@ const TableActionBar: React.FC<TableActionBarProps> = ({
|
|
188
188
|
zIndex={3}
|
189
189
|
>
|
190
190
|
<>
|
191
|
-
<Caption
|
192
|
-
paddingY="sm"
|
191
|
+
<Caption
|
192
|
+
paddingY="sm"
|
193
193
|
text="Columns Config"
|
194
|
-
textAlign="center"
|
194
|
+
textAlign="center"
|
195
195
|
/>
|
196
196
|
<SectionSeparator paddingBottom="xs" />
|
197
197
|
{tree.map((node: VisibilityNode) => (
|
198
|
-
<Flex cursor="pointer"
|
199
|
-
flexDirection="column"
|
198
|
+
<Flex cursor="pointer"
|
199
|
+
flexDirection="column"
|
200
200
|
key={node.id}
|
201
201
|
paddingX="xs"
|
202
202
|
>
|
@@ -124,65 +124,13 @@
|
|
124
124
|
-ms-overflow-style: none !important;
|
125
125
|
scrollbar-width: none !important;
|
126
126
|
}
|
127
|
-
|
128
|
-
// When action bar is hidden, ensure proper border radius for header corners
|
129
|
-
&.hidden-action-bar {
|
130
|
-
.pb_advanced_table_header {
|
131
|
-
> tr:first-child {
|
132
|
-
th:first-child {
|
133
|
-
border-top-left-radius: 4px !important;
|
134
|
-
}
|
135
|
-
th:last-child {
|
136
|
-
border-top-right-radius: 4px !important;
|
137
|
-
}
|
138
|
-
}
|
139
|
-
}
|
140
|
-
|
141
|
-
// Also handle the case when there are multiple header rows
|
142
|
-
.pb_advanced_table_header {
|
143
|
-
> tr:first-child {
|
144
|
-
th:first-child,
|
145
|
-
.table-header-cells:first-child,
|
146
|
-
.table-header-cells-custom:first-child {
|
147
|
-
border-top-left-radius: 4px !important;
|
148
|
-
}
|
149
|
-
th:last-child,
|
150
|
-
.table-header-cells:last-child,
|
151
|
-
.table-header-cells-custom:last-child {
|
152
|
-
border-top-right-radius: 4px !important;
|
153
|
-
}
|
154
|
-
}
|
155
|
-
}
|
156
|
-
}
|
157
|
-
|
158
|
-
// When action bar is shown, remove border radius from header
|
159
|
-
.row-selection-actions-card.is-visible ~ * .pb_advanced_table_header,
|
160
|
-
.row-selection-actions-card.show-action-card ~ * .pb_advanced_table_header {
|
161
|
-
> tr:first-child {
|
162
|
-
th:first-child,
|
163
|
-
th:last-child,
|
164
|
-
.table-header-cells:first-child,
|
165
|
-
.table-header-cells:last-child,
|
166
|
-
.table-header-cells-custom:first-child,
|
167
|
-
.table-header-cells-custom:last-child {
|
168
|
-
border-top-left-radius: 0 !important;
|
169
|
-
border-top-right-radius: 0 !important;
|
170
|
-
}
|
171
|
-
}
|
172
|
-
}
|
173
|
-
|
127
|
+
|
174
128
|
|
175
129
|
.row-selection-actions-card {
|
176
130
|
border-bottom-right-radius: 0px !important;
|
177
131
|
border-bottom-left-radius: 0px !important;
|
178
132
|
border-bottom-color: transparent;
|
179
133
|
transition: height 300ms ease;
|
180
|
-
|
181
|
-
&.is-visible,
|
182
|
-
&.show-action-card {
|
183
|
-
border-top-left-radius: 4px !important;
|
184
|
-
border-top-right-radius: 4px !important;
|
185
|
-
}
|
186
134
|
}
|
187
135
|
.table-header-cells:first-child {
|
188
136
|
min-width: 180px;
|
@@ -218,10 +218,10 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
218
218
|
)
|
219
219
|
|
220
220
|
return (
|
221
|
-
<Card
|
221
|
+
<Card
|
222
222
|
borderNone
|
223
223
|
borderRadius="none"
|
224
|
-
className="advanced-table-fullscreen-header"
|
224
|
+
className="advanced-table-fullscreen-header"
|
225
225
|
{...props}
|
226
226
|
>
|
227
227
|
<Flex justify="end">
|
@@ -250,10 +250,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
250
250
|
const ariaProps = buildAriaProps(aria);
|
251
251
|
const dataProps = buildDataProps(data);
|
252
252
|
const htmlProps = buildHtmlProps(htmlOptions);
|
253
|
-
|
254
|
-
// Visibility flag for action bar
|
255
|
-
const isActionBarVisible = (selectableRows && showActionsBar && selectedRowsLength > 0) || columnVisibilityControl;
|
256
|
-
|
257
253
|
const classes = classnames(
|
258
254
|
buildCss("pb_advanced_table"),
|
259
255
|
`advanced-table-responsive-${responsive}`,
|
@@ -261,8 +257,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
261
257
|
{
|
262
258
|
'advanced-table-fullscreen': isFullscreen,
|
263
259
|
'advanced-table-allow-fullscreen': allowFullScreen,
|
264
|
-
// Add the hidden-action-bar class when action bar functionality exists but is not visible
|
265
|
-
'hidden-action-bar': (selectableRows || columnVisibilityControl) && !isActionBarVisible,
|
266
260
|
},
|
267
261
|
{'advanced-table-sticky-left-columns': stickyLeftColumn && stickyLeftColumn.length > 0},
|
268
262
|
columnGroupBorderColor ? `column-group-border-${columnGroupBorderColor}` : '',
|
@@ -276,6 +270,9 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
276
270
|
? getVirtualizedContainerStyles(maxHeight)
|
277
271
|
: {};
|
278
272
|
|
273
|
+
// Visibility flag for action bar
|
274
|
+
const isActionBarVisible = (selectableRows && showActionsBar && selectedRowsLength > 0) || columnVisibilityControl;
|
275
|
+
|
279
276
|
// The actual Main <Table /> element
|
280
277
|
const tableElement = (
|
281
278
|
<Table
|
@@ -291,7 +288,7 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
291
288
|
) : (
|
292
289
|
<>
|
293
290
|
<TableHeader />
|
294
|
-
<TableBody
|
291
|
+
<TableBody
|
295
292
|
isFetching={isFetching}
|
296
293
|
/>
|
297
294
|
</>
|
@@ -12,7 +12,7 @@
|
|
12
12
|
<% content.presence %>
|
13
13
|
<% else %>
|
14
14
|
<%= pb_rails("advanced_table/table_header", props: { column_definitions: object.column_definitions, enable_toggle_expansion: object.enable_toggle_expansion, responsive: object.responsive, loading: object.loading, selectable_rows: object.selectable_rows, show_actions_bar: object.show_actions_bar }) %>
|
15
|
-
<%= pb_rails("advanced_table/table_body", props: { id: object.id, table_data: object.table_data, column_definitions: object.column_definitions, responsive: object.responsive, loading: object.loading, selectable_rows: object.selectable_rows, enable_toggle_expansion: object.enable_toggle_expansion
|
15
|
+
<%= pb_rails("advanced_table/table_body", props: { id: object.id, table_data: object.table_data, column_definitions: object.column_definitions, responsive: object.responsive, loading: object.loading, selectable_rows: object.selectable_rows, enable_toggle_expansion: object.enable_toggle_expansion }) %>
|
16
16
|
<% end %>
|
17
17
|
<% end %>
|
18
18
|
<% end %>
|
@@ -31,16 +31,9 @@ module Playbook
|
|
31
31
|
default: []
|
32
32
|
prop :scroll_bar_none, type: Playbook::Props::Boolean,
|
33
33
|
default: false
|
34
|
-
prop :row_styling, type: Playbook::Props::Array,
|
35
|
-
default: []
|
36
34
|
|
37
35
|
def classname
|
38
|
-
additional_classes = [
|
39
|
-
responsive_classname,
|
40
|
-
max_height_classname,
|
41
|
-
hide_scroll_bar_class,
|
42
|
-
hidden_action_bar_class,
|
43
|
-
]
|
36
|
+
additional_classes = [responsive_classname, max_height_classname, hide_scroll_bar_class]
|
44
37
|
additional_classes << "column-group-border-#{column_group_border_color}" if column_group_border_color != "none"
|
45
38
|
generate_classname("pb_advanced_table", *additional_classes, separator: " ")
|
46
39
|
end
|
@@ -57,11 +50,6 @@ module Playbook
|
|
57
50
|
scroll_bar_none ? "advanced-table-hide-scrollbar " : ""
|
58
51
|
end
|
59
52
|
|
60
|
-
def hidden_action_bar_class
|
61
|
-
# Add hidden-action-bar class when action bar functionality is enabled but not currently visible
|
62
|
-
selectable_rows && !is_action_bar_visible ? "hidden-action-bar" : ""
|
63
|
-
end
|
64
|
-
|
65
53
|
def selected_rows
|
66
54
|
@selected_rows ||= []
|
67
55
|
end
|
@@ -1,7 +1,4 @@
|
|
1
1
|
function showActionBar(actionBar, selectedCount) {
|
2
|
-
// Get container
|
3
|
-
const tableContainer = actionBar.closest('.pb_advanced_table');
|
4
|
-
|
5
2
|
// Show action bar directly
|
6
3
|
actionBar.style.height = "auto";
|
7
4
|
actionBar.style.overflow = "visible";
|
@@ -11,11 +8,6 @@ function showActionBar(actionBar, selectedCount) {
|
|
11
8
|
actionBar.classList.remove("p_none");
|
12
9
|
actionBar.classList.add("p_xs", "is-visible", "show-action-card");
|
13
10
|
|
14
|
-
// Remove hidden-action-bar class when action bar is shown
|
15
|
-
if (tableContainer) {
|
16
|
-
tableContainer.classList.remove("hidden-action-bar");
|
17
|
-
}
|
18
|
-
|
19
11
|
// Update the count
|
20
12
|
const countElement = actionBar.querySelector(".selected-count");
|
21
13
|
if (countElement) {
|
@@ -24,20 +16,12 @@ function showActionBar(actionBar, selectedCount) {
|
|
24
16
|
}
|
25
17
|
|
26
18
|
function hideActionBar(actionBar) {
|
27
|
-
// Get container
|
28
|
-
const tableContainer = actionBar.closest('.pb_advanced_table');
|
29
|
-
|
30
19
|
// Hide action bar directly
|
31
20
|
actionBar.style.height = "0px";
|
32
21
|
actionBar.style.overflow = "hidden";
|
33
22
|
actionBar.style.opacity = "0";
|
34
23
|
actionBar.classList.add("p_none");
|
35
24
|
actionBar.classList.remove("p_xs", "is-visible", "show-action-card");
|
36
|
-
|
37
|
-
// Add hidden-action-bar class when action bar is hidden
|
38
|
-
if (tableContainer) {
|
39
|
-
tableContainer.classList.add("hidden-action-bar");
|
40
|
-
}
|
41
25
|
}
|
42
26
|
|
43
27
|
export function updateSelectionActionBar(table, selectedCount) {
|
@@ -1 +1 @@
|
|
1
|
-
The optional `header` key/value pair can be used within `columnDefinitions` to render a custom header. This example shows an Icon and Tooltip being used but other kits can be used as well.
|
1
|
+
The optional `header` key/value pair can be used within `columnDefinitions` to render a custom header. This example shows an Icon and Tooltip being used but other kits can be used as well.
|
@@ -10,7 +10,6 @@ examples:
|
|
10
10
|
- advanced_table_beta_sort: Enable Sorting
|
11
11
|
- advanced_table_responsive: Responsive Tables
|
12
12
|
- advanced_table_custom_cell_rails: Custom Components for Cells
|
13
|
-
- advanced_table_with_custom_header_rails: Custom Header Cell
|
14
13
|
- advanced_table_column_headers: Multi-Header Columns
|
15
14
|
- advanced_table_column_headers_multiple: Multi-Header Columns (Multiple Levels)
|
16
15
|
- advanced_table_no_subrows: Table with No Subrows or Expansion
|
@@ -19,7 +18,6 @@ examples:
|
|
19
18
|
- advanced_table_selectable_rows_actions_rails: Selectable Rows (With Actions)
|
20
19
|
- advanced_table_selectable_rows_header_rails: Selectable Rows (No Actions Bar)
|
21
20
|
- advanced_table_scrollbar_none: Advanced Table Scrollbar None
|
22
|
-
- advanced_table_row_styling: Row Styling
|
23
21
|
- advanced_table_column_styling_rails: Column Styling
|
24
22
|
- advanced_table_column_styling_column_headers_rails: Column Styling with Multiple Headers
|
25
23
|
- advanced_table_column_border_color_rails: Column Group Border Color
|
@@ -79,14 +79,8 @@
|
|
79
79
|
left: 0;
|
80
80
|
border-radius: unset;
|
81
81
|
z-index: 5;
|
82
|
-
|
83
|
-
// Add proper border radius when action bar is visible
|
84
|
-
&.is-visible,
|
85
|
-
&.show-action-card {
|
86
|
-
border-top-left-radius: 4px !important;
|
87
|
-
border-top-right-radius: 4px !important;
|
88
|
-
}
|
89
82
|
}
|
83
|
+
|
90
84
|
.checkbox-cell {
|
91
85
|
display: table-cell !important;
|
92
86
|
}
|
@@ -23,8 +23,6 @@ module Playbook
|
|
23
23
|
default: "scroll"
|
24
24
|
prop :selectable_rows, type: Playbook::Props::Boolean,
|
25
25
|
default: false
|
26
|
-
prop :row_styling, type: Playbook::Props::Array,
|
27
|
-
default: []
|
28
26
|
|
29
27
|
def flatten_columns(columns)
|
30
28
|
columns.flat_map do |col|
|
@@ -68,7 +66,7 @@ module Playbook
|
|
68
66
|
end
|
69
67
|
|
70
68
|
# Additional class and data attributes needed for toggle logic
|
71
|
-
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
|
69
|
+
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 })
|
72
70
|
|
73
71
|
if row[:children].present?
|
74
72
|
row[:children].each do |child_row|
|
@@ -76,30 +76,6 @@ module Playbook
|
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
79
|
-
# Get original column definition for custom rendering
|
80
|
-
def find_original_column_def(accessor)
|
81
|
-
find_column_def_by_accessor(column_definitions, accessor)
|
82
|
-
end
|
83
|
-
|
84
|
-
# Check if a header cell has a custom renderer
|
85
|
-
def has_header_renderer?(cell)
|
86
|
-
return false unless cell[:accessor].present?
|
87
|
-
|
88
|
-
original_def = find_original_column_def(cell[:accessor])
|
89
|
-
original_def && original_def[:header].present?
|
90
|
-
end
|
91
|
-
|
92
|
-
# Render custom header content
|
93
|
-
def render_header(cell)
|
94
|
-
return cell[:label] unless has_header_renderer?(cell)
|
95
|
-
|
96
|
-
original_def = find_original_column_def(cell[:accessor])
|
97
|
-
custom_renderer = original_def[:header]
|
98
|
-
|
99
|
-
# Call the custom renderer with the cell data and label
|
100
|
-
custom_renderer.call(cell, cell[:label])
|
101
|
-
end
|
102
|
-
|
103
79
|
private
|
104
80
|
|
105
81
|
def compute_max_depth(columns)
|
@@ -172,18 +148,6 @@ module Playbook
|
|
172
148
|
end
|
173
149
|
wrapped
|
174
150
|
end
|
175
|
-
|
176
|
-
def find_column_def_by_accessor(defs, target_accessor)
|
177
|
-
defs.each do |col|
|
178
|
-
return col if col[:accessor] == target_accessor
|
179
|
-
|
180
|
-
if col[:columns].is_a?(Array)
|
181
|
-
found = find_column_def_by_accessor(col[:columns], target_accessor)
|
182
|
-
return found if found
|
183
|
-
end
|
184
|
-
end
|
185
|
-
nil
|
186
|
-
end
|
187
151
|
end
|
188
152
|
end
|
189
153
|
end
|
@@ -1,10 +1,3 @@
|
|
1
|
-
<%
|
2
|
-
row_style = object.row_styling.find { |style| style[:row_id].to_s == object.row_id.to_s }
|
3
|
-
button_color = row_style&.[](:expand_button_color)
|
4
|
-
bg_color = row_style&.[](:background_color)
|
5
|
-
font_color = row_style&.[](:font_color)
|
6
|
-
%>
|
7
|
-
|
8
1
|
<%= pb_content_tag(:tr) do %>
|
9
2
|
<% has_separate_checkbox = object.selectable_rows && object.enable_toggle_expansion == "none" %>
|
10
3
|
<% if has_separate_checkbox %>
|
@@ -12,7 +5,7 @@
|
|
12
5
|
<% end %>
|
13
6
|
<% object.column_definitions.each_with_index do |column, index| %>
|
14
7
|
<% next unless column[:accessor].present? %>
|
15
|
-
<%= pb_rails("table/table_cell", props: {
|
8
|
+
<%= pb_rails("table/table_cell", props: { classname:object.td_classname(column, index)}) do %>
|
16
9
|
<%= pb_rails("flex", props:{ align: "center", justify: object.justify_for(column, index), classname: object.loading ? "loading-cell" : "" }) do %>
|
17
10
|
<% if collapsible_trail && index.zero? %>
|
18
11
|
<% (1..depth).each do |i| %>
|
@@ -35,9 +28,7 @@
|
|
35
28
|
<button
|
36
29
|
id="<%= "#{object.id}_#{object.row.object_id}" %>"
|
37
30
|
class="gray-icon expand-toggle-icon"
|
38
|
-
data-advanced-table="true"
|
39
|
-
style="color: <%= button_color %>"
|
40
|
-
>
|
31
|
+
data-advanced-table="true">
|
41
32
|
<%= pb_rails("icon", props: { id: "advanced-table_open_icon", icon: "circle-play", cursor: "pointer" }) %>
|
42
33
|
<%= pb_rails("icon", props: { id: "advanced-table_close_icon", icon: "circle-play-down", cursor: "pointer" }) %>
|
43
34
|
</button>
|
@@ -27,8 +27,6 @@ module Playbook
|
|
27
27
|
prop :enable_toggle_expansion, type: Playbook::Props::Enum,
|
28
28
|
values: %w[all header none],
|
29
29
|
default: "header"
|
30
|
-
prop :row_styling, type: Playbook::Props::Array,
|
31
|
-
default: []
|
32
30
|
|
33
31
|
def data
|
34
32
|
Hash(prop(:data)).merge(table_data_attributes)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
##### Prop
|
2
2
|
|
3
3
|
`align` **Type**: String | **Values**: left | center | right (defaults to center)
|
4
|
-
`verticalAlign` **Type**: String | **Values**: top | middle | bottom (defaults
|
4
|
+
`verticalAlign` **Type**: String | **Values**: top | middle | bottom (defaults middle)
|
5
5
|
`layout` **Type**: String | **Values**: horizontal | vertical | proximate (defaults to horizontal)
|
6
6
|
`x` **Type**: Number (defaults to 0)
|
7
7
|
`y` **Type**: Number (defaults to 0)
|
@@ -6,6 +6,8 @@ module Playbook
|
|
6
6
|
prop :error, type: Playbook::Props::Boolean, default: false
|
7
7
|
prop :checked, type: Playbook::Props::Boolean, default: false
|
8
8
|
prop :indeterminate_main, type: Playbook::Props::Boolean, default: false
|
9
|
+
prop :indeterminate_main_labels, type: Playbook::Props::Array,
|
10
|
+
default: []
|
9
11
|
prop :indeterminate_parent
|
10
12
|
prop :text
|
11
13
|
prop :value
|
@@ -49,10 +51,19 @@ module Playbook
|
|
49
51
|
end
|
50
52
|
|
51
53
|
def data
|
52
|
-
Hash(prop(:data)).merge(
|
54
|
+
base_data = Hash(prop(:data)).merge(
|
53
55
|
pb_checkbox_indeterminate_main: indeterminate_main,
|
54
56
|
pb_checkbox_indeterminate_parent: indeterminate_parent
|
55
57
|
)
|
58
|
+
|
59
|
+
if indeterminate_main && indeterminate_main_labels.size == 2
|
60
|
+
base_data.merge!(
|
61
|
+
pb_checkbox_indeterminate_main_label_check: indeterminate_main_labels[0],
|
62
|
+
pb_checkbox_indeterminate_main_label_uncheck: indeterminate_main_labels[1]
|
63
|
+
)
|
64
|
+
end
|
65
|
+
|
66
|
+
base_data
|
56
67
|
end
|
57
68
|
|
58
69
|
private
|
@@ -9,10 +9,10 @@
|
|
9
9
|
<tr>
|
10
10
|
<th>
|
11
11
|
<%= pb_rails("checkbox", props: {
|
12
|
-
text: "Uncheck All",
|
13
12
|
value: "checkbox-value",
|
14
13
|
name: "main-checkbox",
|
15
14
|
indeterminate_main: true,
|
15
|
+
indeterminate_main_labels: ["Check All Ice Cream", "Uncheck All Ice Cream"],
|
16
16
|
id: "indeterminate-checkbox"
|
17
17
|
}) %>
|
18
18
|
</th>
|
@@ -1 +1,2 @@
|
|
1
|
-
If you want to use indeterminate, "check/uncheck all" checkboxes, add `indeterminate_main: true` and an `id` to the main checkbox. Then, add an `indeterminate_parent` prop with the main checkbox's `id` to the children checkboxes.
|
1
|
+
If you want to use indeterminate, "check/uncheck all" checkboxes, add `indeterminate_main: true` and an `id` to the main checkbox. Then, add an `indeterminate_parent` prop with the main checkbox's `id` to the children checkboxes.
|
2
|
+
If you want to customize the main checkbox labels, set an array `indeterminate_main_labels` with "Check All" and "Uncheck All" labels.
|
@@ -23,7 +23,9 @@ export default class PbCheckbox extends PbEnhancedElement {
|
|
23
23
|
mainCheckbox.checked = checkedCount > 0;
|
24
24
|
|
25
25
|
// Determine the main checkbox label based on the number of checked checkboxes
|
26
|
-
const
|
26
|
+
const checkAllLabel = mainCheckboxWrapper.dataset.pbCheckboxIndeterminateMainLabelCheck ?? 'Check All'
|
27
|
+
const uncheckAllLabel = mainCheckboxWrapper.dataset.pbCheckboxIndeterminateMainLabelUncheck ?? 'Uncheck All'
|
28
|
+
const text = checkedCount === 0 ? checkAllLabel : uncheckAllLabel;
|
27
29
|
|
28
30
|
// Determine the icon class to add and remove based on the number of checked checkboxes
|
29
31
|
const iconClassToAdd = checkedCount === 0 ? 'pb_checkbox_checkmark' : 'pb_checkbox_indeterminate';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
##### Prop
|
2
2
|
|
3
3
|
`align` **Type**: String | **Values**: left | center | right (defaults to center)
|
4
|
-
`verticalAlign` **Type**: String | **Values**: top | middle | bottom (defaults
|
4
|
+
`verticalAlign` **Type**: String | **Values**: top | middle | bottom (defaults middle)
|
5
5
|
`layout` **Type**: String | **Values**: horizontal | vertical | proximate (defaults to horizontal)
|
6
6
|
`x` **Type**: Number (defaults to 0)
|
7
7
|
`y` **Type**: Number (defaults to 0)
|
@@ -1 +1,3 @@
|
|
1
|
-
|
1
|
+
Line graphs are used to show changes in data over time. The default height of line graph is 400px and can be changed. The default height is in pixel units, but can also use percentage string (percentage would be that of the width. For example, `height:"50%"` would mean that the height is 50% of the width). This allows for preserving the aspect ratio across responsive sizes.
|
2
|
+
|
3
|
+
For more information, see: <a href="https://api.highcharts.com/highcharts/chart.height" target="_blank"> highcharts/chart.height</a>.
|
@@ -1,8 +1,6 @@
|
|
1
1
|
import React from 'react'
|
2
|
-
|
3
|
-
import
|
4
|
-
import HighchartsReact from "highcharts-react-official"
|
5
|
-
import colors from '../../tokens/exports/_colors.module.scss'
|
2
|
+
|
3
|
+
import LineGraph from '../_line_graph'
|
6
4
|
|
7
5
|
const data = [{
|
8
6
|
name: 'Installation',
|
@@ -21,36 +19,19 @@ const data = [{
|
|
21
19
|
data: [null, null, null, 3112, 4989, 5816, 15274, 18111],
|
22
20
|
}]
|
23
21
|
|
24
|
-
const
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
},
|
39
|
-
},
|
40
|
-
series: data,
|
41
|
-
colors: [colors.data_4, colors.data_5, "#144075", colors.data_7, colors.data_8]
|
42
|
-
}
|
43
|
-
|
44
|
-
const options = Highcharts.merge({}, lineGraphTheme, chartOptions)
|
45
|
-
|
46
|
-
return (
|
47
|
-
<div>
|
48
|
-
<HighchartsReact
|
49
|
-
highcharts={Highcharts}
|
50
|
-
options={options}
|
51
|
-
/>
|
52
|
-
</div>
|
53
|
-
)
|
54
|
-
}
|
22
|
+
const LineGraphColors = (props) => (
|
23
|
+
<div>
|
24
|
+
<LineGraph
|
25
|
+
axisTitle="Number of Employees"
|
26
|
+
chartData={data}
|
27
|
+
colors={['data-4', 'data-5', 'data-6', 'data-7', 'data-8']}
|
28
|
+
id="line-colors"
|
29
|
+
title="Line Graph with Custom Data Colors"
|
30
|
+
xAxisCategories={['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']}
|
31
|
+
yAxisMin={0}
|
32
|
+
{...props}
|
33
|
+
/>
|
34
|
+
</div>
|
35
|
+
)
|
55
36
|
|
56
|
-
export default LineGraphColors
|
37
|
+
export default LineGraphColors
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import React from 'react'
|
2
|
-
|
3
|
-
import
|
4
|
-
import HighchartsReact from "highcharts-react-official"
|
2
|
+
|
3
|
+
import LineGraph from '../_line_graph'
|
5
4
|
|
6
5
|
const data = [{
|
7
6
|
name: 'Installation',
|
@@ -20,33 +19,19 @@ const data = [{
|
|
20
19
|
data: [12908, 5948, 8105, 11248, 8989, 11816, 18274, 18111],
|
21
20
|
}]
|
22
21
|
|
23
|
-
const
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
}
|
38
|
-
|
39
|
-
const LineGraphDefault = () => {
|
40
|
-
const options = Highcharts.merge({}, lineGraphTheme, chartOptions)
|
41
|
-
|
42
|
-
return(
|
43
|
-
<div>
|
44
|
-
<HighchartsReact
|
45
|
-
highcharts={Highcharts}
|
46
|
-
options={options}
|
47
|
-
/>
|
48
|
-
</div>
|
49
|
-
)
|
50
|
-
}
|
22
|
+
const LineGraphDefault = (props) => (
|
23
|
+
<div>
|
24
|
+
<LineGraph
|
25
|
+
axisTitle="Number of Employees"
|
26
|
+
chartData={data}
|
27
|
+
id="line-default"
|
28
|
+
subTitle="Source: thesolarfoundation.com"
|
29
|
+
title="Solar Employment Growth by Sector, 2010-2016"
|
30
|
+
xAxisCategories={['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']}
|
31
|
+
yAxisMin={0}
|
32
|
+
{...props}
|
33
|
+
/>
|
34
|
+
</div>
|
35
|
+
)
|
51
36
|
|
52
37
|
export default LineGraphDefault
|