playbook_ui 16.9.0 → 16.10.0.pre.alpha.PLAY3032dropdowndisabledinput17361
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_advanced_table/Components/RegularTableView.tsx +14 -6
- 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 +2 -2
- 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 +35 -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 +105 -14
- 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_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/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 +1 -1
- data/app/pb_kits/playbook/pb_circle_icon_button/kit.schema.json +1 -1
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +3 -0
- 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 +18 -10
- 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_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 +32 -0
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +13 -4
- 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/_playground.json +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/index.js +1 -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 +56 -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_trigger.html.erb +4 -2
- data/app/pb_kits/playbook/pb_dropdown/dropdown_trigger.rb +2 -0
- data/app/pb_kits/playbook/pb_dropdown/index.js +45 -0
- data/app/pb_kits/playbook/pb_dropdown/keyboard_accessibility.js +6 -0
- data/app/pb_kits/playbook/pb_dropdown/kit.schema.json +8 -0
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownOption.tsx +3 -2
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownTrigger.tsx +22 -13
- data/app/pb_kits/playbook/pb_file_upload/docs/_playground.json +2 -1
- data/app/pb_kits/playbook/pb_file_upload/kit.schema.json +2 -2
- 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 +1 -23
- 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_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/docs/_icon_default.jsx +1 -1
- data/app/pb_kits/playbook/pb_icon/docs/_playground.json +79 -40
- data/app/pb_kits/playbook/pb_icon/docs/_playground.overrides.json +96 -27
- 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 +1 -40
- 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.tsx +2 -2
- 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/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_progress_step/docs/_playground.json +1 -31
- 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 +1 -41
- data/app/pb_kits/playbook/pb_select/_select.tsx +1 -0
- data/app/pb_kits/playbook/pb_select/kit.schema.json +1 -1
- data/app/pb_kits/playbook/pb_select/select.html.erb +1 -1
- data/app/pb_kits/playbook/pb_selectable_card/kit.schema.json +1 -1
- data/app/pb_kits/playbook/pb_selectable_card_icon/docs/_playground.json +1 -38
- data/app/pb_kits/playbook/pb_selectable_card_icon/kit.schema.json +1 -1
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_playground.json +1 -30
- data/app/pb_kits/playbook/pb_source/docs/_playground.json +1 -27
- data/app/pb_kits/playbook/pb_table/docs/_playground.json +1 -57
- data/app/pb_kits/playbook/pb_text_input/kit.schema.json +1 -1
- data/app/pb_kits/playbook/pb_textarea/kit.schema.json +1 -1
- data/app/pb_kits/playbook/pb_time_range_inline/docs/_playground.json +1 -32
- data/app/pb_kits/playbook/pb_timeline/docs/_playground.json +1 -27
- data/app/pb_kits/playbook/pb_toggle/kit.schema.json +1 -1
- data/app/pb_kits/playbook/pb_typeahead/kit.schema.json +1 -1
- data/app/pb_kits/playbook/tokens/_colors.scss +5 -1
- data/app/pb_kits/playbook/utilities/icons/allicons.tsx +38 -0
- data/dist/chunks/{_pb_line_graph-B870s9g1.js → _pb_line_graph-DYysA_-M.js} +1 -1
- data/dist/chunks/_typeahead-B0yIrn2R.js +5 -0
- data/dist/chunks/{globalProps-BInmh-C7.js → globalProps-CC-0LNvd.js} +1 -1
- data/dist/chunks/lib-BQnni8Yf.js +29 -0
- data/dist/chunks/time_picker_helper-CVMV9ync.js +1 -0
- data/dist/chunks/vendor.js +5 -5
- 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/forms/builder/form_field_builder.rb +2 -0
- data/lib/playbook/version.rb +2 -2
- metadata +45 -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/lib-CVYIIiwI.js +0 -29
- data/dist/chunks/time_picker_helper-Bx8nzyM8.js +0 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3c7de1ce3d86ce191ea5196d520df0aeb0919a9802462e6d1ac2c2f5f92eaa38
|
|
4
|
+
data.tar.gz: 36ebe37441e50aa17346ddc906a3492cfd076fd19bc9f474481e16e37df895ac
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8463caa5d2ee1372d2964109e908da03cbb433d81b6de5af078d24ba33a904c9642f9bdb9051be0e7e7e98c4f1732a768f01235112a7f6ab2e4e96a88726ae56
|
|
7
|
+
data.tar.gz: 9b1c86838e5edcf56d3714ccb7c03ae0dee950be56052f56a4e1eb695dc30db0ce59b52b544fbf6df5965ae487f16669084bb3fb7c6070063d48fe6ffdb96588
|
|
@@ -6,7 +6,7 @@ import { GenericObject } from "../../types"
|
|
|
6
6
|
import { isChrome } from "../Utilities/BrowserCheck"
|
|
7
7
|
import { findColumnDefByAccessor } from "../Utilities/ColumnStylingHelper"
|
|
8
8
|
import { playbookColumnLayoutStylesFromMeta } from "../Utilities/ColumnLayoutHelper"
|
|
9
|
-
import { getRowColorClass, shouldShowLoadingIndicator } from "../Utilities/RowUtils"
|
|
9
|
+
import { getFontWeight, getRowColorClass, getRowStyle, shouldShowLoadingIndicator } from "../Utilities/RowUtils"
|
|
10
10
|
|
|
11
11
|
import LoadingInline from "../../pb_loading_inline/_loading_inline"
|
|
12
12
|
import Checkbox from "../../pb_checkbox/_checkbox"
|
|
@@ -81,6 +81,7 @@ const TableCellRenderer = ({
|
|
|
81
81
|
|
|
82
82
|
const paddingValue = colDef?.columnStyling?.cellPadding ?? customRowStyle?.cellPadding
|
|
83
83
|
const paddingClass = paddingValue ? `p_${paddingValue}` : undefined
|
|
84
|
+
const fontWeight = getFontWeight(customRowStyle)
|
|
84
85
|
|
|
85
86
|
return (
|
|
86
87
|
<td
|
|
@@ -103,6 +104,7 @@ const TableCellRenderer = ({
|
|
|
103
104
|
: undefined,
|
|
104
105
|
backgroundColor: cellBackgroundColor || (i === 0 && customRowStyle?.backgroundColor),
|
|
105
106
|
color: cellFontColor || customRowStyle?.fontColor,
|
|
107
|
+
fontWeight,
|
|
106
108
|
}}
|
|
107
109
|
>
|
|
108
110
|
{collapsibleTrail && i === 0 && row.depth > 0 && renderCollapsibleTrail(row.depth)}
|
|
@@ -136,6 +138,7 @@ export const RegularTableView = ({
|
|
|
136
138
|
pinnedRows,
|
|
137
139
|
headerHeight,
|
|
138
140
|
rowHeight,
|
|
141
|
+
actionBarHeight,
|
|
139
142
|
rowStyling = [],
|
|
140
143
|
sampleRowRef,
|
|
141
144
|
} = useContext(AdvancedTableContext)
|
|
@@ -160,7 +163,7 @@ export const RegularTableView = ({
|
|
|
160
163
|
|
|
161
164
|
// Row pinning
|
|
162
165
|
function PinnedRow({ row }: { row: Row<any> }) {
|
|
163
|
-
const customRowStyle = rowStyling
|
|
166
|
+
const customRowStyle = getRowStyle(rowStyling, row);
|
|
164
167
|
return (
|
|
165
168
|
<tr
|
|
166
169
|
className={classnames(
|
|
@@ -172,9 +175,10 @@ export const RegularTableView = ({
|
|
|
172
175
|
position: 'sticky',
|
|
173
176
|
top:
|
|
174
177
|
row.getIsPinned() === 'top'
|
|
175
|
-
? `${row.getPinnedIndex() * rowHeight + headerHeight}px`
|
|
178
|
+
? `${row.getPinnedIndex() * rowHeight + headerHeight + actionBarHeight}px`
|
|
176
179
|
: undefined,
|
|
177
|
-
zIndex: '3'
|
|
180
|
+
zIndex: '3',
|
|
181
|
+
fontWeight: getFontWeight(customRowStyle),
|
|
178
182
|
}}
|
|
179
183
|
>
|
|
180
184
|
<TableCellRenderer
|
|
@@ -204,7 +208,7 @@ export const RegularTableView = ({
|
|
|
204
208
|
const isFirstChildofSubrow = row.depth > 0 && row.index === 0;
|
|
205
209
|
const numberOfColumns = table.getAllFlatColumns().length;
|
|
206
210
|
const isFirstRegularRow = rowIndex === 0 && !row.getIsPinned();
|
|
207
|
-
const customRowStyle = rowStyling
|
|
211
|
+
const customRowStyle = getRowStyle(rowStyling, row);
|
|
208
212
|
|
|
209
213
|
// Use functions from RowUtils for consistent cell coloring
|
|
210
214
|
const rowColor = getRowColorClass(row, inlineRowLoading || false);
|
|
@@ -227,7 +231,11 @@ export const RegularTableView = ({
|
|
|
227
231
|
className={`${rowColor} ${row.depth > 0 ? `depth-sub-row-${row.depth}` : ""}`}
|
|
228
232
|
id={`${row.index}-${row.id}-${row.depth}-row`}
|
|
229
233
|
ref={isFirstRegularRow ? sampleRowRef : null}
|
|
230
|
-
style={{
|
|
234
|
+
style={{
|
|
235
|
+
backgroundColor: customRowStyle?.backgroundColor,
|
|
236
|
+
color: customRowStyle?.fontColor,
|
|
237
|
+
fontWeight: getFontWeight(customRowStyle),
|
|
238
|
+
}}
|
|
231
239
|
>
|
|
232
240
|
{/* Render custom checkbox column when we want selectableRows for non-expanding tables */}
|
|
233
241
|
{selectableRows && !hasAnySubRows && (
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
showActionBar,
|
|
18
18
|
hideActionBar,
|
|
19
19
|
} from "../Utilities/ActionBarAnimationHelper";
|
|
20
|
+
import { scheduleStickyActionBarHeightUpdate } from "../Utilities/StickyLayoutHelper";
|
|
20
21
|
import { GenericObject } from "../../types";
|
|
21
22
|
|
|
22
23
|
interface TableActionBarProps {
|
|
@@ -39,7 +40,7 @@ const TableActionBar: React.FC<TableActionBarProps> = ({
|
|
|
39
40
|
type = "row-selection",
|
|
40
41
|
}) => {
|
|
41
42
|
const cardRef = useRef(null);
|
|
42
|
-
const { table, columnVisibilityControl, columnDefinitions } =
|
|
43
|
+
const { table, columnVisibilityControl, columnDefinitions, tableContainerRef } =
|
|
43
44
|
useContext(AdvancedTableContext);
|
|
44
45
|
|
|
45
46
|
// ----------- Column visibility logic -----------
|
|
@@ -131,8 +132,10 @@ const TableActionBar: React.FC<TableActionBarProps> = ({
|
|
|
131
132
|
} else {
|
|
132
133
|
hideActionBar(cardRef.current);
|
|
133
134
|
}
|
|
135
|
+
|
|
136
|
+
scheduleStickyActionBarHeightUpdate(tableContainerRef?.current ?? null);
|
|
134
137
|
}
|
|
135
|
-
}, [isVisible, type]);
|
|
138
|
+
}, [isVisible, type, tableContainerRef]);
|
|
136
139
|
|
|
137
140
|
const [showPopover, setShowPopover] = useState(false)
|
|
138
141
|
|
|
@@ -4,6 +4,7 @@ import { useVirtualizer } from '@tanstack/react-virtual';
|
|
|
4
4
|
import { Row } from "@tanstack/react-table";
|
|
5
5
|
import { GenericObject } from "../../types";
|
|
6
6
|
import { getRowHeightEstimate } from '../Utilities/TableContainerStyles';
|
|
7
|
+
import { measureElementHeight } from '../Utilities/StickyLayoutHelper';
|
|
7
8
|
|
|
8
9
|
const AdvancedTableContext = createContext<any>({});
|
|
9
10
|
|
|
@@ -30,8 +31,11 @@ export const AdvancedTableProvider = ({ children, ...props }: {
|
|
|
30
31
|
|
|
31
32
|
const [headerHeight, setHeaderHeight] = useState(44);
|
|
32
33
|
const [rowHeight, setRowHeight] = useState(38);
|
|
34
|
+
const [actionBarHeight, setActionBarHeight] = useState(0);
|
|
33
35
|
|
|
34
36
|
const measureHeights = useCallback(() => {
|
|
37
|
+
const wrapper = (props.tableContainerRef?.current || tableContainerRef.current) as HTMLElement | null;
|
|
38
|
+
|
|
35
39
|
if (headerRef.current) {
|
|
36
40
|
const headerElement = headerRef.current as HTMLElement;
|
|
37
41
|
const headerRect = headerElement.getBoundingClientRect();
|
|
@@ -45,7 +49,21 @@ export const AdvancedTableProvider = ({ children, ...props }: {
|
|
|
45
49
|
setRowHeight(rowRect.height);
|
|
46
50
|
}
|
|
47
51
|
}
|
|
48
|
-
|
|
52
|
+
|
|
53
|
+
if (wrapper) {
|
|
54
|
+
const actionBar = wrapper.querySelector(
|
|
55
|
+
".row-selection-actions-card.is-visible, .row-selection-actions-card.show-action-card"
|
|
56
|
+
) as HTMLElement | null;
|
|
57
|
+
const measuredActionBarHeight = actionBar
|
|
58
|
+
? measureElementHeight(actionBar)
|
|
59
|
+
: 0;
|
|
60
|
+
setActionBarHeight(measuredActionBarHeight);
|
|
61
|
+
wrapper.style.setProperty(
|
|
62
|
+
"--advanced-table-action-bar-height",
|
|
63
|
+
`${measuredActionBarHeight}px`
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
}, [props.tableContainerRef]);
|
|
49
67
|
|
|
50
68
|
useEffect(() => {
|
|
51
69
|
const resizeObserver = new ResizeObserver(() => {
|
|
@@ -56,6 +74,12 @@ export const AdvancedTableProvider = ({ children, ...props }: {
|
|
|
56
74
|
resizeObserver.observe(headerRef.current);
|
|
57
75
|
}
|
|
58
76
|
|
|
77
|
+
const wrapper = (props.tableContainerRef?.current || tableContainerRef.current) as HTMLElement | null;
|
|
78
|
+
const actionBar = wrapper?.querySelector(".row-selection-actions-card");
|
|
79
|
+
if (actionBar) {
|
|
80
|
+
resizeObserver.observe(actionBar);
|
|
81
|
+
}
|
|
82
|
+
|
|
59
83
|
if (sampleRowRef.current) {
|
|
60
84
|
resizeObserver.observe(sampleRowRef.current);
|
|
61
85
|
}
|
|
@@ -72,7 +96,7 @@ export const AdvancedTableProvider = ({ children, ...props }: {
|
|
|
72
96
|
|
|
73
97
|
useEffect(() => {
|
|
74
98
|
measureHeights();
|
|
75
|
-
}, [table?.getRowModel().rows.length, headerGroupCount, measureHeights]);
|
|
99
|
+
}, [table?.getRowModel().rows.length, headerGroupCount, props.isActionBarVisible, measureHeights]);
|
|
76
100
|
|
|
77
101
|
|
|
78
102
|
// Create a flattened data array that includes ALL components for virtualization
|
|
@@ -202,6 +226,7 @@ export const AdvancedTableProvider = ({ children, ...props }: {
|
|
|
202
226
|
keepPinnedRows: props.keepPinnedRows,
|
|
203
227
|
headerHeight,
|
|
204
228
|
rowHeight,
|
|
229
|
+
actionBarHeight,
|
|
205
230
|
headerRef,
|
|
206
231
|
sampleRowRef,
|
|
207
232
|
measureHeights,
|
|
@@ -39,7 +39,7 @@ interface UseTableStateProps {
|
|
|
39
39
|
tableOptions?: GenericObject;
|
|
40
40
|
onRowSelectionChange?: (arg: RowSelectionState) => void;
|
|
41
41
|
columnVisibilityControl?: GenericObject;
|
|
42
|
-
rowStyling?: GenericObject;
|
|
42
|
+
rowStyling?: GenericObject[];
|
|
43
43
|
inlineRowLoading?: boolean;
|
|
44
44
|
sortParentOnly?: boolean;
|
|
45
45
|
}
|
|
@@ -150,7 +150,7 @@ export function useTableState({
|
|
|
150
150
|
|
|
151
151
|
return columnStructure;
|
|
152
152
|
}) || [];
|
|
153
|
-
}, [columnHelper, onRowToggleClick, selectableRows]);
|
|
153
|
+
}, [columnHelper, onRowToggleClick, rowStyling, selectableRows]);
|
|
154
154
|
|
|
155
155
|
const columns = useMemo(() => buildColumns(columnDefinitions), [buildColumns, columnDefinitions]);
|
|
156
156
|
|
|
@@ -2,6 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { Row, Getter } from "@tanstack/react-table";
|
|
3
3
|
import { GenericObject } from "../../types";
|
|
4
4
|
import { CustomCell } from "../Components/CustomCell";
|
|
5
|
+
import { getRowStyle } from "./RowUtils";
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Creates a cell render function for table columns
|
|
@@ -18,7 +19,7 @@ export const createCellFunction = (
|
|
|
18
19
|
isFirstColumn?: boolean,
|
|
19
20
|
onRowToggleClick?: (row: Row<GenericObject>) => void,
|
|
20
21
|
selectableRows?: boolean,
|
|
21
|
-
rowStyling?: GenericObject
|
|
22
|
+
rowStyling?: GenericObject[]
|
|
22
23
|
) => {
|
|
23
24
|
// Add display name to the returned function
|
|
24
25
|
const cellRenderer = ({
|
|
@@ -29,7 +30,7 @@ export const createCellFunction = (
|
|
|
29
30
|
getValue: Getter<string>
|
|
30
31
|
}) => {
|
|
31
32
|
const rowData = row.original;
|
|
32
|
-
const customStyle = rowStyling
|
|
33
|
+
const customStyle = getRowStyle(rowStyling, row);
|
|
33
34
|
|
|
34
35
|
if (isFirstColumn) {
|
|
35
36
|
switch (row.depth) {
|
|
@@ -52,6 +53,7 @@ export const createCellFunction = (
|
|
|
52
53
|
return accessorValue ? (
|
|
53
54
|
<CustomCell
|
|
54
55
|
customRenderer={customRenderer}
|
|
56
|
+
customStyle={customStyle}
|
|
55
57
|
onRowToggleClick={onRowToggleClick}
|
|
56
58
|
row={row}
|
|
57
59
|
selectableRows={selectableRows}
|
|
@@ -36,6 +36,23 @@ export const shouldShowLoadingIndicator = (
|
|
|
36
36
|
(row.depth < cellAccessorsLength);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
export const getRowStyle = (
|
|
40
|
+
rowStyling: GenericObject[] | undefined,
|
|
41
|
+
row: Row<GenericObject>
|
|
42
|
+
) => {
|
|
43
|
+
const rowId = row.original?.id ?? row.id
|
|
44
|
+
if (rowId == null) return
|
|
45
|
+
|
|
46
|
+
return rowStyling?.find((style: GenericObject) => (
|
|
47
|
+
String(style?.rowId) === String(rowId)
|
|
48
|
+
))
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export const getFontWeight = (rowStyle?: GenericObject) => {
|
|
52
|
+
if (rowStyle?.fontWeight === "bold") return 700
|
|
53
|
+
if (rowStyle?.fontWeight === "regular") return 400
|
|
54
|
+
}
|
|
55
|
+
|
|
39
56
|
/**
|
|
40
57
|
* Creates a virtual item style object for virtualized rows
|
|
41
58
|
*/
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
const VISIBLE_ACTION_BAR_SELECTOR =
|
|
2
|
+
".row-selection-actions-card.is-visible, .row-selection-actions-card.show-action-card";
|
|
3
|
+
|
|
4
|
+
const ACTION_BAR_HEIGHT_TRANSITION_MS = 350;
|
|
5
|
+
|
|
6
|
+
export const measureElementHeight = (element: HTMLElement): number => {
|
|
7
|
+
const { height: rectHeight } = element.getBoundingClientRect();
|
|
8
|
+
const scrollHeight = element.scrollHeight;
|
|
9
|
+
const offsetHeight = element.offsetHeight;
|
|
10
|
+
|
|
11
|
+
return Math.ceil(Math.max(rectHeight, scrollHeight, offsetHeight));
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const updateStickyActionBarHeight = (
|
|
15
|
+
advancedTableWrapper: HTMLElement | null
|
|
16
|
+
): number => {
|
|
17
|
+
if (!advancedTableWrapper) return 0;
|
|
18
|
+
|
|
19
|
+
const actionBar = advancedTableWrapper.querySelector(
|
|
20
|
+
VISIBLE_ACTION_BAR_SELECTOR
|
|
21
|
+
) as HTMLElement | null;
|
|
22
|
+
|
|
23
|
+
if (!actionBar) {
|
|
24
|
+
advancedTableWrapper.style.setProperty(
|
|
25
|
+
"--advanced-table-action-bar-height",
|
|
26
|
+
"0px"
|
|
27
|
+
);
|
|
28
|
+
return 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const actionBarHeight = measureElementHeight(actionBar);
|
|
32
|
+
|
|
33
|
+
advancedTableWrapper.style.setProperty(
|
|
34
|
+
"--advanced-table-action-bar-height",
|
|
35
|
+
`${actionBarHeight}px`
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
return actionBarHeight;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const scheduleStickyActionBarHeightUpdate = (
|
|
42
|
+
advancedTableWrapper: HTMLElement | null
|
|
43
|
+
): void => {
|
|
44
|
+
if (!advancedTableWrapper) return;
|
|
45
|
+
|
|
46
|
+
updateStickyActionBarHeight(advancedTableWrapper);
|
|
47
|
+
|
|
48
|
+
requestAnimationFrame(() => {
|
|
49
|
+
updateStickyActionBarHeight(advancedTableWrapper);
|
|
50
|
+
requestAnimationFrame(() => {
|
|
51
|
+
updateStickyActionBarHeight(advancedTableWrapper);
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
window.setTimeout(() => {
|
|
56
|
+
updateStickyActionBarHeight(advancedTableWrapper);
|
|
57
|
+
}, ACTION_BAR_HEIGHT_TRANSITION_MS);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export const updateStickyHeaderRowHeights = (
|
|
61
|
+
advancedTableWrapper: HTMLElement | null
|
|
62
|
+
): void => {
|
|
63
|
+
if (!advancedTableWrapper) return;
|
|
64
|
+
|
|
65
|
+
const table = advancedTableWrapper.querySelector("table.pb_table");
|
|
66
|
+
const thead = table?.querySelector("thead");
|
|
67
|
+
if (!thead) return;
|
|
68
|
+
|
|
69
|
+
const rows = Array.from(thead.querySelectorAll("tr"));
|
|
70
|
+
let totalHeight = 0;
|
|
71
|
+
|
|
72
|
+
rows.forEach((tr, index) => {
|
|
73
|
+
const height = tr.offsetHeight;
|
|
74
|
+
if (index === 0) {
|
|
75
|
+
advancedTableWrapper.style.setProperty(
|
|
76
|
+
"--advanced-table-header-row-0-height",
|
|
77
|
+
`${height}px`
|
|
78
|
+
);
|
|
79
|
+
} else if (index === 1) {
|
|
80
|
+
advancedTableWrapper.style.setProperty(
|
|
81
|
+
"--advanced-table-header-row-1-height",
|
|
82
|
+
`${height}px`
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
totalHeight += height;
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
advancedTableWrapper.style.setProperty(
|
|
89
|
+
"--advanced-table-header-height",
|
|
90
|
+
`${totalHeight}px`
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
updateStickyActionBarHeight(advancedTableWrapper);
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export const updateStickyLayoutHeights = (
|
|
97
|
+
advancedTableWrapper: HTMLElement | null
|
|
98
|
+
): void => {
|
|
99
|
+
updateStickyHeaderRowHeights(advancedTableWrapper);
|
|
100
|
+
};
|
|
@@ -364,6 +364,34 @@
|
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
366
|
|
|
367
|
+
&.advanced-table-sticky-header {
|
|
368
|
+
.row-selection-actions-card.show-action-card,
|
|
369
|
+
.row-selection-actions-card.is-visible {
|
|
370
|
+
background-color: $white;
|
|
371
|
+
left: 0;
|
|
372
|
+
position: sticky;
|
|
373
|
+
top: 0;
|
|
374
|
+
z-index: 5;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
.pb_table.sticky-header {
|
|
378
|
+
thead,
|
|
379
|
+
.pb_advanced_table_header {
|
|
380
|
+
top: var(--advanced-table-action-bar-height, 0px);
|
|
381
|
+
z-index: 3;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
&.hidden-action-bar {
|
|
386
|
+
.pb_table.sticky-header {
|
|
387
|
+
thead,
|
|
388
|
+
.pb_advanced_table_header {
|
|
389
|
+
top: 0;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
|
|
367
395
|
// Max height overflow - the below prevents expansion from overflowing container at full screen for responsive and nonresponsive tables
|
|
368
396
|
&.advanced-table-max-height-xs {
|
|
369
397
|
max-height: 320px;
|
|
@@ -401,55 +429,6 @@
|
|
|
401
429
|
@include scrollbar-styling;
|
|
402
430
|
}
|
|
403
431
|
|
|
404
|
-
// Fullscreen
|
|
405
|
-
&.advanced-table-allow-fullscreen {
|
|
406
|
-
transition: all 0.3s ease;
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
&.advanced-table-fullscreen {
|
|
410
|
-
background-color: $bg_light;
|
|
411
|
-
box-sizing: border-box;
|
|
412
|
-
height: 100vh;
|
|
413
|
-
left: 0;
|
|
414
|
-
overflow: auto;
|
|
415
|
-
position: fixed;
|
|
416
|
-
top: 0;
|
|
417
|
-
width: 100%;
|
|
418
|
-
z-index: $z_10;
|
|
419
|
-
|
|
420
|
-
.pb_table {
|
|
421
|
-
th,
|
|
422
|
-
td,
|
|
423
|
-
div,
|
|
424
|
-
button {
|
|
425
|
-
font-size: calc(100%);
|
|
426
|
-
}
|
|
427
|
-
box-sizing: border-box;
|
|
428
|
-
margin: $space_lg;
|
|
429
|
-
max-width: calc(100% - 64px);
|
|
430
|
-
width: calc(100% - 64px);
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
.pb_table.sticky-header {
|
|
434
|
-
thead,
|
|
435
|
-
.pb_advanced_table_header {
|
|
436
|
-
position: sticky !important;
|
|
437
|
-
top: 44px !important;
|
|
438
|
-
z-index: $z_10;
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
.advanced-table-fullscreen-header {
|
|
444
|
-
background-color: $white;
|
|
445
|
-
height: 44px;
|
|
446
|
-
padding: 13px 20px;
|
|
447
|
-
position: sticky;
|
|
448
|
-
top: 0;
|
|
449
|
-
width: 100%;
|
|
450
|
-
z-index: $z_10;
|
|
451
|
-
}
|
|
452
|
-
|
|
453
432
|
// Icons
|
|
454
433
|
.button-icon {
|
|
455
434
|
display: flex;
|
|
@@ -507,16 +486,6 @@
|
|
|
507
486
|
}
|
|
508
487
|
}
|
|
509
488
|
|
|
510
|
-
.fullscreen-icon {
|
|
511
|
-
@extend .button-icon;
|
|
512
|
-
@extend %primary-color-pseudo;
|
|
513
|
-
padding: 2px 0;
|
|
514
|
-
|
|
515
|
-
&:focus-visible {
|
|
516
|
-
border-radius: $border_rad_lighter;
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
|
|
520
489
|
// First column separator/border
|
|
521
490
|
.table-header-cells:first-child,
|
|
522
491
|
.table-header-cells-custom:first-child,
|
|
@@ -987,6 +956,13 @@
|
|
|
987
956
|
background-color: $bg_dark_card;
|
|
988
957
|
}
|
|
989
958
|
|
|
959
|
+
&.advanced-table-sticky-header {
|
|
960
|
+
.row-selection-actions-card.show-action-card,
|
|
961
|
+
.row-selection-actions-card.is-visible {
|
|
962
|
+
background-color: $bg_dark_card;
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
|
|
990
966
|
.loading-toggle-icon,
|
|
991
967
|
.loading-cell {
|
|
992
968
|
&::after {
|
|
@@ -1002,18 +978,6 @@
|
|
|
1002
978
|
}
|
|
1003
979
|
}
|
|
1004
980
|
|
|
1005
|
-
// Fullscreen
|
|
1006
|
-
&.advanced-table-fullscreen {
|
|
1007
|
-
background: $bg_dark;
|
|
1008
|
-
}
|
|
1009
|
-
|
|
1010
|
-
.advanced-table-fullscreen-header {
|
|
1011
|
-
background-color: $bg_dark_card;
|
|
1012
|
-
position: sticky;
|
|
1013
|
-
top: 0;
|
|
1014
|
-
z-index: $z_10;
|
|
1015
|
-
}
|
|
1016
|
-
|
|
1017
981
|
&[class*="advanced-table-sticky-left-columns"] {
|
|
1018
982
|
.sticky-left {
|
|
1019
983
|
background-color: $bg_dark;
|
|
@@ -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}
|