@elastic/eui 93.2.0 → 93.4.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.
- package/dist/eui_charts_theme.d.ts +9 -0
- package/dist/eui_charts_theme.js +56 -14
- package/dist/eui_charts_theme.js.map +1 -1
- package/dist/eui_theme_dark.css +3 -0
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +3 -0
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/breadcrumbs/_breadcrumb_content.js +362 -0
- package/es/components/breadcrumbs/_breadcrumb_content.styles.js +48 -0
- package/es/components/breadcrumbs/breadcrumb.js +10 -324
- package/es/components/breadcrumbs/breadcrumb.styles.js +5 -27
- package/es/components/breadcrumbs/breadcrumbs.js +8 -6
- package/es/components/breadcrumbs/types.js +1 -0
- package/es/components/button/button_display/_button_display.js +2 -3
- package/es/components/button/button_empty/button_empty.js +2 -3
- package/es/components/button/button_group/button_group.js +19 -7
- package/es/components/button/button_group/button_group.styles.js +11 -14
- package/es/components/button/button_group/button_group_button.js +59 -5
- package/es/components/button/button_group/button_group_button.styles.js +39 -3
- package/es/components/button/button_icon/button_icon.js +4 -5
- package/es/components/button/button_icon/button_icon.styles.js +11 -3
- package/es/components/datagrid/body/cell/data_grid_cell.js +102 -59
- package/es/components/datagrid/body/cell/data_grid_cell_actions.js +24 -18
- package/es/components/datagrid/body/cell/data_grid_cell_popover.js +64 -56
- package/es/components/datagrid/body/cell/data_grid_cell_wrapper.js +34 -31
- package/es/components/datagrid/body/cell/index.js +1 -1
- package/es/components/datagrid/body/data_grid_body.js +14 -0
- package/es/components/datagrid/body/data_grid_body_custom.js +54 -35
- package/es/components/datagrid/body/data_grid_body_virtualized.js +87 -56
- package/es/components/datagrid/body/data_grid_row_manager.js +7 -5
- package/es/components/datagrid/body/footer/use_data_grid_footer.js +1 -2
- package/es/components/datagrid/body/header/data_grid_control_header_cell.js +5 -4
- package/es/components/datagrid/body/header/data_grid_header_cell.js +73 -53
- package/es/components/datagrid/body/header/data_grid_header_row.js +15 -551
- package/es/components/datagrid/body/header/use_data_grid_header.js +7 -6
- package/es/components/datagrid/controls/column_selector.js +126 -123
- package/es/components/datagrid/controls/column_sorting.js +605 -103
- package/es/components/datagrid/controls/column_sorting_draggable.js +24 -22
- package/es/components/datagrid/controls/display_selector.js +109 -107
- package/es/components/datagrid/data_grid.a11y.js +13 -12
- package/es/components/datagrid/data_grid.js +47 -22
- package/es/components/datagrid/utils/col_widths.js +12 -8
- package/es/components/datagrid/utils/focus.js +10 -8
- package/es/components/datagrid/utils/grid_height_width.js +31 -30
- package/es/components/datagrid/utils/ref.js +1 -1
- package/es/components/datagrid/utils/row_heights.js +2 -2
- package/es/components/datagrid/utils/sorting.js +29 -27
- package/es/components/date_picker/super_date_picker/super_date_picker.js +9 -0
- package/es/components/date_picker/super_date_picker/super_update_button.js +57 -29
- package/es/components/facet/facet_button.styles.js +1 -2
- package/es/components/flex/flex_grid.js +22 -8
- package/es/components/flex/flex_grid.styles.js +13 -6
- package/es/components/flex/flex_group.js +10 -11
- package/es/components/flex/flex_item.js +9 -11
- package/es/components/flex/flex_item.styles.js +107 -122
- package/es/components/flyout/flyout.js +16 -18
- package/es/components/header/header_breadcrumbs/header_breadcrumbs.js +7 -7
- package/es/components/icon/icon.js +13 -16
- package/es/components/icon/icon.styles.js +6 -9
- package/es/components/link/external_link_icon.js +11 -8
- package/es/components/link/link.js +2 -3
- package/es/components/link/link.styles.js +4 -10
- package/es/components/modal/confirm_modal.js +2 -1
- package/es/components/modal/modal.js +12 -3
- package/es/components/observer/resize_observer/resize_observer.js +15 -24
- package/es/components/page/page_header/page_header_content.js +4 -2
- package/es/components/progress/progress.styles.js +2 -2
- package/es/components/skeleton/skeleton_circle.js +2 -3
- package/es/components/skeleton/skeleton_rectangle.js +2 -3
- package/es/components/skeleton/skeleton_text.js +16 -12
- package/es/components/skeleton/skeleton_title.js +2 -3
- package/es/components/spacer/spacer.js +2 -3
- package/es/components/text/text.js +2 -3
- package/es/components/text/text_align.js +1 -2
- package/es/components/text/text_align.styles.js +5 -7
- package/es/components/text/text_color.js +2 -3
- package/es/components/title/title.js +2 -3
- package/es/components/title/title.styles.js +0 -7
- package/es/components/toast/global_toast_list.js +70 -73
- package/es/components/toast/toast.js +27 -42
- package/es/components/toast/toast.styles.js +2 -17
- package/es/global_styling/mixins/_typography.js +17 -6
- package/es/services/color/eui_palettes.js +21 -13
- package/es/services/color/index.js +1 -1
- package/es/services/hooks/index.js +1 -0
- package/es/services/hooks/useDeepEqual.js +23 -0
- package/es/services/index.js +1 -1
- package/es/services/theme/index.js +1 -1
- package/es/services/theme/style_memoization.js +47 -14
- package/es/themes/amsterdam/global_styling/mixins/button.js +47 -24
- package/eui.d.ts +2862 -2748
- package/i18ntokens.json +267 -267
- package/lib/components/breadcrumbs/_breadcrumb_content.js +372 -0
- package/lib/components/breadcrumbs/_breadcrumb_content.styles.js +55 -0
- package/lib/components/breadcrumbs/breadcrumb.js +11 -328
- package/lib/components/breadcrumbs/breadcrumb.styles.js +5 -29
- package/lib/components/breadcrumbs/breadcrumbs.js +7 -5
- package/lib/components/breadcrumbs/types.js +5 -0
- package/lib/components/button/button_display/_button_display.js +1 -2
- package/lib/components/button/button_empty/button_empty.js +1 -2
- package/lib/components/button/button_group/button_group.js +18 -6
- package/lib/components/button/button_group/button_group.styles.js +11 -14
- package/lib/components/button/button_group/button_group_button.js +59 -5
- package/lib/components/button/button_group/button_group_button.styles.js +45 -11
- package/lib/components/button/button_icon/button_icon.js +3 -4
- package/lib/components/button/button_icon/button_icon.styles.js +10 -2
- package/lib/components/datagrid/body/cell/data_grid_cell.js +100 -58
- package/lib/components/datagrid/body/cell/data_grid_cell_actions.js +24 -18
- package/lib/components/datagrid/body/cell/data_grid_cell_popover.js +63 -55
- package/lib/components/datagrid/body/cell/data_grid_cell_wrapper.js +34 -31
- package/lib/components/datagrid/body/cell/index.js +2 -2
- package/lib/components/datagrid/body/data_grid_body.js +14 -0
- package/lib/components/datagrid/body/data_grid_body_custom.js +53 -34
- package/lib/components/datagrid/body/data_grid_body_virtualized.js +86 -55
- package/lib/components/datagrid/body/data_grid_row_manager.js +6 -4
- package/lib/components/datagrid/body/footer/use_data_grid_footer.js +1 -2
- package/lib/components/datagrid/body/header/data_grid_control_header_cell.js +8 -4
- package/lib/components/datagrid/body/header/data_grid_header_cell.js +72 -52
- package/lib/components/datagrid/body/header/data_grid_header_row.js +14 -550
- package/lib/components/datagrid/body/header/use_data_grid_header.js +7 -6
- package/lib/components/datagrid/controls/column_selector.js +126 -123
- package/lib/components/datagrid/controls/column_sorting.js +615 -110
- package/lib/components/datagrid/controls/column_sorting_draggable.js +27 -22
- package/lib/components/datagrid/controls/display_selector.js +109 -107
- package/lib/components/datagrid/data_grid.a11y.js +13 -12
- package/lib/components/datagrid/data_grid.js +45 -20
- package/lib/components/datagrid/utils/col_widths.js +12 -8
- package/lib/components/datagrid/utils/focus.js +10 -8
- package/lib/components/datagrid/utils/grid_height_width.js +29 -28
- package/lib/components/datagrid/utils/ref.js +1 -1
- package/lib/components/datagrid/utils/row_heights.js +1 -1
- package/lib/components/datagrid/utils/sorting.js +31 -29
- package/lib/components/date_picker/super_date_picker/super_date_picker.js +9 -0
- package/lib/components/date_picker/super_date_picker/super_update_button.js +57 -29
- package/lib/components/facet/facet_button.styles.js +1 -2
- package/lib/components/flex/flex_grid.js +23 -7
- package/lib/components/flex/flex_grid.styles.js +13 -6
- package/lib/components/flex/flex_group.js +10 -10
- package/lib/components/flex/flex_item.js +13 -13
- package/lib/components/flex/flex_item.styles.js +107 -122
- package/lib/components/flyout/flyout.js +16 -18
- package/lib/components/header/header_breadcrumbs/header_breadcrumbs.js +7 -7
- package/lib/components/icon/icon.js +12 -15
- package/lib/components/icon/icon.styles.js +5 -8
- package/lib/components/link/external_link_icon.js +10 -7
- package/lib/components/link/link.js +1 -2
- package/lib/components/link/link.styles.js +6 -14
- package/lib/components/modal/confirm_modal.js +2 -1
- package/lib/components/modal/modal.js +12 -3
- package/lib/components/observer/resize_observer/resize_observer.js +15 -24
- package/lib/components/page/page_header/page_header_content.js +4 -2
- package/lib/components/progress/progress.styles.js +1 -1
- package/lib/components/skeleton/skeleton_circle.js +1 -2
- package/lib/components/skeleton/skeleton_rectangle.js +1 -2
- package/lib/components/skeleton/skeleton_text.js +18 -11
- package/lib/components/skeleton/skeleton_title.js +1 -2
- package/lib/components/spacer/spacer.js +1 -2
- package/lib/components/text/text.js +1 -2
- package/lib/components/text/text_align.js +1 -2
- package/lib/components/text/text_align.styles.js +5 -7
- package/lib/components/text/text_color.js +1 -2
- package/lib/components/title/title.js +1 -2
- package/lib/components/title/title.styles.js +2 -10
- package/lib/components/toast/global_toast_list.js +68 -71
- package/lib/components/toast/toast.js +25 -40
- package/lib/components/toast/toast.styles.js +11 -25
- package/lib/global_styling/mixins/_typography.js +27 -19
- package/lib/services/color/eui_palettes.js +24 -14
- package/lib/services/color/index.js +14 -0
- package/lib/services/hooks/index.js +11 -0
- package/lib/services/hooks/useDeepEqual.js +30 -0
- package/lib/services/index.js +15 -1
- package/lib/services/theme/index.js +6 -0
- package/lib/services/theme/style_memoization.js +49 -16
- package/lib/themes/amsterdam/global_styling/mixins/button.js +49 -25
- package/optimize/es/components/breadcrumbs/_breadcrumb_content.js +153 -0
- package/optimize/es/components/breadcrumbs/_breadcrumb_content.styles.js +48 -0
- package/optimize/es/components/breadcrumbs/breadcrumb.js +10 -109
- package/optimize/es/components/breadcrumbs/breadcrumb.styles.js +5 -27
- package/optimize/es/components/breadcrumbs/breadcrumbs.js +4 -4
- package/optimize/es/components/breadcrumbs/types.js +1 -0
- package/optimize/es/components/button/button_display/_button_display.js +2 -3
- package/optimize/es/components/button/button_empty/button_empty.js +2 -3
- package/optimize/es/components/button/button_group/button_group.js +5 -7
- package/optimize/es/components/button/button_group/button_group.styles.js +11 -14
- package/optimize/es/components/button/button_group/button_group_button.js +36 -4
- package/optimize/es/components/button/button_group/button_group_button.styles.js +39 -3
- package/optimize/es/components/button/button_icon/button_icon.js +4 -5
- package/optimize/es/components/button/button_icon/button_icon.styles.js +8 -3
- package/optimize/es/components/datagrid/body/cell/data_grid_cell.js +83 -56
- package/optimize/es/components/datagrid/body/cell/data_grid_cell_actions.js +24 -18
- package/optimize/es/components/datagrid/body/cell/data_grid_cell_popover.js +64 -56
- package/optimize/es/components/datagrid/body/cell/data_grid_cell_wrapper.js +34 -31
- package/optimize/es/components/datagrid/body/cell/index.js +1 -1
- package/optimize/es/components/datagrid/body/data_grid_body_custom.js +40 -35
- package/optimize/es/components/datagrid/body/data_grid_body_virtualized.js +71 -49
- package/optimize/es/components/datagrid/body/data_grid_row_manager.js +7 -5
- package/optimize/es/components/datagrid/body/footer/use_data_grid_footer.js +1 -2
- package/optimize/es/components/datagrid/body/header/data_grid_control_header_cell.js +4 -3
- package/optimize/es/components/datagrid/body/header/data_grid_header_cell.js +65 -49
- package/optimize/es/components/datagrid/body/header/data_grid_header_row.js +15 -13
- package/optimize/es/components/datagrid/body/header/use_data_grid_header.js +7 -6
- package/optimize/es/components/datagrid/controls/column_selector.js +126 -123
- package/optimize/es/components/datagrid/controls/column_sorting.js +121 -103
- package/optimize/es/components/datagrid/controls/column_sorting_draggable.js +24 -22
- package/optimize/es/components/datagrid/controls/display_selector.js +109 -107
- package/optimize/es/components/datagrid/data_grid.a11y.js +13 -12
- package/optimize/es/components/datagrid/data_grid.js +47 -22
- package/optimize/es/components/datagrid/utils/col_widths.js +9 -5
- package/optimize/es/components/datagrid/utils/focus.js +10 -8
- package/optimize/es/components/datagrid/utils/grid_height_width.js +31 -30
- package/optimize/es/components/datagrid/utils/ref.js +1 -1
- package/optimize/es/components/datagrid/utils/row_heights.js +2 -2
- package/optimize/es/components/datagrid/utils/sorting.js +29 -27
- package/optimize/es/components/date_picker/super_date_picker/super_update_button.js +49 -29
- package/optimize/es/components/facet/facet_button.styles.js +1 -2
- package/optimize/es/components/flex/flex_grid.js +19 -8
- package/optimize/es/components/flex/flex_grid.styles.js +13 -6
- package/optimize/es/components/flex/flex_group.js +9 -10
- package/optimize/es/components/flex/flex_item.js +9 -11
- package/optimize/es/components/flex/flex_item.styles.js +107 -122
- package/optimize/es/components/flyout/flyout.js +16 -18
- package/optimize/es/components/header/header_breadcrumbs/header_breadcrumbs.js +3 -5
- package/optimize/es/components/icon/icon.js +13 -16
- package/optimize/es/components/icon/icon.styles.js +6 -9
- package/optimize/es/components/link/external_link_icon.js +11 -8
- package/optimize/es/components/link/link.js +2 -3
- package/optimize/es/components/link/link.styles.js +4 -10
- package/optimize/es/components/modal/confirm_modal.js +2 -1
- package/optimize/es/components/modal/modal.js +6 -2
- package/optimize/es/components/observer/resize_observer/resize_observer.js +15 -24
- package/optimize/es/components/progress/progress.styles.js +2 -2
- package/optimize/es/components/skeleton/skeleton_circle.js +2 -3
- package/optimize/es/components/skeleton/skeleton_rectangle.js +2 -3
- package/optimize/es/components/skeleton/skeleton_text.js +16 -12
- package/optimize/es/components/skeleton/skeleton_title.js +2 -3
- package/optimize/es/components/spacer/spacer.js +2 -3
- package/optimize/es/components/text/text.js +2 -3
- package/optimize/es/components/text/text_align.js +1 -2
- package/optimize/es/components/text/text_align.styles.js +5 -7
- package/optimize/es/components/text/text_color.js +2 -3
- package/optimize/es/components/title/title.js +2 -3
- package/optimize/es/components/title/title.styles.js +0 -7
- package/optimize/es/components/toast/global_toast_list.js +70 -73
- package/optimize/es/components/toast/toast.js +27 -42
- package/optimize/es/components/toast/toast.styles.js +2 -17
- package/optimize/es/global_styling/mixins/_typography.js +14 -6
- package/optimize/es/services/color/eui_palettes.js +21 -13
- package/optimize/es/services/color/index.js +1 -1
- package/optimize/es/services/hooks/index.js +1 -0
- package/optimize/es/services/hooks/useDeepEqual.js +23 -0
- package/optimize/es/services/index.js +1 -1
- package/optimize/es/services/theme/index.js +1 -1
- package/optimize/es/services/theme/style_memoization.js +47 -14
- package/optimize/es/themes/amsterdam/global_styling/mixins/button.js +47 -24
- package/optimize/lib/components/breadcrumbs/_breadcrumb_content.js +163 -0
- package/optimize/lib/components/breadcrumbs/_breadcrumb_content.styles.js +55 -0
- package/optimize/lib/components/breadcrumbs/breadcrumb.js +10 -112
- package/optimize/lib/components/breadcrumbs/breadcrumb.styles.js +5 -29
- package/optimize/lib/components/breadcrumbs/breadcrumbs.js +3 -3
- package/optimize/lib/components/breadcrumbs/types.js +5 -0
- package/optimize/lib/components/button/button_display/_button_display.js +1 -2
- package/optimize/lib/components/button/button_empty/button_empty.js +1 -2
- package/optimize/lib/components/button/button_group/button_group.js +4 -6
- package/optimize/lib/components/button/button_group/button_group.styles.js +11 -14
- package/optimize/lib/components/button/button_group/button_group_button.js +37 -5
- package/optimize/lib/components/button/button_group/button_group_button.styles.js +45 -11
- package/optimize/lib/components/button/button_icon/button_icon.js +3 -4
- package/optimize/lib/components/button/button_icon/button_icon.styles.js +8 -2
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell.js +81 -55
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell_actions.js +24 -18
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell_popover.js +63 -55
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell_wrapper.js +34 -31
- package/optimize/lib/components/datagrid/body/cell/index.js +2 -2
- package/optimize/lib/components/datagrid/body/data_grid_body_custom.js +39 -34
- package/optimize/lib/components/datagrid/body/data_grid_body_virtualized.js +72 -50
- package/optimize/lib/components/datagrid/body/data_grid_row_manager.js +6 -4
- package/optimize/lib/components/datagrid/body/footer/use_data_grid_footer.js +1 -2
- package/optimize/lib/components/datagrid/body/header/data_grid_control_header_cell.js +8 -4
- package/optimize/lib/components/datagrid/body/header/data_grid_header_cell.js +65 -49
- package/optimize/lib/components/datagrid/body/header/data_grid_header_row.js +14 -12
- package/optimize/lib/components/datagrid/body/header/use_data_grid_header.js +7 -6
- package/optimize/lib/components/datagrid/controls/column_selector.js +126 -123
- package/optimize/lib/components/datagrid/controls/column_sorting.js +125 -107
- package/optimize/lib/components/datagrid/controls/column_sorting_draggable.js +27 -22
- package/optimize/lib/components/datagrid/controls/display_selector.js +109 -107
- package/optimize/lib/components/datagrid/data_grid.a11y.js +13 -12
- package/optimize/lib/components/datagrid/data_grid.js +45 -20
- package/optimize/lib/components/datagrid/utils/col_widths.js +9 -5
- package/optimize/lib/components/datagrid/utils/focus.js +10 -8
- package/optimize/lib/components/datagrid/utils/grid_height_width.js +29 -28
- package/optimize/lib/components/datagrid/utils/ref.js +1 -1
- package/optimize/lib/components/datagrid/utils/row_heights.js +1 -1
- package/optimize/lib/components/datagrid/utils/sorting.js +31 -29
- package/optimize/lib/components/date_picker/super_date_picker/super_update_button.js +49 -29
- package/optimize/lib/components/facet/facet_button.styles.js +1 -2
- package/optimize/lib/components/flex/flex_grid.js +21 -7
- package/optimize/lib/components/flex/flex_grid.styles.js +13 -6
- package/optimize/lib/components/flex/flex_group.js +9 -9
- package/optimize/lib/components/flex/flex_item.js +13 -13
- package/optimize/lib/components/flex/flex_item.styles.js +107 -122
- package/optimize/lib/components/flyout/flyout.js +16 -18
- package/optimize/lib/components/header/header_breadcrumbs/header_breadcrumbs.js +3 -5
- package/optimize/lib/components/icon/icon.js +12 -15
- package/optimize/lib/components/icon/icon.styles.js +5 -8
- package/optimize/lib/components/link/external_link_icon.js +10 -7
- package/optimize/lib/components/link/link.js +1 -2
- package/optimize/lib/components/link/link.styles.js +6 -14
- package/optimize/lib/components/modal/confirm_modal.js +2 -1
- package/optimize/lib/components/modal/modal.js +6 -2
- package/optimize/lib/components/observer/resize_observer/resize_observer.js +15 -24
- package/optimize/lib/components/progress/progress.styles.js +1 -1
- package/optimize/lib/components/skeleton/skeleton_circle.js +1 -2
- package/optimize/lib/components/skeleton/skeleton_rectangle.js +1 -2
- package/optimize/lib/components/skeleton/skeleton_text.js +18 -11
- package/optimize/lib/components/skeleton/skeleton_title.js +1 -2
- package/optimize/lib/components/spacer/spacer.js +1 -2
- package/optimize/lib/components/text/text.js +1 -2
- package/optimize/lib/components/text/text_align.js +1 -2
- package/optimize/lib/components/text/text_align.styles.js +5 -7
- package/optimize/lib/components/text/text_color.js +1 -2
- package/optimize/lib/components/title/title.js +1 -2
- package/optimize/lib/components/title/title.styles.js +2 -10
- package/optimize/lib/components/toast/global_toast_list.js +68 -71
- package/optimize/lib/components/toast/toast.js +25 -40
- package/optimize/lib/components/toast/toast.styles.js +11 -25
- package/optimize/lib/global_styling/mixins/_typography.js +25 -19
- package/optimize/lib/services/color/eui_palettes.js +24 -14
- package/optimize/lib/services/color/index.js +14 -0
- package/optimize/lib/services/hooks/index.js +11 -0
- package/optimize/lib/services/hooks/useDeepEqual.js +30 -0
- package/optimize/lib/services/index.js +15 -1
- package/optimize/lib/services/theme/index.js +6 -0
- package/optimize/lib/services/theme/style_memoization.js +49 -16
- package/optimize/lib/themes/amsterdam/global_styling/mixins/button.js +49 -26
- package/package.json +3 -3
- package/src/components/datagrid/_data_grid_data_row.scss +4 -0
- package/test-env/components/breadcrumbs/_breadcrumb_content.js +363 -0
- package/test-env/components/breadcrumbs/_breadcrumb_content.styles.js +55 -0
- package/test-env/components/breadcrumbs/breadcrumb.js +11 -323
- package/test-env/components/breadcrumbs/breadcrumb.styles.js +5 -29
- package/test-env/components/breadcrumbs/breadcrumbs.js +7 -5
- package/test-env/components/breadcrumbs/types.js +5 -0
- package/test-env/components/button/button_display/_button_display.js +1 -2
- package/test-env/components/button/button_empty/button_empty.js +1 -2
- package/test-env/components/button/button_group/button_group.js +18 -6
- package/test-env/components/button/button_group/button_group.styles.js +11 -14
- package/test-env/components/button/button_group/button_group_button.js +56 -5
- package/test-env/components/button/button_group/button_group_button.styles.js +45 -11
- package/test-env/components/button/button_icon/button_icon.js +3 -4
- package/test-env/components/button/button_icon/button_icon.styles.js +8 -2
- package/test-env/components/datagrid/body/cell/data_grid_cell.js +100 -58
- package/test-env/components/datagrid/body/cell/data_grid_cell_actions.js +24 -18
- package/test-env/components/datagrid/body/cell/data_grid_cell_popover.js +63 -55
- package/test-env/components/datagrid/body/cell/data_grid_cell_wrapper.js +34 -31
- package/test-env/components/datagrid/body/cell/index.js +2 -2
- package/test-env/components/datagrid/body/data_grid_body.js +14 -0
- package/test-env/components/datagrid/body/data_grid_body_custom.js +53 -34
- package/test-env/components/datagrid/body/data_grid_body_virtualized.js +86 -55
- package/test-env/components/datagrid/body/data_grid_row_manager.js +6 -4
- package/test-env/components/datagrid/body/footer/use_data_grid_footer.js +1 -2
- package/test-env/components/datagrid/body/header/data_grid_control_header_cell.js +8 -4
- package/test-env/components/datagrid/body/header/data_grid_header_cell.js +72 -52
- package/test-env/components/datagrid/body/header/data_grid_header_row.js +14 -550
- package/test-env/components/datagrid/body/header/use_data_grid_header.js +7 -6
- package/test-env/components/datagrid/controls/column_selector.js +126 -123
- package/test-env/components/datagrid/controls/column_sorting.js +607 -106
- package/test-env/components/datagrid/controls/column_sorting_draggable.js +27 -22
- package/test-env/components/datagrid/controls/display_selector.js +109 -107
- package/test-env/components/datagrid/data_grid.a11y.js +13 -12
- package/test-env/components/datagrid/data_grid.js +45 -20
- package/test-env/components/datagrid/utils/col_widths.js +9 -5
- package/test-env/components/datagrid/utils/focus.js +10 -8
- package/test-env/components/datagrid/utils/grid_height_width.js +29 -28
- package/test-env/components/datagrid/utils/ref.js +1 -1
- package/test-env/components/datagrid/utils/row_heights.js +1 -1
- package/test-env/components/datagrid/utils/sorting.js +31 -29
- package/test-env/components/date_picker/super_date_picker/super_date_picker.js +9 -0
- package/test-env/components/date_picker/super_date_picker/super_update_button.js +57 -29
- package/test-env/components/facet/facet_button.styles.js +1 -2
- package/test-env/components/flex/flex_grid.js +21 -7
- package/test-env/components/flex/flex_grid.styles.js +13 -6
- package/test-env/components/flex/flex_group.js +10 -10
- package/test-env/components/flex/flex_item.js +13 -13
- package/test-env/components/flex/flex_item.styles.js +107 -122
- package/test-env/components/header/header_breadcrumbs/header_breadcrumbs.js +7 -7
- package/test-env/components/icon/icon.styles.js +5 -8
- package/test-env/components/link/external_link_icon.js +10 -7
- package/test-env/components/link/link.js +1 -2
- package/test-env/components/link/link.styles.js +6 -14
- package/test-env/components/modal/confirm_modal.js +2 -1
- package/test-env/components/modal/modal.js +12 -3
- package/test-env/components/page/page_header/page_header_content.js +4 -2
- package/test-env/components/progress/progress.styles.js +1 -1
- package/test-env/components/skeleton/skeleton_circle.js +1 -2
- package/test-env/components/skeleton/skeleton_rectangle.js +1 -2
- package/test-env/components/skeleton/skeleton_text.js +18 -11
- package/test-env/components/skeleton/skeleton_title.js +1 -2
- package/test-env/components/spacer/spacer.js +1 -2
- package/test-env/components/text/text.js +1 -2
- package/test-env/components/text/text_align.js +1 -2
- package/test-env/components/text/text_align.styles.js +5 -7
- package/test-env/components/text/text_color.js +1 -2
- package/test-env/components/title/title.js +1 -2
- package/test-env/components/title/title.styles.js +2 -10
- package/test-env/components/toast/global_toast_list.js +68 -71
- package/test-env/components/toast/toast.js +25 -40
- package/test-env/components/toast/toast.styles.js +11 -25
- package/test-env/global_styling/mixins/_typography.js +25 -19
- package/test-env/services/color/eui_palettes.js +24 -14
- package/test-env/services/color/index.js +14 -0
- package/test-env/services/hooks/index.js +11 -0
- package/test-env/services/hooks/useDeepEqual.js +30 -0
- package/test-env/services/index.js +15 -1
- package/test-env/services/theme/index.js +6 -0
- package/test-env/services/theme/style_memoization.js +49 -16
- package/test-env/themes/amsterdam/global_styling/mixins/button.js +49 -26
- package/src/themes/charts/theme.scss +0 -5
|
@@ -72,9 +72,19 @@ var commaSeparateNumbers = function commaSeparateNumbers(numberString) {
|
|
|
72
72
|
);
|
|
73
73
|
});
|
|
74
74
|
};
|
|
75
|
+
var renderCellValue = function renderCellValue(_ref2) {
|
|
76
|
+
var rowIndex = _ref2.rowIndex,
|
|
77
|
+
columnId = _ref2.columnId,
|
|
78
|
+
schema = _ref2.schema;
|
|
79
|
+
var value = storeData[rowIndex][columnId];
|
|
80
|
+
if (schema === 'numeric') {
|
|
81
|
+
value = commaSeparateNumbers(value);
|
|
82
|
+
}
|
|
83
|
+
return value;
|
|
84
|
+
};
|
|
75
85
|
var DataGrid = function DataGrid() {
|
|
76
|
-
var _useState = (0, _react.useState)(columns.map(function (
|
|
77
|
-
var id =
|
|
86
|
+
var _useState = (0, _react.useState)(columns.map(function (_ref3) {
|
|
87
|
+
var id = _ref3.id;
|
|
78
88
|
return id;
|
|
79
89
|
})),
|
|
80
90
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -116,16 +126,7 @@ var DataGrid = function DataGrid() {
|
|
|
116
126
|
inMemory: {
|
|
117
127
|
level: 'sorting'
|
|
118
128
|
},
|
|
119
|
-
renderCellValue:
|
|
120
|
-
var rowIndex = _ref3.rowIndex,
|
|
121
|
-
columnId = _ref3.columnId,
|
|
122
|
-
schema = _ref3.schema;
|
|
123
|
-
var value = data[rowIndex][columnId];
|
|
124
|
-
if (schema === 'numeric') {
|
|
125
|
-
value = commaSeparateNumbers(value);
|
|
126
|
-
}
|
|
127
|
-
return value;
|
|
128
|
-
},
|
|
129
|
+
renderCellValue: renderCellValue,
|
|
129
130
|
sorting: {
|
|
130
131
|
columns: sortingColumns,
|
|
131
132
|
onSort: setSorting
|
|
@@ -31,8 +31,7 @@ var _data_grid_schema = require("./utils/data_grid_schema");
|
|
|
31
31
|
var _ref = require("./utils/ref");
|
|
32
32
|
var _data_grid_types = require("./data_grid_types");
|
|
33
33
|
var _react2 = require("@emotion/react");
|
|
34
|
-
var _excluded = ["leadingControlColumns", "trailingControlColumns", "columns", "columnVisibility", "schemaDetectors", "rowCount", "renderCellValue", "renderCellPopover", "renderFooterCellValue", "className", "gridStyle", "toolbarVisibility", "pagination", "sorting", "inMemory", "onColumnResize", "minSizeForControls", "height", "width", "rowHeightsOptions", "virtualizationOptions", "renderCustomGridBody", "renderCustomToolbar"]
|
|
35
|
-
_excluded2 = ["focusProps"];
|
|
34
|
+
var _excluded = ["leadingControlColumns", "trailingControlColumns", "columns", "columnVisibility", "schemaDetectors", "rowCount", "renderCellValue", "cellContext", "renderCellPopover", "renderFooterCellValue", "className", "gridStyle", "toolbarVisibility", "pagination", "sorting", "inMemory", "onColumnResize", "minSizeForControls", "height", "width", "rowHeightsOptions", "virtualizationOptions", "renderCustomGridBody", "renderCustomToolbar"];
|
|
36
35
|
/*
|
|
37
36
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
38
37
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -73,8 +72,8 @@ var cellPaddingsToClassMap = {
|
|
|
73
72
|
m: '',
|
|
74
73
|
l: 'euiDataGrid--paddingLarge'
|
|
75
74
|
};
|
|
75
|
+
var emptyVirtualizationOptions = {};
|
|
76
76
|
var EuiDataGrid = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
77
|
-
var _gridItemsRendered$cu;
|
|
78
77
|
var _props$leadingControl = props.leadingControlColumns,
|
|
79
78
|
leadingControlColumns = _props$leadingControl === void 0 ? _data_grid_types.emptyControlColumns : _props$leadingControl,
|
|
80
79
|
_props$trailingContro = props.trailingControlColumns,
|
|
@@ -84,6 +83,7 @@ var EuiDataGrid = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forward
|
|
|
84
83
|
schemaDetectors = props.schemaDetectors,
|
|
85
84
|
rowCount = props.rowCount,
|
|
86
85
|
renderCellValue = props.renderCellValue,
|
|
86
|
+
cellContext = props.cellContext,
|
|
87
87
|
renderCellPopover = props.renderCellPopover,
|
|
88
88
|
renderFooterCellValue = props.renderFooterCellValue,
|
|
89
89
|
className = props.className,
|
|
@@ -193,8 +193,14 @@ var EuiDataGrid = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forward
|
|
|
193
193
|
/**
|
|
194
194
|
* Sorting
|
|
195
195
|
*/
|
|
196
|
-
var columnSorting = (0, _controls.useDataGridColumnSorting)(
|
|
197
|
-
|
|
196
|
+
var columnSorting = (0, _controls.useDataGridColumnSorting)({
|
|
197
|
+
sorting: sorting,
|
|
198
|
+
columns: orderedVisibleColumns,
|
|
199
|
+
displayValues: displayValues,
|
|
200
|
+
schema: mergedSchema,
|
|
201
|
+
schemaDetectors: allSchemaDetectors
|
|
202
|
+
});
|
|
203
|
+
var sortedContext = (0, _sorting.useSorting)({
|
|
198
204
|
sorting: sorting,
|
|
199
205
|
inMemory: inMemory,
|
|
200
206
|
inMemoryValues: inMemoryValues,
|
|
@@ -208,7 +214,20 @@ var EuiDataGrid = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forward
|
|
|
208
214
|
*/
|
|
209
215
|
var _useFocus = (0, _focus.useFocus)(),
|
|
210
216
|
wrappingDivFocusProps = _useFocus.focusProps,
|
|
211
|
-
|
|
217
|
+
onFocusUpdate = _useFocus.onFocusUpdate,
|
|
218
|
+
focusedCell = _useFocus.focusedCell,
|
|
219
|
+
setFocusedCell = _useFocus.setFocusedCell,
|
|
220
|
+
setIsFocusedCellInView = _useFocus.setIsFocusedCellInView,
|
|
221
|
+
focusFirstVisibleInteractiveCell = _useFocus.focusFirstVisibleInteractiveCell;
|
|
222
|
+
var focusContext = (0, _react.useMemo)(function () {
|
|
223
|
+
return {
|
|
224
|
+
onFocusUpdate: onFocusUpdate,
|
|
225
|
+
focusedCell: focusedCell,
|
|
226
|
+
setFocusedCell: setFocusedCell,
|
|
227
|
+
setIsFocusedCellInView: setIsFocusedCellInView,
|
|
228
|
+
focusFirstVisibleInteractiveCell: focusFirstVisibleInteractiveCell
|
|
229
|
+
};
|
|
230
|
+
}, [onFocusUpdate, focusedCell, setFocusedCell, setIsFocusedCellInView, focusFirstVisibleInteractiveCell]);
|
|
212
231
|
|
|
213
232
|
/**
|
|
214
233
|
* Cell popover
|
|
@@ -238,7 +257,7 @@ var EuiDataGrid = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forward
|
|
|
238
257
|
setIsFullScreen: setIsFullScreen,
|
|
239
258
|
focusContext: focusContext,
|
|
240
259
|
cellPopoverContext: cellPopoverContext,
|
|
241
|
-
|
|
260
|
+
sortedContext: sortedContext,
|
|
242
261
|
pagination: pagination,
|
|
243
262
|
rowCount: rowCount,
|
|
244
263
|
visibleColCount: visibleColCount
|
|
@@ -285,12 +304,25 @@ var EuiDataGrid = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forward
|
|
|
285
304
|
gridAriaProps['aria-labelledby'] = "".concat(rest['aria-labelledby'], " ").concat(pagination ? ariaLabelledById : '');
|
|
286
305
|
delete rest['aria-labelledby'];
|
|
287
306
|
}
|
|
307
|
+
var onKeyDown = (0, _react.useCallback)(function (event) {
|
|
308
|
+
var _gridItemsRendered$cu;
|
|
309
|
+
(0, _focus.createKeyDownHandler)({
|
|
310
|
+
gridElement: contentRef.current,
|
|
311
|
+
visibleColCount: visibleColCount,
|
|
312
|
+
visibleRowCount: visibleRowCount,
|
|
313
|
+
visibleRowStartIndex: ((_gridItemsRendered$cu = gridItemsRendered.current) === null || _gridItemsRendered$cu === void 0 ? void 0 : _gridItemsRendered$cu.visibleRowStartIndex) || 0,
|
|
314
|
+
rowCount: rowCount,
|
|
315
|
+
pagination: pagination,
|
|
316
|
+
hasFooter: !!renderFooterCellValue,
|
|
317
|
+
focusContext: focusContext
|
|
318
|
+
})(event);
|
|
319
|
+
}, [focusContext, visibleColCount, visibleRowCount, rowCount, pagination, renderFooterCellValue]);
|
|
288
320
|
return (0, _react2.jsx)(_focus.DataGridFocusContext.Provider, {
|
|
289
321
|
value: focusContext
|
|
290
322
|
}, (0, _react2.jsx)(_cell.DataGridCellPopoverContext.Provider, {
|
|
291
323
|
value: cellPopoverContext
|
|
292
|
-
}, (0, _react2.jsx)(_sorting.
|
|
293
|
-
value:
|
|
324
|
+
}, (0, _react2.jsx)(_sorting.DataGridSortedContext.Provider, {
|
|
325
|
+
value: sortedContext
|
|
294
326
|
}, (0, _react2.jsx)(_focus_trap.EuiFocusTrap, {
|
|
295
327
|
disabled: !isFullScreen,
|
|
296
328
|
className: "euiDataGrid__focusWrap"
|
|
@@ -326,16 +358,7 @@ var EuiDataGrid = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forward
|
|
|
326
358
|
}) : null, (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
327
359
|
// eslint-disable-line jsx-a11y/interactive-supports-focus
|
|
328
360
|
ref: contentRef,
|
|
329
|
-
onKeyDown:
|
|
330
|
-
gridElement: contentRef.current,
|
|
331
|
-
visibleColCount: visibleColCount,
|
|
332
|
-
visibleRowCount: visibleRowCount,
|
|
333
|
-
visibleRowStartIndex: ((_gridItemsRendered$cu = gridItemsRendered.current) === null || _gridItemsRendered$cu === void 0 ? void 0 : _gridItemsRendered$cu.visibleRowStartIndex) || 0,
|
|
334
|
-
rowCount: rowCount,
|
|
335
|
-
pagination: pagination,
|
|
336
|
-
hasFooter: !!renderFooterCellValue,
|
|
337
|
-
focusContext: focusContext
|
|
338
|
-
}),
|
|
361
|
+
onKeyDown: onKeyDown,
|
|
339
362
|
"data-test-subj": "euiDataGridBody",
|
|
340
363
|
className: "euiDataGrid__content",
|
|
341
364
|
role: "grid",
|
|
@@ -351,15 +374,17 @@ var EuiDataGrid = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forward
|
|
|
351
374
|
switchColumnPos: switchColumnPos,
|
|
352
375
|
onColumnResize: onColumnResize,
|
|
353
376
|
schemaDetectors: allSchemaDetectors,
|
|
377
|
+
sorting: sorting,
|
|
354
378
|
pagination: pagination,
|
|
355
379
|
renderCellValue: renderCellValue,
|
|
380
|
+
cellContext: cellContext,
|
|
356
381
|
renderCellPopover: renderCellPopover,
|
|
357
382
|
renderFooterCellValue: renderFooterCellValue,
|
|
358
383
|
rowCount: rowCount,
|
|
359
384
|
visibleRows: visibleRows,
|
|
360
385
|
interactiveCellId: interactiveCellId,
|
|
361
386
|
rowHeightsOptions: rowHeightsOptions,
|
|
362
|
-
virtualizationOptions: virtualizationOptions ||
|
|
387
|
+
virtualizationOptions: virtualizationOptions || emptyVirtualizationOptions,
|
|
363
388
|
isFullScreen: isFullScreen,
|
|
364
389
|
gridStyles: gridStyles,
|
|
365
390
|
gridWidth: gridWidth,
|
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.useDefaultColumnWidth = exports.useColumnWidths = exports.doesColumnHaveAnInitialWidth = void 0;
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
11
|
var _react = require("react");
|
|
12
12
|
var _services = require("../../../services");
|
|
@@ -55,10 +55,12 @@ var useColumnWidths = function useColumnWidths(_ref) {
|
|
|
55
55
|
onColumnResize = _ref.onColumnResize;
|
|
56
56
|
var computeColumnWidths = (0, _react.useCallback)(function () {
|
|
57
57
|
return columns.filter(doesColumnHaveAnInitialWidth).reduce(function (initialWidths, column) {
|
|
58
|
-
initialWidths
|
|
59
|
-
return initialWidths;
|
|
58
|
+
return _objectSpread(_objectSpread({}, initialWidths), {}, (0, _defineProperty2.default)({}, column.id, column.initialWidth));
|
|
60
59
|
}, {});
|
|
61
60
|
}, [columns]);
|
|
61
|
+
|
|
62
|
+
// Passes initializer function for performance, so computing only runs once on init
|
|
63
|
+
// @see https://react.dev/reference/react/useState#examples-initializer
|
|
62
64
|
var _useState = (0, _react.useState)(computeColumnWidths),
|
|
63
65
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
64
66
|
columnWidths = _useState2[0],
|
|
@@ -67,14 +69,16 @@ var useColumnWidths = function useColumnWidths(_ref) {
|
|
|
67
69
|
setColumnWidths(computeColumnWidths());
|
|
68
70
|
}, [computeColumnWidths]);
|
|
69
71
|
var setColumnWidth = (0, _react.useCallback)(function (columnId, width) {
|
|
70
|
-
setColumnWidths(
|
|
72
|
+
setColumnWidths(function (prevColumnWidths) {
|
|
73
|
+
return _objectSpread(_objectSpread({}, prevColumnWidths), {}, (0, _defineProperty2.default)({}, columnId, width));
|
|
74
|
+
});
|
|
71
75
|
if (onColumnResize) {
|
|
72
76
|
onColumnResize({
|
|
73
77
|
columnId: columnId,
|
|
74
78
|
width: width
|
|
75
79
|
});
|
|
76
80
|
}
|
|
77
|
-
}, [
|
|
81
|
+
}, [onColumnResize]);
|
|
78
82
|
|
|
79
83
|
// Used by react-window to determine actual column widths
|
|
80
84
|
var getColumnWidth = (0, _react.useCallback)(function (index) {
|
|
@@ -95,14 +95,16 @@ var useFocus = function useFocus() {
|
|
|
95
95
|
}
|
|
96
96
|
};
|
|
97
97
|
}, [isFocusedCellInView, focusFirstVisibleInteractiveCell]);
|
|
98
|
-
return {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
98
|
+
return (0, _react.useMemo)(function () {
|
|
99
|
+
return {
|
|
100
|
+
onFocusUpdate: onFocusUpdate,
|
|
101
|
+
focusedCell: focusedCell,
|
|
102
|
+
setFocusedCell: setFocusedCell,
|
|
103
|
+
setIsFocusedCellInView: setIsFocusedCellInView,
|
|
104
|
+
focusFirstVisibleInteractiveCell: focusFirstVisibleInteractiveCell,
|
|
105
|
+
focusProps: focusProps
|
|
106
|
+
};
|
|
107
|
+
}, [onFocusUpdate, focusedCell, setFocusedCell, setIsFocusedCellInView, focusFirstVisibleInteractiveCell, focusProps]);
|
|
106
108
|
};
|
|
107
109
|
exports.useFocus = useFocus;
|
|
108
110
|
var notifyCellOfFocusState = function notifyCellOfFocusState(cellsUpdateFocus, cell, isFocused) {
|
|
@@ -91,42 +91,43 @@ var useUnconstrainedHeight = function useUnconstrainedHeight(_ref2) {
|
|
|
91
91
|
footerRowHeight = _ref2.footerRowHeight,
|
|
92
92
|
scrollBarHeight = _ref2.scrollBarHeight,
|
|
93
93
|
innerGridRef = _ref2.innerGridRef;
|
|
94
|
-
var _useContext = (0, _react.useContext)(_sorting.
|
|
94
|
+
var _useContext = (0, _react.useContext)(_sorting.DataGridSortedContext),
|
|
95
95
|
getCorrectRowIndex = _useContext.getCorrectRowIndex;
|
|
96
|
-
var knownHeight = 0; // tracks the pixel height of rows we know the size of
|
|
97
|
-
var knownRowCount = 0; // how many rows we know the size of
|
|
98
|
-
for (var i = startRow; i < endRow; i++) {
|
|
99
|
-
var correctRowIndex = getCorrectRowIndex(i); // map visible row to logical row
|
|
100
|
-
|
|
101
|
-
// lookup the height configuration of this row
|
|
102
|
-
var rowHeightOption = rowHeightUtils.getRowHeightOption(correctRowIndex, rowHeightsOptions);
|
|
103
|
-
if (rowHeightOption) {
|
|
104
|
-
// this row's height is known
|
|
105
|
-
knownRowCount++;
|
|
106
|
-
knownHeight += rowHeightUtils.getCalculatedHeight(rowHeightOption, defaultRowHeight, correctRowIndex, rowHeightUtils.isRowHeightOverride(correctRowIndex, rowHeightsOptions));
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
// how many rows to provide space for on the screen
|
|
111
|
-
var rowCountToAffordFor = endRow - startRow;
|
|
112
|
-
|
|
113
96
|
// watch the inner element for a change to its width
|
|
114
97
|
// which may cause the horizontal scrollbar to be added or removed
|
|
115
98
|
var _useResizeObserver = (0, _resize_observer.useResizeObserver)(innerGridRef.current, 'width'),
|
|
116
99
|
innerWidth = _useResizeObserver.width;
|
|
117
100
|
var forceRender = (0, _services.useForceRender)();
|
|
118
101
|
(0, _services.useUpdateEffect)(forceRender, [innerWidth]);
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
102
|
+
return (0, _react.useMemo)(function () {
|
|
103
|
+
var knownHeight = 0; // tracks the pixel height of rows we know the size of
|
|
104
|
+
var knownRowCount = 0; // how many rows we know the size of
|
|
105
|
+
for (var i = startRow; i < endRow; i++) {
|
|
106
|
+
var correctRowIndex = getCorrectRowIndex(i); // map visible row to logical row
|
|
107
|
+
|
|
108
|
+
// lookup the height configuration of this row
|
|
109
|
+
var rowHeightOption = rowHeightUtils.getRowHeightOption(correctRowIndex, rowHeightsOptions);
|
|
110
|
+
if (rowHeightOption) {
|
|
111
|
+
// this row's height is known
|
|
112
|
+
knownRowCount++;
|
|
113
|
+
knownHeight += rowHeightUtils.getCalculatedHeight(rowHeightOption, defaultRowHeight, correctRowIndex, rowHeightUtils.isRowHeightOverride(correctRowIndex, rowHeightsOptions));
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// how many rows to provide space for on the screen
|
|
118
|
+
var rowCountToAffordFor = endRow - startRow;
|
|
119
|
+
var unconstrainedHeight = defaultRowHeight * (rowCountToAffordFor - knownRowCount) +
|
|
120
|
+
// guess how much space is required for unknown rows
|
|
121
|
+
knownHeight +
|
|
122
|
+
// computed pixel height of the known rows
|
|
123
|
+
headerRowHeight +
|
|
124
|
+
// account for header
|
|
125
|
+
footerRowHeight +
|
|
126
|
+
// account for footer
|
|
127
|
+
scrollBarHeight; // account for horizontal scrollbar
|
|
128
128
|
|
|
129
|
-
|
|
129
|
+
return unconstrainedHeight;
|
|
130
|
+
}, [defaultRowHeight, endRow, footerRowHeight, headerRowHeight, startRow, getCorrectRowIndex, rowHeightUtils, rowHeightsOptions, scrollBarHeight]);
|
|
130
131
|
};
|
|
131
132
|
|
|
132
133
|
/**
|
|
@@ -19,7 +19,7 @@ var useImperativeGridRef = function useImperativeGridRef(_ref) {
|
|
|
19
19
|
setIsFullScreen = _ref.setIsFullScreen,
|
|
20
20
|
focusContext = _ref.focusContext,
|
|
21
21
|
cellPopoverContext = _ref.cellPopoverContext,
|
|
22
|
-
sortedRowMap = _ref.
|
|
22
|
+
sortedRowMap = _ref.sortedContext.sortedRowMap,
|
|
23
23
|
pagination = _ref.pagination,
|
|
24
24
|
rowCount = _ref.rowCount,
|
|
25
25
|
visibleColCount = _ref.visibleColCount;
|
|
@@ -333,7 +333,7 @@ exports.useRowHeightUtils = useRowHeightUtils;
|
|
|
333
333
|
var useDefaultRowHeight = function useDefaultRowHeight(_ref3) {
|
|
334
334
|
var rowHeightsOptions = _ref3.rowHeightsOptions,
|
|
335
335
|
rowHeightUtils = _ref3.rowHeightUtils;
|
|
336
|
-
var _useContext = (0, _react.useContext)(_sorting.
|
|
336
|
+
var _useContext = (0, _react.useContext)(_sorting.DataGridSortedContext),
|
|
337
337
|
getCorrectRowIndex = _useContext.getCorrectRowIndex;
|
|
338
338
|
|
|
339
339
|
// `minRowHeight` is primarily used by undefined & lineCount heights
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.useSorting = exports.
|
|
6
|
+
exports.useSorting = exports.DataGridSortedContext = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
|
+
var _services = require("../../../services");
|
|
8
9
|
var _data_grid_schema = require("./data_grid_schema");
|
|
9
10
|
/*
|
|
10
11
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -14,14 +15,13 @@ var _data_grid_schema = require("./data_grid_schema");
|
|
|
14
15
|
* Side Public License, v 1.
|
|
15
16
|
*/
|
|
16
17
|
|
|
17
|
-
var
|
|
18
|
-
sorting: undefined,
|
|
18
|
+
var DataGridSortedContext = /*#__PURE__*/(0, _react.createContext)({
|
|
19
19
|
sortedRowMap: [],
|
|
20
20
|
getCorrectRowIndex: function getCorrectRowIndex(number) {
|
|
21
21
|
return number;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
exports.
|
|
24
|
+
exports.DataGridSortedContext = DataGridSortedContext;
|
|
25
25
|
var useSorting = function useSorting(_ref) {
|
|
26
26
|
var sorting = _ref.sorting,
|
|
27
27
|
inMemory = _ref.inMemory,
|
|
@@ -29,22 +29,18 @@ var useSorting = function useSorting(_ref) {
|
|
|
29
29
|
schema = _ref.schema,
|
|
30
30
|
schemaDetectors = _ref.schemaDetectors,
|
|
31
31
|
startRow = _ref.startRow;
|
|
32
|
-
var sortingColumns = sorting === null || sorting === void 0 ? void 0 : sorting.columns;
|
|
33
|
-
var
|
|
34
|
-
var rowMap = [];
|
|
32
|
+
var sortingColumns = (0, _services.useDeepEqual)(sorting === null || sorting === void 0 ? void 0 : sorting.columns);
|
|
33
|
+
var sortedWrappedValues = (0, _react.useMemo)(function () {
|
|
35
34
|
if ((inMemory === null || inMemory === void 0 ? void 0 : inMemory.level) === 'sorting' && sortingColumns != null && sortingColumns.length > 0) {
|
|
36
35
|
var inMemoryRowIndices = Object.keys(inMemoryValues);
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
wrappedValues.sort(function (a, b) {
|
|
46
|
-
for (var _i = 0; _i < sortingColumns.length; _i++) {
|
|
47
|
-
var column = sortingColumns[_i];
|
|
36
|
+
return inMemoryRowIndices.map(function (row, index) {
|
|
37
|
+
return {
|
|
38
|
+
index: index,
|
|
39
|
+
values: inMemoryValues[row]
|
|
40
|
+
};
|
|
41
|
+
}).sort(function (a, b) {
|
|
42
|
+
for (var i = 0; i < sortingColumns.length; i++) {
|
|
43
|
+
var column = sortingColumns[i];
|
|
48
44
|
var aValue = a.values[column.id];
|
|
49
45
|
var bValue = b.values[column.id];
|
|
50
46
|
|
|
@@ -52,8 +48,8 @@ var useSorting = function useSorting(_ref) {
|
|
|
52
48
|
var comparator = _data_grid_schema.defaultComparator;
|
|
53
49
|
if (schema.hasOwnProperty(column.id)) {
|
|
54
50
|
var columnType = schema[column.id].columnType;
|
|
55
|
-
for (var
|
|
56
|
-
var detector = schemaDetectors[
|
|
51
|
+
for (var _i = 0; _i < schemaDetectors.length; _i++) {
|
|
52
|
+
var detector = schemaDetectors[_i];
|
|
57
53
|
if (detector.type === columnType && detector.hasOwnProperty('comparator')) {
|
|
58
54
|
comparator = detector.comparator;
|
|
59
55
|
}
|
|
@@ -68,12 +64,17 @@ var useSorting = function useSorting(_ref) {
|
|
|
68
64
|
}
|
|
69
65
|
return 0;
|
|
70
66
|
});
|
|
71
|
-
for (var _i3 = 0; _i3 < wrappedValues.length; _i3++) {
|
|
72
|
-
rowMap[_i3] = wrappedValues[_i3].index;
|
|
73
|
-
}
|
|
74
67
|
}
|
|
75
|
-
return rowMap;
|
|
76
68
|
}, [inMemory === null || inMemory === void 0 ? void 0 : inMemory.level, inMemoryValues, sortingColumns, schema, schemaDetectors]);
|
|
69
|
+
var sortedRowMap = (0, _react.useMemo)(function () {
|
|
70
|
+
if ((inMemory === null || inMemory === void 0 ? void 0 : inMemory.level) === 'sorting' && sortingColumns != null && sortingColumns.length > 0 && sortedWrappedValues != null) {
|
|
71
|
+
return sortedWrappedValues.map(function (row) {
|
|
72
|
+
return row.index;
|
|
73
|
+
});
|
|
74
|
+
} else {
|
|
75
|
+
return [];
|
|
76
|
+
}
|
|
77
|
+
}, [inMemory === null || inMemory === void 0 ? void 0 : inMemory.level, sortingColumns, sortedWrappedValues]);
|
|
77
78
|
|
|
78
79
|
// Given a visible row index, obtain the unpaginated & unsorted
|
|
79
80
|
// row index from the passed cell data
|
|
@@ -83,10 +84,11 @@ var useSorting = function useSorting(_ref) {
|
|
|
83
84
|
var unsortedRowIndex = unpaginatedRowIndex in sortedRowMap ? sortedRowMap[unpaginatedRowIndex] : unpaginatedRowIndex;
|
|
84
85
|
return unsortedRowIndex;
|
|
85
86
|
}, [startRow, sortedRowMap]);
|
|
86
|
-
return {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
87
|
+
return (0, _react.useMemo)(function () {
|
|
88
|
+
return {
|
|
89
|
+
sortedRowMap: sortedRowMap,
|
|
90
|
+
getCorrectRowIndex: getCorrectRowIndex
|
|
91
|
+
};
|
|
92
|
+
}, [sortedRowMap, getCorrectRowIndex]);
|
|
91
93
|
};
|
|
92
94
|
exports.useSorting = useSorting;
|
|
@@ -22,7 +22,7 @@ var _i18n = require("../../i18n");
|
|
|
22
22
|
var _tool_tip = require("../../tool_tip");
|
|
23
23
|
var _responsive2 = require("../../responsive");
|
|
24
24
|
var _react2 = require("@emotion/react");
|
|
25
|
-
var _excluded = ["className", "needsUpdate", "isLoading", "isDisabled", "onClick", "toolTipProps", "showTooltip", "iconOnly", "responsive", "textProps", "fill"];
|
|
25
|
+
var _excluded = ["children", "className", "needsUpdate", "isLoading", "isDisabled", "onClick", "toolTipProps", "showTooltip", "iconOnly", "responsive", "textProps", "fill"];
|
|
26
26
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
27
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
28
28
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -90,6 +90,7 @@ var EuiSuperUpdateButton = /*#__PURE__*/function (_Component) {
|
|
|
90
90
|
key: "render",
|
|
91
91
|
value: function render() {
|
|
92
92
|
var _this$props = this.props,
|
|
93
|
+
children = _this$props.children,
|
|
93
94
|
className = _this$props.className,
|
|
94
95
|
needsUpdate = _this$props.needsUpdate,
|
|
95
96
|
isLoading = _this$props.isLoading,
|
|
@@ -105,31 +106,6 @@ var EuiSuperUpdateButton = /*#__PURE__*/function (_Component) {
|
|
|
105
106
|
// Force responsive for "all" if `iconOnly = true`
|
|
106
107
|
var responsive = iconOnly ? 'all' : _responsive;
|
|
107
108
|
var classes = (0, _classnames.default)('euiSuperUpdateButton', className);
|
|
108
|
-
var buttonText = (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
109
|
-
token: "euiSuperUpdateButton.refreshButtonLabel",
|
|
110
|
-
default: "Refresh"
|
|
111
|
-
});
|
|
112
|
-
if (needsUpdate || isLoading) {
|
|
113
|
-
buttonText = isLoading ? (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
114
|
-
token: "euiSuperUpdateButton.updatingButtonLabel",
|
|
115
|
-
default: "Updating"
|
|
116
|
-
}) : (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
117
|
-
token: "euiSuperUpdateButton.updateButtonLabel",
|
|
118
|
-
default: "Update"
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
var tooltipContent;
|
|
122
|
-
if (isDisabled) {
|
|
123
|
-
tooltipContent = (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
124
|
-
token: "euiSuperUpdateButton.cannotUpdateTooltip",
|
|
125
|
-
default: "Cannot update"
|
|
126
|
-
});
|
|
127
|
-
} else if (needsUpdate && !isLoading) {
|
|
128
|
-
tooltipContent = (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
129
|
-
token: "euiSuperUpdateButton.clickToApplyTooltip",
|
|
130
|
-
default: "Click to apply"
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
109
|
var sharedButtonProps = {
|
|
134
110
|
color: needsUpdate || isLoading ? 'success' : 'primary',
|
|
135
111
|
iconType: needsUpdate || isLoading ? 'kqlFunction' : 'refresh',
|
|
@@ -137,9 +113,10 @@ var EuiSuperUpdateButton = /*#__PURE__*/function (_Component) {
|
|
|
137
113
|
onClick: onClick,
|
|
138
114
|
isLoading: isLoading
|
|
139
115
|
};
|
|
116
|
+
var buttonContent = this.renderButtonContent();
|
|
140
117
|
return (0, _react2.jsx)(_tool_tip.EuiToolTip, (0, _extends2.default)({
|
|
141
118
|
ref: this.setTootipRef,
|
|
142
|
-
content:
|
|
119
|
+
content: this.renderTooltipContent(),
|
|
143
120
|
position: "bottom"
|
|
144
121
|
}, toolTipProps), (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_responsive2.EuiShowFor, {
|
|
145
122
|
sizes: responsive || 'none'
|
|
@@ -151,7 +128,7 @@ var EuiSuperUpdateButton = /*#__PURE__*/function (_Component) {
|
|
|
151
128
|
textProps: _objectSpread(_objectSpread({}, restTextProps), {}, {
|
|
152
129
|
className: (0, _classnames.default)('euiScreenReaderOnly', restTextProps && restTextProps.className)
|
|
153
130
|
})
|
|
154
|
-
}, rest),
|
|
131
|
+
}, rest), buttonContent)), (0, _react2.jsx)(_responsive2.EuiHideFor, {
|
|
155
132
|
sizes: responsive || 'none'
|
|
156
133
|
}, (0, _react2.jsx)(_button.EuiButton, (0, _extends2.default)({
|
|
157
134
|
className: classes,
|
|
@@ -159,7 +136,50 @@ var EuiSuperUpdateButton = /*#__PURE__*/function (_Component) {
|
|
|
159
136
|
}, sharedButtonProps, {
|
|
160
137
|
fill: fill,
|
|
161
138
|
textProps: restTextProps
|
|
162
|
-
}, rest),
|
|
139
|
+
}, rest), buttonContent))));
|
|
140
|
+
}
|
|
141
|
+
}, {
|
|
142
|
+
key: "renderButtonContent",
|
|
143
|
+
value: function renderButtonContent() {
|
|
144
|
+
var _this$props2 = this.props,
|
|
145
|
+
children = _this$props2.children,
|
|
146
|
+
isLoading = _this$props2.isLoading,
|
|
147
|
+
needsUpdate = _this$props2.needsUpdate;
|
|
148
|
+
if (children) {
|
|
149
|
+
return children;
|
|
150
|
+
}
|
|
151
|
+
if (isLoading) {
|
|
152
|
+
return (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
153
|
+
token: "euiSuperUpdateButton.updatingButtonLabel",
|
|
154
|
+
default: "Updating"
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
if (needsUpdate) {
|
|
158
|
+
return (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
159
|
+
token: "euiSuperUpdateButton.updateButtonLabel",
|
|
160
|
+
default: "Update"
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
return (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
164
|
+
token: "euiSuperUpdateButton.refreshButtonLabel",
|
|
165
|
+
default: "Refresh"
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
}, {
|
|
169
|
+
key: "renderTooltipContent",
|
|
170
|
+
value: function renderTooltipContent() {
|
|
171
|
+
if (this.props.isDisabled) {
|
|
172
|
+
return (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
173
|
+
token: "euiSuperUpdateButton.cannotUpdateTooltip",
|
|
174
|
+
default: "Cannot update"
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
if (this.props.needsUpdate && !this.props.isLoading) {
|
|
178
|
+
return (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
179
|
+
token: "euiSuperUpdateButton.clickToApplyTooltip",
|
|
180
|
+
default: "Click to apply"
|
|
181
|
+
});
|
|
182
|
+
}
|
|
163
183
|
}
|
|
164
184
|
}]);
|
|
165
185
|
return EuiSuperUpdateButton;
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.euiFacetButtonTextStyles = exports.euiFacetButtonStyles = exports.euiFacetButtonQuantityStyles = exports.euiFacetButtonLoadingSpinnerStyles = exports.euiFacetButtonIconStyles = void 0;
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
8
|
var _global_styling = require("../../global_styling");
|
|
9
|
-
var _link = require("../link/link.styles");
|
|
10
9
|
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /*
|
|
11
10
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
12
11
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -18,7 +17,7 @@ var euiFacetButtonStyles = function euiFacetButtonStyles(_ref3) {
|
|
|
18
17
|
var euiTheme = _ref3.euiTheme;
|
|
19
18
|
return {
|
|
20
19
|
// Base
|
|
21
|
-
euiFacetButton: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalTextAlignCSS)('left'), " &:hover,&:focus{
|
|
20
|
+
euiFacetButton: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalTextAlignCSS)('left'), " &:not(:disabled){&:hover,&:focus{text-decoration:none;.euiFacetButton__text{text-decoration:underline;}}&:focus .euiFacetButton__text{text-decoration-thickness:", euiTheme.border.width.thick, ";}}&:disabled{color:", euiTheme.colors.disabledText, ";pointer-events:none;};label:euiFacetButton;")
|
|
22
21
|
};
|
|
23
22
|
};
|
|
24
23
|
exports.euiFacetButtonStyles = euiFacetButtonStyles;
|