@elastic/eui 109.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/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 +14 -2
- 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/data_grid_header_cell.js +23 -6
- 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/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/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/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 +588 -180
- package/i18ntokens.json +1357 -1231
- package/lib/components/accessibility/skip_link/skip_link.js +10 -1
- 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 +14 -2
- 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/data_grid_header_cell.js +23 -6
- 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/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/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/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/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/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 +1 -1
- 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/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/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/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/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/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 +1 -1
- 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/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/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/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/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/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 +3 -2
- package/test-env/components/accessibility/skip_link/skip_link.js +10 -1
- 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 +14 -2
- 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/data_grid_header_cell.js +23 -6
- 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/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/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/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
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.ZOOM_FACTOR_DEFAULT = exports.EuiTimeWindowButtons = void 0;
|
|
8
|
+
exports.useEuiTimeWindow = useEuiTimeWindow;
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _datemath = _interopRequireDefault(require("@elastic/datemath"));
|
|
11
|
+
var _moment = _interopRequireDefault(require("moment"));
|
|
12
|
+
var _pretty_interval = require("./pretty_interval");
|
|
13
|
+
var _relative_utils = require("./relative_utils");
|
|
14
|
+
var _button_group_button = require("../../button/button_group/button_group_button");
|
|
15
|
+
var _button_group = require("../../button/button_group/button_group.styles");
|
|
16
|
+
var _services = require("../../../services");
|
|
17
|
+
var _i18n = require("../../i18n");
|
|
18
|
+
var _react2 = require("@emotion/react");
|
|
19
|
+
/*
|
|
20
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
21
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
22
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
23
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
24
|
+
* Side Public License, v 1.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
var ZOOM_FACTOR_DEFAULT = exports.ZOOM_FACTOR_DEFAULT = 0.5;
|
|
28
|
+
/**
|
|
29
|
+
* Button group with time window controls for shifting the time window
|
|
30
|
+
* forwards and backwards, and zooming out.
|
|
31
|
+
*/
|
|
32
|
+
var EuiTimeWindowButtons = exports.EuiTimeWindowButtons = function EuiTimeWindowButtons(_ref) {
|
|
33
|
+
var applyTime = _ref.applyTime,
|
|
34
|
+
start = _ref.start,
|
|
35
|
+
end = _ref.end,
|
|
36
|
+
compressed = _ref.compressed,
|
|
37
|
+
isDisabled = _ref.isDisabled,
|
|
38
|
+
_ref$showZoomOut = _ref.showZoomOut,
|
|
39
|
+
showZoomOut = _ref$showZoomOut === void 0 ? true : _ref$showZoomOut,
|
|
40
|
+
_ref$showShiftArrows = _ref.showShiftArrows,
|
|
41
|
+
showShiftArrows = _ref$showShiftArrows === void 0 ? true : _ref$showShiftArrows,
|
|
42
|
+
_ref$zoomFactor = _ref.zoomFactor,
|
|
43
|
+
zoomFactor = _ref$zoomFactor === void 0 ? ZOOM_FACTOR_DEFAULT : _ref$zoomFactor;
|
|
44
|
+
var buttonColor = 'text';
|
|
45
|
+
var buttonSize = compressed ? 's' : 'm';
|
|
46
|
+
var iconSize = compressed ? 's' : 'm';
|
|
47
|
+
var styles = (0, _services.useEuiMemoizedStyles)(_button_group.euiButtonGroupButtonsStyles);
|
|
48
|
+
var _useEuiTimeWindow = useEuiTimeWindow(start, end, applyTime, {
|
|
49
|
+
zoomFactor: zoomFactor
|
|
50
|
+
}),
|
|
51
|
+
displayInterval = _useEuiTimeWindow.displayInterval,
|
|
52
|
+
isInvalid = _useEuiTimeWindow.isInvalid,
|
|
53
|
+
stepForward = _useEuiTimeWindow.stepForward,
|
|
54
|
+
stepBackward = _useEuiTimeWindow.stepBackward,
|
|
55
|
+
expandWindow = _useEuiTimeWindow.expandWindow;
|
|
56
|
+
var invalidShiftDescription = (0, _i18n.useEuiI18n)('euiTimeWindowButtons.invalidShiftLabel', 'Cannot shift invalid time window');
|
|
57
|
+
var invalidZoomOutDescription = (0, _i18n.useEuiI18n)('euiTimeWindowButtons.invalidZoomOutLabel', 'Cannot zoom out invalid time window');
|
|
58
|
+
var previousId = (0, _services.useGeneratedHtmlId)({
|
|
59
|
+
prefix: 'previous'
|
|
60
|
+
});
|
|
61
|
+
var previousLabel = (0, _i18n.useEuiI18n)('euiTimeWindowButtons.previousLabel', 'Previous');
|
|
62
|
+
var previousTooltipContent = (0, _i18n.useEuiI18n)('euiTimeWindowButtons.previousDescription', 'Previous {displayInterval}', {
|
|
63
|
+
displayInterval: displayInterval
|
|
64
|
+
});
|
|
65
|
+
var zoomOutId = (0, _services.useGeneratedHtmlId)({
|
|
66
|
+
prefix: 'zoom_out'
|
|
67
|
+
});
|
|
68
|
+
var zoomOutLabel = (0, _i18n.useEuiI18n)('euiTimeWindowButtons.zoomOutLabel', 'Zoom out');
|
|
69
|
+
var zoomOutTooltipContent = isInvalid ? invalidZoomOutDescription : zoomOutLabel;
|
|
70
|
+
var nextId = (0, _services.useGeneratedHtmlId)({
|
|
71
|
+
prefix: 'next'
|
|
72
|
+
});
|
|
73
|
+
var nextLabel = (0, _i18n.useEuiI18n)('euiTimeWindowButtons.nextLabel', 'Next');
|
|
74
|
+
var nextTooltipContent = (0, _i18n.useEuiI18n)('euiTimeWindowButtons.nextDescription', 'Next {displayInterval}', {
|
|
75
|
+
displayInterval: displayInterval
|
|
76
|
+
});
|
|
77
|
+
if (!showZoomOut && !showShiftArrows) return null;
|
|
78
|
+
return (0, _react2.jsx)("div", {
|
|
79
|
+
className: "euiSuperDatePicker__timeWindowButtons",
|
|
80
|
+
css: [styles.euiButtonGroup__buttons, styles[buttonSize], ";label:EuiTimeWindowButtons;"],
|
|
81
|
+
"data-test-subj": "timeWindowButtons"
|
|
82
|
+
}, showShiftArrows && (0, _react2.jsx)(_button_group_button.EuiButtonGroupButton, {
|
|
83
|
+
id: previousId,
|
|
84
|
+
"data-test-subj": "timeWindowButtonsPrevious",
|
|
85
|
+
label: previousLabel,
|
|
86
|
+
title: "",
|
|
87
|
+
toolTipContent: !isDisabled && (isInvalid ? invalidShiftDescription : previousTooltipContent),
|
|
88
|
+
color: buttonColor,
|
|
89
|
+
size: buttonSize,
|
|
90
|
+
iconType: "arrowLeft",
|
|
91
|
+
iconSize: iconSize,
|
|
92
|
+
isIconOnly: true,
|
|
93
|
+
isSelected: false,
|
|
94
|
+
isDisabled: isDisabled,
|
|
95
|
+
onClick: stepBackward
|
|
96
|
+
}), showZoomOut && (0, _react2.jsx)(_button_group_button.EuiButtonGroupButton, {
|
|
97
|
+
id: zoomOutId,
|
|
98
|
+
"data-test-subj": "timeWindowButtonsZoomOut",
|
|
99
|
+
label: zoomOutLabel,
|
|
100
|
+
title: "",
|
|
101
|
+
toolTipContent: !isDisabled && zoomOutTooltipContent,
|
|
102
|
+
toolTipProps: {
|
|
103
|
+
disableScreenReaderOutput: zoomOutLabel === zoomOutTooltipContent
|
|
104
|
+
},
|
|
105
|
+
color: buttonColor,
|
|
106
|
+
size: buttonSize,
|
|
107
|
+
iconType: "magnifyWithMinus",
|
|
108
|
+
iconSize: iconSize,
|
|
109
|
+
isIconOnly: true,
|
|
110
|
+
isSelected: false,
|
|
111
|
+
isDisabled: isDisabled,
|
|
112
|
+
onClick: expandWindow
|
|
113
|
+
}), showShiftArrows && (0, _react2.jsx)(_button_group_button.EuiButtonGroupButton, {
|
|
114
|
+
id: nextId,
|
|
115
|
+
"data-test-subj": "timeWindowButtonsNext",
|
|
116
|
+
label: nextLabel,
|
|
117
|
+
title: "",
|
|
118
|
+
toolTipContent: !isDisabled && (isInvalid ? invalidShiftDescription : nextTooltipContent),
|
|
119
|
+
color: buttonColor,
|
|
120
|
+
size: buttonSize,
|
|
121
|
+
iconType: "arrowRight",
|
|
122
|
+
iconSize: iconSize,
|
|
123
|
+
isIconOnly: true,
|
|
124
|
+
isSelected: false,
|
|
125
|
+
isDisabled: isDisabled,
|
|
126
|
+
onClick: stepForward
|
|
127
|
+
}));
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Partly adapted from date_picker/super_date_picker/quick_select_popover/quick_select.tsx
|
|
132
|
+
*/
|
|
133
|
+
function useEuiTimeWindow(start, end, apply, options) {
|
|
134
|
+
var _options$zoomFactor;
|
|
135
|
+
var min = _datemath.default.parse(start);
|
|
136
|
+
var max = _datemath.default.parse(end, {
|
|
137
|
+
roundUp: true
|
|
138
|
+
});
|
|
139
|
+
var isInvalid = !min || !min.isValid() || !max || !max.isValid();
|
|
140
|
+
var windowDuration = isInvalid ? 1 : max.diff(min);
|
|
141
|
+
var zoomFactor = getPercentageMultiplier((_options$zoomFactor = options === null || options === void 0 ? void 0 : options.zoomFactor) !== null && _options$zoomFactor !== void 0 ? _options$zoomFactor : ZOOM_FACTOR_DEFAULT);
|
|
142
|
+
var zoomAddition = windowDuration * (zoomFactor / 2); // Gets added to each end, that's why it's split in half
|
|
143
|
+
var prettyInterval = (0, _pretty_interval.usePrettyInterval)(false, windowDuration);
|
|
144
|
+
var displayInterval = isInvalid ? '' : prettyInterval;
|
|
145
|
+
if (!isInvalid && !(0, _relative_utils.isRelativeToNow)(start, end) && !isExactMinuteRange(windowDuration)) {
|
|
146
|
+
displayInterval = "~".concat(displayInterval);
|
|
147
|
+
}
|
|
148
|
+
return {
|
|
149
|
+
displayInterval: displayInterval,
|
|
150
|
+
isInvalid: isInvalid,
|
|
151
|
+
stepForward: stepForward,
|
|
152
|
+
stepBackward: stepBackward,
|
|
153
|
+
expandWindow: expandWindow
|
|
154
|
+
};
|
|
155
|
+
function stepForward() {
|
|
156
|
+
if (isInvalid) return;
|
|
157
|
+
apply({
|
|
158
|
+
start: (0, _moment.default)(max).toISOString(),
|
|
159
|
+
end: (0, _moment.default)(max).add(windowDuration, 'ms').toISOString()
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
function stepBackward() {
|
|
163
|
+
if (isInvalid) return;
|
|
164
|
+
apply({
|
|
165
|
+
start: (0, _moment.default)(min).subtract(windowDuration, 'ms').toISOString(),
|
|
166
|
+
end: (0, _moment.default)(min).toISOString()
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
function expandWindow() {
|
|
170
|
+
if (isInvalid) return;
|
|
171
|
+
apply({
|
|
172
|
+
start: (0, _moment.default)(min).subtract(zoomAddition, 'ms').toISOString(),
|
|
173
|
+
end: (0, _moment.default)(max).add(zoomAddition, 'ms').toISOString()
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Get a number out of either 0.2 or "20%"
|
|
180
|
+
*/
|
|
181
|
+
function getPercentageMultiplier(value) {
|
|
182
|
+
var result = typeof value === 'number' ? value : parseFloat(String(value).replace('%', '').trim());
|
|
183
|
+
if (isNaN(result)) throw new TypeError('Please provide a valid number or percentage string e.g. "25%"');
|
|
184
|
+
return result > 1 ? result / 100 : result;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Useful to determine whether to show the tilde in the display
|
|
189
|
+
*/
|
|
190
|
+
function isExactMinuteRange(diffMs) {
|
|
191
|
+
// 60 * 1000 = ms per minute
|
|
192
|
+
return diffMs % (60 * 1000) === 0;
|
|
193
|
+
}
|
|
@@ -219,20 +219,28 @@ var EuiFlyout = exports.EuiFlyout = /*#__PURE__*/(0, _react.forwardRef)(function
|
|
|
219
219
|
}
|
|
220
220
|
return selectors;
|
|
221
221
|
}, [includeSelectorInFocusTrap, includeFixedHeadersInFocusTrap]);
|
|
222
|
-
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Finds the shards to include in the focus trap by querying by `focusTrapSelectors`.
|
|
225
|
+
*
|
|
226
|
+
* @param shouldAutoFocus Whether to auto-focus the flyout wrapper when the focus trap is activated.
|
|
227
|
+
* This is necessary because when a flyout is toggled from within a shard, the focus trap's `autoFocus`
|
|
228
|
+
* feature doesn't work. This logic manually focuses the flyout as a workaround.
|
|
229
|
+
*/
|
|
230
|
+
var findShards = (0, _react.useCallback)(function () {
|
|
231
|
+
var shouldAutoFocus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
223
232
|
if (focusTrapSelectors.length > 0) {
|
|
224
233
|
var shardsEls = focusTrapSelectors.flatMap(function (selector) {
|
|
225
234
|
return Array.from(document.querySelectorAll(selector));
|
|
226
235
|
});
|
|
227
236
|
setFocusTrapShards(Array.from(shardsEls));
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
});
|
|
237
|
+
if (shouldAutoFocus) {
|
|
238
|
+
shardsEls.forEach(function (shard) {
|
|
239
|
+
if (shard.contains(flyoutToggle.current)) {
|
|
240
|
+
resizeRef === null || resizeRef === void 0 || resizeRef.focus();
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
}
|
|
236
244
|
} else {
|
|
237
245
|
// Clear existing shards if necessary, e.g. switching to `false`
|
|
238
246
|
setFocusTrapShards(function (shards) {
|
|
@@ -240,6 +248,15 @@ var EuiFlyout = exports.EuiFlyout = /*#__PURE__*/(0, _react.forwardRef)(function
|
|
|
240
248
|
});
|
|
241
249
|
}
|
|
242
250
|
}, [focusTrapSelectors, resizeRef]);
|
|
251
|
+
(0, _react.useEffect)(function () {
|
|
252
|
+
// Auto-focus should only happen on initial flyout mount (or when the dependencies change)
|
|
253
|
+
// because it snaps focus to the flyout wrapper, which steals it from subsequently focused elements.
|
|
254
|
+
findShards(true);
|
|
255
|
+
var unsubscribe = _services.focusTrapPubSub.subscribe(function () {
|
|
256
|
+
return findShards();
|
|
257
|
+
});
|
|
258
|
+
return unsubscribe;
|
|
259
|
+
}, [findShards]);
|
|
243
260
|
var focusTrapProps = (0, _react.useMemo)(function () {
|
|
244
261
|
return _objectSpread(_objectSpread({}, _focusTrapProps), {}, {
|
|
245
262
|
shards: [].concat((0, _toConsumableArray2.default)(focusTrapShards), (0, _toConsumableArray2.default)((_focusTrapProps === null || _focusTrapProps === void 0 ? void 0 : _focusTrapProps.shards) || []))
|
|
@@ -34,7 +34,7 @@ var EuiIconBoxesVertical = function EuiIconBoxesVertical(_ref) {
|
|
|
34
34
|
}, props), title ? (0, _react2.jsx)("title", {
|
|
35
35
|
id: titleId
|
|
36
36
|
}, title) : null, (0, _react2.jsx)("path", {
|
|
37
|
-
d: "
|
|
37
|
+
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"
|
|
38
38
|
}));
|
|
39
39
|
};
|
|
40
40
|
var icon = exports.icon = EuiIconBoxesVertical;
|
|
@@ -34,8 +34,7 @@ var EuiIconCheckInCircleFilled = function EuiIconCheckInCircleFilled(_ref) {
|
|
|
34
34
|
}, props), title ? (0, _react2.jsx)("title", {
|
|
35
35
|
id: titleId
|
|
36
36
|
}, title) : null, (0, _react2.jsx)("path", {
|
|
37
|
-
|
|
38
|
-
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"
|
|
37
|
+
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"
|
|
39
38
|
}));
|
|
40
39
|
};
|
|
41
40
|
var icon = exports.icon = EuiIconCheckInCircleFilled;
|
|
@@ -34,8 +34,7 @@ var EuiIconErrorFilled = function EuiIconErrorFilled(_ref) {
|
|
|
34
34
|
}, props), title ? (0, _react2.jsx)("title", {
|
|
35
35
|
id: titleId
|
|
36
36
|
}, title) : null, (0, _react2.jsx)("path", {
|
|
37
|
-
|
|
38
|
-
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"
|
|
37
|
+
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"
|
|
39
38
|
}));
|
|
40
39
|
};
|
|
41
40
|
var icon = exports.icon = EuiIconErrorFilled;
|
|
@@ -34,8 +34,7 @@ var EuiIconWarningFilled = function EuiIconWarningFilled(_ref) {
|
|
|
34
34
|
}, props), title ? (0, _react2.jsx)("title", {
|
|
35
35
|
id: titleId
|
|
36
36
|
}, title) : null, (0, _react2.jsx)("path", {
|
|
37
|
-
|
|
38
|
-
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"
|
|
37
|
+
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"
|
|
39
38
|
}));
|
|
40
39
|
};
|
|
41
40
|
var icon = exports.icon = EuiIconWarningFilled;
|
|
@@ -60,8 +60,7 @@ var typeToPathMap = exports.typeToPathMap = {
|
|
|
60
60
|
changePointDetection: 'change_point_detection',
|
|
61
61
|
check: 'check',
|
|
62
62
|
checkCircle: 'checkCircle',
|
|
63
|
-
checkInCircleFilled: '
|
|
64
|
-
// NOTE: To be deprecated in favor of `checkCircle`
|
|
63
|
+
checkInCircleFilled: 'checkInCircleFilled',
|
|
65
64
|
cheer: 'cheer',
|
|
66
65
|
classificationJob: 'ml_classification_job',
|
|
67
66
|
clickLeft: 'clickLeft',
|
|
@@ -166,8 +165,7 @@ var typeToPathMap = exports.typeToPathMap = {
|
|
|
166
165
|
eql: 'eql',
|
|
167
166
|
eraser: 'eraser',
|
|
168
167
|
error: 'error',
|
|
169
|
-
errorFilled: '
|
|
170
|
-
// NOTE: To be deprecated in favor of `error`
|
|
168
|
+
errorFilled: 'errorFilled',
|
|
171
169
|
esqlVis: 'esqlVis',
|
|
172
170
|
exit: 'exit',
|
|
173
171
|
expand: 'expand',
|
|
@@ -506,8 +504,7 @@ var typeToPathMap = exports.typeToPathMap = {
|
|
|
506
504
|
visualizeApp: 'app_visualize',
|
|
507
505
|
vulnerabilityManagementApp: 'app_vulnerability_management',
|
|
508
506
|
warning: 'warning',
|
|
509
|
-
warningFilled: '
|
|
510
|
-
// NOTE: To be deprecated in favor of `warning`
|
|
507
|
+
warningFilled: 'warningFilled',
|
|
511
508
|
watchesApp: 'app_watches',
|
|
512
509
|
web: 'web',
|
|
513
510
|
wordWrap: 'wordWrap',
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
|
2
|
-
<path d="
|
|
2
|
+
<path 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"/>
|
|
3
3
|
</svg>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
|
2
|
-
<path
|
|
2
|
+
<path 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"/>
|
|
3
3
|
</svg>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
|
2
|
-
<path
|
|
2
|
+
<path 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"/>
|
|
3
3
|
</svg>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
|
2
|
-
<path
|
|
2
|
+
<path 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"/>
|
|
3
3
|
</svg>
|
|
@@ -18,7 +18,7 @@ var euiOverlayMaskStyles = exports.euiOverlayMaskStyles = function euiOverlayMas
|
|
|
18
18
|
var euiTheme = _ref.euiTheme,
|
|
19
19
|
highContrastMode = _ref.highContrastMode;
|
|
20
20
|
return {
|
|
21
|
-
euiOverlayMask: /*#__PURE__*/(0, _css.css)("position:fixed;", (0, _global_styling.logicalCSS)('top', 0), " ", (0, _global_styling.logicalCSS)('left', 0), " ", (0, _global_styling.logicalCSS)('right', 0), " ", (0, _global_styling.logicalCSS)('bottom', 0), " display:flex;align-items:center;justify-content:center;
|
|
21
|
+
euiOverlayMask: /*#__PURE__*/(0, _css.css)("position:fixed;", (0, _global_styling.logicalCSS)('top', 0), " ", (0, _global_styling.logicalCSS)('left', 0), " ", (0, _global_styling.logicalCSS)('right', 0), " ", (0, _global_styling.logicalCSS)('bottom', 0), " display:flex;align-items:center;justify-content:center;animation:", _global_styling.euiAnimFadeIn, " ", euiTheme.animation.fast, " ease-in;background:", highContrastMode ? euiTheme.components.overlayMaskBackgroundHighContrast : euiTheme.components.overlayMaskBackground, ";;label:euiOverlayMask;"),
|
|
22
22
|
aboveHeader: /*#__PURE__*/(0, _css.css)("z-index:", euiTheme.levels.mask, ";;label:aboveHeader;"),
|
|
23
23
|
belowHeader: /*#__PURE__*/(0, _css.css)("z-index:", euiTheme.levels.maskBelowHeader, ";", (0, _global_styling.logicalCSS)('top', 'var(--euiFixedHeadersOffset, 0)'), ";;label:belowHeader;")
|
|
24
24
|
};
|
|
@@ -29,11 +29,13 @@ var _accessibility = require("../accessibility");
|
|
|
29
29
|
var _portal = require("../portal");
|
|
30
30
|
var _mutation_observer = require("../observer/mutation_observer");
|
|
31
31
|
var _popover = require("../../services/popover");
|
|
32
|
+
var _reposition_on_scroll = require("../../services/popover/reposition_on_scroll");
|
|
32
33
|
var _i18n = require("../i18n");
|
|
33
34
|
var _outside_click_detector = require("../outside_click_detector");
|
|
34
35
|
var _popover_arrow = require("./popover_arrow");
|
|
35
36
|
var _popover2 = require("./popover.styles");
|
|
36
37
|
var _popover_panel = require("./popover_panel");
|
|
38
|
+
var _component_defaults = require("../provider/component_defaults");
|
|
37
39
|
var _react2 = require("@emotion/react");
|
|
38
40
|
var _excluded = ["anchorPosition", "button", "insert", "isOpen", "ownFocus", "children", "className", "closePopover", "panelClassName", "panelPaddingSize", "panelProps", "panelRef", "panelStyle", "popoverScreenReaderText", "popoverRef", "hasArrow", "arrowChildren", "repositionOnScroll", "repositionToCrossAxis", "zIndex", "attachToAnchor", "display", "offset", "onPositionChange", "buffer", "aria-label", "aria-labelledby", "aria-live", "container", "focusTrapProps", "initialFocus", "tabIndex"];
|
|
39
41
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
@@ -97,7 +99,8 @@ var EuiPopover = exports.EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
97
99
|
var _this;
|
|
98
100
|
(0, _classCallCheck2.default)(this, EuiPopover);
|
|
99
101
|
_this = _callSuper(this, EuiPopover, [props]);
|
|
100
|
-
(0, _defineProperty2.default)(_this, "
|
|
102
|
+
(0, _defineProperty2.default)(_this, "repositionOnScroll", void 0);
|
|
103
|
+
(0, _defineProperty2.default)(_this, "repositionTimeout", void 0);
|
|
101
104
|
(0, _defineProperty2.default)(_this, "strandedFocusTimeout", void 0);
|
|
102
105
|
(0, _defineProperty2.default)(_this, "closingTransitionTimeout", void 0);
|
|
103
106
|
(0, _defineProperty2.default)(_this, "closingTransitionAnimationFrame", void 0);
|
|
@@ -176,12 +179,13 @@ var EuiPopover = exports.EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
176
179
|
}),
|
|
177
180
|
durationMatch = _Array$prototype$slic.durationMatch,
|
|
178
181
|
delayMatch = _Array$prototype$slic.delayMatch;
|
|
179
|
-
clearTimeout(_this.
|
|
180
|
-
_this.
|
|
182
|
+
clearTimeout(_this.repositionTimeout);
|
|
183
|
+
_this.repositionTimeout = window.setTimeout(function () {
|
|
181
184
|
_this.setState({
|
|
182
185
|
isOpenStable: true
|
|
183
186
|
}, function () {
|
|
184
187
|
_this.positionPopoverFixed();
|
|
188
|
+
_services.focusTrapPubSub.publish();
|
|
185
189
|
});
|
|
186
190
|
}, durationMatch + delayMatch);
|
|
187
191
|
});
|
|
@@ -291,6 +295,13 @@ var EuiPopover = exports.EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
291
295
|
// once a stable position has been found, keep the contents on that side
|
|
292
296
|
isOpenStable: false // wait for any initial opening transitions to finish before marking as stable
|
|
293
297
|
};
|
|
298
|
+
_this.repositionOnScroll = (0, _reposition_on_scroll.createRepositionOnScroll)(function () {
|
|
299
|
+
return {
|
|
300
|
+
repositionOnScroll: _this.props.repositionOnScroll,
|
|
301
|
+
componentDefaults: _this.context.EuiPopover,
|
|
302
|
+
repositionFn: _this.positionPopoverFixed
|
|
303
|
+
};
|
|
304
|
+
});
|
|
294
305
|
return _this;
|
|
295
306
|
}
|
|
296
307
|
(0, _inherits2.default)(EuiPopover, _Component);
|
|
@@ -308,9 +319,7 @@ var EuiPopover = exports.EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
308
319
|
_this2.onOpenPopover();
|
|
309
320
|
});
|
|
310
321
|
}
|
|
311
|
-
|
|
312
|
-
window.addEventListener('scroll', this.positionPopoverFixed, true);
|
|
313
|
-
}
|
|
322
|
+
this.repositionOnScroll.subscribe();
|
|
314
323
|
}
|
|
315
324
|
}, {
|
|
316
325
|
key: "componentDidUpdate",
|
|
@@ -327,13 +336,7 @@ var EuiPopover = exports.EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
327
336
|
}
|
|
328
337
|
|
|
329
338
|
// update scroll listener
|
|
330
|
-
|
|
331
|
-
if (this.props.repositionOnScroll) {
|
|
332
|
-
window.addEventListener('scroll', this.positionPopoverFixed, true);
|
|
333
|
-
} else {
|
|
334
|
-
window.removeEventListener('scroll', this.positionPopoverFixed, true);
|
|
335
|
-
}
|
|
336
|
-
}
|
|
339
|
+
this.repositionOnScroll.update();
|
|
337
340
|
|
|
338
341
|
// The popover is being closed.
|
|
339
342
|
if (prevProps.isOpen && !this.props.isOpen) {
|
|
@@ -343,17 +346,19 @@ var EuiPopover = exports.EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
343
346
|
_this3.setState({
|
|
344
347
|
isClosing: false
|
|
345
348
|
});
|
|
349
|
+
_services.focusTrapPubSub.publish();
|
|
346
350
|
}, closingTransitionTime);
|
|
347
351
|
}
|
|
348
352
|
}
|
|
349
353
|
}, {
|
|
350
354
|
key: "componentWillUnmount",
|
|
351
355
|
value: function componentWillUnmount() {
|
|
352
|
-
|
|
353
|
-
clearTimeout(this.
|
|
356
|
+
this.repositionOnScroll.cleanup();
|
|
357
|
+
clearTimeout(this.repositionTimeout);
|
|
354
358
|
clearTimeout(this.strandedFocusTimeout);
|
|
355
359
|
clearTimeout(this.closingTransitionTimeout);
|
|
356
360
|
cancelAnimationFrame(this.closingTransitionAnimationFrame);
|
|
361
|
+
_services.focusTrapPubSub.publish();
|
|
357
362
|
}
|
|
358
363
|
}, {
|
|
359
364
|
key: "render",
|
|
@@ -526,6 +531,7 @@ var EuiPopover = exports.EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
526
531
|
}
|
|
527
532
|
}]);
|
|
528
533
|
}(_react.Component);
|
|
534
|
+
(0, _defineProperty2.default)(EuiPopover, "contextType", _component_defaults.EuiComponentDefaultsContext);
|
|
529
535
|
(0, _defineProperty2.default)(EuiPopover, "defaultProps", {
|
|
530
536
|
isOpen: false,
|
|
531
537
|
ownFocus: true,
|
|
@@ -62,7 +62,7 @@ var euiTableRowStyles = exports.euiTableRowStyles = function euiTableRowStyles(e
|
|
|
62
62
|
// preceding table row via negative margins
|
|
63
63
|
'margin-top', (0, _global_styling.mathWithUnits)([cellContentPadding, euiTheme.border.width.thin], function (x, y) {
|
|
64
64
|
return (x + y * 2) * -1;
|
|
65
|
-
})), (0, _global_styling.logicalCSS)('padding-left', cellContentPadding), " ", (0, _global_styling.logicalCSS)('border-top', euiTheme.border.thin), " ", (0, _global_styling.logicalCSS)('border-top-left-radius', 0), " ", (0, _global_styling.logicalCSS)('border-top-right-radius', 0), " &:after{", (0, _global_styling.logicalCSS)('border-top', 'none'), ";}clip-path:polygon(-50% 0, 150% 0, 150%
|
|
65
|
+
})), (0, _global_styling.logicalCSS)('padding-left', cellContentPadding), " ", (0, _global_styling.logicalCSS)('border-top', euiTheme.border.thin), " ", (0, _global_styling.logicalCSS)('border-top-left-radius', 0), " ", (0, _global_styling.logicalCSS)('border-top-right-radius', 0), " &:after{", (0, _global_styling.logicalCSS)('border-top', 'none'), ";}clip-path:polygon(-50% 0, 150% 0, 150% 150%, -50% 150%);>.euiTableRowCell{", (0, _global_styling.logicalCSS)('width', '100%'), ";}", expandedAnimationCss, ";;label:expanded;")
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
68
|
};
|
|
@@ -17,9 +17,11 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
17
17
|
var _react = _interopRequireWildcard(require("react"));
|
|
18
18
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
19
19
|
var _services = require("../../services");
|
|
20
|
+
var _reposition_on_scroll = require("../../services/popover/reposition_on_scroll");
|
|
20
21
|
var _react2 = require("../../services/react");
|
|
21
22
|
var _resize_observer = require("../observer/resize_observer");
|
|
22
23
|
var _portal = require("../portal");
|
|
24
|
+
var _component_defaults = require("../provider/component_defaults");
|
|
23
25
|
var _tool_tip_popover = require("./tool_tip_popover");
|
|
24
26
|
var _tool_tip_anchor = require("./tool_tip_anchor");
|
|
25
27
|
var _tool_tip_arrow = require("./tool_tip_arrow");
|
|
@@ -56,25 +58,15 @@ var DEFAULT_TOOLTIP_STYLES = {
|
|
|
56
58
|
visibility: 'hidden'
|
|
57
59
|
};
|
|
58
60
|
var EuiToolTip = exports.EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
59
|
-
function EuiToolTip() {
|
|
61
|
+
function EuiToolTip(props) {
|
|
60
62
|
var _this;
|
|
61
63
|
(0, _classCallCheck2.default)(this, EuiToolTip);
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
_this = _callSuper(this, EuiToolTip, [].concat(args));
|
|
64
|
+
_this = _callSuper(this, EuiToolTip, [props]);
|
|
65
|
+
(0, _defineProperty2.default)(_this, "repositionOnScroll", void 0);
|
|
66
66
|
(0, _defineProperty2.default)(_this, "_isMounted", false);
|
|
67
67
|
(0, _defineProperty2.default)(_this, "anchor", null);
|
|
68
68
|
(0, _defineProperty2.default)(_this, "popover", null);
|
|
69
69
|
(0, _defineProperty2.default)(_this, "timeoutId", void 0);
|
|
70
|
-
(0, _defineProperty2.default)(_this, "state", {
|
|
71
|
-
visible: false,
|
|
72
|
-
hasFocus: false,
|
|
73
|
-
calculatedPosition: _this.props.position,
|
|
74
|
-
toolTipStyles: DEFAULT_TOOLTIP_STYLES,
|
|
75
|
-
arrowStyles: undefined,
|
|
76
|
-
id: _this.props.id || (0, _services.htmlIdGenerator)()()
|
|
77
|
-
});
|
|
78
70
|
(0, _defineProperty2.default)(_this, "clearAnimationTimeout", function () {
|
|
79
71
|
if (_this.timeoutId) {
|
|
80
72
|
_this.timeoutId = clearTimeout(_this.timeoutId);
|
|
@@ -203,6 +195,21 @@ var EuiToolTip = exports.EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
203
195
|
_this.props.onMouseOut(event);
|
|
204
196
|
}
|
|
205
197
|
});
|
|
198
|
+
_this.state = {
|
|
199
|
+
visible: false,
|
|
200
|
+
hasFocus: false,
|
|
201
|
+
calculatedPosition: _this.props.position,
|
|
202
|
+
toolTipStyles: DEFAULT_TOOLTIP_STYLES,
|
|
203
|
+
arrowStyles: undefined,
|
|
204
|
+
id: _this.props.id || (0, _services.htmlIdGenerator)()()
|
|
205
|
+
};
|
|
206
|
+
_this.repositionOnScroll = (0, _reposition_on_scroll.createRepositionOnScroll)(function () {
|
|
207
|
+
return {
|
|
208
|
+
repositionOnScroll: _this.props.repositionOnScroll,
|
|
209
|
+
componentDefaults: _this.context.EuiToolTip,
|
|
210
|
+
repositionFn: _this.positionToolTip
|
|
211
|
+
};
|
|
212
|
+
});
|
|
206
213
|
return _this;
|
|
207
214
|
}
|
|
208
215
|
(0, _inherits2.default)(EuiToolTip, _Component);
|
|
@@ -210,16 +217,14 @@ var EuiToolTip = exports.EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
210
217
|
key: "componentDidMount",
|
|
211
218
|
value: function componentDidMount() {
|
|
212
219
|
this._isMounted = true;
|
|
213
|
-
|
|
214
|
-
window.addEventListener('scroll', this.positionToolTip, true);
|
|
215
|
-
}
|
|
220
|
+
this.repositionOnScroll.subscribe();
|
|
216
221
|
}
|
|
217
222
|
}, {
|
|
218
223
|
key: "componentWillUnmount",
|
|
219
224
|
value: function componentWillUnmount() {
|
|
220
225
|
this.clearAnimationTimeout();
|
|
221
226
|
this._isMounted = false;
|
|
222
|
-
|
|
227
|
+
this.repositionOnScroll.cleanup();
|
|
223
228
|
}
|
|
224
229
|
}, {
|
|
225
230
|
key: "componentDidUpdate",
|
|
@@ -229,13 +234,7 @@ var EuiToolTip = exports.EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
229
234
|
}
|
|
230
235
|
|
|
231
236
|
// update scroll listener
|
|
232
|
-
|
|
233
|
-
if (this.props.repositionOnScroll) {
|
|
234
|
-
window.addEventListener('scroll', this.positionToolTip, true);
|
|
235
|
-
} else {
|
|
236
|
-
window.removeEventListener('scroll', this.positionToolTip, true);
|
|
237
|
-
}
|
|
238
|
-
}
|
|
237
|
+
this.repositionOnScroll.update();
|
|
239
238
|
}
|
|
240
239
|
}, {
|
|
241
240
|
key: "render",
|
|
@@ -297,6 +296,7 @@ var EuiToolTip = exports.EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
297
296
|
}
|
|
298
297
|
}]);
|
|
299
298
|
}(_react.Component);
|
|
299
|
+
(0, _defineProperty2.default)(EuiToolTip, "contextType", _component_defaults.EuiComponentDefaultsContext);
|
|
300
300
|
(0, _defineProperty2.default)(EuiToolTip, "defaultProps", {
|
|
301
301
|
position: 'top',
|
|
302
302
|
delay: 'regular',
|
|
@@ -3,9 +3,19 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
euiDisabledSelector: true
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "euiDisabledSelector", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function get() {
|
|
12
|
+
return _selectors.euiDisabledSelector;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
6
15
|
var _global_styles = require("./reset/global_styles");
|
|
7
16
|
Object.keys(_global_styles).forEach(function (key) {
|
|
8
17
|
if (key === "default" || key === "__esModule") return;
|
|
18
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
9
19
|
if (key in exports && exports[key] === _global_styles[key]) return;
|
|
10
20
|
Object.defineProperty(exports, key, {
|
|
11
21
|
enumerable: true,
|
|
@@ -17,6 +27,7 @@ Object.keys(_global_styles).forEach(function (key) {
|
|
|
17
27
|
var _functions = require("./functions");
|
|
18
28
|
Object.keys(_functions).forEach(function (key) {
|
|
19
29
|
if (key === "default" || key === "__esModule") return;
|
|
30
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
20
31
|
if (key in exports && exports[key] === _functions[key]) return;
|
|
21
32
|
Object.defineProperty(exports, key, {
|
|
22
33
|
enumerable: true,
|
|
@@ -28,6 +39,7 @@ Object.keys(_functions).forEach(function (key) {
|
|
|
28
39
|
var _variables = require("./variables");
|
|
29
40
|
Object.keys(_variables).forEach(function (key) {
|
|
30
41
|
if (key === "default" || key === "__esModule") return;
|
|
42
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
31
43
|
if (key in exports && exports[key] === _variables[key]) return;
|
|
32
44
|
Object.defineProperty(exports, key, {
|
|
33
45
|
enumerable: true,
|
|
@@ -39,6 +51,7 @@ Object.keys(_variables).forEach(function (key) {
|
|
|
39
51
|
var _mixins = require("./mixins");
|
|
40
52
|
Object.keys(_mixins).forEach(function (key) {
|
|
41
53
|
if (key === "default" || key === "__esModule") return;
|
|
54
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
42
55
|
if (key in exports && exports[key] === _mixins[key]) return;
|
|
43
56
|
Object.defineProperty(exports, key, {
|
|
44
57
|
enumerable: true,
|
|
@@ -50,6 +63,7 @@ Object.keys(_mixins).forEach(function (key) {
|
|
|
50
63
|
var _animations = require("./utility/animations");
|
|
51
64
|
Object.keys(_animations).forEach(function (key) {
|
|
52
65
|
if (key === "default" || key === "__esModule") return;
|
|
66
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
53
67
|
if (key in exports && exports[key] === _animations[key]) return;
|
|
54
68
|
Object.defineProperty(exports, key, {
|
|
55
69
|
enumerable: true,
|
|
@@ -57,4 +71,5 @@ Object.keys(_animations).forEach(function (key) {
|
|
|
57
71
|
return _animations[key];
|
|
58
72
|
}
|
|
59
73
|
});
|
|
60
|
-
});
|
|
74
|
+
});
|
|
75
|
+
var _selectors = require("./utility/selectors");
|