playbook_ui 14.22.0.pre.alpha.testdialog8898 → 14.22.0.pre.rc.0
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 +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/Components/CustomCell.tsx +9 -11
- data/app/pb_kits/playbook/pb_advanced_table/Components/RegularTableView.tsx +4 -20
- data/app/pb_kits/playbook/pb_advanced_table/Components/SubRowHeaderRow.tsx +11 -32
- data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +5 -25
- data/app/pb_kits/playbook/pb_advanced_table/Components/VirtualizedTableView.tsx +16 -36
- data/app/pb_kits/playbook/pb_advanced_table/Context/AdvancedTableContext.tsx +5 -18
- data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableActions.ts +17 -37
- data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableState.ts +7 -32
- data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableBody.tsx +0 -3
- data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableHeader.tsx +40 -91
- data/app/pb_kits/playbook/pb_advanced_table/Utilities/CellRendererUtils.tsx +1 -4
- data/app/pb_kits/playbook/pb_advanced_table/Utilities/TableContainerStyles.ts +2 -3
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +6 -68
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +18 -42
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +2 -105
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_sort.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_subrow_headers.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_border_color_rails.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_loading.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows.jsx +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_react.md +3 -5
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions.jsx +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions_rails.html.erb +2 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -8
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +0 -6
- data/app/pb_kits/playbook/pb_advanced_table/flat_advanced_table.js +84 -60
- data/app/pb_kits/playbook/pb_advanced_table/index.js +213 -125
- data/app/pb_kits/playbook/pb_advanced_table/scss_partials/advanced_table_sticky_mixin.scss +1 -16
- data/app/pb_kits/playbook/pb_advanced_table/table_action_bar.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/table_header.rb +0 -5
- data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +3 -3
- data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +0 -33
- data/app/pb_kits/playbook/pb_badge/_badge.scss +6 -5
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_colors.jsx +15 -33
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom.jsx +72 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom.md +6 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_default.jsx +15 -33
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_height.jsx +22 -52
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_horizontal.jsx +16 -12
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend.jsx +15 -31
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_non_clickable.jsx +16 -39
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_position.jsx +38 -86
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_negative_numbers.jsx +15 -32
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_pb_styles.jsx +64 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_pb_styles.md +1 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_secondary_y_axis.jsx +22 -72
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_secondary_y_axis.md +1 -1
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_spline.jsx +15 -31
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_stacked.jsx +16 -37
- data/app/pb_kits/playbook/pb_bar_graph/docs/_description.md +3 -1
- data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +3 -1
- data/app/pb_kits/playbook/pb_bar_graph/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_body/docs/_body_truncate.jsx +3 -3
- data/app/pb_kits/playbook/pb_circle_chart/circleChartTheme.ts +1 -36
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.jsx +26 -71
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.jsx +16 -29
- data/app/pb_kits/playbook/pb_circle_chart/docs/{_circle_chart_colors_rails.md → _circle_chart_colors.md} +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.jsx +16 -28
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.md +2 -4
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.jsx +15 -23
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_inner_sizes.jsx +51 -81
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.jsx +75 -103
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.md +6 -3
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_live_data.jsx +13 -19
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_pb_styles.jsx +38 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_pb_styles.md +1 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.jsx +17 -30
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_labels.jsx +20 -34
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_legend_kit.jsx +20 -29
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_title.jsx +20 -28
- data/app/pb_kits/playbook/pb_circle_chart/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_contact/contact.test.js +2 -2
- data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.ts +39 -1
- data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.ts +39 -1
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +12 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_blank_selection.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_blank_selection.jsx +4 -7
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_clear_selection.jsx +3 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_close_on_select.jsx +42 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_close_on_select.md +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default.jsx +3 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default_rails.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default_value.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default_value.jsx +4 -7
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx +4 -7
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select.jsx +10 -19
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select_display.jsx +10 -19
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select_display_rails.html.erb +10 -10
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select_rails.html.erb +10 -10
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select_with_autocomplete.html.erb +10 -10
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select_with_autocomplete.jsx +11 -20
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select_with_custom_options.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select_with_custom_options.jsx +8 -8
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select_with_default.html.erb +10 -10
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select_with_default.jsx +14 -23
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_separators_hidden.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_separators_hidden.jsx +3 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subcomponent_structure.jsx +3 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subcomponent_structure_rails.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subtle_variant.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subtle_variant.jsx +3 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete.jsx +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_with_subcomponents.html.erb +4 -4
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_with_subcomponents.jsx +4 -4
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display.jsx +4 -4
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display_rails.html.erb +4 -4
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_options.jsx +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_options_rails.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_padding.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_padding.jsx +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_trigger.jsx +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_trigger_rails.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_external_control.jsx +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_label.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_label.jsx +3 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_search.jsx +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_search_rails.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +2 -4
- data/app/pb_kits/playbook/pb_dropdown/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownOption.tsx +14 -10
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownTrigger.tsx +26 -15
- data/app/pb_kits/playbook/pb_filter/Filter/index.tsx +0 -13
- data/app/pb_kits/playbook/pb_filter/_filter.scss +0 -4
- data/app/pb_kits/playbook/pb_filter/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_filter/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_filter/filter.test.js +2 -2
- data/app/pb_kits/playbook/pb_table/_table.tsx +4 -4
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns.html.erb +8 -8
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns.jsx +8 -8
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns_rails.md +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns_react.md +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns.html.erb +12 -12
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns.jsx +12 -12
- 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_left_columns_react.md +3 -3
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns.html.erb +12 -12
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns.jsx +12 -12
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns_rails.md +2 -2
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns_react.md +3 -3
- data/app/pb_kits/playbook/pb_table/index.ts +4 -4
- data/app/pb_kits/playbook/pb_table/styles/_table-card.scss +0 -11
- data/app/pb_kits/playbook/pb_table/styles/_vertical_border.scss +0 -4
- data/app/pb_kits/playbook/pb_title/docs/_title_truncate.jsx +3 -3
- data/app/pb_kits/playbook/pb_tooltip/_tooltip.tsx +22 -34
- data/app/pb_kits/playbook/pb_tooltip/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_tooltip/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_tooltip/index.js +36 -59
- data/app/pb_kits/playbook/pb_tooltip/tooltip.rb +2 -9
- data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.scss +14 -0
- data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.tsx +119 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_description.md +5 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.html.erb +37 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.jsx +48 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.md +2 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.html.erb +37 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.jsx +47 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.md +3 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.html.erb +79 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.jsx +90 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.md +1 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.html.erb +54 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.jsx +65 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.md +3 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.html.erb +37 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.jsx +48 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.md +3 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/example.yml +15 -0
- data/app/pb_kits/playbook/pb_treemap_chart/docs/index.js +5 -0
- data/app/pb_kits/playbook/pb_treemap_chart/treemapChart.test.js +63 -0
- data/app/pb_kits/playbook/pb_treemap_chart/treemap_chart.html.erb +1 -0
- data/app/pb_kits/playbook/pb_treemap_chart/treemap_chart.rb +48 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +0 -3
- data/dist/chunks/_typeahead-CoOpeYom.js +22 -0
- data/dist/chunks/_weekday_stacked-B_jpa2Rz.js +45 -0
- data/dist/chunks/lib-D7Va7yqa.js +29 -0
- data/dist/chunks/{pb_form_validation-DO8gKaSb.js → pb_form_validation-DSkdRDMf.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +9 -0
- data/dist/playbook-doc.js +3 -3
- 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 +2 -2
- metadata +41 -51
- data/app/pb_kits/playbook/pb_advanced_table/Utilities/ColumnStylingHelper.ts +0 -15
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table_action_bar.js +0 -36
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling.jsx +0 -51
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling.md +0 -7
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_column_headers.jsx +0 -77
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_column_headers.md +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_column_headers_rails.html.erb +0 -63
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_column_headers_rails.md +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_rails.html.erb +0 -38
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_rails.md +0 -7
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_sort.jsx +0 -65
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_sort.md +0 -5
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_infinite_scroll.md +0 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_row_styling.jsx +0 -64
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_row_styling.md +0 -7
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header.jsx +0 -69
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header.md +0 -1
- data/app/pb_kits/playbook/pb_bar_graph/barGraphTheme.ts +0 -106
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_height.md +0 -3
- data/app/pb_kits/playbook/pb_body/docs/_body_truncate_react.md +0 -4
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors_react.md +0 -2
- data/app/pb_kits/playbook/pb_circle_chart/docs/_description.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_icon_options.html.erb +0 -52
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_icon_options.jsx +0 -99
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_icon_options_rails.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_icon_options_react.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_radio_options.html.erb +0 -28
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_radio_options.jsx +0 -47
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_radio_options_rails.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_radio_options_react.md +0 -1
- data/app/pb_kits/playbook/pb_filter/Filter/FilterSection.tsx +0 -49
- data/app/pb_kits/playbook/pb_filter/Filter/FilterSidebar.tsx +0 -69
- data/app/pb_kits/playbook/pb_filter/docs/_filter_sidebar.jsx +0 -224
- data/app/pb_kits/playbook/pb_title/docs/_title_truncate_react.md +0 -4
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_click_open.html.erb +0 -14
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_click_open.jsx +0 -25
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_click_open_rails.md +0 -1
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_click_open_react.md +0 -1
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_preserve_input.html.erb +0 -18
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_preserve_input_rails.md +0 -1
- data/dist/chunks/_circle_chart-CE1dVeaK.js +0 -1
- data/dist/chunks/_typeahead-CEZhT0Qr.js +0 -6
- data/dist/chunks/_weekday_stacked-Zjg_MJ-c.js +0 -61
- data/dist/chunks/lib-CP6s-TZS.js +0 -29
- /data/app/pb_kits/playbook/pb_body/docs/{_body_truncate_rails.md → _body_truncate.md} +0 -0
- /data/app/pb_kits/playbook/pb_title/docs/{_title_truncate_rails.md → _title_truncate.md} +0 -0
- /data/app/pb_kits/playbook/pb_typeahead/docs/{_typeahead_preserve_input_react.md → _typeahead_preserve_input.md} +0 -0
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions.jsx
CHANGED
@@ -47,14 +47,14 @@ const CustomActions = () => {
|
|
47
47
|
<CircleIconButton
|
48
48
|
icon="file-csv"
|
49
49
|
onClick={() =>
|
50
|
-
alert(rowIds.length === 0 ? "No Selection Made" :
|
50
|
+
alert(rowIds.length === 0 ? "No Selection Made" : `Row ids ${rowIds.join(", ")} will be exported!`)
|
51
51
|
}
|
52
52
|
variant="link"
|
53
53
|
/>
|
54
54
|
<CircleIconButton
|
55
55
|
icon="trash-alt"
|
56
56
|
onClick={() =>
|
57
|
-
alert(rowIds.length === 0 ? "No Selection Made" :
|
57
|
+
alert(rowIds.length === 0 ? "No Selection Made" : `Row ids ${rowIds.join(", ")} will be deleted!`)
|
58
58
|
}
|
59
59
|
variant="link"
|
60
60
|
/>
|
@@ -88,11 +88,10 @@ actions = [
|
|
88
88
|
if (!selectedRowIds || selectedRowIds.length === 0) {
|
89
89
|
alert('No Selection Made');
|
90
90
|
} else {
|
91
|
-
const selectedRowsString = selectedRowIds.join(', ');
|
92
91
|
if (actionType === 'export') {
|
93
|
-
alert(
|
92
|
+
alert(`Row ids ${selectedRowIds.join(', ')} will be exported!`);
|
94
93
|
} else if (actionType === 'delete') {
|
95
|
-
alert(
|
94
|
+
alert(`Row ids ${selectedRowIds.join(', ')} will be deleted!`);
|
96
95
|
}
|
97
96
|
}
|
98
97
|
};
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header.html.erb
CHANGED
@@ -30,4 +30,4 @@
|
|
30
30
|
}
|
31
31
|
] %>
|
32
32
|
|
33
|
-
<%= pb_rails("advanced_table", props: { id: "
|
33
|
+
<%= pb_rails("advanced_table", props: { id: "table_props_table", table_data: @table_data, column_definitions: column_definitions, max_height: "xs", table_props: { sticky: true }}) %>
|
@@ -19,15 +19,12 @@ examples:
|
|
19
19
|
- advanced_table_selectable_rows_actions_rails: Selectable Rows (With Actions)
|
20
20
|
- advanced_table_selectable_rows_header_rails: Selectable Rows (No Actions Bar)
|
21
21
|
- advanced_table_scrollbar_none: Advanced Table Scrollbar None
|
22
|
-
- advanced_table_column_styling_rails: Column Styling
|
23
|
-
- advanced_table_column_styling_column_headers_rails: Column Styling with Multiple Headers
|
24
22
|
|
25
23
|
react:
|
26
24
|
- advanced_table_default: Default (Required Props)
|
27
25
|
- advanced_table_loading: Loading State
|
28
26
|
- advanced_table_sort: Enable Sorting
|
29
27
|
- advanced_table_sort_control: Sort Control
|
30
|
-
- advanced_table_custom_sort: Custom Sort
|
31
28
|
- advanced_table_expanded_control: Expanded Control
|
32
29
|
- advanced_table_expand_by_depth: Expand by Depth
|
33
30
|
- advanced_table_subrow_headers: SubRow Headers
|
@@ -41,7 +38,6 @@ examples:
|
|
41
38
|
- advanced_table_inline_row_loading: Inline Row Loading
|
42
39
|
- advanced_table_responsive: Responsive Tables
|
43
40
|
- advanced_table_custom_cell: Custom Components for Cells
|
44
|
-
- advanced_table_with_custom_header: Custom Header Cell
|
45
41
|
- advanced_table_pagination: Pagination
|
46
42
|
- advanced_table_pagination_with_props: Pagination Props
|
47
43
|
- advanced_table_column_headers: Multi-Header Columns
|
@@ -61,7 +57,3 @@ examples:
|
|
61
57
|
- advanced_table_column_visibility_multi: Column Visibility Control with Multi-Header Columns
|
62
58
|
- advanced_table_pinned_rows: Pinned Rows
|
63
59
|
- advanced_table_scrollbar_none: Advanced Table Scrollbar None
|
64
|
-
- advanced_table_row_styling: Row Styling
|
65
|
-
- advanced_table_column_styling: Column Styling
|
66
|
-
- advanced_table_column_styling_column_headers: Column Styling with Multiple Headers
|
67
|
-
- advanced_table_infinite_scroll: Infinite Scroll
|
@@ -34,9 +34,3 @@ export { default as AdvancedTableColumnVisibilityMulti } from './_advanced_table
|
|
34
34
|
export { default as AdvancedTableColumnVisibilityWithState } from './_advanced_table_column_visibility_with_state.jsx'
|
35
35
|
export { default as AdvancedTablePinnedRows } from './_advanced_table_pinned_rows.jsx'
|
36
36
|
export { default as AdvancedTableScrollbarNone} from './_advanced_table_scrollbar_none.jsx'
|
37
|
-
export { default as AdvancedTableRowStyling } from './_advanced_table_row_styling.jsx'
|
38
|
-
export { default as AdvancedTableColumnStyling } from './_advanced_table_column_styling.jsx'
|
39
|
-
export { default as AdvancedTableColumnStylingColumnHeaders } from './_advanced_table_column_styling_column_headers.jsx'
|
40
|
-
export { default as AdvancedTableInfiniteScroll} from './_advanced_table_infinite_scroll.jsx'
|
41
|
-
export {default as AdvancedTableWithCustomHeader} from './_advanced_table_with_custom_header.jsx'
|
42
|
-
export { default as AdvancedTableCustomSort } from './_advanced_table_custom_sort.jsx'
|
@@ -1,82 +1,106 @@
|
|
1
1
|
import PbEnhancedElement from "../pb_enhanced_element";
|
2
|
-
import { updateSelectionActionBar } from "./advanced_table_action_bar";
|
3
2
|
|
4
|
-
const
|
5
|
-
const SELECT_ALL_SELECTOR = "#select-all-rows input[type='checkbox']";
|
3
|
+
const FLAT_ADVANCED_TABLE_SELECTOR = "[data-flat-advanced-table-select]";
|
6
4
|
|
7
5
|
export default class PbFlatAdvancedTable extends PbEnhancedElement {
|
8
6
|
static get selector() {
|
9
|
-
return
|
7
|
+
return FLAT_ADVANCED_TABLE_SELECTOR;
|
10
8
|
}
|
11
9
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
10
|
+
get target() {
|
11
|
+
const table = this.element.closest("table");
|
12
|
+
return table.querySelectorAll(
|
13
|
+
`"label[data-flat-advanced-table-select='true']"`
|
14
|
+
);
|
16
15
|
}
|
17
16
|
|
17
|
+
static selectedRows = new Set();
|
18
|
+
|
18
19
|
connect() {
|
19
20
|
const table = this.element.closest("table");
|
20
|
-
if (!table
|
21
|
-
table.dataset.flatAdvancedInit = "true";
|
22
|
-
|
23
|
-
// Reference to outer container for action bar
|
21
|
+
if (!table) return;
|
24
22
|
const mainTable = this.element.closest(".pb_advanced_table");
|
25
|
-
//
|
26
|
-
if (
|
27
|
-
|
28
|
-
}
|
23
|
+
// Prevent double-init
|
24
|
+
if (table.dataset.flatAdvancedTableInitialized) return;
|
25
|
+
table.dataset.flatAdvancedTableInitialized = "true";
|
29
26
|
|
30
|
-
const
|
31
|
-
|
32
|
-
|
27
|
+
const checkboxLabels = table.querySelectorAll(
|
28
|
+
"label[data-flat-advanced-table-select='true']"
|
29
|
+
);
|
30
|
+
checkboxLabels.forEach((label) => {
|
31
|
+
const checkbox = label.querySelector("input[type='checkbox']");
|
32
|
+
if (!checkbox) return;
|
33
|
+
checkbox.addEventListener("change", () => {
|
34
|
+
const rowId = checkbox.id;
|
35
|
+
const isChecked = checkbox.checked;
|
36
|
+
|
37
|
+
if (isChecked) {
|
38
|
+
PbFlatAdvancedTable.selectedRows.add(rowId);
|
39
|
+
} else {
|
40
|
+
PbFlatAdvancedTable.selectedRows.delete(rowId);
|
41
|
+
}
|
42
|
+
|
43
|
+
// Update row background color based on checkbox state
|
44
|
+
const rowEl = checkbox.closest("tr");
|
45
|
+
if (rowEl) {
|
46
|
+
if (isChecked) {
|
47
|
+
rowEl.classList.add("bg-row-selection");
|
48
|
+
rowEl.classList.remove("bg-white");
|
49
|
+
} else {
|
50
|
+
rowEl.classList.remove("bg-row-selection");
|
51
|
+
rowEl.classList.add("bg-white");
|
52
|
+
}
|
53
|
+
}
|
54
|
+
const allCheckboxes = table.querySelectorAll(
|
55
|
+
"label[data-flat-advanced-table-select='true'] input[type='checkbox']"
|
56
|
+
);
|
57
|
+
|
58
|
+
const selectAllInput = table.querySelector(
|
59
|
+
"#select-all-rows input[type='checkbox']"
|
60
|
+
);
|
61
|
+
|
62
|
+
if (selectAllInput) {
|
63
|
+
const allChecked = Array.from(allCheckboxes).every(cb => cb.checked);
|
64
|
+
selectAllInput.checked = allChecked;
|
65
|
+
}
|
66
|
+
|
33
67
|
mainTable.dataset.selectedRows = JSON.stringify(
|
34
|
-
Array.from(
|
68
|
+
Array.from(PbFlatAdvancedTable.selectedRows)
|
35
69
|
);
|
36
|
-
|
37
|
-
|
38
|
-
};
|
39
|
-
|
40
|
-
table.addEventListener("change", (e) => {
|
41
|
-
const rowCb = e.target.closest(FLAT_SELECTOR + " input[type='checkbox']");
|
42
|
-
const allCb = e.target.closest(SELECT_ALL_SELECTOR);
|
43
|
-
if (!rowCb && !allCb) return;
|
44
|
-
|
45
|
-
if (rowCb) {
|
46
|
-
const id = rowCb.id;
|
47
|
-
if (rowCb.checked) this.selectedRows.add(id);
|
48
|
-
else this.selectedRows.delete(id);
|
70
|
+
});
|
71
|
+
|
72
|
+
});
|
49
73
|
|
50
|
-
|
51
|
-
|
52
|
-
|
74
|
+
// Handle select-all checkbox
|
75
|
+
const selectAllWrapper = table.querySelector("#select-all-rows");
|
76
|
+
if (selectAllWrapper) {
|
77
|
+
const selectAllInput = selectAllWrapper.querySelector(
|
78
|
+
'input[type="checkbox"]'
|
79
|
+
);
|
80
|
+
selectAllInput.addEventListener("change", () => {
|
81
|
+
const checkAll = selectAllInput.checked;
|
53
82
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
const
|
58
|
-
|
59
|
-
).every((cb) => cb.checked);
|
60
|
-
header.checked = all;
|
61
|
-
}
|
62
|
-
}
|
83
|
+
checkboxLabels.forEach((label) => {
|
84
|
+
const cb = label.querySelector("input[type='checkbox']");
|
85
|
+
cb.checked = checkAll;
|
86
|
+
const rowId = cb.id;
|
87
|
+
const rowEl = cb.closest("tr");
|
63
88
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
const id = cb.id;
|
74
|
-
if (checked) this.selectedRows.add(id);
|
75
|
-
else this.selectedRows.delete(id);
|
89
|
+
if (checkAll) {
|
90
|
+
PbFlatAdvancedTable.selectedRows.add(rowId);
|
91
|
+
rowEl?.classList.add("bg-row-selection");
|
92
|
+
rowEl?.classList.remove("bg-white");
|
93
|
+
} else {
|
94
|
+
PbFlatAdvancedTable.selectedRows.delete(rowId);
|
95
|
+
rowEl?.classList.remove("bg-row-selection");
|
96
|
+
rowEl?.classList.add("bg-white");
|
97
|
+
}
|
76
98
|
});
|
77
|
-
}
|
78
99
|
|
79
|
-
|
80
|
-
|
100
|
+
mainTable.dataset.selectedRows = JSON.stringify(
|
101
|
+
Array.from(PbFlatAdvancedTable.selectedRows)
|
102
|
+
);
|
103
|
+
});
|
104
|
+
}
|
81
105
|
}
|
82
106
|
}
|
@@ -1,5 +1,4 @@
|
|
1
1
|
import PbEnhancedElement from "../pb_enhanced_element";
|
2
|
-
import { updateSelectionActionBar } from "./advanced_table_action_bar";
|
3
2
|
|
4
3
|
const ADVANCED_TABLE_SELECTOR = "[data-advanced-table]";
|
5
4
|
const DOWN_ARROW_SELECTOR = "#advanced-table_open_icon";
|
@@ -10,33 +9,9 @@ export default class PbAdvancedTable extends PbEnhancedElement {
|
|
10
9
|
return ADVANCED_TABLE_SELECTOR;
|
11
10
|
}
|
12
11
|
|
13
|
-
static expandedRows = new Set();
|
14
|
-
static selectedRows = new Set();
|
15
|
-
static isCollapsing = false;
|
16
|
-
|
17
|
-
constructor(...args) {
|
18
|
-
super(...args);
|
19
|
-
// Map parent row ID to array of its child rows
|
20
|
-
this.childRowsMap = new Map();
|
21
|
-
}
|
22
|
-
|
23
|
-
// Fetch and cache child rows for a given parent row ID
|
24
|
-
childRowsFor(parentId) {
|
25
|
-
if (!this.childRowsMap.has(parentId)) {
|
26
|
-
const table = this.element.closest("table");
|
27
|
-
const rows = Array.from(
|
28
|
-
table.querySelectorAll(`tr[data-row-parent="${parentId}"]`)
|
29
|
-
);
|
30
|
-
this.childRowsMap.set(parentId, rows);
|
31
|
-
}
|
32
|
-
return this.childRowsMap.get(parentId);
|
33
|
-
}
|
34
|
-
|
35
12
|
updateTableSelectedRowsAttribute() {
|
36
13
|
const mainTable = this.element.closest(".pb_advanced_table");
|
37
|
-
mainTable.dataset.selectedRows = JSON.stringify(
|
38
|
-
Array.from(PbAdvancedTable.selectedRows)
|
39
|
-
);
|
14
|
+
mainTable.dataset.selectedRows = JSON.stringify(Array.from(PbAdvancedTable.selectedRows));
|
40
15
|
}
|
41
16
|
|
42
17
|
// Check if the row is expanded or collapsed
|
@@ -129,7 +104,7 @@ export default class PbAdvancedTable extends PbEnhancedElement {
|
|
129
104
|
} else {
|
130
105
|
PbAdvancedTable.selectedRows.delete(rowId);
|
131
106
|
}
|
132
|
-
|
107
|
+
// Update background color on row
|
133
108
|
if (!isChecked) {
|
134
109
|
rowEl.classList.remove("bg-row-selection");
|
135
110
|
|
@@ -201,129 +176,99 @@ export default class PbAdvancedTable extends PbEnhancedElement {
|
|
201
176
|
);
|
202
177
|
selectAllInput.checked = allChecked;
|
203
178
|
}
|
204
|
-
updateSelectionActionBar(table.closest(".pb_advanced_table"), PbAdvancedTable.selectedRows.size);
|
205
179
|
}
|
206
180
|
|
207
181
|
get target() {
|
208
|
-
|
182
|
+
const table = this.element.closest("table");
|
183
|
+
return table.querySelectorAll(`[data-row-parent="${this.element.id}"]`);
|
209
184
|
}
|
210
185
|
|
186
|
+
static expandedRows = new Set();
|
187
|
+
static selectedRows = new Set();
|
188
|
+
static isCollapsing = false;
|
189
|
+
|
211
190
|
connect() {
|
212
|
-
|
191
|
+
this.element.addEventListener("click", () => {
|
192
|
+
if (!PbAdvancedTable.isCollapsing) {
|
193
|
+
const isExpanded =
|
194
|
+
this.element.querySelector(UP_ARROW_SELECTOR).style.display ===
|
195
|
+
"inline-block";
|
196
|
+
if (!isExpanded) {
|
197
|
+
PbAdvancedTable.expandedRows.add(this.element.id);
|
198
|
+
} else {
|
199
|
+
PbAdvancedTable.expandedRows.delete(this.element.id);
|
200
|
+
}
|
201
|
+
this.toggleElement(this.target);
|
202
|
+
}
|
203
|
+
});
|
213
204
|
|
214
205
|
this.hideCloseIcon();
|
215
|
-
const mainTable = this.element.closest(".pb_advanced_table");
|
216
|
-
|
217
|
-
// This so it is hidden on first render
|
218
|
-
if (mainTable) {
|
219
|
-
updateSelectionActionBar(mainTable);
|
220
|
-
}
|
221
206
|
|
222
|
-
|
223
|
-
table.querySelectorAll("tr[data-row-parent]").forEach((row) => {
|
224
|
-
const parentId = row.dataset.rowParent;
|
225
|
-
if (!this.childRowsMap.has(parentId)) {
|
226
|
-
this.childRowsMap.set(parentId, []);
|
227
|
-
}
|
228
|
-
this.childRowsMap.get(parentId).push(row);
|
229
|
-
});
|
207
|
+
const table = this.element.closest("table");
|
230
208
|
|
231
209
|
// Prevent duplicate initialization
|
232
210
|
if (table.dataset.pbAdvancedTableInitialized) return;
|
233
211
|
table.dataset.pbAdvancedTableInitialized = "true";
|
234
212
|
|
235
|
-
//
|
236
|
-
table.
|
237
|
-
|
213
|
+
// Bind checkbox change handlers for all row checkboxes
|
214
|
+
const checkboxLabels = table.querySelectorAll("label[data-row-id]");
|
215
|
+
checkboxLabels.forEach((label) => {
|
216
|
+
const checkbox = label.querySelector("input[type='checkbox']");
|
238
217
|
if (!checkbox) return;
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
const checkAll = checkbox.checked;
|
243
|
-
const rowCheckboxes = table.querySelectorAll(
|
244
|
-
'label[data-row-id] input[type="checkbox"]'
|
245
|
-
);
|
246
|
-
rowCheckboxes.forEach((cb) => {
|
247
|
-
if (cb.checked !== checkAll) {
|
248
|
-
cb.checked = checkAll;
|
249
|
-
this.handleCheckboxClick({ currentTarget: cb });
|
250
|
-
}
|
251
|
-
});
|
252
|
-
this.updateTableSelectedRowsAttribute();
|
253
|
-
updateSelectionActionBar(table.closest(".pb_advanced_table"), PbAdvancedTable.selectedRows.size);
|
254
|
-
return;
|
255
|
-
}
|
256
|
-
|
257
|
-
// Individual row checkbox logic
|
258
|
-
const rowLabel = checkbox.closest("label[data-row-id]");
|
259
|
-
if (rowLabel) {
|
260
|
-
this.handleCheckboxClick({ currentTarget: checkbox });
|
261
|
-
this.updateTableSelectedRowsAttribute();
|
262
|
-
|
263
|
-
// Sync header select-all state
|
264
|
-
const selectAllInput = table.querySelector(
|
265
|
-
'#select-all-rows input[type="checkbox"]'
|
266
|
-
);
|
267
|
-
if (selectAllInput) {
|
268
|
-
selectAllInput.checked = Array.from(
|
269
|
-
table.querySelectorAll('label[data-row-id] input[type="checkbox"]')
|
270
|
-
).every((cb) => cb.checked);
|
271
|
-
}
|
272
|
-
}
|
218
|
+
checkbox.addEventListener("change", (event) => {
|
219
|
+
this.handleCheckboxClick(event);
|
220
|
+
});
|
273
221
|
});
|
274
222
|
|
275
|
-
//
|
276
|
-
table.
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
"inline-block";
|
288
|
-
if (!isExpanded) {
|
289
|
-
PbAdvancedTable.expandedRows.add(toggleBtn.id);
|
290
|
-
} else {
|
291
|
-
PbAdvancedTable.expandedRows.delete(toggleBtn.id);
|
292
|
-
}
|
293
|
-
|
294
|
-
// Find direct child rows
|
295
|
-
const childRows = Array.from(
|
296
|
-
table.querySelectorAll(`[data-row-parent="${toggleBtn.id}"]`)
|
297
|
-
);
|
298
|
-
this.toggleElement(childRows);
|
299
|
-
|
300
|
-
// Restore original element context
|
301
|
-
this.element = prevElement;
|
223
|
+
// Bind nested row expansion logic
|
224
|
+
const nestedButtons = table.querySelectorAll("[data-advanced-table]");
|
225
|
+
nestedButtons.forEach((button) => {
|
226
|
+
button.addEventListener("click", () => {
|
227
|
+
const isExpanded =
|
228
|
+
button.querySelector(UP_ARROW_SELECTOR).style.display === "inline-block";
|
229
|
+
if (isExpanded) {
|
230
|
+
PbAdvancedTable.expandedRows.add(button.id);
|
231
|
+
} else {
|
232
|
+
PbAdvancedTable.expandedRows.delete(button.id);
|
233
|
+
}
|
234
|
+
});
|
302
235
|
});
|
303
236
|
|
304
|
-
this
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
237
|
+
// Bind select-all logic for this table
|
238
|
+
const selectAllCheckbox = table.querySelector("#select-all-rows");
|
239
|
+
if (selectAllCheckbox) {
|
240
|
+
selectAllCheckbox.addEventListener("change", () => {
|
241
|
+
const checkboxInput = selectAllCheckbox.querySelector('input[type="checkbox"]');
|
242
|
+
const checkAll = checkboxInput.checked;
|
309
243
|
|
310
|
-
|
244
|
+
const checkboxes = Array.from(
|
245
|
+
table.querySelectorAll("label[data-row-id] input[type='checkbox']")
|
246
|
+
);
|
311
247
|
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
248
|
+
checkboxes.forEach((cb) => {
|
249
|
+
cb.checked = checkAll;
|
250
|
+
const rowId = cb.id;
|
251
|
+
const rowEl = cb.closest("tr");
|
316
252
|
|
317
|
-
|
253
|
+
if (checkAll) {
|
254
|
+
PbAdvancedTable.selectedRows.add(rowId);
|
255
|
+
rowEl?.classList.add("bg-row-selection");
|
256
|
+
rowEl?.classList.remove("bg-white", "bg-silver");
|
257
|
+
} else {
|
258
|
+
PbAdvancedTable.selectedRows.delete(rowId);
|
259
|
+
rowEl?.classList.remove("bg-row-selection");
|
260
|
+
rowEl?.classList.add("bg-white");
|
261
|
+
}
|
262
|
+
});
|
318
263
|
|
319
|
-
|
264
|
+
checkboxes.forEach((cb) => this.updateParentCheckboxes(cb));
|
320
265
|
|
321
|
-
|
322
|
-
|
323
|
-
}
|
266
|
+
this.updateTableSelectedRowsAttribute();
|
267
|
+
});
|
324
268
|
}
|
325
269
|
}
|
326
270
|
|
271
|
+
|
327
272
|
hideCloseIcon() {
|
328
273
|
const closeIcon = this.element.querySelector(UP_ARROW_SELECTOR);
|
329
274
|
closeIcon.style.display = "none";
|
@@ -422,8 +367,6 @@ export default class PbAdvancedTable extends PbEnhancedElement {
|
|
422
367
|
row.classList.toggle("bg-silver", !isVisible);
|
423
368
|
row.classList.toggle("bg-white", isVisible);
|
424
369
|
}
|
425
|
-
|
426
|
-
this.addBorderRadiusOnLastVisibleRow();
|
427
370
|
}
|
428
371
|
|
429
372
|
displayDownArrow() {
|
@@ -506,6 +449,151 @@ export default class PbAdvancedTable extends PbEnhancedElement {
|
|
506
449
|
}
|
507
450
|
}
|
508
451
|
|
452
|
+
// Isolate action bar functionality so it doesn't mix with existing functionality
|
453
|
+
class PbAdvancedTableActionBar {
|
454
|
+
constructor() {
|
455
|
+
this.init();
|
456
|
+
}
|
457
|
+
|
458
|
+
init() {
|
459
|
+
// Initialize action bars for all advanced tables with action bars
|
460
|
+
document.addEventListener('DOMContentLoaded', () => {
|
461
|
+
this.setupActionBars();
|
462
|
+
});
|
463
|
+
|
464
|
+
// Also run immediately in case DOM is already loaded
|
465
|
+
if (document.readyState === 'loading') {
|
466
|
+
// DOM is still loading
|
467
|
+
} else {
|
468
|
+
// DOM is already loaded
|
469
|
+
this.setupActionBars();
|
470
|
+
}
|
471
|
+
}
|
472
|
+
|
473
|
+
setupActionBars() {
|
474
|
+
const advancedTables = document.querySelectorAll('.pb_advanced_table');
|
475
|
+
|
476
|
+
advancedTables.forEach(table => {
|
477
|
+
// Only proceed if this table has both selectable rows AND an action bar
|
478
|
+
if (!this.shouldEnableActionBar(table)) return;
|
479
|
+
|
480
|
+
const actionBar = table.querySelector('.row-selection-actions-card');
|
481
|
+
if (!actionBar) return; // Skip tables without action bars
|
482
|
+
|
483
|
+
// Initialize action bar styles
|
484
|
+
this.initializeActionBar(actionBar);
|
485
|
+
|
486
|
+
// Set up checkbox listeners for this table
|
487
|
+
this.setupCheckboxListeners(table, actionBar);
|
488
|
+
});
|
489
|
+
}
|
490
|
+
|
491
|
+
shouldEnableActionBar(table) {
|
492
|
+
// Check if the table has selectable rows
|
493
|
+
const hasSelectableRows = table.querySelector('input[type="checkbox"]') !== null;
|
494
|
+
|
495
|
+
// Check if the table has a row selection action bar (not other types of action bars)
|
496
|
+
const hasRowSelectionActionBar = table.querySelector('.row-selection-actions-card') !== null;
|
497
|
+
|
498
|
+
// Additional check: look for the presence of row checkboxes with data-row-id
|
499
|
+
const hasRowCheckboxes = table.querySelector('label[data-row-id] input[type="checkbox"]') !== null;
|
500
|
+
|
501
|
+
// Only enable if ALL conditions are met:
|
502
|
+
// 1. Has selectable checkboxes
|
503
|
+
// 2. Has the specific row selection action bar
|
504
|
+
// 3. Has row checkboxes (not just other types of checkboxes)
|
505
|
+
return hasSelectableRows && hasRowSelectionActionBar && hasRowCheckboxes;
|
506
|
+
}
|
507
|
+
|
508
|
+
initializeActionBar(actionBar) {
|
509
|
+
// Set initial hidden state
|
510
|
+
Object.assign(actionBar.style, {
|
511
|
+
height: '0px',
|
512
|
+
overflow: 'hidden',
|
513
|
+
display: 'block',
|
514
|
+
opacity: '0'
|
515
|
+
});
|
516
|
+
|
517
|
+
// Remove any visibility classes
|
518
|
+
actionBar.classList.remove("p_xs", "is-visible", "show-action-card");
|
519
|
+
actionBar.classList.add("p_none");
|
520
|
+
}
|
521
|
+
|
522
|
+
setupCheckboxListeners(table, actionBar) {
|
523
|
+
// Only listen to row checkboxes (those with data-row-id), not all checkboxes
|
524
|
+
const rowCheckboxes = table.querySelectorAll('label[data-row-id] input[type="checkbox"]');
|
525
|
+
|
526
|
+
rowCheckboxes.forEach(checkbox => {
|
527
|
+
checkbox.addEventListener('change', () => {
|
528
|
+
// Use setTimeout to ensure this runs after the main checkbox logic
|
529
|
+
setTimeout(() => {
|
530
|
+
this.updateActionBarVisibility(table, actionBar);
|
531
|
+
}, 0);
|
532
|
+
});
|
533
|
+
});
|
534
|
+
|
535
|
+
// Special handling for select-all checkbox (only if it exists)
|
536
|
+
const selectAllCheckbox = table.querySelector("#select-all-rows");
|
537
|
+
if (selectAllCheckbox) {
|
538
|
+
const selectAllInput = selectAllCheckbox.querySelector('input[type="checkbox"]');
|
539
|
+
if (selectAllInput) {
|
540
|
+
selectAllInput.addEventListener('change', () => {
|
541
|
+
// Use setTimeout to ensure this runs after the main select-all logic
|
542
|
+
setTimeout(() => {
|
543
|
+
this.updateActionBarVisibility(table, actionBar);
|
544
|
+
}, 10); // Slightly longer delay for select-all to ensure all row checkboxes are updated
|
545
|
+
});
|
546
|
+
}
|
547
|
+
}
|
548
|
+
}
|
549
|
+
|
550
|
+
updateActionBarVisibility(table, actionBar) {
|
551
|
+
// Only count row checkboxes (those with data-row-id), not all checkboxes
|
552
|
+
const rowCheckboxes = table.querySelectorAll('label[data-row-id] input[type="checkbox"]');
|
553
|
+
|
554
|
+
// Get all checked row checkboxes
|
555
|
+
const selectedRowCheckboxes = Array.from(rowCheckboxes).filter(cb => cb.checked);
|
556
|
+
|
557
|
+
// Get the selected count
|
558
|
+
const selectedCount = selectedRowCheckboxes.length;
|
559
|
+
|
560
|
+
if (selectedCount > 0) {
|
561
|
+
this.showActionBar(actionBar, selectedCount);
|
562
|
+
} else {
|
563
|
+
this.hideActionBar(actionBar);
|
564
|
+
}
|
565
|
+
}
|
566
|
+
|
567
|
+
showActionBar(actionBar, selectedCount) {
|
568
|
+
// Show action bar directly
|
569
|
+
actionBar.style.height = 'auto';
|
570
|
+
actionBar.style.overflow = 'visible';
|
571
|
+
actionBar.style.opacity = '1';
|
572
|
+
actionBar.style.transitionProperty = 'all';
|
573
|
+
actionBar.style.transitionTimingFunction = 'ease-in-out';
|
574
|
+
actionBar.classList.remove("p_none");
|
575
|
+
actionBar.classList.add("p_xs", "is-visible", "show-action-card");
|
576
|
+
|
577
|
+
// Update the count
|
578
|
+
const countElement = actionBar.querySelector(".selected-count");
|
579
|
+
if (countElement) {
|
580
|
+
countElement.textContent = `${selectedCount} Selected`;
|
581
|
+
}
|
582
|
+
}
|
583
|
+
|
584
|
+
hideActionBar(actionBar) {
|
585
|
+
// Hide action bar directly
|
586
|
+
actionBar.style.height = '0px';
|
587
|
+
actionBar.style.overflow = 'hidden';
|
588
|
+
actionBar.style.opacity = '0';
|
589
|
+
actionBar.classList.add("p_none");
|
590
|
+
actionBar.classList.remove("p_xs", "is-visible", "show-action-card");
|
591
|
+
}
|
592
|
+
}
|
593
|
+
|
594
|
+
// Initialize the isolated action bar functionality
|
595
|
+
new PbAdvancedTableActionBar();
|
596
|
+
|
509
597
|
window.expandAllRows = (element) => {
|
510
598
|
PbAdvancedTable.handleToggleAllHeaders(element);
|
511
599
|
};
|