playbook_ui 16.9.0 → 16.10.0.pre.alpha.PLAY3053advancedtablebottompinnedrowsreact17469
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/_playbook.scss +2 -0
- data/app/pb_kits/playbook/pb_advanced_table/Components/RegularTableView.tsx +32 -11
- data/app/pb_kits/playbook/pb_advanced_table/Components/TableActionBar.tsx +5 -2
- data/app/pb_kits/playbook/pb_advanced_table/Context/AdvancedTableContext.tsx +27 -2
- data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableState.ts +19 -14
- data/app/pb_kits/playbook/pb_advanced_table/Utilities/CellRendererUtils.tsx +4 -2
- data/app/pb_kits/playbook/pb_advanced_table/Utilities/RowUtils.ts +17 -0
- data/app/pb_kits/playbook/pb_advanced_table/Utilities/StickyLayoutHelper.ts +100 -0
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +38 -71
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +27 -77
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +7 -0
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +128 -12
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table_action_bar.js +31 -9
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows.jsx +19 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_react.md +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_row_styling.html.erb +4 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_row_styling.jsx +6 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_row_styling_rails.md +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_row_styling_react.md +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header.html.erb +36 -44
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header.jsx +10 -19
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_rails.md +0 -4
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_react.md +3 -5
- data/app/pb_kits/playbook/pb_advanced_table/docs/_playground.json +2 -8
- data/app/pb_kits/playbook/pb_advanced_table/docs/_playground.overrides.json +1 -8
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/index.js +20 -29
- data/app/pb_kits/playbook/pb_advanced_table/kit.schema.json +0 -12
- data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +2 -1
- data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +16 -2
- data/app/pb_kits/playbook/pb_badge/kit.schema.json +1 -1
- data/app/pb_kits/playbook/pb_button_toolbar/kit.schema.json +1 -1
- data/app/pb_kits/playbook/pb_card/card.rb +1 -1
- data/app/pb_kits/playbook/pb_card/kit.schema.json +2 -0
- data/app/pb_kits/playbook/pb_checkbox/kit.schema.json +2 -2
- data/app/pb_kits/playbook/pb_circle_icon_button/kit.schema.json +2 -2
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.scss +6 -0
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +19 -2
- data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +58 -1
- data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +3 -0
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +319 -65
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_year_asc.html.erb +1 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_year_asc.jsx +15 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_year_asc.md +1 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_playground.json +1 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_date_picker/kit.schema.json +9 -1
- data/app/pb_kits/playbook/pb_date_time/kit.schema.json +1 -1
- data/app/pb_kits/playbook/pb_date_time_stacked/kit.schema.json +1 -1
- data/app/pb_kits/playbook/pb_dialog/_dialog.scss +54 -1
- data/app/pb_kits/playbook/pb_dialog/_dialog.tsx +21 -5
- data/app/pb_kits/playbook/pb_dialog/_dialog_context.tsx +8 -2
- data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_header.tsx +1 -1
- data/app/pb_kits/playbook/pb_dialog/dialog.html.erb +5 -1
- data/app/pb_kits/playbook/pb_dialog/dialog.test.jsx +125 -0
- data/app/pb_kits/playbook/pb_dialog/index.js +11 -1
- data/app/pb_kits/playbook/pb_draggable/context/index.tsx +1 -1
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_event_listeners_rails.md +1 -1
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_independent_containers.html.erb +35 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_independent_containers_rails.md +8 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_rails.md +3 -1
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_react.md +1 -1
- data/app/pb_kits/playbook/pb_draggable/docs/_playground.json +260 -19
- data/app/pb_kits/playbook/pb_draggable/docs/_playground.overrides.json +258 -13
- data/app/pb_kits/playbook/pb_draggable/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_draggable/index.js +10 -3
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +122 -0
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +114 -35
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_custom_display_disabled_option.html.erb +93 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_custom_display_disabled_option.jsx +127 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_custom_display_disabled_option.md +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_disabled.html.erb +10 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_disabled.jsx +37 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_disabled_option.html.erb +10 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_disabled_option.jsx +37 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_disabled_option.md +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_playground.json +150 -237
- data/app/pb_kits/playbook/pb_dropdown/docs/_playground.overrides.json +58 -74
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +6 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/index.js +3 -0
- data/app/pb_kits/playbook/pb_dropdown/dropdown.html.erb +5 -4
- data/app/pb_kits/playbook/pb_dropdown/dropdown.rb +6 -1
- data/app/pb_kits/playbook/pb_dropdown/dropdown.test.jsx +96 -0
- data/app/pb_kits/playbook/pb_dropdown/dropdown_container.html.erb +1 -0
- data/app/pb_kits/playbook/pb_dropdown/dropdown_container.rb +2 -0
- data/app/pb_kits/playbook/pb_dropdown/dropdown_option.html.erb +2 -2
- data/app/pb_kits/playbook/pb_dropdown/dropdown_option.rb +27 -2
- data/app/pb_kits/playbook/pb_dropdown/dropdown_trigger.html.erb +4 -2
- data/app/pb_kits/playbook/pb_dropdown/dropdown_trigger.rb +2 -0
- data/app/pb_kits/playbook/pb_dropdown/hooks/useHandleOnKeydown.tsx +25 -5
- data/app/pb_kits/playbook/pb_dropdown/index.js +270 -25
- data/app/pb_kits/playbook/pb_dropdown/keyboard_accessibility.js +19 -10
- data/app/pb_kits/playbook/pb_dropdown/kit.schema.json +8 -0
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownContainer.tsx +39 -2
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownOption.tsx +15 -4
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownTrigger.tsx +22 -13
- data/app/pb_kits/playbook/pb_file_upload/docs/_file_upload_remove_replace.html.erb +66 -0
- data/app/pb_kits/playbook/pb_file_upload/docs/_file_upload_remove_replace.jsx +53 -0
- data/app/pb_kits/playbook/pb_file_upload/docs/_file_upload_remove_replace.md +5 -0
- data/app/pb_kits/playbook/pb_file_upload/docs/_playground.json +2 -1
- data/app/pb_kits/playbook/pb_file_upload/docs/example.yml +3 -1
- data/app/pb_kits/playbook/pb_file_upload/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_file_upload/kit.schema.json +3 -3
- data/app/pb_kits/playbook/pb_filter/Filter/CurrentFilters.tsx +55 -28
- data/app/pb_kits/playbook/pb_filter/Filter/FilterDouble.tsx +4 -1
- data/app/pb_kits/playbook/pb_filter/Filter/FilterSingle.tsx +4 -1
- data/app/pb_kits/playbook/pb_filter/Filter/InteractiveFilter.tsx +277 -0
- data/app/pb_kits/playbook/pb_filter/_filter.scss +88 -1
- data/app/pb_kits/playbook/pb_filter/_filter.tsx +27 -0
- data/app/pb_kits/playbook/pb_filter/docs/_filter_interactive.html.erb +116 -0
- data/app/pb_kits/playbook/pb_filter/docs/_filter_interactive.md +12 -0
- data/app/pb_kits/playbook/pb_filter/docs/_filter_interactive_react.jsx +153 -0
- data/app/pb_kits/playbook/pb_filter/docs/_filter_interactive_react.md +10 -0
- data/app/pb_kits/playbook/pb_filter/docs/_filter_no_background.html.erb +1 -1
- data/app/pb_kits/playbook/pb_filter/docs/_playground.json +308 -5
- data/app/pb_kits/playbook/pb_filter/docs/_playground.overrides.json +312 -0
- data/app/pb_kits/playbook/pb_filter/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_filter/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_filter/filter.html.erb +80 -3
- data/app/pb_kits/playbook/pb_filter/filter.rb +71 -0
- data/app/pb_kits/playbook/pb_filter/filter.test.js +78 -0
- data/app/pb_kits/playbook/pb_filter/index.ts +349 -0
- data/app/pb_kits/playbook/pb_filter/kit.schema.json +94 -29
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_playground.json +210 -14
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_playground.overrides.json +231 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/kit.schema.json +1 -1
- data/app/pb_kits/playbook/pb_flex/docs/_playground.json +297 -38
- data/app/pb_kits/playbook/pb_flex/docs/_playground.overrides.json +300 -40
- data/app/pb_kits/playbook/pb_form/docs/_form_with_required_indicator.html.erb +20 -19
- data/app/pb_kits/playbook/pb_form/docs/_playground.json +1 -13
- data/app/pb_kits/playbook/pb_form_group/docs/_playground.json +82 -5
- data/app/pb_kits/playbook/pb_form_group/docs/_playground.overrides.json +91 -0
- data/app/pb_kits/playbook/pb_form_pill/docs/_playground.json +155 -14
- data/app/pb_kits/playbook/pb_form_pill/docs/_playground.overrides.json +147 -0
- data/app/pb_kits/playbook/pb_form_pill/kit.schema.json +1 -1
- data/app/pb_kits/playbook/pb_full_screen/_full_screen.scss +77 -0
- data/app/pb_kits/playbook/pb_full_screen/_full_screen.tsx +183 -0
- data/app/pb_kits/playbook/pb_full_screen/docs/_description.md +1 -0
- data/app/pb_kits/playbook/pb_full_screen/docs/_full_screen_content_padding.jsx +68 -0
- data/app/pb_kits/playbook/pb_full_screen/docs/_full_screen_content_padding.md +1 -0
- data/app/pb_kits/playbook/pb_full_screen/docs/_full_screen_custom_trigger.jsx +71 -0
- data/app/pb_kits/playbook/pb_full_screen/docs/_full_screen_custom_trigger.md +1 -0
- data/app/pb_kits/playbook/pb_full_screen/docs/_full_screen_default.html.erb +3 -0
- data/app/pb_kits/playbook/pb_full_screen/docs/_full_screen_default.jsx +63 -0
- data/app/pb_kits/playbook/pb_full_screen/docs/_full_screen_default.md +1 -0
- data/app/pb_kits/playbook/pb_full_screen/docs/_full_screen_header_text_styling.jsx +68 -0
- data/app/pb_kits/playbook/pb_full_screen/docs/_full_screen_header_text_styling.md +1 -0
- data/app/pb_kits/playbook/pb_full_screen/docs/_full_screen_sticky_header.jsx +68 -0
- data/app/pb_kits/playbook/pb_full_screen/docs/_full_screen_sticky_header.md +1 -0
- data/app/pb_kits/playbook/pb_full_screen/docs/_full_screen_table_and_filter.jsx +149 -0
- data/app/pb_kits/playbook/pb_full_screen/docs/_full_screen_table_and_filter.md +1 -0
- data/app/pb_kits/playbook/pb_full_screen/docs/_playground.json +155 -0
- data/app/pb_kits/playbook/pb_full_screen/docs/_playground.overrides.json +137 -0
- data/app/pb_kits/playbook/pb_full_screen/docs/example.yml +14 -0
- data/app/pb_kits/playbook/pb_full_screen/docs/index.js +6 -0
- data/app/pb_kits/playbook/pb_full_screen/full_screen.html.erb +12 -0
- data/app/pb_kits/playbook/pb_full_screen/full_screen.rb +11 -0
- data/app/pb_kits/playbook/pb_full_screen/full_screen.test.jsx +237 -0
- data/app/pb_kits/playbook/pb_full_screen/kit.schema.json +89 -0
- data/app/pb_kits/playbook/pb_full_screen/useFullScreen.ts +15 -0
- data/app/pb_kits/playbook/pb_hashtag/docs/_playground.json +72 -11
- data/app/pb_kits/playbook/pb_hashtag/docs/_playground.overrides.json +75 -0
- data/app/pb_kits/playbook/pb_highlight/docs/_playground.json +75 -4
- data/app/pb_kits/playbook/pb_highlight/docs/_playground.overrides.json +75 -0
- data/app/pb_kits/playbook/pb_home_address_street/docs/_playground.json +138 -12
- data/app/pb_kits/playbook/pb_home_address_street/docs/_playground.overrides.json +162 -0
- data/app/pb_kits/playbook/pb_icon/_icon.tsx +22 -11
- data/app/pb_kits/playbook/pb_icon/docs/_icon_default.jsx +1 -1
- data/app/pb_kits/playbook/pb_icon/docs/_playground.json +66 -41
- data/app/pb_kits/playbook/pb_icon/docs/_playground.overrides.json +85 -27
- data/app/pb_kits/playbook/pb_icon/icon.rb +5 -2
- data/app/pb_kits/playbook/pb_icon/kit.schema.json +3 -5
- data/app/pb_kits/playbook/pb_icon_button/docs/_playground.json +111 -9
- data/app/pb_kits/playbook/pb_icon_button/docs/_playground.overrides.json +131 -0
- data/app/pb_kits/playbook/pb_icon_button/kit.schema.json +1 -1
- data/app/pb_kits/playbook/pb_icon_circle/docs/_playground.json +92 -7
- data/app/pb_kits/playbook/pb_icon_circle/docs/_playground.overrides.json +108 -0
- data/app/pb_kits/playbook/pb_icon_stat_value/docs/_playground.json +32 -17
- data/app/pb_kits/playbook/pb_icon_stat_value/docs/_playground.overrides.json +81 -8
- data/app/pb_kits/playbook/pb_icon_value/docs/_playground.json +28 -18
- data/app/pb_kits/playbook/pb_icon_value/docs/_playground.overrides.json +58 -9
- data/app/pb_kits/playbook/pb_image/docs/_playground.json +124 -47
- data/app/pb_kits/playbook/pb_image/docs/_playground.overrides.json +122 -47
- data/app/pb_kits/playbook/pb_label_pill/docs/_playground.json +68 -6
- data/app/pb_kits/playbook/pb_label_pill/docs/_playground.overrides.json +85 -0
- data/app/pb_kits/playbook/pb_label_value/docs/_playground.json +59 -36
- data/app/pb_kits/playbook/pb_label_value/docs/_playground.overrides.json +101 -30
- data/app/pb_kits/playbook/pb_layout/docs/_playground.json +216 -10
- data/app/pb_kits/playbook/pb_layout/docs/_playground.overrides.json +188 -0
- data/app/pb_kits/playbook/pb_legend/docs/_playground.json +60 -7
- data/app/pb_kits/playbook/pb_legend/docs/_playground.overrides.json +77 -0
- data/app/pb_kits/playbook/pb_list/docs/_playground.json +165 -17
- data/app/pb_kits/playbook/pb_list/docs/_playground.overrides.json +191 -0
- data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.tsx +3 -1
- data/app/pb_kits/playbook/pb_loading_inline/docs/_loading_inline_color.html.erb +21 -0
- data/app/pb_kits/playbook/pb_loading_inline/docs/_loading_inline_color.jsx +55 -0
- data/app/pb_kits/playbook/pb_loading_inline/docs/_loading_inline_color.md +1 -0
- data/app/pb_kits/playbook/pb_loading_inline/docs/_playground.json +28 -1
- data/app/pb_kits/playbook/pb_loading_inline/docs/_playground.overrides.json +27 -1
- data/app/pb_kits/playbook/pb_loading_inline/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_loading_inline/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_loading_inline/kit.schema.json +18 -2
- data/app/pb_kits/playbook/pb_loading_inline/loading_inline.html.erb +1 -1
- data/app/pb_kits/playbook/pb_loading_inline/loading_inline.rb +3 -0
- data/app/pb_kits/playbook/pb_map/docs/_playground.json +164 -7
- data/app/pb_kits/playbook/pb_map/docs/_playground.overrides.json +180 -0
- data/app/pb_kits/playbook/pb_message/docs/_playground.json +114 -8
- data/app/pb_kits/playbook/pb_message/docs/_playground.overrides.json +144 -0
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.scss +7 -7
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +127 -12
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_playground.json +310 -61
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_playground.overrides.json +327 -44
- data/app/pb_kits/playbook/pb_multiple_users/docs/_playground.json +35 -6
- data/app/pb_kits/playbook/pb_multiple_users/docs/_playground.overrides.json +35 -6
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_playground.json +32 -21
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_playground.overrides.json +32 -21
- data/app/pb_kits/playbook/pb_nav/docs/_playground.json +546 -18
- data/app/pb_kits/playbook/pb_nav/docs/_playground.overrides.json +561 -14
- data/app/pb_kits/playbook/pb_online_status/docs/_playground.json +18 -23
- data/app/pb_kits/playbook/pb_online_status/docs/_playground.overrides.json +18 -14
- data/app/pb_kits/playbook/pb_overlay/docs/_playground.json +133 -14
- data/app/pb_kits/playbook/pb_overlay/docs/_playground.overrides.json +154 -0
- data/app/pb_kits/playbook/pb_pagination/docs/_playground.json +35 -14
- data/app/pb_kits/playbook/pb_pagination/docs/_playground.overrides.json +35 -14
- data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_breached.html.erb +1 -1
- data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_common.html.erb +1 -1
- data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_meter_settings.html.erb +5 -5
- data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_strength_change.html.erb +1 -1
- data/app/pb_kits/playbook/pb_passphrase/docs/_playground.json +129 -14
- data/app/pb_kits/playbook/pb_passphrase/docs/_playground.overrides.json +148 -0
- data/app/pb_kits/playbook/pb_passphrase/index.ts +58 -0
- data/app/pb_kits/playbook/pb_passphrase/kit.schema.json +13 -0
- data/app/pb_kits/playbook/pb_passphrase/passphrase.html.erb +70 -1
- data/app/pb_kits/playbook/pb_passphrase/passphrase.rb +70 -0
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_playground.json +378 -4
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_playground.overrides.json +245 -0
- data/app/pb_kits/playbook/pb_pb_bar_graph/kit.schema.json +1 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_playground.json +215 -4
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_playground.overrides.json +224 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/kit.schema.json +1 -1
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_playground.json +149 -4
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_playground.overrides.json +162 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/kit.schema.json +1 -1
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_playground.json +392 -4
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_playground.overrides.json +212 -0
- data/app/pb_kits/playbook/pb_pb_line_graph/kit.schema.json +1 -1
- data/app/pb_kits/playbook/pb_person/docs/_playground.json +27 -11
- data/app/pb_kits/playbook/pb_person/docs/_playground.overrides.json +34 -9
- data/app/pb_kits/playbook/pb_person_contact/docs/_playground.json +72 -21
- data/app/pb_kits/playbook/pb_person_contact/docs/_playground.overrides.json +71 -21
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_playground.json +179 -21
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_playground.overrides.json +180 -0
- data/app/pb_kits/playbook/pb_phone_number_input/kit.schema.json +2 -2
- data/app/pb_kits/playbook/pb_pill/docs/_playground.json +16 -49
- data/app/pb_kits/playbook/pb_pill/docs/_playground.overrides.json +33 -30
- data/app/pb_kits/playbook/pb_popover/_popover.scss +27 -0
- data/app/pb_kits/playbook/pb_popover/_popover.tsx +49 -16
- data/app/pb_kits/playbook/pb_popover/docs/_playground.json +155 -46
- data/app/pb_kits/playbook/pb_popover/docs/_playground.overrides.json +162 -30
- data/app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx +9 -11
- data/app/pb_kits/playbook/pb_popover/index.ts +35 -4
- data/app/pb_kits/playbook/pb_popover/popover.html.erb +5 -2
- data/app/pb_kits/playbook/pb_popover/popover.test.js +212 -5
- data/app/pb_kits/playbook/pb_progress_pills/docs/_playground.json +26 -13
- data/app/pb_kits/playbook/pb_progress_pills/docs/_playground.overrides.json +24 -6
- data/app/pb_kits/playbook/pb_progress_simple/docs/_playground.json +50 -17
- data/app/pb_kits/playbook/pb_progress_simple/docs/_playground.overrides.json +41 -7
- data/app/pb_kits/playbook/pb_progress_step/docs/_playground.json +197 -10
- data/app/pb_kits/playbook/pb_progress_step/docs/_playground.overrides.json +189 -0
- data/app/pb_kits/playbook/pb_radio/docs/_playground.json +80 -6
- data/app/pb_kits/playbook/pb_radio/docs/_playground.overrides.json +82 -3
- data/app/pb_kits/playbook/pb_radio/kit.schema.json +1 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/ToolbarDropdown.tsx +12 -24
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_playground.json +152 -22
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_playground.overrides.json +153 -0
- data/app/pb_kits/playbook/pb_select/_select.tsx +1 -0
- data/app/pb_kits/playbook/pb_select/docs/_playground.json +65 -19
- data/app/pb_kits/playbook/pb_select/docs/_playground.overrides.json +54 -14
- data/app/pb_kits/playbook/pb_select/kit.schema.json +2 -2
- data/app/pb_kits/playbook/pb_select/select.html.erb +1 -1
- data/app/pb_kits/playbook/pb_selectable_card/docs/_playground.json +75 -82
- data/app/pb_kits/playbook/pb_selectable_card/docs/_playground.overrides.json +76 -76
- data/app/pb_kits/playbook/pb_selectable_card/kit.schema.json +2 -2
- data/app/pb_kits/playbook/pb_selectable_card_icon/docs/_playground.json +105 -15
- data/app/pb_kits/playbook/pb_selectable_card_icon/docs/_playground.overrides.json +106 -0
- data/app/pb_kits/playbook/pb_selectable_card_icon/kit.schema.json +2 -2
- data/app/pb_kits/playbook/pb_selectable_icon/docs/_playground.json +37 -21
- data/app/pb_kits/playbook/pb_selectable_icon/docs/_playground.overrides.json +35 -18
- data/app/pb_kits/playbook/pb_selectable_icon/kit.schema.json +1 -1
- data/app/pb_kits/playbook/pb_selectable_list/docs/_playground.json +174 -12
- data/app/pb_kits/playbook/pb_selectable_list/docs/_playground.overrides.json +162 -10
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_playground.json +68 -6
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_playground.overrides.json +80 -0
- data/app/pb_kits/playbook/pb_source/docs/_playground.json +67 -6
- data/app/pb_kits/playbook/pb_source/docs/_playground.overrides.json +80 -0
- data/app/pb_kits/playbook/pb_star_rating/docs/_playground.json +28 -53
- data/app/pb_kits/playbook/pb_star_rating/docs/_playground.overrides.json +33 -32
- data/app/pb_kits/playbook/pb_star_rating/kit.schema.json +1 -1
- data/app/pb_kits/playbook/pb_stat_change/docs/_playground.json +15 -9
- data/app/pb_kits/playbook/pb_stat_change/docs/_playground.overrides.json +15 -5
- data/app/pb_kits/playbook/pb_stat_value/docs/_playground.json +19 -9
- data/app/pb_kits/playbook/pb_stat_value/docs/_playground.overrides.json +18 -7
- data/app/pb_kits/playbook/pb_stat_value/kit.schema.json +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_playground.json +223 -21
- data/app/pb_kits/playbook/pb_table/docs/_playground.overrides.json +176 -0
- data/app/pb_kits/playbook/pb_text_input/docs/_playground.json +44 -5
- data/app/pb_kits/playbook/pb_text_input/docs/_playground.overrides.json +39 -3
- data/app/pb_kits/playbook/pb_text_input/kit.schema.json +3 -3
- data/app/pb_kits/playbook/pb_textarea/docs/_playground.json +35 -3
- data/app/pb_kits/playbook/pb_textarea/docs/_playground.overrides.json +28 -3
- data/app/pb_kits/playbook/pb_textarea/kit.schema.json +1 -1
- data/app/pb_kits/playbook/pb_time/docs/_playground.json +28 -14
- data/app/pb_kits/playbook/pb_time/docs/_playground.overrides.json +26 -13
- data/app/pb_kits/playbook/pb_time_picker/_time_picker.scss +42 -0
- data/app/pb_kits/playbook/pb_time_picker/_time_picker.tsx +309 -167
- data/app/pb_kits/playbook/pb_time_picker/docs/_playground.json +36 -30
- data/app/pb_kits/playbook/pb_time_picker/docs/_playground.overrides.json +31 -26
- data/app/pb_kits/playbook/pb_time_picker/index.ts +263 -11
- data/app/pb_kits/playbook/pb_time_range_inline/docs/_playground.json +63 -9
- data/app/pb_kits/playbook/pb_time_range_inline/docs/_playground.overrides.json +69 -0
- data/app/pb_kits/playbook/pb_time_stacked/docs/_playground.json +30 -9
- data/app/pb_kits/playbook/pb_time_stacked/docs/_playground.overrides.json +30 -9
- data/app/pb_kits/playbook/pb_timeline/docs/_playground.json +178 -6
- data/app/pb_kits/playbook/pb_timeline/docs/_playground.overrides.json +165 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_playground.json +36 -21
- data/app/pb_kits/playbook/pb_timestamp/docs/_playground.overrides.json +35 -20
- data/app/pb_kits/playbook/pb_toggle/docs/_playground.json +24 -13
- data/app/pb_kits/playbook/pb_toggle/docs/_playground.overrides.json +20 -12
- data/app/pb_kits/playbook/pb_toggle/kit.schema.json +2 -2
- data/app/pb_kits/playbook/pb_tooltip/docs/_playground.json +42 -23
- data/app/pb_kits/playbook/pb_tooltip/docs/_playground.overrides.json +35 -15
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +109 -3
- data/app/pb_kits/playbook/pb_typeahead/docs/_playground.json +124 -44
- data/app/pb_kits/playbook/pb_typeahead/docs/_playground.overrides.json +98 -31
- data/app/pb_kits/playbook/pb_typeahead/kit.schema.json +8 -2
- data/app/pb_kits/playbook/pb_user/docs/_playground.json +33 -15
- data/app/pb_kits/playbook/pb_user/docs/_playground.overrides.json +32 -15
- data/app/pb_kits/playbook/pb_user_badge/docs/_playground.json +26 -12
- data/app/pb_kits/playbook/pb_user_badge/docs/_playground.overrides.json +26 -9
- data/app/pb_kits/playbook/pb_weekday_stacked/docs/_playground.json +32 -5
- data/app/pb_kits/playbook/pb_weekday_stacked/docs/_playground.overrides.json +30 -4
- data/app/pb_kits/playbook/tokens/_colors.scss +5 -1
- data/app/pb_kits/playbook/utilities/_border.scss +262 -0
- data/app/pb_kits/playbook/utilities/floatingPortalHosts.ts +565 -0
- data/app/pb_kits/playbook/utilities/global-props.schema.json +98 -0
- data/app/pb_kits/playbook/utilities/globalProps.ts +83 -1
- data/app/pb_kits/playbook/utilities/icons/allicons.tsx +38 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/border.test.js +66 -0
- data/dist/chunks/{_pb_line_graph-B870s9g1.js → _pb_line_graph-C2H9vs_8.js} +1 -1
- data/dist/chunks/_typeahead-Du8dRYaM.js +5 -0
- data/dist/chunks/globalProps-DIAZ03-L.js +6 -0
- data/dist/chunks/lib-ZHDedNfP.js +29 -0
- data/dist/chunks/time_picker_helper-CVMV9ync.js +1 -0
- data/dist/chunks/vendor.js +5 -5
- data/dist/menu.yml +7 -0
- 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/border.rb +87 -0
- data/lib/playbook/classnames.rb +1 -0
- data/lib/playbook/forms/builder/form_field_builder.rb +2 -0
- data/lib/playbook/kit_base.rb +2 -0
- data/lib/playbook/pb_forms_global_props_helper.rb +15 -0
- data/lib/playbook/version.rb +2 -2
- metadata +93 -9
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_fullscreen.jsx +0 -92
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_fullscreen.md +0 -3
- data/dist/chunks/_typeahead-jMN-A0_C.js +0 -5
- data/dist/chunks/globalProps-BInmh-C7.js +0 -6
- data/dist/chunks/lib-CVYIIiwI.js +0 -29
- data/dist/chunks/time_picker_helper-Bx8nzyM8.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useRef, useEffect
|
|
1
|
+
import React, { useRef, useEffect } from "react";
|
|
2
2
|
import classnames from "classnames";
|
|
3
3
|
|
|
4
4
|
import { GenericObject } from "../types";
|
|
@@ -18,15 +18,7 @@ import TableActionBar from "./Components/TableActionBar";
|
|
|
18
18
|
|
|
19
19
|
import { useTableState } from "./Hooks/useTableState";
|
|
20
20
|
import { useTableActions } from "./Hooks/useTableActions";
|
|
21
|
-
|
|
22
|
-
import Card from "../pb_card/_card"
|
|
23
|
-
import Flex from "../pb_flex/_flex"
|
|
24
|
-
import Icon from "../pb_icon/_icon"
|
|
25
|
-
|
|
26
|
-
type FullscreenControls = {
|
|
27
|
-
toggleFullscreen: () => void;
|
|
28
|
-
isFullscreen: boolean;
|
|
29
|
-
};
|
|
21
|
+
import { updateStickyLayoutHeights, scheduleStickyActionBarHeightUpdate } from "./Utilities/StickyLayoutHelper";
|
|
30
22
|
|
|
31
23
|
type AdvancedTableProps = {
|
|
32
24
|
aria?: { [key: string]: string }
|
|
@@ -74,8 +66,6 @@ type AdvancedTableProps = {
|
|
|
74
66
|
onRowSelectionChange?: (arg: RowSelectionState) => void
|
|
75
67
|
onCustomSortClick?: (arg: GenericObject[]) => void
|
|
76
68
|
virtualizedRows?: boolean
|
|
77
|
-
allowFullScreen?: boolean
|
|
78
|
-
fullScreenControl?: (controls: FullscreenControls) => void
|
|
79
69
|
} & GlobalProps;
|
|
80
70
|
|
|
81
71
|
/**
|
|
@@ -135,8 +125,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
|
135
125
|
toggleExpansionIcon = "arrows-from-line",
|
|
136
126
|
onRowSelectionChange,
|
|
137
127
|
virtualizedRows = false,
|
|
138
|
-
allowFullScreen = false,
|
|
139
|
-
fullScreenControl,
|
|
140
128
|
} = props;
|
|
141
129
|
|
|
142
130
|
const noTableCardContainer = tableProps?.container === false;
|
|
@@ -214,87 +202,51 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
|
214
202
|
);
|
|
215
203
|
}, [fetchMoreOnBottomReached, fetchNextPage, isFetching, totalFetched, fullData.length]);
|
|
216
204
|
|
|
217
|
-
//
|
|
218
|
-
const
|
|
205
|
+
// Build CSS classes and props
|
|
206
|
+
const ariaProps = buildAriaProps(aria);
|
|
207
|
+
const dataProps = buildDataProps(data);
|
|
208
|
+
const htmlProps = buildHtmlProps(htmlOptions);
|
|
219
209
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
210
|
+
// Visibility flag for action bar
|
|
211
|
+
const isActionBarVisible = (selectableRows && showActionsBar && selectedRowsLength > 0) || columnVisibilityControl;
|
|
212
|
+
const isStickyHeader = Boolean(tableProps?.sticky);
|
|
223
213
|
|
|
224
214
|
useEffect(() => {
|
|
225
|
-
if (
|
|
226
|
-
fullScreenControl({
|
|
227
|
-
toggleFullscreen,
|
|
228
|
-
isFullscreen
|
|
229
|
-
})
|
|
230
|
-
}
|
|
231
|
-
}, [allowFullScreen, fullScreenControl, toggleFullscreen, isFullscreen])
|
|
215
|
+
if (!isStickyHeader || !tableWrapperRef.current) return;
|
|
232
216
|
|
|
233
|
-
|
|
234
|
-
|
|
217
|
+
const wrapper = tableWrapperRef.current;
|
|
218
|
+
const updateHeights = () => updateStickyLayoutHeights(wrapper);
|
|
235
219
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
className="gray-icon fullscreen-icon"
|
|
239
|
-
onClick={toggleFullscreen}
|
|
240
|
-
>
|
|
241
|
-
<Icon
|
|
242
|
-
cursor="pointer"
|
|
243
|
-
fixedWidth
|
|
244
|
-
icon="arrow-down-left-and-arrow-up-right-to-center"
|
|
245
|
-
{...props}
|
|
246
|
-
/>
|
|
247
|
-
</button>
|
|
248
|
-
)
|
|
249
|
-
|
|
250
|
-
return (
|
|
251
|
-
<Card
|
|
252
|
-
borderNone
|
|
253
|
-
borderRadius="none"
|
|
254
|
-
className="advanced-table-fullscreen-header"
|
|
255
|
-
{...props}
|
|
256
|
-
>
|
|
257
|
-
<Flex justify="end">
|
|
258
|
-
{defaultMinimizeIcon}
|
|
259
|
-
</Flex>
|
|
260
|
-
</Card>
|
|
261
|
-
)
|
|
262
|
-
}
|
|
220
|
+
updateHeights();
|
|
221
|
+
scheduleStickyActionBarHeightUpdate(wrapper);
|
|
263
222
|
|
|
264
|
-
|
|
265
|
-
|
|
223
|
+
const resizeObserver = new ResizeObserver(updateHeights);
|
|
224
|
+
resizeObserver.observe(wrapper);
|
|
266
225
|
|
|
267
|
-
const
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
toggleFullscreen()
|
|
271
|
-
}
|
|
226
|
+
const actionBar = wrapper.querySelector(".row-selection-actions-card");
|
|
227
|
+
if (actionBar) {
|
|
228
|
+
resizeObserver.observe(actionBar);
|
|
272
229
|
}
|
|
273
|
-
document.addEventListener('keydown', handleKeyDown)
|
|
274
|
-
return () => {
|
|
275
|
-
document.removeEventListener('keydown', handleKeyDown)
|
|
276
|
-
}
|
|
277
|
-
}, [allowFullScreen, toggleFullscreen, isFullscreen])
|
|
278
230
|
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
231
|
+
const table = wrapper.querySelector("table.pb_table");
|
|
232
|
+
const thead = table?.querySelector("thead");
|
|
233
|
+
if (thead) {
|
|
234
|
+
resizeObserver.observe(thead);
|
|
235
|
+
}
|
|
283
236
|
|
|
284
|
-
|
|
285
|
-
|
|
237
|
+
return () => resizeObserver.disconnect();
|
|
238
|
+
}, [isStickyHeader, isActionBarVisible, columnDefinitions, tableData]);
|
|
286
239
|
|
|
287
240
|
const classes = classnames(
|
|
288
241
|
buildCss("pb_advanced_table"),
|
|
289
242
|
`advanced-table-responsive-${responsive}`,
|
|
290
243
|
maxHeight ? `advanced-table-max-height-${maxHeight}` : '',
|
|
291
244
|
{
|
|
292
|
-
'advanced-table-fullscreen': isFullscreen,
|
|
293
|
-
'advanced-table-allow-fullscreen': allowFullScreen,
|
|
294
245
|
// Add the hidden-action-bar class when action bar functionality exists but is not visible
|
|
295
246
|
'hidden-action-bar': (selectableRows || columnVisibilityControl) && !isActionBarVisible,
|
|
296
247
|
},
|
|
297
248
|
{'advanced-table-sticky-left-columns': stickyLeftColumn && stickyLeftColumn.length > 0},
|
|
249
|
+
{ 'advanced-table-sticky-header': isStickyHeader },
|
|
298
250
|
{ 'advanced-table-no-table-container': noTableCardContainer },
|
|
299
251
|
columnGroupBorderColor ? `column-group-border-${columnGroupBorderColor}` : '',
|
|
300
252
|
scrollBarNone ? 'advanced-table-hide-scrollbar' : '',
|
|
@@ -358,7 +310,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
|
358
310
|
ref={tableWrapperRef}
|
|
359
311
|
style={tableWrapperStyle as React.CSSProperties}
|
|
360
312
|
>
|
|
361
|
-
{renderFullscreenHeader()}
|
|
362
313
|
<AdvancedTableProvider
|
|
363
314
|
cascadeCollapse={cascadeCollapse}
|
|
364
315
|
columnDefinitions={columnDefinitions}
|
|
@@ -375,7 +326,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
|
375
326
|
hasAnySubRows={hasAnySubRows}
|
|
376
327
|
inlineRowLoading={inlineRowLoading}
|
|
377
328
|
isActionBarVisible={isActionBarVisible}
|
|
378
|
-
isFullscreen={isFullscreen}
|
|
379
329
|
loading={loading}
|
|
380
330
|
onCustomSortClick={onCustomSortClick}
|
|
381
331
|
onExpandByDepthClick={onExpandByDepthClick}
|
|
@@ -46,6 +46,7 @@ module Playbook
|
|
|
46
46
|
max_height_classname,
|
|
47
47
|
hide_scroll_bar_class,
|
|
48
48
|
hidden_action_bar_class,
|
|
49
|
+
sticky_header_class,
|
|
49
50
|
]
|
|
50
51
|
additional_classes << "column-group-border-#{column_group_border_color}" if column_group_border_color != "none"
|
|
51
52
|
additional_classes << "advanced-table-no-table-container" if no_table_card_container?
|
|
@@ -75,6 +76,12 @@ module Playbook
|
|
|
75
76
|
selectable_rows && !is_action_bar_visible ? "hidden-action-bar" : ""
|
|
76
77
|
end
|
|
77
78
|
|
|
79
|
+
def sticky_header_class
|
|
80
|
+
return "" unless table_props.is_a?(Hash)
|
|
81
|
+
|
|
82
|
+
table_props[:sticky] || table_props["sticky"] ? "advanced-table-sticky-header" : ""
|
|
83
|
+
end
|
|
84
|
+
|
|
78
85
|
def selected_rows
|
|
79
86
|
@selected_rows ||= []
|
|
80
87
|
end
|
|
@@ -418,6 +418,56 @@ test("tableProps prop functions as expected", () => {
|
|
|
418
418
|
const kit = screen.getByTestId(testId)
|
|
419
419
|
const table = kit.querySelector('table')
|
|
420
420
|
expect(table).toHaveClass("pb_table table-sm table-responsive-none data_table sticky-header ns_tabular")
|
|
421
|
+
expect(kit).toHaveClass("advanced-table-sticky-header")
|
|
422
|
+
})
|
|
423
|
+
|
|
424
|
+
test("sticky header with column visibility control offsets layout heights", async () => {
|
|
425
|
+
const columnDefsWithIds = columnDefinitions.map((col) => ({
|
|
426
|
+
...col,
|
|
427
|
+
id: col.accessor,
|
|
428
|
+
}))
|
|
429
|
+
|
|
430
|
+
render(
|
|
431
|
+
<AdvancedTable
|
|
432
|
+
columnDefinitions={columnDefsWithIds}
|
|
433
|
+
columnVisibilityControl={{ default: true }}
|
|
434
|
+
data={{ testid: testId }}
|
|
435
|
+
responsive="none"
|
|
436
|
+
tableData={MOCK_DATA}
|
|
437
|
+
tableProps={{ sticky: true }}
|
|
438
|
+
/>
|
|
439
|
+
)
|
|
440
|
+
|
|
441
|
+
const kit = screen.getByTestId(testId)
|
|
442
|
+
expect(kit).toHaveClass("advanced-table-sticky-header")
|
|
443
|
+
expect(kit).not.toHaveClass("hidden-action-bar")
|
|
444
|
+
|
|
445
|
+
const actionBar = kit.querySelector(".row-selection-actions-card.show-action-card")
|
|
446
|
+
expect(actionBar).toBeInTheDocument()
|
|
447
|
+
|
|
448
|
+
await waitFor(() => {
|
|
449
|
+
expect(kit.style.getPropertyValue("--advanced-table-action-bar-height")).toMatch(/^\d+px$/)
|
|
450
|
+
})
|
|
451
|
+
})
|
|
452
|
+
|
|
453
|
+
test("sticky header without column visibility control keeps zero action bar offset", async () => {
|
|
454
|
+
render(
|
|
455
|
+
<AdvancedTable
|
|
456
|
+
columnDefinitions={columnDefinitions}
|
|
457
|
+
data={{ testid: testId }}
|
|
458
|
+
responsive="none"
|
|
459
|
+
tableData={MOCK_DATA}
|
|
460
|
+
tableProps={{ sticky: true }}
|
|
461
|
+
/>
|
|
462
|
+
)
|
|
463
|
+
|
|
464
|
+
const kit = screen.getByTestId(testId)
|
|
465
|
+
expect(kit).toHaveClass("advanced-table-sticky-header")
|
|
466
|
+
expect(kit).not.toHaveClass("hidden-action-bar")
|
|
467
|
+
|
|
468
|
+
await waitFor(() => {
|
|
469
|
+
expect(kit.style.getPropertyValue("--advanced-table-action-bar-height")).toBe("0px")
|
|
470
|
+
})
|
|
421
471
|
})
|
|
422
472
|
|
|
423
473
|
test("enableExpansionIcon changes icon", () => {
|
|
@@ -646,22 +696,34 @@ test("customRenderer prop functions as expected", () => {
|
|
|
646
696
|
expect(pill).toBeInTheDocument()
|
|
647
697
|
})
|
|
648
698
|
|
|
649
|
-
test("
|
|
699
|
+
test("pinnedRows prop renders top pinned rows at top", () => {
|
|
700
|
+
const pinnedRowsControl = {
|
|
701
|
+
value: { top: ["1", "3"] },
|
|
702
|
+
onChange: jest.fn()
|
|
703
|
+
}
|
|
704
|
+
|
|
650
705
|
render(
|
|
651
706
|
<AdvancedTable
|
|
652
|
-
allowFullScreen
|
|
653
707
|
columnDefinitions={columnDefinitions}
|
|
654
|
-
|
|
708
|
+
data={{ testid: testId }}
|
|
709
|
+
pinnedRows={pinnedRowsControl}
|
|
710
|
+
tableData={MOCK_DATA_WITH_ID}
|
|
655
711
|
/>
|
|
656
712
|
)
|
|
657
713
|
|
|
658
|
-
const
|
|
659
|
-
|
|
714
|
+
const kit = screen.getByTestId(testId)
|
|
715
|
+
const pinnedRows = kit.querySelectorAll(".pinned-row")
|
|
716
|
+
|
|
717
|
+
expect(pinnedRows).toHaveLength(2)
|
|
718
|
+
|
|
719
|
+
const firstPinnedRow = pinnedRows[0]
|
|
720
|
+
expect(firstPinnedRow).toHaveStyle("position: sticky")
|
|
721
|
+
expect(firstPinnedRow).toHaveStyle("background-color: white")
|
|
660
722
|
})
|
|
661
723
|
|
|
662
|
-
test("pinnedRows prop renders pinned rows at
|
|
724
|
+
test("pinnedRows prop renders bottom pinned rows at bottom", () => {
|
|
663
725
|
const pinnedRowsControl = {
|
|
664
|
-
value: {
|
|
726
|
+
value: { bottom: ["1", "3"] },
|
|
665
727
|
onChange: jest.fn()
|
|
666
728
|
}
|
|
667
729
|
|
|
@@ -675,13 +737,13 @@ test("pinnedRows prop renders pinned rows at top", () => {
|
|
|
675
737
|
)
|
|
676
738
|
|
|
677
739
|
const kit = screen.getByTestId(testId)
|
|
678
|
-
const pinnedRows = kit.querySelectorAll(".pinned-row")
|
|
740
|
+
const pinnedRows = kit.querySelectorAll(".pinned-row-bottom")
|
|
679
741
|
|
|
680
742
|
expect(pinnedRows).toHaveLength(2)
|
|
681
743
|
|
|
682
|
-
const
|
|
683
|
-
expect(
|
|
684
|
-
expect(
|
|
744
|
+
const lastPinnedRow = pinnedRows[0]
|
|
745
|
+
expect(lastPinnedRow).toHaveStyle("position: sticky")
|
|
746
|
+
expect(lastPinnedRow).toHaveStyle("background-color: white")
|
|
685
747
|
})
|
|
686
748
|
|
|
687
749
|
test("columnStyling.headerAlignment aligns header as expected", () => {
|
|
@@ -1005,7 +1067,12 @@ test("rowStyling prop works as expected", () => {
|
|
|
1005
1067
|
{
|
|
1006
1068
|
rowId: "1",
|
|
1007
1069
|
backgroundColor: colors.white,
|
|
1008
|
-
fontColor: colors.black
|
|
1070
|
+
fontColor: colors.black,
|
|
1071
|
+
fontWeight: "bold",
|
|
1072
|
+
},
|
|
1073
|
+
{
|
|
1074
|
+
rowId: "2",
|
|
1075
|
+
fontWeight: "regular",
|
|
1009
1076
|
},
|
|
1010
1077
|
];
|
|
1011
1078
|
|
|
@@ -1022,6 +1089,55 @@ test("rowStyling prop works as expected", () => {
|
|
|
1022
1089
|
const tableBody = kit.querySelector('tbody')
|
|
1023
1090
|
const row1 = tableBody.querySelector('tr:nth-child(1)')
|
|
1024
1091
|
expect(row1).toHaveStyle({backgroundColor: colors.white, color: colors.black})
|
|
1092
|
+
expect(row1).toHaveStyle({fontWeight: "700"})
|
|
1093
|
+
const row2 = tableBody.querySelector('tr:nth-child(2)')
|
|
1094
|
+
expect(row2).toHaveStyle({fontWeight: "400"})
|
|
1095
|
+
})
|
|
1096
|
+
|
|
1097
|
+
test("rowStyling fontWeight applies to expandable rows", () => {
|
|
1098
|
+
const rowStyling = [
|
|
1099
|
+
{
|
|
1100
|
+
rowId: "1",
|
|
1101
|
+
fontWeight: "bold",
|
|
1102
|
+
},
|
|
1103
|
+
];
|
|
1104
|
+
|
|
1105
|
+
const tableData = [
|
|
1106
|
+
{
|
|
1107
|
+
id: "1",
|
|
1108
|
+
year: "2021",
|
|
1109
|
+
quarter: null,
|
|
1110
|
+
month: null,
|
|
1111
|
+
day: null,
|
|
1112
|
+
newEnrollments: "20",
|
|
1113
|
+
scheduledMeetings: "10",
|
|
1114
|
+
children: [
|
|
1115
|
+
{
|
|
1116
|
+
id: "1-1",
|
|
1117
|
+
year: "2021",
|
|
1118
|
+
quarter: "Q1",
|
|
1119
|
+
month: null,
|
|
1120
|
+
day: null,
|
|
1121
|
+
newEnrollments: "2",
|
|
1122
|
+
scheduledMeetings: "35",
|
|
1123
|
+
},
|
|
1124
|
+
],
|
|
1125
|
+
},
|
|
1126
|
+
];
|
|
1127
|
+
|
|
1128
|
+
render(
|
|
1129
|
+
<AdvancedTable
|
|
1130
|
+
columnDefinitions={columnDefinitions}
|
|
1131
|
+
data={{ testid: testId }}
|
|
1132
|
+
rowStyling={rowStyling}
|
|
1133
|
+
tableData={tableData}
|
|
1134
|
+
/>
|
|
1135
|
+
)
|
|
1136
|
+
|
|
1137
|
+
const kit = screen.getByTestId(testId)
|
|
1138
|
+
const tableBody = kit.querySelector('tbody')
|
|
1139
|
+
const expandableRow = tableBody.querySelector('tr:nth-child(1)')
|
|
1140
|
+
expect(expandableRow).toHaveStyle({fontWeight: "700"})
|
|
1025
1141
|
})
|
|
1026
1142
|
|
|
1027
1143
|
test("rowStyling prop to allow padding control", () => {
|
|
@@ -1,26 +1,44 @@
|
|
|
1
|
+
import {
|
|
2
|
+
scheduleStickyActionBarHeightUpdate,
|
|
3
|
+
updateStickyActionBarHeight,
|
|
4
|
+
} from "./Utilities/StickyLayoutHelper";
|
|
5
|
+
|
|
6
|
+
// Card kit defaults to `transition-property: all`, which can animate height/opacity
|
|
7
|
+
// during expand/collapse. Limit transitions to decorative properties only.
|
|
8
|
+
const ACTION_BAR_TRANSITION_PROPERTIES = "border-color, box-shadow";
|
|
9
|
+
|
|
1
10
|
function showActionBar(actionBar, selectedCount) {
|
|
2
11
|
// Get container
|
|
3
12
|
const tableContainer = actionBar.closest('.pb_advanced_table');
|
|
4
13
|
|
|
5
|
-
//
|
|
6
|
-
|
|
14
|
+
// Update the count before measuring height so the label is included on first show
|
|
15
|
+
const countElement = actionBar.querySelector(".selected-count");
|
|
16
|
+
if (countElement) {
|
|
17
|
+
countElement.textContent = `${selectedCount} Selected`;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Expand without animating height so sticky offsets measure the final size
|
|
21
|
+
actionBar.style.transitionProperty = "none";
|
|
7
22
|
actionBar.style.overflow = "visible";
|
|
8
23
|
actionBar.style.opacity = "1";
|
|
9
|
-
actionBar.style.transitionProperty = "all";
|
|
10
|
-
actionBar.style.transitionTimingFunction = "ease-in-out";
|
|
11
24
|
actionBar.classList.remove("p_none");
|
|
12
25
|
actionBar.classList.add("p_xs", "is-visible", "show-action-card");
|
|
26
|
+
actionBar.style.height = "auto";
|
|
27
|
+
|
|
28
|
+
// Force layout so padding/content are included before measuring
|
|
29
|
+
void actionBar.offsetHeight;
|
|
30
|
+
|
|
31
|
+
const expandedHeight = actionBar.scrollHeight;
|
|
32
|
+
actionBar.style.height = `${expandedHeight}px`;
|
|
13
33
|
|
|
14
34
|
// Remove hidden-action-bar class when action bar is shown
|
|
15
35
|
if (tableContainer) {
|
|
16
36
|
tableContainer.classList.remove("hidden-action-bar");
|
|
37
|
+
updateStickyActionBarHeight(tableContainer);
|
|
38
|
+
scheduleStickyActionBarHeightUpdate(tableContainer);
|
|
17
39
|
}
|
|
18
40
|
|
|
19
|
-
|
|
20
|
-
const countElement = actionBar.querySelector(".selected-count");
|
|
21
|
-
if (countElement) {
|
|
22
|
-
countElement.textContent = `${selectedCount} Selected`;
|
|
23
|
-
}
|
|
41
|
+
actionBar.style.transitionProperty = ACTION_BAR_TRANSITION_PROPERTIES;
|
|
24
42
|
}
|
|
25
43
|
|
|
26
44
|
function hideActionBar(actionBar) {
|
|
@@ -28,6 +46,7 @@ function hideActionBar(actionBar) {
|
|
|
28
46
|
const tableContainer = actionBar.closest('.pb_advanced_table');
|
|
29
47
|
|
|
30
48
|
// Hide action bar directly
|
|
49
|
+
actionBar.style.transitionProperty = "none";
|
|
31
50
|
actionBar.style.height = "0px";
|
|
32
51
|
actionBar.style.overflow = "hidden";
|
|
33
52
|
actionBar.style.opacity = "0";
|
|
@@ -37,7 +56,10 @@ function hideActionBar(actionBar) {
|
|
|
37
56
|
// Add hidden-action-bar class when action bar is hidden
|
|
38
57
|
if (tableContainer) {
|
|
39
58
|
tableContainer.classList.add("hidden-action-bar");
|
|
59
|
+
updateStickyActionBarHeight(tableContainer);
|
|
40
60
|
}
|
|
61
|
+
|
|
62
|
+
actionBar.style.transitionProperty = ACTION_BAR_TRANSITION_PROPERTIES;
|
|
41
63
|
}
|
|
42
64
|
|
|
43
65
|
export function updateSelectionActionBar(table, selectedCount) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useState } from "react"
|
|
2
2
|
import AdvancedTable from '../_advanced_table'
|
|
3
3
|
import MOCK_DATA_WITH_ID from "./advanced_table_mock_data_with_id.json"
|
|
4
|
+
import Caption from "../../pb_caption/_caption"
|
|
4
5
|
|
|
5
6
|
const AdvancedTableRowPinning = (props) => {
|
|
6
7
|
const columnDefinitions = [
|
|
@@ -35,14 +36,30 @@ const AdvancedTableRowPinning = (props) => {
|
|
|
35
36
|
},
|
|
36
37
|
]
|
|
37
38
|
|
|
38
|
-
const [
|
|
39
|
+
const [pinnedRowsTop, setPinnedRowsTop] = useState({top: ["8"]})
|
|
40
|
+
const [pinnedRowsBottom, setPinnedRowsBottom] = useState({bottom: ["8"]})
|
|
39
41
|
|
|
40
42
|
return (
|
|
41
43
|
<div>
|
|
44
|
+
<Caption text="Pinned Rows Top" />
|
|
42
45
|
<AdvancedTable
|
|
43
46
|
columnDefinitions={columnDefinitions}
|
|
44
47
|
maxHeight="xs"
|
|
45
|
-
pinnedRows={{value:
|
|
48
|
+
pinnedRows={{value: pinnedRowsTop, onChange: setPinnedRowsTop}}
|
|
49
|
+
tableData={MOCK_DATA_WITH_ID}
|
|
50
|
+
tableProps={{sticky: true}}
|
|
51
|
+
{...props}
|
|
52
|
+
>
|
|
53
|
+
<AdvancedTable.Header enableSorting />
|
|
54
|
+
<AdvancedTable.Body />
|
|
55
|
+
</AdvancedTable>
|
|
56
|
+
<Caption marginTop="md"
|
|
57
|
+
text="Pinned Rows Bottom"
|
|
58
|
+
/>
|
|
59
|
+
<AdvancedTable
|
|
60
|
+
columnDefinitions={columnDefinitions}
|
|
61
|
+
maxHeight="xs"
|
|
62
|
+
pinnedRows={{value: pinnedRowsBottom, onChange: setPinnedRowsBottom}}
|
|
46
63
|
tableData={MOCK_DATA_WITH_ID}
|
|
47
64
|
tableProps={{sticky: true}}
|
|
48
65
|
{...props}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
Use the `pinnedRows` prop to pin specific rows to the top of an Advanced Table. Pinned rows will remain at the top when scrolling through table data and will not change position if sorting is used.
|
|
1
|
+
Use the `pinnedRows` prop to pin specific rows to the top or bottom of an Advanced Table. Pinned rows will remain at the top or bottom when scrolling through table data and will not change position if sorting is used.
|
|
2
2
|
|
|
3
3
|
**NOTE:**
|
|
4
4
|
- Sticky header required: Pinned rows must be used with `sticky: true` via `tableProps` (works with both responsive and non-responsive tables)
|
|
5
5
|
- Row ids required: Each object within the `tableData` Array must contain a unique id in order to attach an id to all Rows for this to function.
|
|
6
|
-
- `pinnedRows` takes an array of row ids to the `top` property as shown in the code snippet below.
|
|
6
|
+
- `pinnedRows` takes an array of row ids to the `top` or `bottom` property as shown in the code snippet below (both can be used on the same table).
|
|
7
7
|
- For expandable rows, use the parent id in `pinnedRows`, all its children will automatically be pinned with it. If id for a child is passed in without parent being pinned, nothing will be pinned.
|
|
@@ -41,6 +41,10 @@
|
|
|
41
41
|
font_color: "white",
|
|
42
42
|
expand_button_color: "white",
|
|
43
43
|
},
|
|
44
|
+
{
|
|
45
|
+
row_id: "15",
|
|
46
|
+
font_weight: "bold",
|
|
47
|
+
},
|
|
44
48
|
] %>
|
|
45
49
|
|
|
46
50
|
<%= pb_rails("advanced_table", props: { id: "row-styling", table_data: @table_data_with_id, column_definitions: column_definitions, row_styling: row_styling }) %>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react"
|
|
2
2
|
import AdvancedTable from '../_advanced_table'
|
|
3
|
-
import
|
|
3
|
+
import MOCK_DATA_WITH_ID from "./advanced_table_mock_data_with_id.json"
|
|
4
4
|
import colors from '../../tokens/exports/_colors.module.scss'
|
|
5
5
|
|
|
6
6
|
|
|
@@ -48,6 +48,10 @@ const rowStyling = [
|
|
|
48
48
|
fontColor: colors.white,
|
|
49
49
|
expandButtonColor: colors.white,
|
|
50
50
|
},
|
|
51
|
+
{
|
|
52
|
+
rowId: "15",
|
|
53
|
+
fontWeight: "bold",
|
|
54
|
+
},
|
|
51
55
|
];
|
|
52
56
|
|
|
53
57
|
return (
|
|
@@ -55,7 +59,7 @@ const rowStyling = [
|
|
|
55
59
|
<AdvancedTable
|
|
56
60
|
columnDefinitions={columnDefinitions}
|
|
57
61
|
rowStyling={rowStyling}
|
|
58
|
-
tableData={
|
|
62
|
+
tableData={MOCK_DATA_WITH_ID}
|
|
59
63
|
{...props}
|
|
60
64
|
/>
|
|
61
65
|
</div>
|
|
@@ -3,5 +3,6 @@ The `row_styling` prop can be used in conjunction with row ids to control certai
|
|
|
3
3
|
- `background_color` : use this to control the background color of the row
|
|
4
4
|
- `font_color`: use this to control font color for each row if needed, for example if using a darker background color.
|
|
5
5
|
- `expand_button_color`: use this to control the color of the expand icon if needed, for example if using a darker background color.
|
|
6
|
+
- `font_weight`: use this to control row font weight. Accepted values are `regular` (default appearance) and `bold`.
|
|
6
7
|
|
|
7
8
|
**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.
|
|
@@ -3,5 +3,6 @@ The `rowStyling` prop can be used in conjunction with row ids to control certain
|
|
|
3
3
|
- `backgroundColor` : use this to control the background color of the row
|
|
4
4
|
- `fontColor`: use this to control font color for each row if needed, for example if using a darker background color.
|
|
5
5
|
- `expandButtonColor`: use this to control the color of the expand icon if needed, for example if using a darker background color.
|
|
6
|
+
- `fontWeight`: use this to control row font weight. Accepted values are `regular` (default appearance) and `bold`.
|
|
6
7
|
|
|
7
8
|
**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.
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header.html.erb
CHANGED
|
@@ -1,47 +1,39 @@
|
|
|
1
1
|
<% column_definitions = [
|
|
2
|
-
{
|
|
3
|
-
accessor: "year",
|
|
4
|
-
label: "Year",
|
|
5
|
-
},
|
|
6
|
-
{
|
|
7
|
-
accessor: "newEnrollments",
|
|
8
|
-
label: "New Enrollments",
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
accessor: "scheduledMeetings",
|
|
12
|
-
label: "Scheduled Meetings",
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
accessor: "attendanceRate",
|
|
16
|
-
label: "Attendance Rate",
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
accessor: "completedClasses",
|
|
20
|
-
label: "Completed Classes",
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
accessor: "classCompletionRate",
|
|
24
|
-
label: "Class Completion Rate",
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
accessor: "graduatedStudents",
|
|
28
|
-
label: "Graduated Students",
|
|
29
|
-
}
|
|
30
|
-
] %>
|
|
31
|
-
|
|
32
|
-
<% table_data = 15.times.map do |index|
|
|
33
2
|
{
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
+
] %>
|
|
44
32
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
33
|
+
<%= pb_rails("advanced_table", props: {
|
|
34
|
+
id: "table_props_sticky_table",
|
|
35
|
+
table_data: @table_data,
|
|
36
|
+
column_definitions: column_definitions,
|
|
37
|
+
max_height: "xs",
|
|
38
|
+
table_props: { sticky: true },
|
|
39
|
+
}) %>
|