playbook_ui 14.11.0 → 14.11.1.pre.alpha.PBNTR440enableglobalpropspbformwith5624
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/_playbook.scss +2 -0
- data/app/pb_kits/playbook/pb_advanced_table/Components/CustomCell.tsx +18 -2
- data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +27 -5
- data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableBody.tsx +17 -2
- data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableHeader.tsx +23 -1
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +29 -0
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +61 -4
- 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 +2 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_no_subrows.jsx +50 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination.jsx +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.jsx +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows.jsx +60 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows.md +5 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions.jsx +78 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions.md +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_header.jsx +53 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_header.md +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows.jsx +52 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows.md +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_control.md +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.html.erb +33 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_rails.md +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_mock_data_no_subrows.json +42 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_mock_data_with_id.json +299 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +6 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +6 -1
- data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.scss +9 -11
- data/app/pb_kits/playbook/pb_badge/_badge.scss +2 -4
- data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumbs.scss +1 -3
- data/app/pb_kits/playbook/pb_button/_button.scss +1 -3
- data/app/pb_kits/playbook/pb_button/button.html.erb +2 -3
- data/app/pb_kits/playbook/pb_checkbox/checkbox.html.erb +1 -6
- data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.scss +2 -4
- data/app/pb_kits/playbook/pb_collapsible/collapsible.html.erb +3 -1
- data/app/pb_kits/playbook/pb_collapsible/collapsible.rb +3 -0
- data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +24 -16
- data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +2 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default_date.md +1 -1
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_turbo_frames.html.erb +13 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_turbo_frames_rails.md +3 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_input_styles.scss +1 -3
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_overrides.scss +3 -5
- data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.scss +4 -6
- data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.scss +2 -4
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_list_rails.html.erb +3 -9
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_list_rails.md +5 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_selectable_list_rails.html.erb +38 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_selectable_list_rails.md +3 -0
- data/app/pb_kits/playbook/pb_draggable/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_drawer/_drawer.scss +145 -183
- data/app/pb_kits/playbook/pb_drawer/_drawer.tsx +158 -268
- data/app/pb_kits/playbook/pb_drawer/context.ts +11 -0
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_behavior.jsx +38 -0
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_borders.jsx +3 -45
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.jsx +0 -1
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_default.jsx +9 -16
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.jsx +44 -19
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.md +21 -3
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx +16 -21
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_sizes.jsx +2 -19
- data/app/pb_kits/playbook/pb_drawer/docs/example.yml +2 -1
- data/app/pb_kits/playbook/pb_drawer/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_drawer/drawer.test.jsx +5 -5
- data/app/pb_kits/playbook/pb_drawer/hooks/useBreakpoint.tsx +60 -0
- data/app/pb_kits/playbook/pb_drawer/hooks/useDrawerAnimation.tsx +21 -0
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +8 -10
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subtle_variant.md +1 -1
- data/app/pb_kits/playbook/pb_dropdown/dropdown.html.erb +7 -12
- data/app/pb_kits/playbook/pb_dropdown/dropdown_container.html.erb +9 -14
- data/app/pb_kits/playbook/pb_dropdown/dropdown_option.html.erb +6 -11
- data/app/pb_kits/playbook/pb_dropdown/dropdown_trigger.html.erb +8 -14
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.scss +4 -6
- data/app/pb_kits/playbook/pb_icon_button/_icon_button.scss +78 -0
- data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_default.html.erb +3 -0
- data/app/pb_kits/playbook/pb_icon_button/docs/example.yml +7 -0
- data/app/pb_kits/playbook/pb_icon_button/icon_button.html.erb +16 -0
- data/app/pb_kits/playbook/pb_icon_button/icon_button.rb +22 -0
- data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.scss +1 -3
- data/app/pb_kits/playbook/pb_label_value/_label_value.scss +2 -4
- data/app/pb_kits/playbook/pb_list/item.html.erb +30 -8
- data/app/pb_kits/playbook/pb_list/item.rb +7 -0
- data/app/pb_kits/playbook/pb_list/list.html.erb +31 -11
- data/app/pb_kits/playbook/pb_list/list.rb +4 -0
- data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.tsx +6 -1
- data/app/pb_kits/playbook/pb_message/_message_mixins.scss +1 -3
- data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.scss +5 -3
- data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.tsx +1 -0
- data/app/pb_kits/playbook/pb_multiple_users/multiple_users.html.erb +1 -1
- data/app/pb_kits/playbook/pb_passphrase/_passphrase.scss +3 -5
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.scss +8 -10
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +30 -12
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_format.html.erb +15 -0
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_format.jsx +24 -0
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_format.md +1 -0
- data/app/pb_kits/playbook/pb_phone_number_input/docs/example.yml +3 -1
- data/app/pb_kits/playbook/pb_phone_number_input/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.rb +3 -0
- data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.test.js +20 -1
- data/app/pb_kits/playbook/pb_pill/_pill.scss +2 -4
- data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.scss +2 -4
- data/app/pb_kits/playbook/pb_radio/_radio.scss +12 -8
- data/app/pb_kits/playbook/pb_radio/docs/_radio_custom_children.jsx +8 -3
- data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.scss +2 -4
- data/app/pb_kits/playbook/pb_select/_select.scss +6 -10
- data/app/pb_kits/playbook/pb_select/_select.tsx +5 -1
- data/app/pb_kits/playbook/pb_select/select.html.erb +2 -2
- data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +3 -5
- data/app/pb_kits/playbook/pb_selectable_icon/_selectable_icon.tsx +9 -1
- data/app/pb_kits/playbook/pb_selectable_icon/docs/_selectable_icon_default.jsx +4 -1
- data/app/pb_kits/playbook/pb_selectable_icon/docs/_selectable_icon_single_select.jsx +4 -1
- data/app/pb_kits/playbook/pb_selectable_list/selectable_list.html.erb +17 -3
- data/app/pb_kits/playbook/pb_selectable_list/selectable_list.rb +3 -0
- data/app/pb_kits/playbook/pb_selectable_list/selectable_list_item.html.erb +11 -4
- data/app/pb_kits/playbook/pb_selectable_list/selectable_list_item.rb +3 -0
- data/app/pb_kits/playbook/pb_table/_table.tsx +2 -3
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns.html.erb +74 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns_rails.md +3 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns_rails.md +2 -2
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns.html.erb +74 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns_rails.md +3 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.html.erb +47 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_rails.md +2 -0
- data/app/pb_kits/playbook/pb_table/docs/example.yml +3 -0
- data/app/pb_kits/playbook/pb_table/index.ts +187 -88
- data/app/pb_kits/playbook/pb_table/styles/_collapsible.scss +12 -0
- data/app/pb_kits/playbook/pb_table/styles/_scroll.scss +6 -5
- data/app/pb_kits/playbook/pb_table/table.html.erb +1 -1
- data/app/pb_kits/playbook/pb_table/table.rb +17 -2
- data/app/pb_kits/playbook/pb_table/table_row.html.erb +20 -1
- data/app/pb_kits/playbook/pb_table/table_row.rb +5 -0
- data/app/pb_kits/playbook/pb_table/utilities/addDataTitle.ts +22 -0
- data/app/pb_kits/playbook/pb_text_input/_text_input.scss +1 -3
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask.html.erb +46 -0
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask_rails.md +3 -0
- data/app/pb_kits/playbook/pb_text_input/docs/example.yml +2 -1
- data/app/pb_kits/playbook/pb_text_input/index.js +103 -0
- data/app/pb_kits/playbook/pb_text_input/text_input.html.erb +4 -0
- data/app/pb_kits/playbook/pb_text_input/text_input.rb +33 -3
- data/app/pb_kits/playbook/pb_textarea/_textarea.scss +1 -3
- data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.scss +4 -5
- data/app/pb_kits/playbook/pb_timeline/_timeline.scss +32 -34
- data/app/pb_kits/playbook/pb_toggle/_toggle.scss +3 -5
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +3 -2
- data/app/pb_kits/playbook/pb_typeahead/components/ClearIndicator.tsx +12 -4
- data/app/pb_kits/playbook/pb_typeahead/components/Control.tsx +5 -1
- data/app/pb_kits/playbook/pb_typeahead/components/IndicatorsContainer.tsx +8 -3
- data/app/pb_kits/playbook/pb_typeahead/components/MenuList.tsx +6 -1
- data/app/pb_kits/playbook/pb_typeahead/components/Option.tsx +21 -6
- data/app/pb_kits/playbook/pb_typeahead/components/Placeholder.tsx +13 -6
- data/app/pb_kits/playbook/pb_typeahead/components/ValueContainer.tsx +7 -3
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_custom_menu_list.jsx +2 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.html.erb +19 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.jsx +27 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.md +1 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async.jsx +4 -2
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async_custom_options.jsx +5 -5
- data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/index.js +1 -0
- data/dist/chunks/_typeahead-BWwaAo_0.js +36 -0
- data/dist/chunks/_weekday_stacked-zyBCd1s8.js +45 -0
- data/dist/chunks/lazysizes-B7xYodB-.js +1 -0
- data/dist/chunks/{lib-B7sgJtGS.js → lib-kMuhBuU7.js} +2 -2
- data/dist/chunks/{pb_form_validation-C5Cc0-1v.js → pb_form_validation-DBJ0wZuS.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +6 -0
- 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/pb_forms_global_props_helper.rb +136 -0
- data/lib/playbook/pb_forms_helper.rb +13 -4
- data/lib/playbook/version.rb +2 -2
- metadata +67 -9
- data/dist/chunks/_typeahead-C2iCBqxQ.js +0 -36
- data/dist/chunks/_weekday_stacked-E-5KcEkc.js +0 -45
- data/dist/chunks/lazysizes-DHz07jlL.js +0 -1
- /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_table_props.md → _advanced_table_table_props_react.md} +0 -0
- /data/app/pb_kits/playbook/pb_table/docs/{_table_with_collapsible.md → _table_with_collapsible_react.md} +0 -0
@@ -0,0 +1,78 @@
|
|
1
|
+
import React, {useState} from "react"
|
2
|
+
import { AdvancedTable, CircleIconButton, Flex } from "playbook-ui"
|
3
|
+
import MOCK_DATA from "./advanced_table_mock_data_no_subrows.json"
|
4
|
+
|
5
|
+
const AdvancedTableSelectableRowsActions = (props) => {
|
6
|
+
const columnDefinitions = [
|
7
|
+
{
|
8
|
+
accessor: "year",
|
9
|
+
label: "Year",
|
10
|
+
cellAccessors: ["quarter", "month", "day"],
|
11
|
+
},
|
12
|
+
{
|
13
|
+
accessor: "newEnrollments",
|
14
|
+
label: "New Enrollments",
|
15
|
+
},
|
16
|
+
{
|
17
|
+
accessor: "scheduledMeetings",
|
18
|
+
label: "Scheduled Meetings",
|
19
|
+
},
|
20
|
+
{
|
21
|
+
accessor: "attendanceRate",
|
22
|
+
label: "Attendance Rate",
|
23
|
+
},
|
24
|
+
{
|
25
|
+
accessor: "completedClasses",
|
26
|
+
label: "Completed Classes",
|
27
|
+
},
|
28
|
+
{
|
29
|
+
accessor: "classCompletionRate",
|
30
|
+
label: "Class Completion Rate",
|
31
|
+
},
|
32
|
+
{
|
33
|
+
accessor: "graduatedStudents",
|
34
|
+
label: "Graduated Students",
|
35
|
+
},
|
36
|
+
]
|
37
|
+
|
38
|
+
const [selectedRows, setSelectedRows] = useState()
|
39
|
+
|
40
|
+
const CustomActions = () => {
|
41
|
+
const rowIds = selectedRows ? Object.keys(selectedRows) : [];
|
42
|
+
|
43
|
+
return (
|
44
|
+
<Flex>
|
45
|
+
<CircleIconButton
|
46
|
+
icon="file-csv"
|
47
|
+
onClick={() =>
|
48
|
+
alert(rowIds.length === 0 ? "No Selection Made" : `Row ids ${rowIds.join(", ")} will be exported!`)
|
49
|
+
}
|
50
|
+
variant="link"
|
51
|
+
/>
|
52
|
+
<CircleIconButton
|
53
|
+
icon="trash-alt"
|
54
|
+
onClick={() =>
|
55
|
+
alert(rowIds.length === 0 ? "No Selection Made" : `Row ids ${rowIds.join(", ")} will be deleted!`)
|
56
|
+
}
|
57
|
+
variant="link"
|
58
|
+
/>
|
59
|
+
</Flex>
|
60
|
+
);
|
61
|
+
};
|
62
|
+
|
63
|
+
|
64
|
+
return (
|
65
|
+
<div>
|
66
|
+
<AdvancedTable
|
67
|
+
actions={<CustomActions/>}
|
68
|
+
columnDefinitions={columnDefinitions}
|
69
|
+
onRowSelectionChange={(selected) => setSelectedRows(selected)}
|
70
|
+
selectableRows
|
71
|
+
tableData={MOCK_DATA}
|
72
|
+
{...props}
|
73
|
+
/>
|
74
|
+
</div>
|
75
|
+
)
|
76
|
+
}
|
77
|
+
|
78
|
+
export default AdvancedTableSelectableRowsActions
|
@@ -0,0 +1 @@
|
|
1
|
+
Custom actions content can be rendered within the Actions Bar as shown in this doc example. The component passed to `actions` will be rendered on the right of the actionsBar. The `onRowSelectionChange` can then be used to attach the needed click events to those actions.
|
@@ -0,0 +1,53 @@
|
|
1
|
+
import React from "react"
|
2
|
+
import { AdvancedTable } from "playbook-ui"
|
3
|
+
import MOCK_DATA from "./advanced_table_mock_data_no_subrows.json"
|
4
|
+
|
5
|
+
const AdvancedTableSelectableRowsHeader = (props) => {
|
6
|
+
const columnDefinitions = [
|
7
|
+
{
|
8
|
+
accessor: "year",
|
9
|
+
label: "Year",
|
10
|
+
cellAccessors: ["quarter", "month", "day"],
|
11
|
+
},
|
12
|
+
{
|
13
|
+
accessor: "newEnrollments",
|
14
|
+
label: "New Enrollments",
|
15
|
+
},
|
16
|
+
{
|
17
|
+
accessor: "scheduledMeetings",
|
18
|
+
label: "Scheduled Meetings",
|
19
|
+
},
|
20
|
+
{
|
21
|
+
accessor: "attendanceRate",
|
22
|
+
label: "Attendance Rate",
|
23
|
+
},
|
24
|
+
{
|
25
|
+
accessor: "completedClasses",
|
26
|
+
label: "Completed Classes",
|
27
|
+
},
|
28
|
+
{
|
29
|
+
accessor: "classCompletionRate",
|
30
|
+
label: "Class Completion Rate",
|
31
|
+
},
|
32
|
+
{
|
33
|
+
accessor: "graduatedStudents",
|
34
|
+
label: "Graduated Students",
|
35
|
+
},
|
36
|
+
]
|
37
|
+
|
38
|
+
|
39
|
+
return (
|
40
|
+
<div>
|
41
|
+
<AdvancedTable
|
42
|
+
columnDefinitions={columnDefinitions}
|
43
|
+
onRowSelectionChange={(selectedRows) => console.log(selectedRows)}
|
44
|
+
selectableRows
|
45
|
+
showActionsBar={false}
|
46
|
+
tableData={MOCK_DATA}
|
47
|
+
{...props}
|
48
|
+
/>
|
49
|
+
</div>
|
50
|
+
)
|
51
|
+
}
|
52
|
+
|
53
|
+
export default AdvancedTableSelectableRowsHeader
|
@@ -0,0 +1 @@
|
|
1
|
+
`showActionsBar` is an optional prop that renders the header at the top showing the row count. This is set to `true` by default but can be toggled off by setting it to `false`
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows.jsx
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
import React from "react"
|
2
|
+
import { AdvancedTable } from "playbook-ui"
|
3
|
+
import MOCK_DATA from "./advanced_table_mock_data_no_subrows.json"
|
4
|
+
|
5
|
+
const AdvancedTableSelectableRowsNoSubrows = (props) => {
|
6
|
+
const columnDefinitions = [
|
7
|
+
{
|
8
|
+
accessor: "year",
|
9
|
+
label: "Year",
|
10
|
+
cellAccessors: ["quarter", "month", "day"],
|
11
|
+
},
|
12
|
+
{
|
13
|
+
accessor: "newEnrollments",
|
14
|
+
label: "New Enrollments",
|
15
|
+
},
|
16
|
+
{
|
17
|
+
accessor: "scheduledMeetings",
|
18
|
+
label: "Scheduled Meetings",
|
19
|
+
},
|
20
|
+
{
|
21
|
+
accessor: "attendanceRate",
|
22
|
+
label: "Attendance Rate",
|
23
|
+
},
|
24
|
+
{
|
25
|
+
accessor: "completedClasses",
|
26
|
+
label: "Completed Classes",
|
27
|
+
},
|
28
|
+
{
|
29
|
+
accessor: "classCompletionRate",
|
30
|
+
label: "Class Completion Rate",
|
31
|
+
},
|
32
|
+
{
|
33
|
+
accessor: "graduatedStudents",
|
34
|
+
label: "Graduated Students",
|
35
|
+
},
|
36
|
+
]
|
37
|
+
|
38
|
+
|
39
|
+
return (
|
40
|
+
<div>
|
41
|
+
<AdvancedTable
|
42
|
+
columnDefinitions={columnDefinitions}
|
43
|
+
onRowSelectionChange={(selectedRows) => console.log(selectedRows)}
|
44
|
+
selectableRows
|
45
|
+
tableData={MOCK_DATA}
|
46
|
+
{...props}
|
47
|
+
/>
|
48
|
+
</div>
|
49
|
+
)
|
50
|
+
}
|
51
|
+
|
52
|
+
export default AdvancedTableSelectableRowsNoSubrows
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
`selectableRows` can also be used with tables without nested row data.
|
@@ -1,3 +1,3 @@
|
|
1
|
-
`sortControl` is an optional prop that can be used to gain greater control over the sort state of the Advanced Table. Tanstack handles sort itself, however it does provide for a way to handle the state manually if needed. Usecases for this include needing to store the sort state so it persists on page reload, set an initial sort state, etc.
|
1
|
+
`sortControl` is an optional prop that can be used to gain greater control over the sort state of the Advanced Table. Tanstack handles sort itself, however it does provide for a way to handle the state manually if needed. Usecases for this include needing to store the sort state so it persists on page reload, set an initial sort state, etc.
|
2
2
|
|
3
|
-
The sort state must be an object with a single key/value pair, with the key being "desc" and the value being a boolean. The default for sort
|
3
|
+
The sort state must be an object with a single key/value pair, with the key being "desc" and the value being a boolean. The default for sort direction is `desc: true`.
|
@@ -0,0 +1,33 @@
|
|
1
|
+
<% column_definitions = [
|
2
|
+
{
|
3
|
+
accessor: "year",
|
4
|
+
label: "Year",
|
5
|
+
cellAccessors: ["quarter", "month", "day"],
|
6
|
+
},
|
7
|
+
{
|
8
|
+
accessor: "newEnrollments",
|
9
|
+
label: "New Enrollments",
|
10
|
+
},
|
11
|
+
{
|
12
|
+
accessor: "scheduledMeetings",
|
13
|
+
label: "Scheduled Meetings",
|
14
|
+
},
|
15
|
+
{
|
16
|
+
accessor: "attendanceRate",
|
17
|
+
label: "Attendance Rate",
|
18
|
+
},
|
19
|
+
{
|
20
|
+
accessor: "completedClasses",
|
21
|
+
label: "Completed Classes",
|
22
|
+
},
|
23
|
+
{
|
24
|
+
accessor: "classCompletionRate",
|
25
|
+
label: "Class Completion Rate",
|
26
|
+
},
|
27
|
+
{
|
28
|
+
accessor: "graduatedStudents",
|
29
|
+
label: "Graduated Students",
|
30
|
+
}
|
31
|
+
] %>
|
32
|
+
|
33
|
+
<%= pb_rails("advanced_table", props: { id: "table_props_table", table_data: @table_data, column_definitions: column_definitions, table_props: { container: false, sticky: true }}) %>
|
@@ -0,0 +1 @@
|
|
1
|
+
This kit uses the [Table kit](https://playbook.powerapp.cloud/kits/table) under the hood which comes with it's own set of props. If you want to apply certain Table props to that underlying kit, you can do so by using the optional `table_props` prop. This prop must be an object that contains valid Table props. For a full list of Table props, see [here](https://playbook.powerapp.cloud/kits/table).
|
@@ -0,0 +1,42 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"year": "2021",
|
4
|
+
"id": "1",
|
5
|
+
"newEnrollments": "20",
|
6
|
+
"scheduledMeetings": "10",
|
7
|
+
"attendanceRate": "51%",
|
8
|
+
"completedClasses": "3",
|
9
|
+
"classCompletionRate": "33%",
|
10
|
+
"graduatedStudents": "19"
|
11
|
+
},
|
12
|
+
{
|
13
|
+
"year": "2022",
|
14
|
+
"id": "8",
|
15
|
+
"newEnrollments": "25",
|
16
|
+
"scheduledMeetings": "17",
|
17
|
+
"attendanceRate": "75%",
|
18
|
+
"completedClasses": "5",
|
19
|
+
"classCompletionRate": "45%",
|
20
|
+
"graduatedStudents": "32"
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"year": "2023",
|
24
|
+
"id": "15",
|
25
|
+
"newEnrollments": "10",
|
26
|
+
"scheduledMeetings": "15",
|
27
|
+
"attendanceRate": "65%",
|
28
|
+
"completedClasses": "4",
|
29
|
+
"classCompletionRate": "49%",
|
30
|
+
"graduatedStudents": "29"
|
31
|
+
},
|
32
|
+
{
|
33
|
+
"year": "2024",
|
34
|
+
"id": "14",
|
35
|
+
"newEnrollments": "15",
|
36
|
+
"scheduledMeetings": "34",
|
37
|
+
"attendanceRate": "32%",
|
38
|
+
"completedClasses": "6",
|
39
|
+
"classCompletionRate": "67%",
|
40
|
+
"graduatedStudents": "65"
|
41
|
+
}
|
42
|
+
]
|
@@ -0,0 +1,299 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"year": "2021",
|
4
|
+
"id": "1",
|
5
|
+
"quarter": null,
|
6
|
+
"month": null,
|
7
|
+
"day": null,
|
8
|
+
"newEnrollments": "20",
|
9
|
+
"scheduledMeetings": "10",
|
10
|
+
"attendanceRate": "51%",
|
11
|
+
"completedClasses": "3",
|
12
|
+
"classCompletionRate": "33%",
|
13
|
+
"graduatedStudents": "19",
|
14
|
+
"children": [
|
15
|
+
{
|
16
|
+
"year": "2021",
|
17
|
+
"id": "2",
|
18
|
+
"quarter": "Q1",
|
19
|
+
"month": null,
|
20
|
+
"day": null,
|
21
|
+
"newEnrollments": "2",
|
22
|
+
"scheduledMeetings": "35",
|
23
|
+
"attendanceRate": "32%",
|
24
|
+
"completedClasses": "15",
|
25
|
+
"classCompletionRate": "52%",
|
26
|
+
"graduatedStudents": "36",
|
27
|
+
"children": [
|
28
|
+
{
|
29
|
+
"year": "2021",
|
30
|
+
"id": "3",
|
31
|
+
"quarter": "Q1",
|
32
|
+
"month": "January",
|
33
|
+
"day": null,
|
34
|
+
"newEnrollments": "16",
|
35
|
+
"scheduledMeetings": "20",
|
36
|
+
"attendanceRate": "11%",
|
37
|
+
"completedClasses": "13",
|
38
|
+
"classCompletionRate": "47%",
|
39
|
+
"graduatedStudents": "28",
|
40
|
+
"children": [
|
41
|
+
{
|
42
|
+
"year": "2021",
|
43
|
+
"id": "4",
|
44
|
+
"quarter": "Q1",
|
45
|
+
"month": "January",
|
46
|
+
"day": "10",
|
47
|
+
"newEnrollments": "34",
|
48
|
+
"scheduledMeetings": "28",
|
49
|
+
"attendanceRate": "97%",
|
50
|
+
"completedClasses": "20",
|
51
|
+
"classCompletionRate": "15%",
|
52
|
+
"graduatedStudents": "17"
|
53
|
+
},
|
54
|
+
{
|
55
|
+
"year": "2021",
|
56
|
+
"id": "5",
|
57
|
+
"quarter": "Q1",
|
58
|
+
"month": "January",
|
59
|
+
"day": "20",
|
60
|
+
"newEnrollments": "43",
|
61
|
+
"scheduledMeetings": "23",
|
62
|
+
"attendanceRate": "66%",
|
63
|
+
"completedClasses": "26",
|
64
|
+
"classCompletionRate": "47%",
|
65
|
+
"graduatedStudents": "9"
|
66
|
+
}
|
67
|
+
]
|
68
|
+
},
|
69
|
+
{
|
70
|
+
"year": "2021",
|
71
|
+
"id": "6",
|
72
|
+
"quarter": "Q1",
|
73
|
+
"month": "February",
|
74
|
+
"day": null,
|
75
|
+
"newEnrollments": "20",
|
76
|
+
"scheduledMeetings": "41",
|
77
|
+
"attendanceRate": "95%",
|
78
|
+
"completedClasses": "26",
|
79
|
+
"classCompletionRate": "83%",
|
80
|
+
"graduatedStudents": "43",
|
81
|
+
"children": [
|
82
|
+
{
|
83
|
+
"year": "2021",
|
84
|
+
"id": "7",
|
85
|
+
"quarter": "Q1",
|
86
|
+
"month": "February",
|
87
|
+
"day": "15",
|
88
|
+
"newEnrollments": "19",
|
89
|
+
"scheduledMeetings": "35",
|
90
|
+
"attendanceRate": "69%",
|
91
|
+
"completedClasses": "8",
|
92
|
+
"classCompletionRate": "75%",
|
93
|
+
"graduatedStudents": "23"
|
94
|
+
}
|
95
|
+
]
|
96
|
+
}
|
97
|
+
]
|
98
|
+
}
|
99
|
+
]
|
100
|
+
},
|
101
|
+
{
|
102
|
+
"year": "2022",
|
103
|
+
"id": "8",
|
104
|
+
"quarter": null,
|
105
|
+
"month": null,
|
106
|
+
"day": null,
|
107
|
+
"newEnrollments": "25",
|
108
|
+
"scheduledMeetings": "17",
|
109
|
+
"attendanceRate": "75%",
|
110
|
+
"completedClasses": "5",
|
111
|
+
"classCompletionRate": "45%",
|
112
|
+
"graduatedStudents": "32",
|
113
|
+
"children": [
|
114
|
+
{
|
115
|
+
"year": "2022",
|
116
|
+
"id": "9",
|
117
|
+
"quarter": "Q1",
|
118
|
+
"month": null,
|
119
|
+
"day": null,
|
120
|
+
"newEnrollments": "2",
|
121
|
+
"scheduledMeetings": "35",
|
122
|
+
"attendanceRate": "32%",
|
123
|
+
"completedClasses": "15",
|
124
|
+
"classCompletionRate": "52%",
|
125
|
+
"graduatedStudents": "36",
|
126
|
+
"children": [
|
127
|
+
{
|
128
|
+
"year": "2022",
|
129
|
+
"id": "10",
|
130
|
+
"quarter": "Q1",
|
131
|
+
"month": "January",
|
132
|
+
"day": null,
|
133
|
+
"newEnrollments": "16",
|
134
|
+
"scheduledMeetings": "20",
|
135
|
+
"attendanceRate": "11%",
|
136
|
+
"completedClasses": "13",
|
137
|
+
"classCompletionRate": "47%",
|
138
|
+
"graduatedStudents": "28",
|
139
|
+
"children": [
|
140
|
+
{
|
141
|
+
"year": "2022",
|
142
|
+
"id": "11",
|
143
|
+
"quarter": "Q1",
|
144
|
+
"month": "January",
|
145
|
+
"day": "15",
|
146
|
+
"newEnrollments": "34",
|
147
|
+
"scheduledMeetings": "28",
|
148
|
+
"attendanceRate": "97%",
|
149
|
+
"completedClasses": "20",
|
150
|
+
"classCompletionRate": "15%",
|
151
|
+
"graduatedStudents": "17"
|
152
|
+
},
|
153
|
+
{
|
154
|
+
"year": "2022",
|
155
|
+
"id": "12",
|
156
|
+
"quarter": "Q1",
|
157
|
+
"month": "January",
|
158
|
+
"day": "25",
|
159
|
+
"newEnrollments": "43",
|
160
|
+
"scheduledMeetings": "23",
|
161
|
+
"attendanceRate": "66%",
|
162
|
+
"completedClasses": "26",
|
163
|
+
"classCompletionRate": "47%",
|
164
|
+
"graduatedStudents": "9"
|
165
|
+
}
|
166
|
+
]
|
167
|
+
},
|
168
|
+
{
|
169
|
+
"year": "2022",
|
170
|
+
"id": "13",
|
171
|
+
"quarter": "Q1",
|
172
|
+
"month": "May",
|
173
|
+
"day": null,
|
174
|
+
"newEnrollments": "20",
|
175
|
+
"scheduledMeetings": "41",
|
176
|
+
"attendanceRate": "95%",
|
177
|
+
"completedClasses": "26",
|
178
|
+
"classCompletionRate": "83%",
|
179
|
+
"graduatedStudents": "43",
|
180
|
+
"children": [
|
181
|
+
{
|
182
|
+
"year": "2022",
|
183
|
+
"id": "14",
|
184
|
+
"quarter": "Q1",
|
185
|
+
"month": "May",
|
186
|
+
"day": "2",
|
187
|
+
"newEnrollments": "19",
|
188
|
+
"scheduledMeetings": "35",
|
189
|
+
"attendanceRate": "69%",
|
190
|
+
"completedClasses": "8",
|
191
|
+
"classCompletionRate": "75%",
|
192
|
+
"graduatedStudents": "23"
|
193
|
+
}
|
194
|
+
]
|
195
|
+
}
|
196
|
+
]
|
197
|
+
}
|
198
|
+
]
|
199
|
+
},
|
200
|
+
{
|
201
|
+
"year": "2023",
|
202
|
+
"id": "15",
|
203
|
+
"quarter": null,
|
204
|
+
"month": null,
|
205
|
+
"day": null,
|
206
|
+
"newEnrollments": "10",
|
207
|
+
"scheduledMeetings": "15",
|
208
|
+
"attendanceRate": "65%",
|
209
|
+
"completedClasses": "4",
|
210
|
+
"classCompletionRate": "49%",
|
211
|
+
"graduatedStudents": "29",
|
212
|
+
"children": [
|
213
|
+
{
|
214
|
+
"year": "2023",
|
215
|
+
"id": "16",
|
216
|
+
"quarter": "Q1",
|
217
|
+
"month": null,
|
218
|
+
"day": null,
|
219
|
+
"newEnrollments": "2",
|
220
|
+
"scheduledMeetings": "35",
|
221
|
+
"attendanceRate": "32%",
|
222
|
+
"completedClasses": "15",
|
223
|
+
"classCompletionRate": "52%",
|
224
|
+
"graduatedStudents": "36",
|
225
|
+
"children": [
|
226
|
+
{
|
227
|
+
"year": "2023",
|
228
|
+
"id": "17",
|
229
|
+
"quarter": "Q1",
|
230
|
+
"month": "March",
|
231
|
+
"day": null,
|
232
|
+
"newEnrollments": "16",
|
233
|
+
"scheduledMeetings": "20",
|
234
|
+
"attendanceRate": "11%",
|
235
|
+
"completedClasses": "13",
|
236
|
+
"classCompletionRate": "47%",
|
237
|
+
"graduatedStudents": "28",
|
238
|
+
"children": [
|
239
|
+
{
|
240
|
+
"year": "2023",
|
241
|
+
"id": "18",
|
242
|
+
"quarter": "Q1",
|
243
|
+
"month": "March",
|
244
|
+
"day": "10",
|
245
|
+
"newEnrollments": "34",
|
246
|
+
"scheduledMeetings": "28",
|
247
|
+
"attendanceRate": "97%",
|
248
|
+
"completedClasses": "20",
|
249
|
+
"classCompletionRate": "15%",
|
250
|
+
"graduatedStudents": "17"
|
251
|
+
},
|
252
|
+
{
|
253
|
+
"year": "2023",
|
254
|
+
"id": "19",
|
255
|
+
"quarter": "Q1",
|
256
|
+
"month": "March",
|
257
|
+
"day": "11",
|
258
|
+
"newEnrollments": "43",
|
259
|
+
"scheduledMeetings": "23",
|
260
|
+
"attendanceRate": "66%",
|
261
|
+
"completedClasses": "26",
|
262
|
+
"classCompletionRate": "47%",
|
263
|
+
"graduatedStudents": "9"
|
264
|
+
}
|
265
|
+
]
|
266
|
+
},
|
267
|
+
{
|
268
|
+
"year": "2023",
|
269
|
+
"id": "20",
|
270
|
+
"quarter": "Q1",
|
271
|
+
"month": "April",
|
272
|
+
"day": null,
|
273
|
+
"newEnrollments": "20",
|
274
|
+
"scheduledMeetings": "41",
|
275
|
+
"attendanceRate": "95%",
|
276
|
+
"completedClasses": "26",
|
277
|
+
"classCompletionRate": "83%",
|
278
|
+
"graduatedStudents": "43",
|
279
|
+
"children": [
|
280
|
+
{
|
281
|
+
"year": "2023",
|
282
|
+
"id": "21",
|
283
|
+
"quarter": "Q1",
|
284
|
+
"month": "April",
|
285
|
+
"day": "15",
|
286
|
+
"newEnrollments": "19",
|
287
|
+
"scheduledMeetings": "35",
|
288
|
+
"attendanceRate": "69%",
|
289
|
+
"completedClasses": "8",
|
290
|
+
"classCompletionRate": "75%",
|
291
|
+
"graduatedStudents": "23"
|
292
|
+
}
|
293
|
+
]
|
294
|
+
}
|
295
|
+
]
|
296
|
+
}
|
297
|
+
]
|
298
|
+
}
|
299
|
+
]
|
@@ -3,6 +3,7 @@ examples:
|
|
3
3
|
- advanced_table_beta: Default (Required Props)
|
4
4
|
- advanced_table_beta_subrow_headers: SubRow Headers
|
5
5
|
- advanced_table_collapsible_trail_rails: Collapsible Trail
|
6
|
+
- advanced_table_table_props: Table Props
|
6
7
|
- advanced_table_beta_sort: Enable Sorting
|
7
8
|
- advanced_table_custom_cell_rails: Custom Components for Cells
|
8
9
|
- advanced_table_column_headers: Multi-Header Columns
|
@@ -26,3 +27,8 @@ examples:
|
|
26
27
|
- advanced_table_pagination_with_props: Pagination Props
|
27
28
|
- advanced_table_column_headers: Multi-Header Columns
|
28
29
|
- advanced_table_column_headers_multiple: Multi-Header Columns (Multiple Levels)
|
30
|
+
# - advanced_table_no_subrows: Table with No Subrows
|
31
|
+
- advanced_table_selectable_rows: Selectable Rows
|
32
|
+
- advanced_table_selectable_rows_no_subrows: Selectable Rows (No Subrows)
|
33
|
+
- advanced_table_selectable_rows_actions: Selectable Rows (With Actions)
|
34
|
+
- advanced_table_selectable_rows_header: Selectable Rows (No Actions Bar)
|
@@ -13,4 +13,9 @@ export { default as AdvancedTableCustomCell } from './_advanced_table_custom_cel
|
|
13
13
|
export { default as AdvancedTablePagination } from './_advanced_table_pagination.jsx'
|
14
14
|
export { default as AdvancedTablePaginationWithProps } from './_advanced_table_pagination_with_props.jsx'
|
15
15
|
export { default as AdvancedTableColumnHeaders } from './_advanced_table_column_headers.jsx'
|
16
|
-
export { default as AdvancedTableColumnHeadersMultiple } from './_advanced_table_column_headers_multiple.jsx'
|
16
|
+
export { default as AdvancedTableColumnHeadersMultiple } from './_advanced_table_column_headers_multiple.jsx'
|
17
|
+
export { default as AdvancedTableSelectableRows } from './_advanced_table_selectable_rows.jsx'
|
18
|
+
export { default as AdvancedTableSelectableRowsNoSubrows } from './_advanced_table_selectable_rows_no_subrows.jsx'
|
19
|
+
export { default as AdvancedTableNoSubrows } from './_advanced_table_no_subrows.jsx'
|
20
|
+
export { default as AdvancedTableSelectableRowsHeader } from './_advanced_table_selectable_rows_header.jsx'
|
21
|
+
export { default as AdvancedTableSelectableRowsActions } from './_advanced_table_selectable_rows_actions.jsx'
|
@@ -1,5 +1,3 @@
|
|
1
|
-
@use "sass:math";
|
2
|
-
|
3
1
|
[class^=pb_avatar_action_button_kit] {
|
4
2
|
|
5
3
|
$icon_size: 0px;
|
@@ -15,7 +13,7 @@
|
|
15
13
|
color: $value;
|
16
14
|
}
|
17
15
|
}
|
18
|
-
|
16
|
+
|
19
17
|
@mixin icon-base {
|
20
18
|
&.dark{
|
21
19
|
background-color: $bg_dark
|
@@ -33,22 +31,22 @@
|
|
33
31
|
}
|
34
32
|
|
35
33
|
@each $name, $size in $avatar-sizes {
|
36
|
-
|
34
|
+
|
37
35
|
&[class*=_#{$name}] {
|
38
|
-
|
36
|
+
|
39
37
|
$avatar_size: map-get($avatar-sizes, $name);
|
40
|
-
$icon_size:
|
41
|
-
$border_size:
|
38
|
+
$icon_size: $avatar_size / 2;
|
39
|
+
$border_size: $icon_size / 10;
|
42
40
|
|
43
41
|
position: relative;
|
44
42
|
width: $avatar_size * 1.25;
|
45
43
|
height: $avatar_size * 1.1;
|
46
44
|
display: flex;
|
47
|
-
|
45
|
+
|
48
46
|
[class^=pb_tooltip_kit] {
|
49
47
|
justify-self: center;
|
50
48
|
}
|
51
|
-
|
49
|
+
|
52
50
|
&[class*=_bottom] .icon {
|
53
51
|
@include icon-base;
|
54
52
|
top: $icon_size * 1.27;
|
@@ -61,8 +59,8 @@
|
|
61
59
|
left: $icon_size * 1.5;
|
62
60
|
}
|
63
61
|
&[class*=_left] [class^=pb_avatar_kit] {
|
64
|
-
padding-left:
|
62
|
+
padding-left: $icon_size / 2;
|
65
63
|
}
|
66
64
|
}
|
67
65
|
}
|
68
|
-
}
|
66
|
+
}
|