@elastic/eui 115.0.0 → 116.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (275) hide show
  1. package/es/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +14 -11
  2. package/es/components/color_picker/color_palette_picker/color_palette_picker.js +0 -1
  3. package/es/components/combo_box/combo_box.a11y.js +5 -5
  4. package/es/components/combo_box/combo_box.js +61 -53
  5. package/es/components/combo_box/combo_box_options_list/combo_box_options_list.js +147 -84
  6. package/es/components/combo_box/combo_box_options_list/combo_box_options_list.styles.js +8 -7
  7. package/es/components/context_menu/context_menu.js +19 -21
  8. package/es/components/context_menu/context_menu.styles.js +5 -2
  9. package/es/components/context_menu/context_menu_item.js +69 -58
  10. package/es/components/context_menu/context_menu_item.styles.js +14 -28
  11. package/es/components/context_menu/context_menu_panel.js +37 -21
  12. package/es/components/context_menu/context_menu_panel.styles.js +7 -2
  13. package/es/components/context_menu/context_menu_panel_title.js +124 -0
  14. package/es/components/context_menu/context_menu_panel_title.styles.js +20 -0
  15. package/es/components/context_menu/index.js +2 -1
  16. package/es/components/datagrid/body/cell/data_grid_cell.js +35 -29
  17. package/es/components/datagrid/body/data_grid_body.js +23 -17
  18. package/es/components/datagrid/body/data_grid_body_custom.js +23 -17
  19. package/es/components/datagrid/body/data_grid_body_virtualized.js +23 -17
  20. package/es/components/datagrid/body/header/column_actions.js +1 -2
  21. package/es/components/datagrid/body/header/data_grid_header_cell.js +23 -17
  22. package/es/components/datagrid/controls/column_sorting.js +23 -17
  23. package/es/components/datagrid/utils/in_memory.js +23 -17
  24. package/es/components/filter_group/filter_group.a11y.js +8 -2
  25. package/es/components/flyout/flyout_menu.js +1 -4
  26. package/es/components/form/checkbox/checkbox.js +6 -6
  27. package/es/components/form/checkbox/checkbox.styles.js +1 -22
  28. package/es/components/form/checkbox/checkbox_control.js +78 -0
  29. package/es/components/form/checkbox/checkbox_control.styles.js +40 -0
  30. package/es/components/form/checkbox/index.js +1 -0
  31. package/es/components/form/form.styles.js +2 -1
  32. package/es/components/form/radio/radio.styles.js +1 -1
  33. package/es/components/form/super_select/super_select.js +118 -99
  34. package/es/components/form/super_select/super_select.styles.js +4 -8
  35. package/es/components/form/super_select/super_select_item.js +10 -18
  36. package/es/components/link/external_link_icon.js +4 -2
  37. package/es/components/list_group/list_group.js +20 -34
  38. package/es/components/list_group/list_group.styles.js +2 -16
  39. package/es/components/list_group/list_group_item.js +75 -86
  40. package/es/components/list_group/list_group_item.styles.js +17 -61
  41. package/es/components/list_group/list_group_item_extra_action.styles.js +6 -6
  42. package/es/components/list_group/pinnable_list_group/pinnable_list_group.js +16 -28
  43. package/es/components/list_item_layout/_list_item_layout.js +692 -0
  44. package/es/components/list_item_layout/_list_item_layout.styles.js +93 -0
  45. package/es/components/list_item_layout/index.js +9 -0
  46. package/es/components/search_bar/filters/field_value_selection_filter.js +2 -1
  47. package/es/components/selectable/selectable.js +1 -0
  48. package/es/components/selectable/selectable_list/selectable_list.js +52 -36
  49. package/es/components/selectable/selectable_list/selectable_list.styles.js +19 -4
  50. package/es/components/selectable/selectable_list/selectable_list_item.js +45 -152
  51. package/es/components/selectable/selectable_list/utils/get_list_item_size.js +17 -0
  52. package/es/components/selectable/selectable_search/selectable_search.js +4 -1
  53. package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
  54. package/es/components/selectable/selectable_templates/selectable_template_sitewide.styles.js +2 -12
  55. package/es/components/selectable/selectable_templates/selectable_template_sitewide_option.js +1 -1
  56. package/es/components/selectable/selectable_templates/selectable_template_sitewide_popover.js +1 -1
  57. package/es/global_styling/mixins/_helpers.js +32 -11
  58. package/eui.d.ts +10397 -8051
  59. package/i18ntokens.json +2607 -2589
  60. package/lib/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +14 -11
  61. package/lib/components/color_picker/color_palette_picker/color_palette_picker.js +0 -1
  62. package/lib/components/combo_box/combo_box.a11y.js +5 -5
  63. package/lib/components/combo_box/combo_box.js +61 -53
  64. package/lib/components/combo_box/combo_box_options_list/combo_box_options_list.js +145 -82
  65. package/lib/components/combo_box/combo_box_options_list/combo_box_options_list.styles.js +7 -6
  66. package/lib/components/context_menu/context_menu.js +20 -22
  67. package/lib/components/context_menu/context_menu.styles.js +4 -1
  68. package/lib/components/context_menu/context_menu_item.js +70 -59
  69. package/lib/components/context_menu/context_menu_item.styles.js +13 -27
  70. package/lib/components/context_menu/context_menu_panel.js +37 -21
  71. package/lib/components/context_menu/context_menu_panel.styles.js +7 -2
  72. package/lib/components/context_menu/context_menu_panel_title.js +130 -0
  73. package/lib/components/context_menu/context_menu_panel_title.styles.js +26 -0
  74. package/lib/components/context_menu/index.js +8 -1
  75. package/lib/components/datagrid/body/cell/data_grid_cell.js +35 -29
  76. package/lib/components/datagrid/body/data_grid_body.js +23 -17
  77. package/lib/components/datagrid/body/data_grid_body_custom.js +23 -17
  78. package/lib/components/datagrid/body/data_grid_body_virtualized.js +23 -17
  79. package/lib/components/datagrid/body/header/column_actions.js +1 -2
  80. package/lib/components/datagrid/body/header/data_grid_header_cell.js +23 -17
  81. package/lib/components/datagrid/controls/column_sorting.js +23 -17
  82. package/lib/components/datagrid/utils/in_memory.js +23 -17
  83. package/lib/components/filter_group/filter_group.a11y.js +8 -2
  84. package/lib/components/flyout/flyout_menu.js +1 -4
  85. package/lib/components/form/checkbox/checkbox.js +6 -6
  86. package/lib/components/form/checkbox/checkbox.styles.js +1 -22
  87. package/lib/components/form/checkbox/checkbox_control.js +84 -0
  88. package/lib/components/form/checkbox/checkbox_control.styles.js +44 -0
  89. package/lib/components/form/checkbox/index.js +7 -0
  90. package/lib/components/form/form.styles.js +2 -1
  91. package/lib/components/form/radio/radio.styles.js +1 -1
  92. package/lib/components/form/super_select/super_select.js +116 -97
  93. package/lib/components/form/super_select/super_select.styles.js +4 -8
  94. package/lib/components/form/super_select/super_select_item.js +13 -18
  95. package/lib/components/link/external_link_icon.js +4 -2
  96. package/lib/components/list_group/list_group.js +21 -35
  97. package/lib/components/list_group/list_group.styles.js +2 -16
  98. package/lib/components/list_group/list_group_item.js +75 -86
  99. package/lib/components/list_group/list_group_item.styles.js +17 -61
  100. package/lib/components/list_group/list_group_item_extra_action.styles.js +5 -5
  101. package/lib/components/list_group/pinnable_list_group/pinnable_list_group.js +16 -28
  102. package/lib/components/list_item_layout/_list_item_layout.js +699 -0
  103. package/lib/components/list_item_layout/_list_item_layout.styles.js +97 -0
  104. package/lib/components/list_item_layout/index.js +12 -0
  105. package/lib/components/search_bar/filters/field_value_selection_filter.js +2 -1
  106. package/lib/components/selectable/selectable.js +1 -0
  107. package/lib/components/selectable/selectable_list/selectable_list.js +50 -34
  108. package/lib/components/selectable/selectable_list/selectable_list.styles.js +20 -5
  109. package/lib/components/selectable/selectable_list/selectable_list_item.js +44 -152
  110. package/lib/components/selectable/selectable_list/utils/get_list_item_size.js +23 -0
  111. package/lib/components/selectable/selectable_search/selectable_search.js +4 -1
  112. package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
  113. package/lib/components/selectable/selectable_templates/selectable_template_sitewide.styles.js +2 -12
  114. package/lib/components/selectable/selectable_templates/selectable_template_sitewide_option.js +1 -1
  115. package/lib/components/selectable/selectable_templates/selectable_template_sitewide_popover.js +1 -1
  116. package/lib/global_styling/mixins/_helpers.js +33 -12
  117. package/optimize/es/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +1 -4
  118. package/optimize/es/components/color_picker/color_palette_picker/color_palette_picker.js +0 -1
  119. package/optimize/es/components/combo_box/combo_box.a11y.js +5 -5
  120. package/optimize/es/components/combo_box/combo_box.js +60 -52
  121. package/optimize/es/components/combo_box/combo_box_options_list/combo_box_options_list.js +145 -83
  122. package/optimize/es/components/combo_box/combo_box_options_list/combo_box_options_list.styles.js +8 -7
  123. package/optimize/es/components/context_menu/context_menu.js +18 -13
  124. package/optimize/es/components/context_menu/context_menu.styles.js +5 -2
  125. package/optimize/es/components/context_menu/context_menu_item.js +55 -53
  126. package/optimize/es/components/context_menu/context_menu_item.styles.js +14 -28
  127. package/optimize/es/components/context_menu/context_menu_panel.js +36 -17
  128. package/optimize/es/components/context_menu/context_menu_panel.styles.js +7 -2
  129. package/optimize/es/components/context_menu/context_menu_panel_title.js +53 -0
  130. package/optimize/es/components/context_menu/context_menu_panel_title.styles.js +20 -0
  131. package/optimize/es/components/context_menu/index.js +2 -1
  132. package/optimize/es/components/datagrid/body/header/column_actions.js +1 -2
  133. package/optimize/es/components/filter_group/filter_group.a11y.js +8 -2
  134. package/optimize/es/components/flyout/flyout_menu.js +1 -4
  135. package/optimize/es/components/form/checkbox/checkbox.js +6 -6
  136. package/optimize/es/components/form/checkbox/checkbox.styles.js +1 -22
  137. package/optimize/es/components/form/checkbox/checkbox_control.js +48 -0
  138. package/optimize/es/components/form/checkbox/checkbox_control.styles.js +40 -0
  139. package/optimize/es/components/form/checkbox/index.js +1 -0
  140. package/optimize/es/components/form/form.styles.js +2 -1
  141. package/optimize/es/components/form/radio/radio.styles.js +1 -1
  142. package/optimize/es/components/form/super_select/super_select.js +118 -90
  143. package/optimize/es/components/form/super_select/super_select.styles.js +4 -8
  144. package/optimize/es/components/form/super_select/super_select_item.js +10 -14
  145. package/optimize/es/components/link/external_link_icon.js +4 -2
  146. package/optimize/es/components/list_group/list_group.js +7 -14
  147. package/optimize/es/components/list_group/list_group.styles.js +2 -16
  148. package/optimize/es/components/list_group/list_group_item.js +62 -79
  149. package/optimize/es/components/list_group/list_group_item.styles.js +17 -61
  150. package/optimize/es/components/list_group/list_group_item_extra_action.styles.js +6 -6
  151. package/optimize/es/components/list_item_layout/_list_item_layout.js +353 -0
  152. package/optimize/es/components/list_item_layout/_list_item_layout.styles.js +93 -0
  153. package/optimize/es/components/list_item_layout/index.js +9 -0
  154. package/optimize/es/components/search_bar/filters/field_value_selection_filter.js +2 -1
  155. package/optimize/es/components/selectable/selectable_list/selectable_list.js +48 -33
  156. package/optimize/es/components/selectable/selectable_list/selectable_list.styles.js +19 -4
  157. package/optimize/es/components/selectable/selectable_list/selectable_list_item.js +41 -143
  158. package/optimize/es/components/selectable/selectable_list/utils/get_list_item_size.js +17 -0
  159. package/optimize/es/components/selectable/selectable_search/selectable_search.js +4 -1
  160. package/optimize/es/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
  161. package/optimize/es/components/selectable/selectable_templates/selectable_template_sitewide.styles.js +2 -12
  162. package/optimize/es/components/selectable/selectable_templates/selectable_template_sitewide_option.js +1 -1
  163. package/optimize/es/components/selectable/selectable_templates/selectable_template_sitewide_popover.js +1 -1
  164. package/optimize/es/global_styling/mixins/_helpers.js +32 -11
  165. package/optimize/lib/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +1 -4
  166. package/optimize/lib/components/color_picker/color_palette_picker/color_palette_picker.js +0 -1
  167. package/optimize/lib/components/combo_box/combo_box.a11y.js +5 -5
  168. package/optimize/lib/components/combo_box/combo_box.js +60 -52
  169. package/optimize/lib/components/combo_box/combo_box_options_list/combo_box_options_list.js +143 -81
  170. package/optimize/lib/components/combo_box/combo_box_options_list/combo_box_options_list.styles.js +7 -6
  171. package/optimize/lib/components/context_menu/context_menu.js +19 -14
  172. package/optimize/lib/components/context_menu/context_menu.styles.js +4 -1
  173. package/optimize/lib/components/context_menu/context_menu_item.js +56 -54
  174. package/optimize/lib/components/context_menu/context_menu_item.styles.js +13 -27
  175. package/optimize/lib/components/context_menu/context_menu_panel.js +36 -17
  176. package/optimize/lib/components/context_menu/context_menu_panel.styles.js +7 -2
  177. package/optimize/lib/components/context_menu/context_menu_panel_title.js +59 -0
  178. package/optimize/lib/components/context_menu/context_menu_panel_title.styles.js +26 -0
  179. package/optimize/lib/components/context_menu/index.js +8 -1
  180. package/optimize/lib/components/datagrid/body/header/column_actions.js +1 -2
  181. package/optimize/lib/components/filter_group/filter_group.a11y.js +8 -2
  182. package/optimize/lib/components/flyout/flyout_menu.js +1 -4
  183. package/optimize/lib/components/form/checkbox/checkbox.js +6 -6
  184. package/optimize/lib/components/form/checkbox/checkbox.styles.js +1 -22
  185. package/optimize/lib/components/form/checkbox/checkbox_control.js +54 -0
  186. package/optimize/lib/components/form/checkbox/checkbox_control.styles.js +44 -0
  187. package/optimize/lib/components/form/checkbox/index.js +7 -0
  188. package/optimize/lib/components/form/form.styles.js +2 -1
  189. package/optimize/lib/components/form/radio/radio.styles.js +1 -1
  190. package/optimize/lib/components/form/super_select/super_select.js +116 -88
  191. package/optimize/lib/components/form/super_select/super_select.styles.js +4 -8
  192. package/optimize/lib/components/form/super_select/super_select_item.js +13 -14
  193. package/optimize/lib/components/link/external_link_icon.js +4 -2
  194. package/optimize/lib/components/list_group/list_group.js +8 -15
  195. package/optimize/lib/components/list_group/list_group.styles.js +2 -16
  196. package/optimize/lib/components/list_group/list_group_item.js +62 -79
  197. package/optimize/lib/components/list_group/list_group_item.styles.js +17 -61
  198. package/optimize/lib/components/list_group/list_group_item_extra_action.styles.js +5 -5
  199. package/optimize/lib/components/list_item_layout/_list_item_layout.js +361 -0
  200. package/optimize/lib/components/list_item_layout/_list_item_layout.styles.js +97 -0
  201. package/optimize/lib/components/list_item_layout/index.js +12 -0
  202. package/optimize/lib/components/search_bar/filters/field_value_selection_filter.js +2 -1
  203. package/optimize/lib/components/selectable/selectable_list/selectable_list.js +46 -31
  204. package/optimize/lib/components/selectable/selectable_list/selectable_list.styles.js +20 -5
  205. package/optimize/lib/components/selectable/selectable_list/selectable_list_item.js +41 -143
  206. package/optimize/lib/components/selectable/selectable_list/utils/get_list_item_size.js +23 -0
  207. package/optimize/lib/components/selectable/selectable_search/selectable_search.js +4 -1
  208. package/optimize/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
  209. package/optimize/lib/components/selectable/selectable_templates/selectable_template_sitewide.styles.js +2 -12
  210. package/optimize/lib/components/selectable/selectable_templates/selectable_template_sitewide_option.js +1 -1
  211. package/optimize/lib/components/selectable/selectable_templates/selectable_template_sitewide_popover.js +1 -1
  212. package/optimize/lib/global_styling/mixins/_helpers.js +33 -12
  213. package/package.json +4 -4
  214. package/test-env/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +14 -11
  215. package/test-env/components/color_picker/color_palette_picker/color_palette_picker.js +0 -1
  216. package/test-env/components/combo_box/combo_box.a11y.js +5 -5
  217. package/test-env/components/combo_box/combo_box.js +61 -53
  218. package/test-env/components/combo_box/combo_box_options_list/combo_box_options_list.js +145 -82
  219. package/test-env/components/combo_box/combo_box_options_list/combo_box_options_list.styles.js +7 -6
  220. package/test-env/components/context_menu/context_menu.js +20 -22
  221. package/test-env/components/context_menu/context_menu.styles.js +4 -1
  222. package/test-env/components/context_menu/context_menu_item.js +67 -59
  223. package/test-env/components/context_menu/context_menu_item.styles.js +13 -27
  224. package/test-env/components/context_menu/context_menu_panel.js +37 -21
  225. package/test-env/components/context_menu/context_menu_panel.styles.js +7 -2
  226. package/test-env/components/context_menu/context_menu_panel_title.js +129 -0
  227. package/test-env/components/context_menu/context_menu_panel_title.styles.js +26 -0
  228. package/test-env/components/context_menu/index.js +8 -1
  229. package/test-env/components/datagrid/body/cell/data_grid_cell.js +35 -29
  230. package/test-env/components/datagrid/body/data_grid_body.js +23 -17
  231. package/test-env/components/datagrid/body/data_grid_body_custom.js +23 -17
  232. package/test-env/components/datagrid/body/data_grid_body_virtualized.js +23 -17
  233. package/test-env/components/datagrid/body/header/column_actions.js +1 -2
  234. package/test-env/components/datagrid/body/header/data_grid_header_cell.js +23 -17
  235. package/test-env/components/datagrid/controls/column_sorting.js +23 -17
  236. package/test-env/components/datagrid/utils/in_memory.js +23 -17
  237. package/test-env/components/filter_group/filter_group.a11y.js +8 -2
  238. package/test-env/components/flyout/flyout_menu.js +1 -4
  239. package/test-env/components/form/checkbox/checkbox.js +6 -6
  240. package/test-env/components/form/checkbox/checkbox.styles.js +1 -22
  241. package/test-env/components/form/checkbox/checkbox_control.js +83 -0
  242. package/test-env/components/form/checkbox/checkbox_control.styles.js +44 -0
  243. package/test-env/components/form/checkbox/index.js +7 -0
  244. package/test-env/components/form/form.styles.js +2 -1
  245. package/test-env/components/form/radio/radio.styles.js +1 -1
  246. package/test-env/components/form/super_select/super_select.js +116 -97
  247. package/test-env/components/form/super_select/super_select.styles.js +4 -8
  248. package/test-env/components/form/super_select/super_select_item.js +13 -18
  249. package/test-env/components/link/external_link_icon.js +4 -2
  250. package/test-env/components/list_group/list_group.js +21 -35
  251. package/test-env/components/list_group/list_group.styles.js +2 -16
  252. package/test-env/components/list_group/list_group_item.js +75 -86
  253. package/test-env/components/list_group/list_group_item.styles.js +17 -61
  254. package/test-env/components/list_group/list_group_item_extra_action.styles.js +5 -5
  255. package/test-env/components/list_group/pinnable_list_group/pinnable_list_group.js +16 -28
  256. package/test-env/components/list_item_layout/_list_item_layout.js +691 -0
  257. package/test-env/components/list_item_layout/_list_item_layout.styles.js +97 -0
  258. package/test-env/components/list_item_layout/index.js +12 -0
  259. package/test-env/components/search_bar/filters/field_value_selection_filter.js +2 -1
  260. package/test-env/components/selectable/selectable.js +1 -0
  261. package/test-env/components/selectable/selectable_list/selectable_list.js +50 -34
  262. package/test-env/components/selectable/selectable_list/selectable_list.styles.js +20 -5
  263. package/test-env/components/selectable/selectable_list/selectable_list_item.js +42 -147
  264. package/test-env/components/selectable/selectable_list/utils/get_list_item_size.js +23 -0
  265. package/test-env/components/selectable/selectable_search/selectable_search.js +4 -1
  266. package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
  267. package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.styles.js +2 -12
  268. package/test-env/components/selectable/selectable_templates/selectable_template_sitewide_option.js +1 -1
  269. package/test-env/components/selectable/selectable_templates/selectable_template_sitewide_popover.js +1 -1
  270. package/test-env/global_styling/mixins/_helpers.js +33 -12
  271. package/es/components/selectable/selectable_list/selectable_list_item.styles.js +0 -55
  272. package/lib/components/selectable/selectable_list/selectable_list_item.styles.js +0 -59
  273. package/optimize/es/components/selectable/selectable_list/selectable_list_item.styles.js +0 -55
  274. package/optimize/lib/components/selectable/selectable_list/selectable_list_item.styles.js +0 -59
  275. package/test-env/components/selectable/selectable_list/selectable_list_item.styles.js +0 -59
@@ -7,7 +7,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
7
7
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
8
8
  import _inherits from "@babel/runtime/helpers/inherits";
9
9
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
10
- var _excluded = ["data-test-subj", "async", "className", "compressed", "customOptionText", "fullWidth", "id", "inputRef", "isCaseSensitive", "isClearable", "isDisabled", "isInvalid", "isLoading", "noSuggestions", "onBlur", "onChange", "onCreateOption", "onSearchChange", "options", "placeholder", "renderOption", "rowHeight", "selectedOptions", "singleSelection", "prepend", "sortMatchesBy", "delimiter", "append", "autoFocus", "truncationProps", "inputPopoverProps", "optionMatcher", "aria-label", "aria-labelledby", "aria-describedby"];
10
+ var _excluded = ["data-test-subj", "async", "className", "compressed", "customOptionText", "fullWidth", "id", "inputRef", "isCaseSensitive", "isClearable", "isDisabled", "isInvalid", "isLoading", "noSuggestions", "onBlur", "onChange", "onCreateOption", "onSearchChange", "options", "placeholder", "renderOption", "rowHeight", "selectedOptions", "singleSelection", "prepend", "sortMatchesBy", "delimiter", "append", "autoFocus", "onFocusBadge", "truncationProps", "inputPopoverProps", "optionMatcher", "aria-label", "aria-labelledby", "aria-describedby"];
11
11
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
12
12
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
13
13
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
@@ -88,6 +88,9 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
88
88
  _this.listRefInstance = ref;
89
89
  });
90
90
  _defineProperty(_this, "setListOptionRefs", function (node, index) {
91
+ var current = _this.state.listOptionRefs[index];
92
+ // Skip updating if the ref is null (on cleanup) or didn't change
93
+ if (node === null || node === current) return;
91
94
  _this.setState(function (_ref) {
92
95
  var listOptionRefs = _ref.listOptionRefs;
93
96
  var _listOptionRefs = listOptionRefs;
@@ -108,41 +111,32 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
108
111
  isListOpen: false
109
112
  });
110
113
  });
111
- _defineProperty(_this, "incrementActiveOptionIndex", function (amount) {
112
- // If there are no options available, do nothing.
113
- if (!_this.state.matchingOptions.length) {
114
- return;
114
+ _defineProperty(_this, "findNextSelectableOptionIndex", function (options, startIndex) {
115
+ var direction = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
116
+ if (!options.length) return -1;
117
+ var index = startIndex;
118
+ for (var count = 0; count < options.length; count++) {
119
+ var option = options[index];
120
+ if (!option.isGroupLabelOption && !option.disabled) {
121
+ return index;
122
+ }
123
+ index = (index + direction + options.length) % options.length;
115
124
  }
125
+ return -1; // the remaining options can't be selected (group labels or disabled)
126
+ });
127
+ _defineProperty(_this, "incrementActiveOptionIndex", function (amount) {
128
+ if (!_this.state.matchingOptions.length) return;
116
129
  _this.setState(function (_ref2) {
117
130
  var activeOptionIndex = _ref2.activeOptionIndex,
118
131
  matchingOptions = _ref2.matchingOptions;
119
- var nextActiveOptionIndex;
120
- if (activeOptionIndex < 0) {
121
- // If this is the beginning of the user's keyboard navigation of the menu, then we'll focus
122
- // either the first or last item.
123
- nextActiveOptionIndex = amount < 0 ? matchingOptions.length - 1 : 0;
124
- } else {
125
- nextActiveOptionIndex = activeOptionIndex + amount;
126
- if (nextActiveOptionIndex < 0) {
127
- nextActiveOptionIndex = matchingOptions.length - 1;
128
- } else if (nextActiveOptionIndex === matchingOptions.length) {
129
- nextActiveOptionIndex = 0;
130
- }
131
- }
132
-
133
- // Group titles are included in option list but are not selectable
134
- // Skip group title options
135
132
  var direction = amount > 0 ? 1 : -1;
136
- while (matchingOptions[nextActiveOptionIndex].isGroupLabelOption) {
137
- nextActiveOptionIndex = nextActiveOptionIndex + direction;
138
- if (nextActiveOptionIndex < 0) {
139
- nextActiveOptionIndex = matchingOptions.length - 1;
140
- } else if (nextActiveOptionIndex === matchingOptions.length) {
141
- nextActiveOptionIndex = 0;
142
- }
143
- }
133
+ var startIndex = activeOptionIndex < 0 ?
134
+ // Inintial interaction: jump to first or last item
135
+ amount < 0 ? matchingOptions.length - 1 : 0 :
136
+ // Advance by amount, wrapping around
137
+ (activeOptionIndex + amount + matchingOptions.length) % matchingOptions.length;
144
138
  return {
145
- activeOptionIndex: nextActiveOptionIndex
139
+ activeOptionIndex: _this.findNextSelectableOptionIndex(matchingOptions, startIndex, direction)
146
140
  };
147
141
  });
148
142
  });
@@ -360,27 +354,36 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
360
354
  onChange = _this$props7.onChange,
361
355
  selectedOptions = _this$props7.selectedOptions,
362
356
  singleSelectionProp = _this$props7.singleSelection;
357
+ var _this$state2 = _this.state,
358
+ matchingOptions = _this$state2.matchingOptions,
359
+ listOptionRefs = _this$state2.listOptionRefs;
363
360
  var singleSelection = Boolean(singleSelectionProp);
364
361
  var changeOptions = singleSelection ? [addedOption] : selectedOptions.concat(addedOption);
365
362
  onChange === null || onChange === void 0 || onChange(changeOptions);
366
363
  _this.clearSearchValue();
367
- _this.clearActiveOption();
368
- if (!isContainerBlur) {
369
- var _this$searchInputRefI2;
370
- (_this$searchInputRefI2 = _this.searchInputRefInstance) === null || _this$searchInputRefI2 === void 0 || _this$searchInputRefI2.focus();
371
- }
372
364
  if (singleSelection) {
365
+ // List closes after single selection; return focus to the input
366
+ _this.clearActiveOption();
367
+ if (!isContainerBlur) {
368
+ var _this$searchInputRefI2;
369
+ (_this$searchInputRefI2 = _this.searchInputRefInstance) === null || _this$searchInputRefI2 === void 0 || _this$searchInputRefI2.focus();
370
+ }
373
371
  requestAnimationFrame(function () {
374
372
  return _this.closeList();
375
373
  });
374
+ } else if (isContainerBlur) {
375
+ // User tabbed away. `onContainerBlur` will close the list. We're only cleaning up state
376
+ _this.clearActiveOption();
376
377
  } else {
377
- _this.setState(function (_ref4) {
378
- var listOptionRefs = _ref4.listOptionRefs,
379
- matchingOptions = _ref4.matchingOptions;
380
- return {
381
- listOptionRefs: listOptionRefs.slice(0, matchingOptions.length - 1),
382
- activeOptionIndex: matchingOptions.indexOf(addedOption)
383
- };
378
+ var currentIndex = matchingOptions.indexOf(addedOption);
379
+ var nextOptions = matchingOptions.filter(function (option) {
380
+ return option !== addedOption;
381
+ });
382
+ _this.setState({
383
+ listOptionRefs: listOptionRefs.slice(0, matchingOptions.length - 1),
384
+ activeOptionIndex: _this.findNextSelectableOptionIndex(nextOptions, Math.min(currentIndex, nextOptions.length - 1)
385
+ // direction defaults to 1 (forward)
386
+ )
384
387
  });
385
388
  }
386
389
  });
@@ -488,6 +491,7 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
488
491
  delimiter = _this$props11.delimiter,
489
492
  append = _this$props11.append,
490
493
  autoFocus = _this$props11.autoFocus,
494
+ onFocusBadge = _this$props11.onFocusBadge,
491
495
  truncationProps = _this$props11.truncationProps,
492
496
  inputPopoverProps = _this$props11.inputPopoverProps,
493
497
  optionMatcher = _this$props11.optionMatcher,
@@ -495,12 +499,12 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
495
499
  ariaLabelledby = _this$props11['aria-labelledby'],
496
500
  ariaDescribedby = _this$props11['aria-describedby'],
497
501
  rest = _objectWithoutProperties(_this$props11, _excluded);
498
- var _this$state2 = this.state,
499
- activeOptionIndex = _this$state2.activeOptionIndex,
500
- hasFocus = _this$state2.hasFocus,
501
- isListOpen = _this$state2.isListOpen,
502
- searchValue = _this$state2.searchValue,
503
- matchingOptions = _this$state2.matchingOptions;
502
+ var _this$state3 = this.state,
503
+ activeOptionIndex = _this$state3.activeOptionIndex,
504
+ hasFocus = _this$state3.hasFocus,
505
+ isListOpen = _this$state3.isListOpen,
506
+ searchValue = _this$state3.searchValue,
507
+ matchingOptions = _this$state3.matchingOptions;
504
508
 
505
509
  // Make sure we have a valid ID if users don't pass one as a prop
506
510
  var inputId = id !== null && id !== void 0 ? id : this.rootId('_eui-combobox-id');
@@ -551,7 +555,8 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
551
555
  delimiter: delimiter,
552
556
  getSelectedOptionForSearchValue: getSelectedOptionForSearchValue,
553
557
  listboxAriaLabel: listboxAriaLabel,
554
- truncationProps: truncationProps
558
+ truncationProps: truncationProps,
559
+ onFocusBadge: onFocusBadge
555
560
  });
556
561
  });
557
562
  }
@@ -576,11 +581,11 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
576
581
  ref: _this2.comboBoxRefCallback
577
582
  }), ___EmotionJSX(EuiInputPopover, _extends({
578
583
  fullWidth: fullWidth,
579
- panelPaddingSize: "none",
584
+ panelPaddingSize: "s",
580
585
  disableFocusTrap: true,
581
586
  closeOnScroll: true
582
587
  }, inputPopoverProps, {
583
- isOpen: isListOpen,
588
+ isOpen: isListOpen && !noSuggestions,
584
589
  closePopover: _this2.closeList
585
590
  /* we don't want content changes to be announced via aria-live
586
591
  because ComboBox uses a virtualized list that updates itself
@@ -588,7 +593,10 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
588
593
  "aria-live": "off",
589
594
  input: ___EmotionJSX(EuiComboBoxInput, {
590
595
  compressed: compressed,
591
- focusedOptionId: _this2.hasActiveOption() ? (_this2$state$listOpti = (_this2$state$listOpti2 = _this2.state.listOptionRefs[_this2.state.activeOptionIndex]) === null || _this2$state$listOpti2 === void 0 ? void 0 : _this2$state$listOpti2.id) !== null && _this2$state$listOpti !== void 0 ? _this2$state$listOpti : _this2.rootId("_option-".concat(_this2.state.activeOptionIndex)) : undefined,
596
+ focusedOptionId: _this2.hasActiveOption() ? (_this2$state$listOpti = (_this2$state$listOpti2 = _this2.state.listOptionRefs[_this2.state.activeOptionIndex]) === null || _this2$state$listOpti2 === void 0 ? void 0 : _this2$state$listOpti2.id) !== null && _this2$state$listOpti !== void 0 ? _this2$state$listOpti :
597
+ // uses the original `options` array to ensure a stable `id`, otherwise `aria-activedescendant`
598
+ // loses focus on selecting an option (due to actively removing it from the list)
599
+ _this2.rootId("_option-".concat(_this2.props.options.indexOf(matchingOptions[activeOptionIndex]))) : undefined,
592
600
  fullWidth: fullWidth,
593
601
  hasSelectedOptions: selectedOptions.length > 0,
594
602
  id: inputId,
@@ -7,8 +7,8 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
7
  import _inherits from "@babel/runtime/helpers/inherits";
8
8
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
9
  var _excluded = ["children"],
10
- _excluded2 = ["key", "isGroupLabelOption", "label", "value", "prepend", "append", "truncationProps"],
11
- _excluded3 = ["data-test-subj", "activeOptionIndex", "areAllOptionsSelected", "customOptionText", "fullWidth", "getSelectedOptionForSearchValue", "isCaseSensitive", "isLoading", "listRef", "matchingOptions", "onCloseList", "onCreateOption", "onOptionClick", "onOptionEnterKey", "onScroll", "options", "renderOption", "rootId", "rowHeight", "scrollToIndex", "searchValue", "selectedOptions", "singleSelection", "delimiter", "truncationProps", "listboxAriaLabel", "setListOptionRefs"];
10
+ _excluded2 = ["key", "className", "isGroupLabelOption", "label", "value", "prepend", "append", "truncationProps", "toolTipContent", "toolTipProps"],
11
+ _excluded3 = ["data-test-subj", "activeOptionIndex", "areAllOptionsSelected", "customOptionText", "fullWidth", "getSelectedOptionForSearchValue", "isCaseSensitive", "isLoading", "listRef", "matchingOptions", "onCloseList", "onCreateOption", "onOptionClick", "onOptionEnterKey", "onScroll", "options", "renderOption", "rootId", "rowHeight", "scrollToIndex", "searchValue", "selectedOptions", "singleSelection", "delimiter", "onFocusBadge", "truncationProps", "listboxAriaLabel", "setListOptionRefs"];
12
12
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
13
13
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
14
14
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
@@ -21,9 +21,9 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
21
21
  * Side Public License, v 1.
22
22
  */
23
23
 
24
- import React, { Component } from 'react';
24
+ import React, { Component, createRef } from 'react';
25
25
  import classNames from 'classnames';
26
- import { FixedSizeList } from 'react-window';
26
+ import { VariableSizeList } from 'react-window';
27
27
  import { RenderWithEuiStylesMemoizer } from '../../../services';
28
28
  import { EuiFlexGroup, EuiFlexItem } from '../../flex';
29
29
  import { EuiHighlight } from '../../highlight';
@@ -31,12 +31,12 @@ import { EuiMark } from '../../mark';
31
31
  import { EuiText } from '../../text';
32
32
  import { EuiLoadingSpinner } from '../../loading';
33
33
  import { EuiI18n } from '../../i18n';
34
- import { EuiFilterSelectItem } from '../../filter_group/filter_select_item';
34
+ import { euiSelectableListGroupLabelStyles } from '../../selectable/selectable_list/selectable_list.styles';
35
+ import { getListItemSize } from '../../selectable/selectable_list/utils/get_list_item_size';
35
36
  import { EuiBadge } from '../../badge';
36
37
  import { EuiTextTruncate } from '../../text_truncate';
37
38
  import { EuiInputPopoverWidthContext } from '../../popover/input_popover';
38
- import { EuiComboBoxOptionAppendPrepend } from '../utils';
39
- import { EuiComboBoxTitle } from './combo_box_title';
39
+ import { EuiListItemLayout } from '../../list_item_layout';
40
40
  import { euiComboBoxOptionListStyles, LIST_MAX_HEIGHT } from './combo_box_options_list.styles';
41
41
  import { jsx as ___EmotionJSX } from "@emotion/react";
42
42
  var hitEnterBadge = ___EmotionJSX(EuiBadge, {
@@ -54,13 +54,20 @@ export var EuiComboBoxOptionsList = /*#__PURE__*/function (_Component) {
54
54
  }
55
55
  _this = _callSuper(this, EuiComboBoxOptionsList, [].concat(args));
56
56
  _defineProperty(_this, "listRef", null);
57
+ _defineProperty(_this, "listBoxRef", /*#__PURE__*/createRef());
58
+ _defineProperty(_this, "optionRefs", {});
57
59
  _defineProperty(_this, "setListRef", function (ref) {
58
60
  _this.listRef = ref;
59
61
  });
62
+ _defineProperty(_this, "setOptionRef", function (ref, index) {
63
+ var _this$props$setListOp, _this$props;
64
+ _this.optionRefs[index] = ref;
65
+ (_this$props$setListOp = (_this$props = _this.props).setListOptionRefs) === null || _this$props$setListOp === void 0 || _this$props$setListOp.call(_this$props, ref, index);
66
+ });
60
67
  _defineProperty(_this, "ListInnerElement", function (_ref) {
61
68
  var children = _ref.children,
62
69
  rest = _objectWithoutProperties(_ref, _excluded);
63
- return ___EmotionJSX("div", _extends({}, rest, _this.getListInnerElementProps()), children);
70
+ return ___EmotionJSX("ul", _extends({}, rest, _this.getListInnerElementProps()), children);
64
71
  });
65
72
  _defineProperty(_this, "ListRow", function (_ref2) {
66
73
  var _option$key;
@@ -69,33 +76,43 @@ export var EuiComboBoxOptionsList = /*#__PURE__*/function (_Component) {
69
76
  style = _ref2.style;
70
77
  var option = data[index];
71
78
  var key = option.key,
79
+ className = option.className,
72
80
  isGroupLabelOption = option.isGroupLabelOption,
73
81
  label = option.label,
74
82
  value = option.value,
75
83
  prepend = option.prepend,
76
84
  append = option.append,
77
85
  _truncationProps = option.truncationProps,
86
+ toolTipContent = option.toolTipContent,
87
+ toolTipProps = option.toolTipProps,
78
88
  rest = _objectWithoutProperties(option, _excluded2);
79
- var _this$props = _this.props,
80
- singleSelection = _this$props.singleSelection,
81
- selectedOptions = _this$props.selectedOptions,
82
- onOptionClick = _this$props.onOptionClick,
83
- activeOptionIndex = _this$props.activeOptionIndex,
84
- renderOption = _this$props.renderOption,
85
- searchValue = _this$props.searchValue,
86
- rootId = _this$props.rootId,
87
- matchingOptions = _this$props.matchingOptions,
88
- setListOptionRefs = _this$props.setListOptionRefs,
89
- rowHeight = _this$props.rowHeight;
89
+ var _this$props2 = _this.props,
90
+ options = _this$props2.options,
91
+ singleSelection = _this$props2.singleSelection,
92
+ selectedOptions = _this$props2.selectedOptions,
93
+ onOptionClick = _this$props2.onOptionClick,
94
+ activeOptionIndex = _this$props2.activeOptionIndex,
95
+ renderOption = _this$props2.renderOption,
96
+ searchValue = _this$props2.searchValue,
97
+ rootId = _this$props2.rootId,
98
+ matchingOptions = _this$props2.matchingOptions,
99
+ onFocusBadge = _this$props2.onFocusBadge,
100
+ rowHeight = _this$props2.rowHeight;
90
101
  var optionIndex = matchingOptions.indexOf(option);
91
102
  var hasTruncationProps = _this.props.truncationProps || _truncationProps;
92
103
  var truncationProps = hasTruncationProps ? // Individual truncation settings should override component prop
93
104
  _objectSpread(_objectSpread({}, _this.props.truncationProps), _truncationProps) : undefined;
94
105
  if (isGroupLabelOption) {
95
- return ___EmotionJSX("div", {
96
- key: key !== null && key !== void 0 ? key : label,
97
- style: style
98
- }, ___EmotionJSX(EuiComboBoxTitle, null, prepend, label, append));
106
+ return ___EmotionJSX(RenderWithEuiStylesMemoizer, null, function (stylesMemoizer) {
107
+ var styles = stylesMemoizer(euiSelectableListGroupLabelStyles);
108
+ return ___EmotionJSX("li", {
109
+ key: key !== null && key !== void 0 ? key : label,
110
+ style: style,
111
+ role: "presentation",
112
+ className: "euiComboBoxTitle",
113
+ css: styles.groupLabel
114
+ }, prepend, label, append);
115
+ });
99
116
  }
100
117
  var checked = undefined;
101
118
  if (singleSelection && selectedOptions.length && selectedOptions[0].label === label && selectedOptions[0].key === key) {
@@ -103,40 +120,54 @@ export var EuiComboBoxOptionsList = /*#__PURE__*/function (_Component) {
103
120
  }
104
121
  var optionIsFocused = activeOptionIndex === index;
105
122
  var optionIsDisabled = option.hasOwnProperty('disabled') && option.disabled === true;
106
- return ___EmotionJSX(EuiFilterSelectItem, _extends({
107
- style: style,
123
+ var hasOnFocusBadge = onFocusBadge && optionIsFocused && !optionIsDisabled;
124
+ return ___EmotionJSX(EuiListItemLayout, _extends({
125
+ element: "li",
126
+ role: "option"
127
+ // uses `aria-selected` over `aria-checked` for multi-selection as the selected options are removed from the list
128
+ ,
129
+ selectionMode: "selected",
130
+ className: classNames('euiComboBoxOption', className),
131
+ ref: function ref(node) {
132
+ return _this.setOptionRef(node, index);
133
+ }
134
+ // uses the original `options` array for the index to ensure a stable `id`, otherwise `aria-activedescendant`
135
+ // loses focus on selecting an option (due to actively removing it from the list)
136
+ ,
137
+ id: rootId("_option-".concat(options.indexOf(option))),
108
138
  key: (_option$key = option.key) !== null && _option$key !== void 0 ? _option$key : option.label,
139
+ title: label,
140
+ prepend: option.prepend,
141
+ append: hasOnFocusBadge ? ___EmotionJSX(React.Fragment, null, option.append, hitEnterBadge) : option.append,
142
+ checked: checked,
143
+ isFocused: optionIsFocused,
144
+ isSelected: !optionIsDisabled && checked !== undefined,
145
+ isDisabled: optionIsDisabled,
146
+ isSingleSelection: !!singleSelection,
147
+ showIndicator: !!singleSelection,
148
+ textWrap: rowHeight !== 'auto' ? 'truncate' : 'wrap',
149
+ tooltipProps: toolTipContent && !optionIsDisabled ? _objectSpread(_objectSpread({}, toolTipProps), {}, {
150
+ content: toolTipContent
151
+ }) : undefined,
152
+ style: style,
153
+ "aria-setsize": matchingOptions.length,
154
+ "aria-posinset": optionIndex + 1,
155
+ contentProps: {
156
+ className: 'euiComboBoxOption__content'
157
+ },
109
158
  onClick: function onClick() {
110
159
  if (onOptionClick) {
111
160
  onOptionClick(option);
112
161
  }
113
- },
114
- isFocused: optionIsFocused,
115
- checked: checked,
116
- showIcons: singleSelection ? true : false,
117
- truncateContent: rowHeight !== 'auto',
118
- id: rootId("_option-".concat(index)),
119
- title: label,
120
- "aria-setsize": matchingOptions.length,
121
- "aria-posinset": optionIndex + 1,
122
- forwardRef: function forwardRef(ref) {
123
- return setListOptionRefs(ref, index);
124
162
  }
125
- }, rest), ___EmotionJSX("span", {
126
- className: "euiComboBoxOption__contentWrapper"
127
- }, ___EmotionJSX(EuiComboBoxOptionAppendPrepend, {
128
- option: option,
129
- classNamePrefix: "euiComboBoxOption",
130
- marginSize: "s"
131
- }, ___EmotionJSX("span", {
132
- className: classNames('euiComboBoxOption__content', rowHeight !== 'auto' && 'eui-textTruncate')
133
- }, renderOption ? renderOption(option, searchValue, 'euiComboBoxOption__renderOption') : rowHeight === 'auto' ? _this.renderVariableHeightOption(label) : _this.renderTruncatedOption(label, truncationProps))), optionIsFocused && !optionIsDisabled ? hitEnterBadge : null));
163
+ }, rest), renderOption ? renderOption(option, searchValue, 'euiComboBoxOption__renderOption') : rowHeight === 'auto' ? _this.renderVariableHeightOption(label) : _this.renderTruncatedOption(label, truncationProps));
134
164
  });
135
165
  _defineProperty(_this, "getListInnerElementProps", function () {
136
166
  return {
137
167
  'aria-label': _this.props.listboxAriaLabel,
138
168
  id: _this.props.rootId('listbox'),
139
169
  role: 'listbox',
170
+ 'aria-multiselectable': _this.props.singleSelection === false ? true : undefined,
140
171
  tabIndex: 0
141
172
  };
142
173
  });
@@ -190,49 +221,66 @@ export var EuiComboBoxOptionsList = /*#__PURE__*/function (_Component) {
190
221
  // just highlight the entire truncated text
191
222
  ___EmotionJSX(EuiMark, null, text));
192
223
  });
224
+ _defineProperty(_this, "getItemSize", function (index) {
225
+ var _ref3 = _this.props,
226
+ rowHeight = _ref3.rowHeight;
227
+ var option = _this.props.matchingOptions[index];
228
+ return getListItemSize(index, rowHeight, !!(option !== null && option !== void 0 && option.isGroupLabelOption));
229
+ });
193
230
  return _this;
194
231
  }
195
232
  _inherits(EuiComboBoxOptionsList, _Component);
196
233
  return _createClass(EuiComboBoxOptionsList, [{
197
234
  key: "componentDidUpdate",
198
235
  value: function componentDidUpdate(prevProps) {
199
- if (this.listRef && typeof this.props.activeOptionIndex !== 'undefined' && this.props.activeOptionIndex !== prevProps.activeOptionIndex && this.props.rowHeight !== 'auto') {
200
- this.listRef.scrollToItem(this.props.activeOptionIndex, 'auto');
236
+ var _this$props3 = this.props,
237
+ activeOptionIndex = _this$props3.activeOptionIndex,
238
+ rowHeight = _this$props3.rowHeight;
239
+ if (this.listRef && typeof activeOptionIndex !== 'undefined' && activeOptionIndex !== prevProps.activeOptionIndex && rowHeight !== 'auto') {
240
+ // NOTE: The 'auto' setting results in the item being scrolled to the top/end edge;
241
+ // We could consider changing it to 'center' to keep items further way from the listbox edges.
242
+ this.listRef.scrollToItem(activeOptionIndex, 'auto');
243
+ } else if (rowHeight === 'auto') {
244
+ var _this$optionRefs, _this$optionRefs$scro;
245
+ (_this$optionRefs = this.optionRefs[activeOptionIndex !== null && activeOptionIndex !== void 0 ? activeOptionIndex : 0]) === null || _this$optionRefs === void 0 || (_this$optionRefs$scro = _this$optionRefs.scrollIntoView) === null || _this$optionRefs$scro === void 0 || _this$optionRefs$scro.call(_this$optionRefs, {
246
+ block: 'nearest'
247
+ });
201
248
  }
202
249
  }
203
250
  }, {
204
251
  key: "render",
205
252
  value: function render() {
206
253
  var _this2 = this;
207
- var _this$props2 = this.props,
208
- dataTestSubj = _this$props2['data-test-subj'],
209
- activeOptionIndex = _this$props2.activeOptionIndex,
210
- areAllOptionsSelected = _this$props2.areAllOptionsSelected,
211
- customOptionText = _this$props2.customOptionText,
212
- fullWidth = _this$props2.fullWidth,
213
- getSelectedOptionForSearchValue = _this$props2.getSelectedOptionForSearchValue,
214
- isCaseSensitive = _this$props2.isCaseSensitive,
215
- isLoading = _this$props2.isLoading,
216
- listRef = _this$props2.listRef,
217
- matchingOptions = _this$props2.matchingOptions,
218
- onCloseList = _this$props2.onCloseList,
219
- onCreateOption = _this$props2.onCreateOption,
220
- onOptionClick = _this$props2.onOptionClick,
221
- onOptionEnterKey = _this$props2.onOptionEnterKey,
222
- onScroll = _this$props2.onScroll,
223
- options = _this$props2.options,
224
- renderOption = _this$props2.renderOption,
225
- rootId = _this$props2.rootId,
226
- rowHeight = _this$props2.rowHeight,
227
- scrollToIndex = _this$props2.scrollToIndex,
228
- searchValue = _this$props2.searchValue,
229
- selectedOptions = _this$props2.selectedOptions,
230
- singleSelection = _this$props2.singleSelection,
231
- delimiter = _this$props2.delimiter,
232
- truncationProps = _this$props2.truncationProps,
233
- listboxAriaLabel = _this$props2.listboxAriaLabel,
234
- setListOptionRefs = _this$props2.setListOptionRefs,
235
- rest = _objectWithoutProperties(_this$props2, _excluded3);
254
+ var _this$props4 = this.props,
255
+ dataTestSubj = _this$props4['data-test-subj'],
256
+ activeOptionIndex = _this$props4.activeOptionIndex,
257
+ areAllOptionsSelected = _this$props4.areAllOptionsSelected,
258
+ customOptionText = _this$props4.customOptionText,
259
+ fullWidth = _this$props4.fullWidth,
260
+ getSelectedOptionForSearchValue = _this$props4.getSelectedOptionForSearchValue,
261
+ isCaseSensitive = _this$props4.isCaseSensitive,
262
+ isLoading = _this$props4.isLoading,
263
+ listRef = _this$props4.listRef,
264
+ matchingOptions = _this$props4.matchingOptions,
265
+ onCloseList = _this$props4.onCloseList,
266
+ onCreateOption = _this$props4.onCreateOption,
267
+ onOptionClick = _this$props4.onOptionClick,
268
+ onOptionEnterKey = _this$props4.onOptionEnterKey,
269
+ onScroll = _this$props4.onScroll,
270
+ options = _this$props4.options,
271
+ renderOption = _this$props4.renderOption,
272
+ rootId = _this$props4.rootId,
273
+ rowHeight = _this$props4.rowHeight,
274
+ scrollToIndex = _this$props4.scrollToIndex,
275
+ searchValue = _this$props4.searchValue,
276
+ selectedOptions = _this$props4.selectedOptions,
277
+ singleSelection = _this$props4.singleSelection,
278
+ delimiter = _this$props4.delimiter,
279
+ onFocusBadge = _this$props4.onFocusBadge,
280
+ truncationProps = _this$props4.truncationProps,
281
+ listboxAriaLabel = _this$props4.listboxAriaLabel,
282
+ setListOptionRefs = _this$props4.setListOptionRefs,
283
+ rest = _objectWithoutProperties(_this$props4, _excluded3);
236
284
  var emptyStateContent;
237
285
  if (isLoading) {
238
286
  emptyStateContent = ___EmotionJSX(EuiFlexGroup, {
@@ -330,6 +378,10 @@ export var EuiComboBoxOptionsList = /*#__PURE__*/function (_Component) {
330
378
  // bounded by max-height of .euiComboBoxOptionsList
331
379
  boundedHeight = height > LIST_MAX_HEIGHT ? LIST_MAX_HEIGHT : height;
332
380
  }
381
+
382
+ /* We need to consider the panel padding (2 * 8px) but should only subtract it if
383
+ the panel width has already been set. */
384
+ var listWidth = this.context && this.context > 0 ? this.context - 16 : this.context;
333
385
  return ___EmotionJSX(RenderWithEuiStylesMemoizer, null, function (stylesMemoizer) {
334
386
  var styles = stylesMemoizer(euiComboBoxOptionListStyles);
335
387
  return ___EmotionJSX("div", _extends({
@@ -337,29 +389,39 @@ export var EuiComboBoxOptionsList = /*#__PURE__*/function (_Component) {
337
389
  className: "euiComboBoxOptionsList",
338
390
  "data-test-subj": classNames('comboBoxOptionsList', dataTestSubj),
339
391
  ref: listRef
340
- }, rest), emptyStateContent ? ___EmotionJSX(EuiText, {
392
+ }, rest, {
393
+ onMouseDown: function onMouseDown(e) {
394
+ // prevent focus shifting; expected behavior to keep focus in the input
395
+ e.preventDefault();
396
+ }
397
+ }), emptyStateContent ? ___EmotionJSX(EuiText, {
341
398
  size: "xs",
342
399
  css: styles.euiComboBoxOptionsList__empty,
343
400
  className: "euiComboBoxOptionsList__empty"
344
- }, emptyStateContent) : rowHeight === 'auto' ? ___EmotionJSX("div", _this2.getListInnerElementProps(), matchingOptions.map(function (_, index) {
401
+ }, emptyStateContent) : rowHeight === 'auto' ? ___EmotionJSX("ul", _extends({
402
+ ref: _this2.listBoxRef
403
+ }, _this2.getListInnerElementProps()), matchingOptions.map(function (_, index) {
345
404
  return ___EmotionJSX(_this2.ListRow, {
346
405
  data: matchingOptions,
347
406
  index: index,
348
- key: index // same as FixedSizeList's default
407
+ key: index // same as VariableSizeList's default
349
408
  ,
350
409
  style: {}
351
410
  });
352
- })) : ___EmotionJSX(FixedSizeList, {
411
+ })) : ___EmotionJSX(VariableSizeList, {
353
412
  css: styles.euiComboBoxOptionList__virtualization,
354
413
  className: "euiComboBoxOptionsList__virtualization",
355
414
  height: boundedHeight,
356
415
  onScroll: onScroll,
357
416
  itemCount: matchingOptions.length,
358
- itemSize: rowHeight,
359
- itemData: matchingOptions,
417
+ itemSize: _this2.getItemSize,
418
+ itemData: matchingOptions
419
+ // Prevents scrollbar jump before VariableSizeList populates the cached size
420
+ ,
421
+ estimatedItemSize: rowHeight,
360
422
  ref: _this2.setListRef,
361
423
  innerElementType: _this2.ListInnerElement,
362
- width: _this2.context
424
+ width: listWidth
363
425
  }, _this2.ListRow));
364
426
  });
365
427
  }
@@ -7,20 +7,21 @@
7
7
  */
8
8
 
9
9
  import { css } from '@emotion/react';
10
- import { logicalCSS, mathWithUnits, euiScrollBarStyles, euiTextBreakWord } from '../../../global_styling';
11
- import { euiTitle } from '../../title/title.styles';
10
+ import { logicalCSS, euiScrollBarStyles, euiTextBreakWord, euiYScrollWithShadows } from '../../../global_styling';
12
11
  export var LIST_MAX_HEIGHT = 200;
13
12
  export var euiComboBoxOptionListStyles = function euiComboBoxOptionListStyles(euiThemeContext) {
14
13
  var euiTheme = euiThemeContext.euiTheme;
15
14
  return {
16
- euiComboBoxOptionList: /*#__PURE__*/css(logicalCSS('max-height', "".concat(LIST_MAX_HEIGHT, "px")), " overflow:hidden;.euiTextTruncate{pointer-events:none;}.euiComboBoxOption__contentWrapper{display:flex;align-items:center;}.euiComboBoxOption__content{flex:1;text-align:start;overflow-wrap:anywhere;}.euiComboBoxOption__emptyStateText{flex:1;text-align:start;", logicalCSS('margin-bottom', 0), ";}.euiComboBoxOption__enterBadge{", logicalCSS('margin-left', euiTheme.size.xs), ";}.euiComboBoxTitle{display:flex;", logicalCSS('padding-horizontal', euiTheme.size.s), logicalCSS('padding-top', mathWithUnits(euiTheme.size.s, function (x) {
17
- return x + 1;
18
- })), " ", logicalCSS('padding-bottom', euiTheme.size.xs), " ", euiTitle(euiThemeContext, 'xxxs'), ";};label:euiComboBoxOptionList;"),
15
+ euiComboBoxOptionList: /*#__PURE__*/css(logicalCSS('max-height', "".concat(LIST_MAX_HEIGHT, "px")), " overflow:hidden;.euiTextTruncate{pointer-events:none;}.euiComboBoxOption__contentWrapper{display:flex;align-items:center;}.euiComboBoxOption__content{flex:1;text-align:start;overflow-wrap:anywhere;}.euiComboBoxOption__emptyStateText{flex:1;text-align:start;", logicalCSS('margin-bottom', 0), ";}.euiComboBoxOption__enterBadge{", logicalCSS('margin-left', euiTheme.size.xs), ";};label:euiComboBoxOptionList;"),
19
16
  /* eslint-disable local/css-logical-properties */
20
- hasRowHeightAuto: /*#__PURE__*/css("overflow-y:auto;.euiComboBoxOption__contentWrapper{align-items:flex-start;}", euiScrollBarStyles(euiThemeContext), ";;label:hasRowHeightAuto;"),
17
+ hasRowHeightAuto: /*#__PURE__*/css(euiYScrollWithShadows(euiThemeContext, {
18
+ hasAnimatedOverflowShadow: true
19
+ }), " .euiComboBoxOption__contentWrapper{align-items:flex-start;}", euiScrollBarStyles(euiThemeContext), ";;label:hasRowHeightAuto;"),
21
20
  /* eslint-enable local/css-logical-properties */
22
21
 
23
- euiComboBoxOptionList__virtualization: /*#__PURE__*/css(euiScrollBarStyles(euiThemeContext), ";;label:euiComboBoxOptionList__virtualization;"),
22
+ euiComboBoxOptionList__virtualization: /*#__PURE__*/css(euiYScrollWithShadows(euiThemeContext, {
23
+ hasAnimatedOverflowShadow: true
24
+ }), ";;label:euiComboBoxOptionList__virtualization;"),
24
25
  euiComboBoxOptionsList__empty: /*#__PURE__*/css("padding:", euiTheme.size.s, ";text-align:center;", euiTextBreakWord(), ";;label:euiComboBoxOptionsList__empty;")
25
26
  };
26
27
  };