@elastic/eui 108.0.0 → 109.1.0-snapshot.1763390960850
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/es/components/accessibility/skip_link/skip_link.js +10 -1
- package/es/components/basic_table/collapsed_item_actions.js +3 -1
- package/es/components/basic_table/default_item_action.js +7 -4
- package/es/components/bottom_bar/bottom_bar.js +12 -2
- package/es/components/button/button.js +20 -25
- package/es/components/button/button_display/_button_display.js +32 -30
- package/es/components/button/button_display/_button_display.styles.js +4 -4
- package/es/components/button/button_empty/button_empty.js +32 -14
- package/es/components/button/button_group/button_group.js +49 -31
- package/es/components/button/button_group/button_group_button.js +16 -5
- package/es/components/button/button_group/button_group_button.styles.js +12 -8
- package/es/components/button/button_icon/button_icon.js +30 -6
- package/es/components/card/card.js +20 -25
- package/es/components/card/card_select/card_select.js +20 -25
- package/es/components/code/code_block_virtualized.js +9 -7
- package/es/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +13 -1
- package/es/components/datagrid/body/cell/data_grid_cell.js +35 -12
- package/es/components/datagrid/body/data_grid_body.js +23 -6
- package/es/components/datagrid/body/data_grid_body_custom.js +23 -6
- package/es/components/datagrid/body/data_grid_body_virtualized.js +23 -6
- package/es/components/datagrid/body/header/column_actions.js +5 -21
- package/es/components/datagrid/body/header/data_grid_header_cell.js +29 -10
- package/es/components/datagrid/body/header/data_grid_header_cell.styles.js +8 -2
- package/es/components/datagrid/body/header/data_grid_header_cell_wrapper.js +5 -2
- package/es/components/datagrid/controls/column_selector.js +36 -19
- package/es/components/datagrid/controls/column_sorting.js +23 -6
- package/es/components/datagrid/controls/data_grid_toolbar_control.js +13 -7
- package/es/components/datagrid/data_grid.js +5 -1
- package/es/components/datagrid/utils/in_memory.js +25 -7
- package/es/components/date_picker/auto_refresh/auto_refresh.js +11 -2
- package/es/components/date_picker/super_date_picker/date_popover/absolute_tab.js +31 -5
- package/es/components/date_picker/super_date_picker/date_popover/date_popover_button.js +24 -3
- package/es/components/date_picker/super_date_picker/date_popover/date_popover_content.js +26 -4
- package/es/components/date_picker/super_date_picker/date_popover/relative_tab.js +29 -3
- package/es/components/date_picker/super_date_picker/date_popover/timezone_display.js +98 -0
- package/es/components/date_picker/super_date_picker/date_popover/timezone_display.styles.js +19 -0
- package/es/components/date_picker/super_date_picker/pretty_duration.js +1 -8
- package/es/components/date_picker/super_date_picker/relative_utils.js +8 -0
- package/es/components/date_picker/super_date_picker/super_date_picker.js +118 -26
- package/es/components/date_picker/super_date_picker/time_window_buttons.js +185 -0
- package/es/components/facet/facet_button.js +9 -19
- package/es/components/filter_group/filter_button.js +14 -1
- package/es/components/flyout/flyout.js +27 -10
- package/es/components/form/file_picker/file_picker.styles.js +3 -3
- package/es/components/form/form_control_button/form_control_button.js +13 -7
- package/es/components/header/header_links/header_link.js +13 -7
- package/es/components/header/header_section/header_section_item_button.js +13 -7
- package/es/components/icon/assets/boxes_vertical.js +1 -1
- package/es/components/icon/assets/checkInCircleFilled.js +1 -2
- package/es/components/icon/assets/errorFilled.js +1 -2
- package/es/components/icon/assets/paper_clip.js +1 -1
- package/es/components/icon/assets/streams_wired.js +3 -2
- package/es/components/icon/assets/warningFilled.js +1 -2
- package/es/components/icon/icon_map.js +3 -6
- package/es/components/list_group/list_group.js +13 -1
- package/es/components/list_group/list_group_item.js +13 -1
- package/es/components/list_group/list_group_item_extra_action.js +13 -1
- package/es/components/list_group/pinnable_list_group/pinnable_list_group.js +15 -2
- package/es/components/overlay_mask/overlay_mask.styles.js +1 -1
- package/es/components/pagination/pagination_button.js +13 -7
- package/es/components/popover/popover.js +22 -16
- package/es/components/provider/component_defaults/component_defaults.js +22 -2
- package/es/components/table/table_row.styles.js +1 -1
- package/es/components/tool_tip/tool_tip.js +24 -24
- package/es/global_styling/index.js +2 -1
- package/es/global_styling/mixins/_button.js +1 -1
- package/es/global_styling/utility/selectors.js +9 -0
- package/es/services/focus_trap/focus_trap_pub_sub.js +74 -0
- package/es/services/focus_trap/index.js +9 -0
- package/es/services/hooks/index.js +2 -1
- package/es/services/hooks/useEuiDisabledElement.js +195 -0
- package/es/services/index.js +1 -0
- package/es/services/popover/reposition_on_scroll.js +61 -0
- package/es/services/theme/high_contrast_overrides.js +5 -1
- package/es/test/cypress/index.d.ts +12 -0
- package/es/test/cypress/index.js +9 -0
- package/es/test/cypress/matchers.d.ts +20 -0
- package/es/test/cypress/matchers.js +54 -0
- package/es/test/cypress/test_reposition_on_scroll.js +66 -0
- package/es/test/enzyme/enzyme_matchers.d.ts +36 -0
- package/es/test/enzyme/enzyme_matchers.js +43 -0
- package/es/test/enzyme/index.d.ts +14 -0
- package/es/test/enzyme/index.js +10 -0
- package/es/test/rtl/index.d.ts +9 -1
- package/es/test/rtl/index.js +2 -1
- package/es/test/rtl/matchers.d.ts +36 -0
- package/es/test/rtl/matchers.js +82 -0
- package/es/utils/element_can_be_disabled.js +16 -0
- package/es/utils/index.js +2 -1
- package/eui.d.ts +604 -183
- package/i18ntokens.json +1357 -1231
- package/lib/components/accessibility/skip_link/skip_link.js +10 -1
- package/lib/components/basic_table/collapsed_item_actions.js +3 -1
- package/lib/components/basic_table/default_item_action.js +7 -4
- package/lib/components/bottom_bar/bottom_bar.js +11 -1
- package/lib/components/button/button.js +21 -26
- package/lib/components/button/button_display/_button_display.js +31 -29
- package/lib/components/button/button_display/_button_display.styles.js +4 -4
- package/lib/components/button/button_empty/button_empty.js +31 -13
- package/lib/components/button/button_group/button_group.js +49 -31
- package/lib/components/button/button_group/button_group_button.js +16 -5
- package/lib/components/button/button_group/button_group_button.styles.js +10 -6
- package/lib/components/button/button_icon/button_icon.js +29 -5
- package/lib/components/card/card.js +21 -26
- package/lib/components/card/card_select/card_select.js +21 -26
- package/lib/components/code/code_block_virtualized.js +9 -7
- package/lib/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +13 -1
- package/lib/components/datagrid/body/cell/data_grid_cell.js +35 -12
- package/lib/components/datagrid/body/data_grid_body.js +23 -6
- package/lib/components/datagrid/body/data_grid_body_custom.js +23 -6
- package/lib/components/datagrid/body/data_grid_body_virtualized.js +23 -6
- package/lib/components/datagrid/body/header/column_actions.js +5 -21
- package/lib/components/datagrid/body/header/data_grid_header_cell.js +29 -10
- package/lib/components/datagrid/body/header/data_grid_header_cell.styles.js +8 -1
- package/lib/components/datagrid/body/header/data_grid_header_cell_wrapper.js +5 -2
- package/lib/components/datagrid/controls/column_selector.js +36 -19
- package/lib/components/datagrid/controls/column_sorting.js +23 -6
- package/lib/components/datagrid/controls/data_grid_toolbar_control.js +13 -7
- package/lib/components/datagrid/data_grid.js +5 -1
- package/lib/components/datagrid/utils/in_memory.js +25 -7
- package/lib/components/date_picker/auto_refresh/auto_refresh.js +12 -3
- package/lib/components/date_picker/super_date_picker/date_popover/absolute_tab.js +30 -4
- package/lib/components/date_picker/super_date_picker/date_popover/date_popover_button.js +24 -3
- package/lib/components/date_picker/super_date_picker/date_popover/date_popover_content.js +26 -4
- package/lib/components/date_picker/super_date_picker/date_popover/relative_tab.js +29 -3
- package/lib/components/date_picker/super_date_picker/date_popover/timezone_display.js +104 -0
- package/lib/components/date_picker/super_date_picker/date_popover/timezone_display.styles.js +25 -0
- package/lib/components/date_picker/super_date_picker/pretty_duration.js +2 -9
- package/lib/components/date_picker/super_date_picker/relative_utils.js +9 -0
- package/lib/components/date_picker/super_date_picker/super_date_picker.js +118 -26
- package/lib/components/date_picker/super_date_picker/time_window_buttons.js +193 -0
- package/lib/components/facet/facet_button.js +9 -19
- package/lib/components/filter_group/filter_button.js +14 -1
- package/lib/components/flyout/flyout.js +26 -9
- package/lib/components/form/file_picker/file_picker.styles.js +3 -3
- package/lib/components/form/form_control_button/form_control_button.js +13 -7
- package/lib/components/header/header_links/header_link.js +13 -7
- package/lib/components/header/header_section/header_section_item_button.js +13 -7
- package/lib/components/icon/assets/boxes_vertical.js +1 -1
- package/lib/components/icon/assets/checkInCircleFilled.js +1 -2
- package/lib/components/icon/assets/errorFilled.js +1 -2
- package/lib/components/icon/assets/paper_clip.js +1 -1
- package/lib/components/icon/assets/streams_wired.js +3 -2
- package/lib/components/icon/assets/warningFilled.js +1 -2
- package/lib/components/icon/icon_map.js +3 -6
- package/lib/components/icon/svgs/boxes_vertical.svg +1 -1
- package/lib/components/icon/svgs/checkInCircleFilled.svg +1 -1
- package/lib/components/icon/svgs/errorFilled.svg +1 -1
- package/lib/components/icon/svgs/paper_clip.svg +3 -3
- package/lib/components/icon/svgs/warningFilled.svg +1 -1
- package/lib/components/list_group/list_group.js +13 -1
- package/lib/components/list_group/list_group_item.js +13 -1
- package/lib/components/list_group/list_group_item_extra_action.js +13 -1
- package/lib/components/list_group/pinnable_list_group/pinnable_list_group.js +15 -2
- package/lib/components/overlay_mask/overlay_mask.styles.js +1 -1
- package/lib/components/pagination/pagination_button.js +13 -7
- package/lib/components/popover/popover.js +21 -15
- package/lib/components/provider/component_defaults/component_defaults.js +22 -2
- package/lib/components/table/table_row.styles.js +1 -1
- package/lib/components/tool_tip/tool_tip.js +24 -24
- package/lib/global_styling/index.js +16 -1
- package/lib/global_styling/mixins/_button.js +1 -1
- package/lib/global_styling/utility/selectors.js +15 -0
- package/lib/services/focus_trap/focus_trap_pub_sub.js +80 -0
- package/lib/services/focus_trap/index.js +12 -0
- package/lib/services/hooks/index.js +18 -1
- package/lib/services/hooks/useEuiDisabledElement.js +199 -0
- package/lib/services/index.js +8 -0
- package/lib/services/popover/reposition_on_scroll.js +67 -0
- package/lib/services/theme/high_contrast_overrides.js +5 -1
- package/lib/test/cypress/index.d.ts +12 -0
- package/lib/test/cypress/index.js +18 -0
- package/lib/test/cypress/matchers.d.ts +20 -0
- package/lib/test/cypress/matchers.js +61 -0
- package/lib/test/cypress/test_reposition_on_scroll.js +69 -0
- package/lib/test/enzyme/enzyme_matchers.d.ts +36 -0
- package/lib/test/enzyme/enzyme_matchers.js +49 -0
- package/lib/test/enzyme/index.d.ts +14 -0
- package/lib/test/enzyme/index.js +24 -0
- package/lib/test/rtl/index.d.ts +9 -1
- package/lib/test/rtl/index.js +24 -2
- package/lib/test/rtl/matchers.d.ts +36 -0
- package/lib/test/rtl/matchers.js +86 -0
- package/lib/utils/element_can_be_disabled.js +22 -0
- package/lib/utils/index.js +14 -1
- package/optimize/es/components/basic_table/collapsed_item_actions.js +3 -1
- package/optimize/es/components/basic_table/default_item_action.js +7 -4
- package/optimize/es/components/bottom_bar/bottom_bar.js +12 -2
- package/optimize/es/components/button/button_display/_button_display.js +24 -12
- package/optimize/es/components/button/button_display/_button_display.styles.js +4 -4
- package/optimize/es/components/button/button_empty/button_empty.js +18 -6
- package/optimize/es/components/button/button_group/button_group.js +10 -5
- package/optimize/es/components/button/button_group/button_group_button.js +2 -3
- package/optimize/es/components/button/button_group/button_group_button.styles.js +12 -8
- package/optimize/es/components/button/button_icon/button_icon.js +17 -5
- package/optimize/es/components/code/code_block_virtualized.js +9 -7
- package/optimize/es/components/datagrid/body/header/column_actions.js +5 -21
- package/optimize/es/components/datagrid/body/header/data_grid_header_cell.js +6 -4
- package/optimize/es/components/datagrid/body/header/data_grid_header_cell.styles.js +8 -2
- package/optimize/es/components/datagrid/body/header/data_grid_header_cell_wrapper.js +4 -2
- package/optimize/es/components/datagrid/controls/column_selector.js +36 -19
- package/optimize/es/components/datagrid/data_grid.js +5 -1
- package/optimize/es/components/datagrid/utils/in_memory.js +2 -1
- package/optimize/es/components/date_picker/super_date_picker/date_popover/absolute_tab.js +12 -4
- package/optimize/es/components/date_picker/super_date_picker/date_popover/date_popover_button.js +5 -2
- package/optimize/es/components/date_picker/super_date_picker/date_popover/date_popover_content.js +7 -3
- package/optimize/es/components/date_picker/super_date_picker/date_popover/relative_tab.js +10 -2
- package/optimize/es/components/date_picker/super_date_picker/date_popover/timezone_display.js +97 -0
- package/optimize/es/components/date_picker/super_date_picker/date_popover/timezone_display.styles.js +19 -0
- package/optimize/es/components/date_picker/super_date_picker/pretty_duration.js +1 -8
- package/optimize/es/components/date_picker/super_date_picker/relative_utils.js +8 -0
- package/optimize/es/components/date_picker/super_date_picker/super_date_picker.js +49 -25
- package/optimize/es/components/date_picker/super_date_picker/time_window_buttons.js +185 -0
- package/optimize/es/components/flyout/flyout.js +27 -10
- package/optimize/es/components/form/file_picker/file_picker.styles.js +3 -3
- package/optimize/es/components/icon/assets/boxes_vertical.js +1 -1
- package/optimize/es/components/icon/assets/checkInCircleFilled.js +1 -2
- package/optimize/es/components/icon/assets/errorFilled.js +1 -2
- package/optimize/es/components/icon/assets/paper_clip.js +1 -1
- package/optimize/es/components/icon/assets/streams_wired.js +3 -2
- package/optimize/es/components/icon/assets/warningFilled.js +1 -2
- package/optimize/es/components/icon/icon_map.js +3 -6
- package/optimize/es/components/overlay_mask/overlay_mask.styles.js +1 -1
- package/optimize/es/components/popover/popover.js +22 -16
- package/optimize/es/components/table/table_row.styles.js +1 -1
- package/optimize/es/components/tool_tip/tool_tip.js +24 -24
- package/optimize/es/global_styling/index.js +2 -1
- package/optimize/es/global_styling/mixins/_button.js +1 -1
- package/optimize/es/global_styling/utility/selectors.js +9 -0
- package/optimize/es/services/focus_trap/focus_trap_pub_sub.js +74 -0
- package/optimize/es/services/focus_trap/index.js +9 -0
- package/optimize/es/services/hooks/index.js +2 -1
- package/optimize/es/services/hooks/useEuiDisabledElement.js +192 -0
- package/optimize/es/services/index.js +1 -0
- package/optimize/es/services/popover/reposition_on_scroll.js +61 -0
- package/optimize/es/services/theme/high_contrast_overrides.js +5 -1
- package/optimize/es/test/cypress/index.d.ts +12 -0
- package/optimize/es/test/cypress/index.js +9 -0
- package/optimize/es/test/cypress/matchers.d.ts +20 -0
- package/optimize/es/test/cypress/matchers.js +54 -0
- package/optimize/es/test/cypress/test_reposition_on_scroll.js +63 -0
- package/optimize/es/test/enzyme/enzyme_matchers.d.ts +36 -0
- package/optimize/es/test/enzyme/enzyme_matchers.js +43 -0
- package/optimize/es/test/enzyme/index.d.ts +14 -0
- package/optimize/es/test/enzyme/index.js +10 -0
- package/optimize/es/test/rtl/index.d.ts +9 -1
- package/optimize/es/test/rtl/index.js +2 -1
- package/optimize/es/test/rtl/matchers.d.ts +36 -0
- package/optimize/es/test/rtl/matchers.js +82 -0
- package/optimize/es/utils/element_can_be_disabled.js +16 -0
- package/optimize/es/utils/index.js +2 -1
- package/optimize/lib/components/basic_table/collapsed_item_actions.js +3 -1
- package/optimize/lib/components/basic_table/default_item_action.js +7 -4
- package/optimize/lib/components/bottom_bar/bottom_bar.js +11 -1
- package/optimize/lib/components/button/button_display/_button_display.js +23 -11
- package/optimize/lib/components/button/button_display/_button_display.styles.js +4 -4
- package/optimize/lib/components/button/button_empty/button_empty.js +17 -5
- package/optimize/lib/components/button/button_group/button_group.js +10 -5
- package/optimize/lib/components/button/button_group/button_group_button.js +2 -3
- package/optimize/lib/components/button/button_group/button_group_button.styles.js +10 -6
- package/optimize/lib/components/button/button_icon/button_icon.js +16 -4
- package/optimize/lib/components/code/code_block_virtualized.js +9 -7
- package/optimize/lib/components/datagrid/body/header/column_actions.js +5 -21
- package/optimize/lib/components/datagrid/body/header/data_grid_header_cell.js +6 -4
- package/optimize/lib/components/datagrid/body/header/data_grid_header_cell.styles.js +8 -1
- package/optimize/lib/components/datagrid/body/header/data_grid_header_cell_wrapper.js +4 -2
- package/optimize/lib/components/datagrid/controls/column_selector.js +36 -19
- package/optimize/lib/components/datagrid/data_grid.js +5 -1
- package/optimize/lib/components/datagrid/utils/in_memory.js +2 -1
- package/optimize/lib/components/date_picker/super_date_picker/date_popover/absolute_tab.js +11 -3
- package/optimize/lib/components/date_picker/super_date_picker/date_popover/date_popover_button.js +5 -2
- package/optimize/lib/components/date_picker/super_date_picker/date_popover/date_popover_content.js +7 -3
- package/optimize/lib/components/date_picker/super_date_picker/date_popover/relative_tab.js +10 -2
- package/optimize/lib/components/date_picker/super_date_picker/date_popover/timezone_display.js +103 -0
- package/optimize/lib/components/date_picker/super_date_picker/date_popover/timezone_display.styles.js +25 -0
- package/optimize/lib/components/date_picker/super_date_picker/pretty_duration.js +2 -9
- package/optimize/lib/components/date_picker/super_date_picker/relative_utils.js +9 -0
- package/optimize/lib/components/date_picker/super_date_picker/super_date_picker.js +49 -25
- package/optimize/lib/components/date_picker/super_date_picker/time_window_buttons.js +193 -0
- package/optimize/lib/components/flyout/flyout.js +26 -9
- package/optimize/lib/components/form/file_picker/file_picker.styles.js +3 -3
- package/optimize/lib/components/icon/assets/boxes_vertical.js +1 -1
- package/optimize/lib/components/icon/assets/checkInCircleFilled.js +1 -2
- package/optimize/lib/components/icon/assets/errorFilled.js +1 -2
- package/optimize/lib/components/icon/assets/paper_clip.js +1 -1
- package/optimize/lib/components/icon/assets/streams_wired.js +3 -2
- package/optimize/lib/components/icon/assets/warningFilled.js +1 -2
- package/optimize/lib/components/icon/icon_map.js +3 -6
- package/optimize/lib/components/icon/svgs/boxes_vertical.svg +1 -1
- package/optimize/lib/components/icon/svgs/checkInCircleFilled.svg +1 -1
- package/optimize/lib/components/icon/svgs/errorFilled.svg +1 -1
- package/optimize/lib/components/icon/svgs/paper_clip.svg +3 -3
- package/optimize/lib/components/icon/svgs/warningFilled.svg +1 -1
- package/optimize/lib/components/overlay_mask/overlay_mask.styles.js +1 -1
- package/optimize/lib/components/popover/popover.js +21 -15
- package/optimize/lib/components/table/table_row.styles.js +1 -1
- package/optimize/lib/components/tool_tip/tool_tip.js +24 -24
- package/optimize/lib/global_styling/index.js +16 -1
- package/optimize/lib/global_styling/mixins/_button.js +1 -1
- package/optimize/lib/global_styling/utility/selectors.js +15 -0
- package/optimize/lib/services/focus_trap/focus_trap_pub_sub.js +80 -0
- package/optimize/lib/services/focus_trap/index.js +12 -0
- package/optimize/lib/services/hooks/index.js +18 -1
- package/optimize/lib/services/hooks/useEuiDisabledElement.js +197 -0
- package/optimize/lib/services/index.js +8 -0
- package/optimize/lib/services/popover/reposition_on_scroll.js +67 -0
- package/optimize/lib/services/theme/high_contrast_overrides.js +5 -1
- package/optimize/lib/test/cypress/index.d.ts +12 -0
- package/optimize/lib/test/cypress/index.js +18 -0
- package/optimize/lib/test/cypress/matchers.d.ts +20 -0
- package/optimize/lib/test/cypress/matchers.js +61 -0
- package/optimize/lib/test/cypress/test_reposition_on_scroll.js +70 -0
- package/optimize/lib/test/enzyme/enzyme_matchers.d.ts +36 -0
- package/optimize/lib/test/enzyme/enzyme_matchers.js +50 -0
- package/optimize/lib/test/enzyme/index.d.ts +14 -0
- package/optimize/lib/test/enzyme/index.js +24 -0
- package/optimize/lib/test/rtl/index.d.ts +9 -1
- package/optimize/lib/test/rtl/index.js +24 -2
- package/optimize/lib/test/rtl/matchers.d.ts +36 -0
- package/optimize/lib/test/rtl/matchers.js +86 -0
- package/optimize/lib/utils/element_can_be_disabled.js +22 -0
- package/optimize/lib/utils/index.js +14 -1
- package/package.json +6 -5
- package/test-env/components/accessibility/skip_link/skip_link.js +10 -1
- package/test-env/components/basic_table/collapsed_item_actions.js +3 -1
- package/test-env/components/basic_table/default_item_action.js +7 -4
- package/test-env/components/bottom_bar/bottom_bar.js +11 -1
- package/test-env/components/button/button.js +21 -26
- package/test-env/components/button/button_display/_button_display.js +31 -29
- package/test-env/components/button/button_display/_button_display.styles.js +4 -4
- package/test-env/components/button/button_empty/button_empty.js +31 -13
- package/test-env/components/button/button_group/button_group.js +49 -31
- package/test-env/components/button/button_group/button_group_button.js +16 -5
- package/test-env/components/button/button_group/button_group_button.styles.js +10 -6
- package/test-env/components/button/button_icon/button_icon.js +29 -5
- package/test-env/components/card/card.js +21 -26
- package/test-env/components/card/card_select/card_select.js +21 -26
- package/test-env/components/code/code_block_virtualized.js +9 -7
- package/test-env/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +13 -1
- package/test-env/components/datagrid/body/cell/data_grid_cell.js +35 -12
- package/test-env/components/datagrid/body/data_grid_body.js +23 -6
- package/test-env/components/datagrid/body/data_grid_body_custom.js +23 -6
- package/test-env/components/datagrid/body/data_grid_body_virtualized.js +23 -6
- package/test-env/components/datagrid/body/header/column_actions.js +5 -21
- package/test-env/components/datagrid/body/header/data_grid_header_cell.js +29 -10
- package/test-env/components/datagrid/body/header/data_grid_header_cell.styles.js +8 -1
- package/test-env/components/datagrid/body/header/data_grid_header_cell_wrapper.js +5 -2
- package/test-env/components/datagrid/controls/column_selector.js +36 -19
- package/test-env/components/datagrid/controls/column_sorting.js +23 -6
- package/test-env/components/datagrid/controls/data_grid_toolbar_control.js +13 -7
- package/test-env/components/datagrid/data_grid.js +5 -1
- package/test-env/components/datagrid/utils/in_memory.js +25 -7
- package/test-env/components/date_picker/auto_refresh/auto_refresh.js +12 -3
- package/test-env/components/date_picker/super_date_picker/date_popover/absolute_tab.js +30 -4
- package/test-env/components/date_picker/super_date_picker/date_popover/date_popover_button.js +24 -3
- package/test-env/components/date_picker/super_date_picker/date_popover/date_popover_content.js +26 -4
- package/test-env/components/date_picker/super_date_picker/date_popover/relative_tab.js +29 -3
- package/test-env/components/date_picker/super_date_picker/date_popover/timezone_display.js +103 -0
- package/test-env/components/date_picker/super_date_picker/date_popover/timezone_display.styles.js +25 -0
- package/test-env/components/date_picker/super_date_picker/pretty_duration.js +2 -9
- package/test-env/components/date_picker/super_date_picker/relative_utils.js +9 -0
- package/test-env/components/date_picker/super_date_picker/super_date_picker.js +118 -26
- package/test-env/components/date_picker/super_date_picker/time_window_buttons.js +193 -0
- package/test-env/components/facet/facet_button.js +9 -19
- package/test-env/components/filter_group/filter_button.js +14 -1
- package/test-env/components/form/file_picker/file_picker.styles.js +3 -3
- package/test-env/components/form/form_control_button/form_control_button.js +13 -7
- package/test-env/components/header/header_links/header_link.js +13 -7
- package/test-env/components/header/header_section/header_section_item_button.js +13 -7
- package/test-env/components/icon/assets/boxes_vertical.js +1 -1
- package/test-env/components/icon/assets/checkInCircleFilled.js +1 -2
- package/test-env/components/icon/assets/errorFilled.js +1 -2
- package/test-env/components/icon/assets/paper_clip.js +1 -1
- package/test-env/components/icon/assets/streams_wired.js +3 -2
- package/test-env/components/icon/assets/warningFilled.js +1 -2
- package/test-env/components/icon/icon_map.js +3 -6
- package/test-env/components/list_group/list_group.js +13 -1
- package/test-env/components/list_group/list_group_item.js +13 -1
- package/test-env/components/list_group/list_group_item_extra_action.js +13 -1
- package/test-env/components/list_group/pinnable_list_group/pinnable_list_group.js +15 -2
- package/test-env/components/overlay_mask/overlay_mask.styles.js +1 -1
- package/test-env/components/pagination/pagination_button.js +13 -7
- package/test-env/components/popover/popover.js +21 -15
- package/test-env/components/provider/component_defaults/component_defaults.js +22 -2
- package/test-env/components/table/table_row.styles.js +1 -1
- package/test-env/components/tool_tip/tool_tip.js +24 -24
- package/test-env/global_styling/index.js +16 -1
- package/test-env/global_styling/mixins/_button.js +1 -1
- package/test-env/global_styling/utility/selectors.js +15 -0
- package/test-env/services/focus_trap/focus_trap_pub_sub.js +80 -0
- package/test-env/services/focus_trap/index.js +12 -0
- package/test-env/services/hooks/index.js +18 -1
- package/test-env/services/hooks/useEuiDisabledElement.js +197 -0
- package/test-env/services/index.js +8 -0
- package/test-env/services/popover/reposition_on_scroll.js +67 -0
- package/test-env/services/theme/high_contrast_overrides.js +5 -1
- package/test-env/test/cypress/index.js +18 -0
- package/test-env/test/cypress/matchers.js +61 -0
- package/test-env/test/cypress/test_reposition_on_scroll.js +70 -0
- package/test-env/test/enzyme/enzyme_matchers.js +50 -0
- package/test-env/test/enzyme/index.js +24 -0
- package/test-env/test/rtl/index.js +24 -2
- package/test-env/test/rtl/matchers.js +86 -0
- package/test-env/utils/element_can_be_disabled.js +22 -0
- package/test-env/utils/index.js +14 -1
|
@@ -11,7 +11,7 @@ import dateMath from '@elastic/datemath';
|
|
|
11
11
|
import moment from 'moment'; // eslint-disable-line import/named
|
|
12
12
|
import { useEuiI18n } from '../../i18n';
|
|
13
13
|
import { getDateMode, DATE_MODES } from './date_modes';
|
|
14
|
-
import { parseRelativeParts } from './relative_utils';
|
|
14
|
+
import { parseRelativeParts, isRelativeToNow } from './relative_utils';
|
|
15
15
|
import { useI18nTimeOptions } from './time_options';
|
|
16
16
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
17
17
|
/**
|
|
@@ -272,13 +272,6 @@ var hasRangeMatch = function hasRangeMatch(timeFrom, timeTo, ranges) {
|
|
|
272
272
|
return timeFrom === start && timeTo === end;
|
|
273
273
|
});
|
|
274
274
|
};
|
|
275
|
-
var isRelativeToNow = function isRelativeToNow(timeFrom, timeTo) {
|
|
276
|
-
var fromDateMode = getDateMode(timeFrom);
|
|
277
|
-
var toDateMode = getDateMode(timeTo);
|
|
278
|
-
var isLast = fromDateMode === DATE_MODES.RELATIVE && toDateMode === DATE_MODES.NOW;
|
|
279
|
-
var isNext = fromDateMode === DATE_MODES.NOW && toDateMode === DATE_MODES.RELATIVE;
|
|
280
|
-
return isLast || isNext;
|
|
281
|
-
};
|
|
282
275
|
export var showPrettyDuration = function showPrettyDuration(timeFrom, timeTo, quickRanges) {
|
|
283
276
|
if (hasRangeMatch(timeFrom, timeTo, quickRanges)) {
|
|
284
277
|
return true;
|
|
@@ -13,6 +13,7 @@ import dateMath from '@elastic/datemath';
|
|
|
13
13
|
import moment from 'moment';
|
|
14
14
|
import { get } from '../../../services/objects';
|
|
15
15
|
import { isString } from '../../../services/predicate';
|
|
16
|
+
import { getDateMode, DATE_MODES } from './date_modes';
|
|
16
17
|
var ROUND_DELIMETER = '/';
|
|
17
18
|
export var relativeUnitsFromLargestToSmallest = ['y', 'M', 'w', 'd', 'h', 'm', 's'];
|
|
18
19
|
export function parseRelativeParts(value) {
|
|
@@ -62,4 +63,11 @@ export var toRelativeStringFromParts = function toRelativeStringFromParts(relati
|
|
|
62
63
|
var operator = matches && matches[2] ? matches[2] : '-';
|
|
63
64
|
var round = isRounded ? "".concat(ROUND_DELIMETER).concat(unit) : '';
|
|
64
65
|
return "now".concat(operator).concat(count).concat(unit).concat(round);
|
|
66
|
+
};
|
|
67
|
+
export var isRelativeToNow = function isRelativeToNow(timeFrom, timeTo) {
|
|
68
|
+
var fromDateMode = getDateMode(timeFrom);
|
|
69
|
+
var toDateMode = getDateMode(timeTo);
|
|
70
|
+
var isLast = fromDateMode === DATE_MODES.RELATIVE && toDateMode === DATE_MODES.NOW;
|
|
71
|
+
var isNext = fromDateMode === DATE_MODES.NOW && toDateMode === DATE_MODES.RELATIVE;
|
|
72
|
+
return isLast || isNext;
|
|
65
73
|
};
|
|
@@ -30,6 +30,7 @@ import { EuiDatePickerRange } from '../date_picker_range';
|
|
|
30
30
|
import { EuiFormControlButton, EuiFormControlLayout } from '../../form';
|
|
31
31
|
import { RenderI18nTimeOptions } from './time_options';
|
|
32
32
|
import { PrettyDuration, showPrettyDuration } from './pretty_duration';
|
|
33
|
+
import { EuiTimeWindowButtons } from './time_window_buttons';
|
|
33
34
|
import { AsyncInterval } from './async_interval';
|
|
34
35
|
import { EuiSuperUpdateButton } from './super_update_button';
|
|
35
36
|
import { EuiQuickSelectPopover } from './quick_select_popover/quick_select_popover';
|
|
@@ -268,7 +269,9 @@ export var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
|
|
|
268
269
|
maxDate = _this$props3.maxDate,
|
|
269
270
|
compressed = _this$props3.compressed,
|
|
270
271
|
onFocus = _this$props3.onFocus,
|
|
271
|
-
styles = _this$props3.memoizedStyles
|
|
272
|
+
styles = _this$props3.memoizedStyles,
|
|
273
|
+
_this$props3$timeZone = _this$props3.timeZoneDisplayProps,
|
|
274
|
+
timeZoneDisplayProps = _this$props3$timeZone === void 0 ? {} : _this$props3$timeZone;
|
|
272
275
|
var autoRefreshAppend = !isPaused ? ___EmotionJSX(EuiAutoRefreshButton, {
|
|
273
276
|
refreshInterval: refreshInterval,
|
|
274
277
|
minInterval: refreshMinInterval,
|
|
@@ -345,7 +348,8 @@ export var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
|
|
|
345
348
|
timeOptions: timeOptions,
|
|
346
349
|
buttonProps: {
|
|
347
350
|
onFocus: onFocus
|
|
348
|
-
}
|
|
351
|
+
},
|
|
352
|
+
timeZoneDisplayProps: timeZoneDisplayProps
|
|
349
353
|
}),
|
|
350
354
|
endDateControl: isQuickSelectOnly ? undefined : ___EmotionJSX(EuiDatePopoverButton, {
|
|
351
355
|
css: styles.euiSuperDatePicker__rangeInput,
|
|
@@ -370,7 +374,8 @@ export var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
|
|
|
370
374
|
timeOptions: timeOptions,
|
|
371
375
|
buttonProps: {
|
|
372
376
|
onFocus: onFocus
|
|
373
|
-
}
|
|
377
|
+
},
|
|
378
|
+
timeZoneDisplayProps: timeZoneDisplayProps
|
|
374
379
|
})
|
|
375
380
|
}));
|
|
376
381
|
});
|
|
@@ -390,13 +395,32 @@ export var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
|
|
|
390
395
|
_this.applyTime();
|
|
391
396
|
}
|
|
392
397
|
});
|
|
393
|
-
_defineProperty(_this, "
|
|
398
|
+
_defineProperty(_this, "renderTimeWindowButtons", function () {
|
|
399
|
+
if (!_this.props.showTimeWindowButtons || _this.props.isAutoRefreshOnly) {
|
|
400
|
+
return null;
|
|
401
|
+
}
|
|
394
402
|
var _this$props5 = _this.props,
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
403
|
+
start = _this$props5.start,
|
|
404
|
+
end = _this$props5.end,
|
|
405
|
+
showTimeWindowButtons = _this$props5.showTimeWindowButtons,
|
|
406
|
+
compressed = _this$props5.compressed,
|
|
407
|
+
isDisabled = _this$props5.isDisabled;
|
|
408
|
+
var config = typeof showTimeWindowButtons === 'boolean' ? {} : showTimeWindowButtons;
|
|
409
|
+
return ___EmotionJSX(EuiTimeWindowButtons, _extends({
|
|
410
|
+
applyTime: _this.applyQuickTime,
|
|
411
|
+
start: start,
|
|
412
|
+
end: end,
|
|
413
|
+
compressed: compressed,
|
|
414
|
+
isDisabled: !!isDisabled || _this.state.isInvalid
|
|
415
|
+
}, config));
|
|
416
|
+
});
|
|
417
|
+
_defineProperty(_this, "renderUpdateButton", function () {
|
|
418
|
+
var _this$props6 = _this.props,
|
|
419
|
+
isLoading = _this$props6.isLoading,
|
|
420
|
+
isDisabled = _this$props6.isDisabled,
|
|
421
|
+
updateButtonProps = _this$props6.updateButtonProps,
|
|
422
|
+
showUpdateButton = _this$props6.showUpdateButton,
|
|
423
|
+
compressed = _this$props6.compressed;
|
|
400
424
|
if (!showUpdateButton) return null;
|
|
401
425
|
return ___EmotionJSX(EuiSuperUpdateButton, _extends({
|
|
402
426
|
needsUpdate: _this.state.hasChanged,
|
|
@@ -415,21 +439,21 @@ export var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
|
|
|
415
439
|
return _createClass(EuiSuperDatePickerInternal, [{
|
|
416
440
|
key: "render",
|
|
417
441
|
value: function render() {
|
|
418
|
-
var _this$
|
|
419
|
-
isAutoRefreshOnly = _this$
|
|
420
|
-
isDisabled = _this$
|
|
421
|
-
isPaused = _this$
|
|
422
|
-
onRefreshChange = _this$
|
|
423
|
-
refreshInterval = _this$
|
|
424
|
-
refreshMinInterval = _this$
|
|
425
|
-
refreshIntervalUnits = _this$
|
|
426
|
-
showUpdateButton = _this$
|
|
427
|
-
dataTestSubj = _this$
|
|
428
|
-
_width = _this$
|
|
429
|
-
isQuickSelectOnly = _this$
|
|
430
|
-
compressed = _this$
|
|
431
|
-
className = _this$
|
|
432
|
-
styles = _this$
|
|
442
|
+
var _this$props7 = this.props,
|
|
443
|
+
isAutoRefreshOnly = _this$props7.isAutoRefreshOnly,
|
|
444
|
+
isDisabled = _this$props7.isDisabled,
|
|
445
|
+
isPaused = _this$props7.isPaused,
|
|
446
|
+
onRefreshChange = _this$props7.onRefreshChange,
|
|
447
|
+
refreshInterval = _this$props7.refreshInterval,
|
|
448
|
+
refreshMinInterval = _this$props7.refreshMinInterval,
|
|
449
|
+
refreshIntervalUnits = _this$props7.refreshIntervalUnits,
|
|
450
|
+
showUpdateButton = _this$props7.showUpdateButton,
|
|
451
|
+
dataTestSubj = _this$props7['data-test-subj'],
|
|
452
|
+
_width = _this$props7.width,
|
|
453
|
+
isQuickSelectOnly = _this$props7.isQuickSelectOnly,
|
|
454
|
+
compressed = _this$props7.compressed,
|
|
455
|
+
className = _this$props7.className,
|
|
456
|
+
styles = _this$props7.memoizedStyles;
|
|
433
457
|
var _this$state2 = this.state,
|
|
434
458
|
hasChanged = _this$state2.hasChanged,
|
|
435
459
|
isInvalid = _this$state2.isInvalid;
|
|
@@ -454,7 +478,7 @@ export var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
|
|
|
454
478
|
compressed: compressed,
|
|
455
479
|
isDisabled: !!isDisabled,
|
|
456
480
|
className: className
|
|
457
|
-
}) : ___EmotionJSX(React.Fragment, null, this.renderDatePickerRange(), this.renderUpdateButton()));
|
|
481
|
+
}) : ___EmotionJSX(React.Fragment, null, this.renderDatePickerRange(), this.renderTimeWindowButtons(), this.renderUpdateButton()));
|
|
458
482
|
}
|
|
459
483
|
}], [{
|
|
460
484
|
key: "getDerivedStateFromProps",
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
5
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
|
+
* Side Public License, v 1.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import dateMath from '@elastic/datemath';
|
|
11
|
+
import moment from 'moment';
|
|
12
|
+
import { usePrettyInterval } from './pretty_interval';
|
|
13
|
+
import { isRelativeToNow } from './relative_utils';
|
|
14
|
+
import { EuiButtonGroupButton } from '../../button/button_group/button_group_button';
|
|
15
|
+
import { euiButtonGroupButtonsStyles } from '../../button/button_group/button_group.styles';
|
|
16
|
+
import { useEuiMemoizedStyles, useGeneratedHtmlId } from '../../../services';
|
|
17
|
+
import { useEuiI18n } from '../../i18n';
|
|
18
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
19
|
+
export var ZOOM_FACTOR_DEFAULT = 0.5;
|
|
20
|
+
/**
|
|
21
|
+
* Button group with time window controls for shifting the time window
|
|
22
|
+
* forwards and backwards, and zooming out.
|
|
23
|
+
*/
|
|
24
|
+
export var EuiTimeWindowButtons = function EuiTimeWindowButtons(_ref) {
|
|
25
|
+
var applyTime = _ref.applyTime,
|
|
26
|
+
start = _ref.start,
|
|
27
|
+
end = _ref.end,
|
|
28
|
+
compressed = _ref.compressed,
|
|
29
|
+
isDisabled = _ref.isDisabled,
|
|
30
|
+
_ref$showZoomOut = _ref.showZoomOut,
|
|
31
|
+
showZoomOut = _ref$showZoomOut === void 0 ? true : _ref$showZoomOut,
|
|
32
|
+
_ref$showShiftArrows = _ref.showShiftArrows,
|
|
33
|
+
showShiftArrows = _ref$showShiftArrows === void 0 ? true : _ref$showShiftArrows,
|
|
34
|
+
_ref$zoomFactor = _ref.zoomFactor,
|
|
35
|
+
zoomFactor = _ref$zoomFactor === void 0 ? ZOOM_FACTOR_DEFAULT : _ref$zoomFactor;
|
|
36
|
+
var buttonColor = 'text';
|
|
37
|
+
var buttonSize = compressed ? 's' : 'm';
|
|
38
|
+
var iconSize = compressed ? 's' : 'm';
|
|
39
|
+
var styles = useEuiMemoizedStyles(euiButtonGroupButtonsStyles);
|
|
40
|
+
var _useEuiTimeWindow = useEuiTimeWindow(start, end, applyTime, {
|
|
41
|
+
zoomFactor: zoomFactor
|
|
42
|
+
}),
|
|
43
|
+
displayInterval = _useEuiTimeWindow.displayInterval,
|
|
44
|
+
isInvalid = _useEuiTimeWindow.isInvalid,
|
|
45
|
+
stepForward = _useEuiTimeWindow.stepForward,
|
|
46
|
+
stepBackward = _useEuiTimeWindow.stepBackward,
|
|
47
|
+
expandWindow = _useEuiTimeWindow.expandWindow;
|
|
48
|
+
var invalidShiftDescription = useEuiI18n('euiTimeWindowButtons.invalidShiftLabel', 'Cannot shift invalid time window');
|
|
49
|
+
var invalidZoomOutDescription = useEuiI18n('euiTimeWindowButtons.invalidZoomOutLabel', 'Cannot zoom out invalid time window');
|
|
50
|
+
var previousId = useGeneratedHtmlId({
|
|
51
|
+
prefix: 'previous'
|
|
52
|
+
});
|
|
53
|
+
var previousLabel = useEuiI18n('euiTimeWindowButtons.previousLabel', 'Previous');
|
|
54
|
+
var previousTooltipContent = useEuiI18n('euiTimeWindowButtons.previousDescription', 'Previous {displayInterval}', {
|
|
55
|
+
displayInterval: displayInterval
|
|
56
|
+
});
|
|
57
|
+
var zoomOutId = useGeneratedHtmlId({
|
|
58
|
+
prefix: 'zoom_out'
|
|
59
|
+
});
|
|
60
|
+
var zoomOutLabel = useEuiI18n('euiTimeWindowButtons.zoomOutLabel', 'Zoom out');
|
|
61
|
+
var zoomOutTooltipContent = isInvalid ? invalidZoomOutDescription : zoomOutLabel;
|
|
62
|
+
var nextId = useGeneratedHtmlId({
|
|
63
|
+
prefix: 'next'
|
|
64
|
+
});
|
|
65
|
+
var nextLabel = useEuiI18n('euiTimeWindowButtons.nextLabel', 'Next');
|
|
66
|
+
var nextTooltipContent = useEuiI18n('euiTimeWindowButtons.nextDescription', 'Next {displayInterval}', {
|
|
67
|
+
displayInterval: displayInterval
|
|
68
|
+
});
|
|
69
|
+
if (!showZoomOut && !showShiftArrows) return null;
|
|
70
|
+
return ___EmotionJSX("div", {
|
|
71
|
+
className: "euiSuperDatePicker__timeWindowButtons",
|
|
72
|
+
css: [styles.euiButtonGroup__buttons, styles[buttonSize], ";label:EuiTimeWindowButtons;"],
|
|
73
|
+
"data-test-subj": "timeWindowButtons"
|
|
74
|
+
}, showShiftArrows && ___EmotionJSX(EuiButtonGroupButton, {
|
|
75
|
+
id: previousId,
|
|
76
|
+
"data-test-subj": "timeWindowButtonsPrevious",
|
|
77
|
+
label: previousLabel,
|
|
78
|
+
title: "",
|
|
79
|
+
toolTipContent: !isDisabled && (isInvalid ? invalidShiftDescription : previousTooltipContent),
|
|
80
|
+
color: buttonColor,
|
|
81
|
+
size: buttonSize,
|
|
82
|
+
iconType: "arrowLeft",
|
|
83
|
+
iconSize: iconSize,
|
|
84
|
+
isIconOnly: true,
|
|
85
|
+
isSelected: false,
|
|
86
|
+
isDisabled: isDisabled,
|
|
87
|
+
onClick: stepBackward
|
|
88
|
+
}), showZoomOut && ___EmotionJSX(EuiButtonGroupButton, {
|
|
89
|
+
id: zoomOutId,
|
|
90
|
+
"data-test-subj": "timeWindowButtonsZoomOut",
|
|
91
|
+
label: zoomOutLabel,
|
|
92
|
+
title: "",
|
|
93
|
+
toolTipContent: !isDisabled && zoomOutTooltipContent,
|
|
94
|
+
toolTipProps: {
|
|
95
|
+
disableScreenReaderOutput: zoomOutLabel === zoomOutTooltipContent
|
|
96
|
+
},
|
|
97
|
+
color: buttonColor,
|
|
98
|
+
size: buttonSize,
|
|
99
|
+
iconType: "magnifyWithMinus",
|
|
100
|
+
iconSize: iconSize,
|
|
101
|
+
isIconOnly: true,
|
|
102
|
+
isSelected: false,
|
|
103
|
+
isDisabled: isDisabled,
|
|
104
|
+
onClick: expandWindow
|
|
105
|
+
}), showShiftArrows && ___EmotionJSX(EuiButtonGroupButton, {
|
|
106
|
+
id: nextId,
|
|
107
|
+
"data-test-subj": "timeWindowButtonsNext",
|
|
108
|
+
label: nextLabel,
|
|
109
|
+
title: "",
|
|
110
|
+
toolTipContent: !isDisabled && (isInvalid ? invalidShiftDescription : nextTooltipContent),
|
|
111
|
+
color: buttonColor,
|
|
112
|
+
size: buttonSize,
|
|
113
|
+
iconType: "arrowRight",
|
|
114
|
+
iconSize: iconSize,
|
|
115
|
+
isIconOnly: true,
|
|
116
|
+
isSelected: false,
|
|
117
|
+
isDisabled: isDisabled,
|
|
118
|
+
onClick: stepForward
|
|
119
|
+
}));
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Partly adapted from date_picker/super_date_picker/quick_select_popover/quick_select.tsx
|
|
124
|
+
*/
|
|
125
|
+
export function useEuiTimeWindow(start, end, apply, options) {
|
|
126
|
+
var _options$zoomFactor;
|
|
127
|
+
var min = dateMath.parse(start);
|
|
128
|
+
var max = dateMath.parse(end, {
|
|
129
|
+
roundUp: true
|
|
130
|
+
});
|
|
131
|
+
var isInvalid = !min || !min.isValid() || !max || !max.isValid();
|
|
132
|
+
var windowDuration = isInvalid ? 1 : max.diff(min);
|
|
133
|
+
var zoomFactor = getPercentageMultiplier((_options$zoomFactor = options === null || options === void 0 ? void 0 : options.zoomFactor) !== null && _options$zoomFactor !== void 0 ? _options$zoomFactor : ZOOM_FACTOR_DEFAULT);
|
|
134
|
+
var zoomAddition = windowDuration * (zoomFactor / 2); // Gets added to each end, that's why it's split in half
|
|
135
|
+
var prettyInterval = usePrettyInterval(false, windowDuration);
|
|
136
|
+
var displayInterval = isInvalid ? '' : prettyInterval;
|
|
137
|
+
if (!isInvalid && !isRelativeToNow(start, end) && !isExactMinuteRange(windowDuration)) {
|
|
138
|
+
displayInterval = "~".concat(displayInterval);
|
|
139
|
+
}
|
|
140
|
+
return {
|
|
141
|
+
displayInterval: displayInterval,
|
|
142
|
+
isInvalid: isInvalid,
|
|
143
|
+
stepForward: stepForward,
|
|
144
|
+
stepBackward: stepBackward,
|
|
145
|
+
expandWindow: expandWindow
|
|
146
|
+
};
|
|
147
|
+
function stepForward() {
|
|
148
|
+
if (isInvalid) return;
|
|
149
|
+
apply({
|
|
150
|
+
start: moment(max).toISOString(),
|
|
151
|
+
end: moment(max).add(windowDuration, 'ms').toISOString()
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
function stepBackward() {
|
|
155
|
+
if (isInvalid) return;
|
|
156
|
+
apply({
|
|
157
|
+
start: moment(min).subtract(windowDuration, 'ms').toISOString(),
|
|
158
|
+
end: moment(min).toISOString()
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
function expandWindow() {
|
|
162
|
+
if (isInvalid) return;
|
|
163
|
+
apply({
|
|
164
|
+
start: moment(min).subtract(zoomAddition, 'ms').toISOString(),
|
|
165
|
+
end: moment(max).add(zoomAddition, 'ms').toISOString()
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Get a number out of either 0.2 or "20%"
|
|
172
|
+
*/
|
|
173
|
+
function getPercentageMultiplier(value) {
|
|
174
|
+
var result = typeof value === 'number' ? value : parseFloat(String(value).replace('%', '').trim());
|
|
175
|
+
if (isNaN(result)) throw new TypeError('Please provide a valid number or percentage string e.g. "25%"');
|
|
176
|
+
return result > 1 ? result / 100 : result;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Useful to determine whether to show the tilde in the display
|
|
181
|
+
*/
|
|
182
|
+
function isExactMinuteRange(diffMs) {
|
|
183
|
+
// 60 * 1000 = ms per minute
|
|
184
|
+
return diffMs % (60 * 1000) === 0;
|
|
185
|
+
}
|
|
@@ -16,7 +16,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
16
16
|
|
|
17
17
|
import React, { useEffect, useRef, useMemo, useCallback, useState, forwardRef } from 'react';
|
|
18
18
|
import classnames from 'classnames';
|
|
19
|
-
import { keys, EuiWindowEvent, useCombinedRefs, useIsWithinMinBreakpoint, useEuiMemoizedStyles, useGeneratedHtmlId, useEuiThemeCSSVariables } from '../../services';
|
|
19
|
+
import { keys, EuiWindowEvent, useCombinedRefs, useIsWithinMinBreakpoint, useEuiMemoizedStyles, useGeneratedHtmlId, useEuiThemeCSSVariables, focusTrapPubSub } from '../../services';
|
|
20
20
|
import { logicalStyle } from '../../global_styling';
|
|
21
21
|
import { EuiFocusTrap } from '../focus_trap';
|
|
22
22
|
import { EuiOverlayMask } from '../overlay_mask';
|
|
@@ -210,20 +210,28 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
210
210
|
}
|
|
211
211
|
return selectors;
|
|
212
212
|
}, [includeSelectorInFocusTrap, includeFixedHeadersInFocusTrap]);
|
|
213
|
-
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Finds the shards to include in the focus trap by querying by `focusTrapSelectors`.
|
|
216
|
+
*
|
|
217
|
+
* @param shouldAutoFocus Whether to auto-focus the flyout wrapper when the focus trap is activated.
|
|
218
|
+
* This is necessary because when a flyout is toggled from within a shard, the focus trap's `autoFocus`
|
|
219
|
+
* feature doesn't work. This logic manually focuses the flyout as a workaround.
|
|
220
|
+
*/
|
|
221
|
+
var findShards = useCallback(function () {
|
|
222
|
+
var shouldAutoFocus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
214
223
|
if (focusTrapSelectors.length > 0) {
|
|
215
224
|
var shardsEls = focusTrapSelectors.flatMap(function (selector) {
|
|
216
225
|
return Array.from(document.querySelectorAll(selector));
|
|
217
226
|
});
|
|
218
227
|
setFocusTrapShards(Array.from(shardsEls));
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
});
|
|
228
|
+
if (shouldAutoFocus) {
|
|
229
|
+
shardsEls.forEach(function (shard) {
|
|
230
|
+
if (shard.contains(flyoutToggle.current)) {
|
|
231
|
+
resizeRef === null || resizeRef === void 0 || resizeRef.focus();
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
}
|
|
227
235
|
} else {
|
|
228
236
|
// Clear existing shards if necessary, e.g. switching to `false`
|
|
229
237
|
setFocusTrapShards(function (shards) {
|
|
@@ -231,6 +239,15 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
231
239
|
});
|
|
232
240
|
}
|
|
233
241
|
}, [focusTrapSelectors, resizeRef]);
|
|
242
|
+
useEffect(function () {
|
|
243
|
+
// Auto-focus should only happen on initial flyout mount (or when the dependencies change)
|
|
244
|
+
// because it snaps focus to the flyout wrapper, which steals it from subsequently focused elements.
|
|
245
|
+
findShards(true);
|
|
246
|
+
var unsubscribe = focusTrapPubSub.subscribe(function () {
|
|
247
|
+
return findShards();
|
|
248
|
+
});
|
|
249
|
+
return unsubscribe;
|
|
250
|
+
}, [findShards]);
|
|
234
251
|
var focusTrapProps = useMemo(function () {
|
|
235
252
|
return _objectSpread(_objectSpread({}, _focusTrapProps), {}, {
|
|
236
253
|
shards: [].concat(_toConsumableArray(focusTrapShards), _toConsumableArray((_focusTrapProps === null || _focusTrapProps === void 0 ? void 0 : _focusTrapProps.shards) || []))
|
|
@@ -43,7 +43,7 @@ export var euiFilePickerStyles = function euiFilePickerStyles(euiThemeContext) {
|
|
|
43
43
|
fontSize = _euiFontSize.fontSize,
|
|
44
44
|
lineHeight = _euiFontSize.lineHeight;
|
|
45
45
|
return {
|
|
46
|
-
euiFilePicker: /*#__PURE__*/css("--euiFormControlLeftIconsCount:1;position:relative;border-radius:", formVariables.controlBorderRadius, ";&:has(input:focus){--euiFormControlStateColor:", formVariables.borderFocused, ";}&:hover{--euiFormControlStateColor:", highContrastMode ? euiTheme.border.color :
|
|
46
|
+
euiFilePicker: /*#__PURE__*/css("--euiFormControlLeftIconsCount:1;position:relative;border-radius:", formVariables.controlBorderRadius, ";&:has(input:focus){--euiFormControlStateColor:", formVariables.borderFocused, ";}&:hover{--euiFormControlStateColor:", highContrastMode ? euiTheme.border.color : euiTheme.colors.borderInteractiveFormsHoverProminent, ";--euiFormControlStateStyle:", highContrastMode ? 'solid' : 'dashed', ";}&:focus-within{", highContrastModeStyles(euiThemeContext, {
|
|
47
47
|
forced: "\n ".concat(euiFormControlShowBackgroundLine(euiThemeContext, formVariables.borderFocused), "\n ")
|
|
48
48
|
}), ";};label:euiFilePicker;"),
|
|
49
49
|
isDroppingFile: /*#__PURE__*/css("--euiFormControlStateColor:", euiTheme.colors.borderStrongSuccess, ";--euiFormControlStateStyle:", highContrastMode === 'forced' ? 'solid' : 'dashed', ";background-color:", euiTheme.components.forms.backgroundDropping, ";;label:isDroppingFile;"),
|
|
@@ -62,8 +62,8 @@ export var euiFilePickerStyles = function euiFilePickerStyles(euiThemeContext) {
|
|
|
62
62
|
forced: "\n text-decoration: underline;\n "
|
|
63
63
|
}), ";}.euiFilePicker__icon{transform:scale(1.05);}}};label:largeInteractive;")
|
|
64
64
|
},
|
|
65
|
-
euiFilePicker__prompt: /*#__PURE__*/css("pointer-events:none;font-size:", fontSize, ";line-height:1;", euiTextTruncate(), " color:", euiTheme.colors.textParagraph, ";border:", euiTheme.border.width.thin, " var(--euiFormControlStateStyle, dashed) var(--euiFormControlStateColor, ",
|
|
66
|
-
disabled: /*#__PURE__*/css(formStyles.disabled, "
|
|
65
|
+
euiFilePicker__prompt: /*#__PURE__*/css("pointer-events:none;font-size:", fontSize, ";line-height:1;", euiTextTruncate(), " color:", euiTheme.colors.textParagraph, ";border:", euiTheme.border.width.thin, " var(--euiFormControlStateStyle, dashed) var(--euiFormControlStateColor, ", euiTheme.colors.borderBaseProminent, ");", euiCanAnimate, "{transition:border-color ", euiTheme.animation.fast, " ease-in,background-color ", euiTheme.animation.fast, " ease-in;};label:euiFilePicker__prompt;"),
|
|
66
|
+
disabled: /*#__PURE__*/css(formStyles.disabled, "--euiFormControlStateColor:transparent;;label:disabled;"),
|
|
67
67
|
// Skip the css() on the default height to avoid generating a className
|
|
68
68
|
uncompressed: formStyles.uncompressed,
|
|
69
69
|
compressed: /*#__PURE__*/css(formStyles.compressed, ";label:compressed;"),
|
|
@@ -26,7 +26,7 @@ var EuiIconBoxesVertical = function EuiIconBoxesVertical(_ref) {
|
|
|
26
26
|
}, props), title ? ___EmotionJSX("title", {
|
|
27
27
|
id: titleId
|
|
28
28
|
}, title) : null, ___EmotionJSX("path", {
|
|
29
|
-
d: "
|
|
29
|
+
d: "M6 3a2 2 0 1 1 4 0 2 2 0 0 1-4 0Zm2-1a1 1 0 1 0 0 2 1 1 0 0 0 0-2ZM6 8a2 2 0 1 1 4 0 2 2 0 0 1-4 0Zm2-1a1 1 0 1 0 0 2 1 1 0 0 0 0-2Zm0 4a2 2 0 1 0 0 4 2 2 0 0 0 0-4Zm-1 2a1 1 0 1 1 2 0 1 1 0 0 1-2 0Z"
|
|
30
30
|
}));
|
|
31
31
|
};
|
|
32
32
|
export var icon = EuiIconBoxesVertical;
|
|
@@ -26,8 +26,7 @@ var EuiIconCheckInCircleFilled = function EuiIconCheckInCircleFilled(_ref) {
|
|
|
26
26
|
}, props), title ? ___EmotionJSX("title", {
|
|
27
27
|
id: titleId
|
|
28
28
|
}, title) : null, ___EmotionJSX("path", {
|
|
29
|
-
|
|
30
|
-
d: "M8 16A8 8 0 1 1 8 0a8 8 0 0 1 0 16Zm3.65-10.857L6.91 9.8 4.35 7.286a.5.5 0 0 0-.7.714l2.909 2.857a.5.5 0 0 0 .7 0l5.091-5a.5.5 0 1 0-.7-.714Z"
|
|
29
|
+
d: "M8 1a7 7 0 1 1 0 14A7 7 0 0 1 8 1ZM7 9.293 5.354 7.646l-.708.708L7 10.707l4.354-4.353-.707-.708L7 9.293Z"
|
|
31
30
|
}));
|
|
32
31
|
};
|
|
33
32
|
export var icon = EuiIconCheckInCircleFilled;
|
|
@@ -26,8 +26,7 @@ var EuiIconErrorFilled = function EuiIconErrorFilled(_ref) {
|
|
|
26
26
|
}, props), title ? ___EmotionJSX("title", {
|
|
27
27
|
id: titleId
|
|
28
28
|
}, title) : null, ___EmotionJSX("path", {
|
|
29
|
-
|
|
30
|
-
d: "M10 1a1 1 0 0 1 .707.293l4 4A1 1 0 0 1 15 6v5a1 1 0 0 1-.293.707l-4 4A1 1 0 0 1 10 16H5a1 1 0 0 1-.707-.293l-4-4A1 1 0 0 1 0 11V6a1 1 0 0 1 .293-.707l4-4A1 1 0 0 1 5 1h5ZM4.146 5.146a.5.5 0 0 1 .708 0L7.5 7.793l2.646-2.647a.5.5 0 0 1 .708.708L8.207 8.5l2.647 2.646a.5.5 0 0 1-.708.708L7.5 9.207l-2.646 2.647a.5.5 0 0 1-.708-.708L6.793 8.5 4.146 5.854a.5.5 0 0 1 0-.708Z"
|
|
29
|
+
d: "M10.392 1.005a1 1 0 0 1 .608.288L14.707 5a1 1 0 0 1 .293.707v4.586a1 1 0 0 1-.293.707L11 14.707a1 1 0 0 1-.707.293H5.707a1 1 0 0 1-.634-.227L5 14.707 1.293 11a1 1 0 0 1-.288-.608L1 10.293V5.707A1 1 0 0 1 1.293 5L5 1.293A1 1 0 0 1 5.707 1h4.586l.099.005ZM8 7.293 5.354 4.646l-.708.708L7.293 8l-2.647 2.646.708.707L8 8.707l2.646 2.646.707-.707L8.707 8l2.646-2.646-.707-.708L8 7.293Z"
|
|
31
30
|
}));
|
|
32
31
|
};
|
|
33
32
|
export var icon = EuiIconErrorFilled;
|
|
@@ -26,7 +26,7 @@ var EuiIconPaperClip = function EuiIconPaperClip(_ref) {
|
|
|
26
26
|
}, props), title ? ___EmotionJSX("title", {
|
|
27
27
|
id: titleId
|
|
28
28
|
}, title) : null, ___EmotionJSX("path", {
|
|
29
|
-
d: "
|
|
29
|
+
d: "M7 11c0 .423.105.648.229.771.123.124.348.229.771.229.423 0 .648-.105.771-.229.124-.123.229-.348.229-.771V5h1v6c0 .577-.145 1.102-.521 1.479C9.102 12.854 8.577 13 8 13c-.577 0-1.102-.145-1.479-.521C6.145 12.101 6 11.577 6 11V4c0-.719.215-1.468.716-2.046C7.226 1.364 7.996 1 9 1c1.005 0 1.773.365 2.284.954.5.578.716 1.327.716 2.046v7c0 1.103-.345 2.11-1.043 2.845C10.255 14.583 9.242 15 8 15c-1.242 0-2.255-.417-2.957-1.155C4.345 13.11 4 12.103 4 11V4h1v7c0 .897.279 1.64.768 2.155C6.253 13.666 6.99 14 8 14c1.01 0 1.747-.334 2.232-.845.49-.515.768-1.258.768-2.155V4c0-.531-.16-1.032-.472-1.392C10.227 2.26 9.745 2 9 2s-1.227.26-1.528.608C7.16 2.968 7 3.47 7 4v7Z"
|
|
30
30
|
}));
|
|
31
31
|
};
|
|
32
32
|
export var icon = EuiIconPaperClip;
|
|
@@ -21,17 +21,18 @@ var EuiIconStreamsWired = function EuiIconStreamsWired(_ref) {
|
|
|
21
21
|
xmlns: "http://www.w3.org/2000/svg",
|
|
22
22
|
width: 16,
|
|
23
23
|
height: 16,
|
|
24
|
+
fill: "none",
|
|
24
25
|
viewBox: "0 0 16 16",
|
|
25
26
|
"aria-labelledby": titleId
|
|
26
27
|
}, props), title ? ___EmotionJSX("title", {
|
|
27
28
|
id: titleId
|
|
28
29
|
}, title) : null, ___EmotionJSX("path", {
|
|
29
30
|
fillRule: "evenodd",
|
|
30
|
-
d: "M13.5 1a1.5 1.5 0 1 1-1.413 2H11.5A1.5 1.5 0 0 0 10 4.
|
|
31
|
+
d: "M13.5 1a1.5 1.5 0 1 1-1.413 2H11.5A1.5 1.5 0 0 0 10 4.5V6a2.49 2.49 0 0 1-.504 1.5H9.5l-.048.06a2.58 2.58 0 0 1-.352.36c-.01.01-.021.017-.032.025a2.496 2.496 0 0 1-.142.108l-.043.03c-.055.036-.11.07-.168.103l-.047.024c-.057.03-.115.06-.175.085-.018.008-.036.014-.055.021A2.475 2.475 0 0 1 7.5 8.5h-.504c.315.418.504.936.504 1.5v1.5A1.5 1.5 0 0 0 9 13h3.087a1.5 1.5 0 1 1 0 1H9a2.5 2.5 0 0 1-2.5-2.5V10A1.5 1.5 0 0 0 5 8.5H3.913a1.5 1.5 0 1 1 0-1H7.5A1.5 1.5 0 0 0 9 6V4.5A2.5 2.5 0 0 1 11.5 2h.587A1.5 1.5 0 0 1 13.5 1Zm0 12a.5.5 0 1 0 0 1 .5.5 0 0 0 0-1Zm-11-5.5a.5.5 0 1 0 0 1 .5.5 0 0 0 0-1Zm11-5.5a.5.5 0 1 0 0 1 .5.5 0 0 0 0-1Z",
|
|
31
32
|
clipRule: "evenodd"
|
|
32
33
|
}), ___EmotionJSX("path", {
|
|
33
34
|
fillRule: "evenodd",
|
|
34
|
-
d: "M13.5
|
|
35
|
+
d: "M13.5 6.5a1.5 1.5 0 1 1-1.413 2H9.948c.293-.287.536-.625.714-1h1.425a1.5 1.5 0 0 1 1.413-1Zm0 1a.5.5 0 1 0 0 1 .5.5 0 0 0 0-1Z",
|
|
35
36
|
clipRule: "evenodd"
|
|
36
37
|
}));
|
|
37
38
|
};
|
|
@@ -26,8 +26,7 @@ var EuiIconWarningFilled = function EuiIconWarningFilled(_ref) {
|
|
|
26
26
|
}, props), title ? ___EmotionJSX("title", {
|
|
27
27
|
id: titleId
|
|
28
28
|
}, title) : null, ___EmotionJSX("path", {
|
|
29
|
-
|
|
30
|
-
d: "M8 1a1 1 0 0 1 .864.496l7 12A1 1 0 0 1 15 15H1a1 1 0 0 1-.864-1.504l7-12A1 1 0 0 1 8 1Zm.9 4.995-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995a.905.905 0 1 1 1.8 0ZM8 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"
|
|
29
|
+
d: "M8 1a1 1 0 0 1 .863.496l7 12A1 1 0 0 1 15 15H1a1 1 0 0 1-.864-1.504l7-12A1 1 0 0 1 8 1Zm0 10a1 1 0 1 0 0 2 1 1 0 0 0 0-2Zm-.5-6v5h1V5h-1Z"
|
|
31
30
|
}));
|
|
32
31
|
};
|
|
33
32
|
export var icon = EuiIconWarningFilled;
|
|
@@ -54,8 +54,7 @@ export var typeToPathMap = {
|
|
|
54
54
|
changePointDetection: 'change_point_detection',
|
|
55
55
|
check: 'check',
|
|
56
56
|
checkCircle: 'checkCircle',
|
|
57
|
-
checkInCircleFilled: '
|
|
58
|
-
// NOTE: To be deprecated in favor of `checkCircle`
|
|
57
|
+
checkInCircleFilled: 'checkInCircleFilled',
|
|
59
58
|
cheer: 'cheer',
|
|
60
59
|
classificationJob: 'ml_classification_job',
|
|
61
60
|
clickLeft: 'clickLeft',
|
|
@@ -160,8 +159,7 @@ export var typeToPathMap = {
|
|
|
160
159
|
eql: 'eql',
|
|
161
160
|
eraser: 'eraser',
|
|
162
161
|
error: 'error',
|
|
163
|
-
errorFilled: '
|
|
164
|
-
// NOTE: To be deprecated in favor of `error`
|
|
162
|
+
errorFilled: 'errorFilled',
|
|
165
163
|
esqlVis: 'esqlVis',
|
|
166
164
|
exit: 'exit',
|
|
167
165
|
expand: 'expand',
|
|
@@ -500,8 +498,7 @@ export var typeToPathMap = {
|
|
|
500
498
|
visualizeApp: 'app_visualize',
|
|
501
499
|
vulnerabilityManagementApp: 'app_vulnerability_management',
|
|
502
500
|
warning: 'warning',
|
|
503
|
-
warningFilled: '
|
|
504
|
-
// NOTE: To be deprecated in favor of `warning`
|
|
501
|
+
warningFilled: 'warningFilled',
|
|
505
502
|
watchesApp: 'app_watches',
|
|
506
503
|
web: 'web',
|
|
507
504
|
wordWrap: 'wordWrap',
|
|
@@ -12,7 +12,7 @@ export var euiOverlayMaskStyles = function euiOverlayMaskStyles(_ref) {
|
|
|
12
12
|
var euiTheme = _ref.euiTheme,
|
|
13
13
|
highContrastMode = _ref.highContrastMode;
|
|
14
14
|
return {
|
|
15
|
-
euiOverlayMask: /*#__PURE__*/css("position:fixed;", logicalCSS('top', 0), " ", logicalCSS('left', 0), " ", logicalCSS('right', 0), " ", logicalCSS('bottom', 0), " display:flex;align-items:center;justify-content:center;
|
|
15
|
+
euiOverlayMask: /*#__PURE__*/css("position:fixed;", logicalCSS('top', 0), " ", logicalCSS('left', 0), " ", logicalCSS('right', 0), " ", logicalCSS('bottom', 0), " display:flex;align-items:center;justify-content:center;animation:", euiAnimFadeIn, " ", euiTheme.animation.fast, " ease-in;background:", highContrastMode ? euiTheme.components.overlayMaskBackgroundHighContrast : euiTheme.components.overlayMaskBackground, ";;label:euiOverlayMask;"),
|
|
16
16
|
aboveHeader: /*#__PURE__*/css("z-index:", euiTheme.levels.mask, ";;label:aboveHeader;"),
|
|
17
17
|
belowHeader: /*#__PURE__*/css("z-index:", euiTheme.levels.maskBelowHeader, ";", logicalCSS('top', 'var(--euiFixedHeadersOffset, 0)'), ";;label:belowHeader;")
|
|
18
18
|
};
|