@elastic/eui 91.0.0 → 91.2.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 (507) hide show
  1. package/dist/eui_theme_dark.css +191 -124
  2. package/dist/eui_theme_dark.min.css +1 -1
  3. package/dist/eui_theme_light.css +191 -124
  4. package/dist/eui_theme_light.min.css +1 -1
  5. package/es/components/accordion/accordion.a11y.js +1 -3
  6. package/es/components/avatar/avatar.js +1 -1
  7. package/es/components/badge/badge.js +1 -1
  8. package/es/components/badge/beta_badge/beta_badge.js +1 -1
  9. package/es/components/basic_table/action_types.js +5 -0
  10. package/es/components/basic_table/basic_table.a11y.js +1 -2
  11. package/es/components/basic_table/basic_table.js +9 -9
  12. package/es/components/basic_table/collapsed_item_actions.js +120 -249
  13. package/es/components/basic_table/custom_item_action.js +9 -95
  14. package/es/components/basic_table/default_item_action.js +23 -14
  15. package/es/components/basic_table/in_memory_table.a11y.js +13 -11
  16. package/es/components/basic_table/in_memory_table.js +9 -9
  17. package/es/components/breadcrumbs/breadcrumb.js +11 -7
  18. package/es/components/breadcrumbs/breadcrumb.styles.js +5 -0
  19. package/es/components/button/button_display/_button_display.js +6 -4
  20. package/es/components/button/button_display/_button_display_content.js +9 -5
  21. package/es/components/button/button_empty/button_empty.js +10 -8
  22. package/es/components/button/button_group/button_group.js +6 -4
  23. package/es/components/button/button_group/button_group_button.js +6 -4
  24. package/es/components/button/button_icon/button_icon.js +1 -1
  25. package/es/components/call_out/call_out.js +1 -1
  26. package/es/components/card/card.a11y.js +5 -18
  27. package/es/components/card/card.js +1 -1
  28. package/es/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
  29. package/es/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +2 -2
  30. package/es/components/collapsible_nav_beta/collapsible_nav_body_footer.js +4 -1
  31. package/es/components/collapsible_nav_beta/collapsible_nav_body_footer.styles.js +12 -9
  32. package/es/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +1 -101
  33. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +21 -59
  34. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +91 -39
  35. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +69 -83
  36. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.styles.js +1 -19
  37. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +7 -102
  38. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.styles.js +4 -4
  39. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_group.js +7 -90
  40. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +154 -134
  41. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_link.js +0 -10
  42. package/es/components/combo_box/combo_box.js +1 -1
  43. package/es/components/comment_list/comment.js +2 -2
  44. package/es/components/comment_list/comment_event.js +1 -1
  45. package/es/components/comment_list/comment_list.js +2 -2
  46. package/es/components/comment_list/comment_timeline.js +1 -1
  47. package/es/components/context_menu/context_menu_item.js +16 -8
  48. package/es/components/context_menu/context_menu_item.styles.js +1 -1
  49. package/es/components/datagrid/body/data_grid_body.js +29 -19
  50. package/es/components/datagrid/body/data_grid_body_custom.js +29 -19
  51. package/es/components/datagrid/body/data_grid_body_virtualized.js +29 -19
  52. package/es/components/datagrid/body/data_grid_cell.js +91 -68
  53. package/es/components/datagrid/body/data_grid_cell_actions.js +12 -12
  54. package/es/components/datagrid/body/data_grid_cell_popover.js +43 -10
  55. package/es/components/datagrid/body/header/data_grid_header_cell.js +77 -46
  56. package/es/components/datagrid/body/header/data_grid_header_row.js +29 -19
  57. package/es/components/datagrid/controls/column_selector.js +19 -39
  58. package/es/components/datagrid/controls/column_sorting.js +18 -29
  59. package/es/components/datagrid/controls/column_sorting_draggable.js +1 -1
  60. package/es/components/datagrid/controls/data_grid_toolbar_control.js +154 -0
  61. package/es/components/datagrid/controls/display_selector.js +0 -1
  62. package/es/components/datagrid/controls/fullscreen_selector.js +2 -6
  63. package/es/components/datagrid/controls/index.js +2 -1
  64. package/es/components/datagrid/index.js +1 -1
  65. package/es/components/datagrid/utils/in_memory.js +28 -18
  66. package/es/components/datagrid/utils/row_heights.js +1 -1
  67. package/es/components/date_picker/auto_refresh/auto_refresh.js +6 -4
  68. package/es/components/date_picker/date_picker.js +2 -2
  69. package/es/components/date_picker/date_picker_range.js +1 -1
  70. package/es/components/date_picker/super_date_picker/super_update_button.js +1 -1
  71. package/es/components/empty_prompt/empty_prompt.js +1 -1
  72. package/es/components/error_boundary/error_boundary.a11y.js +1 -1
  73. package/es/components/expression/expression.a11y.js +2 -4
  74. package/es/components/facet/facet_button.js +6 -4
  75. package/es/components/filter_group/filter_button.js +2 -2
  76. package/es/components/focus_trap/focus_trap.a11y.js +3 -3
  77. package/es/components/form/field_number/field_number.js +1 -1
  78. package/es/components/form/field_text/field_text.js +2 -2
  79. package/es/components/form/form_control_layout/form_control_layout.js +2 -2
  80. package/es/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
  81. package/es/components/form/form_control_layout/form_control_layout_icons.js +2 -2
  82. package/es/components/form/range/range.a11y.js +5 -10
  83. package/es/components/form/super_select/super_select.js +3 -2
  84. package/es/components/form/super_select/super_select_control.js +13 -20
  85. package/es/components/header/header.a11y.js +1 -1
  86. package/es/components/header/header_links/header_link.js +8 -6
  87. package/es/components/header/header_links/header_links.js +1 -1
  88. package/es/components/header/header_logo/header_logo.js +1 -1
  89. package/es/components/header/header_section/header_section_item_button.js +8 -6
  90. package/es/components/icon/assets/endpoint.js +37 -0
  91. package/es/components/icon/icon.js +1 -1
  92. package/es/components/icon/icon_map.js +1 -0
  93. package/es/components/image/image.a11y.js +1 -2
  94. package/es/components/key_pad_menu/key_pad_menu.a11y.js +5 -5
  95. package/es/components/key_pad_menu/key_pad_menu_item.js +1 -1
  96. package/es/components/link/external_link_icon.js +51 -0
  97. package/es/components/link/link.js +6 -20
  98. package/es/components/link/link.styles.js +2 -5
  99. package/es/components/list_group/list_group.js +8 -3
  100. package/es/components/list_group/list_group_item.js +16 -6
  101. package/es/components/list_group/list_group_item.styles.js +2 -1
  102. package/es/components/list_group/list_group_item_extra_action.js +1 -1
  103. package/es/components/list_group/pinnable_list_group/pinnable_list_group.js +16 -6
  104. package/es/components/loading/loading_logo.js +1 -1
  105. package/es/components/markdown_editor/markdown_editor.js +1 -1
  106. package/es/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
  107. package/es/components/markdown_editor/markdown_editor_footer.js +1 -1
  108. package/es/components/markdown_editor/markdown_editor_toolbar.js +1 -1
  109. package/es/components/notification/notification_event.a11y.js +1 -2
  110. package/es/components/notification/notification_event.js +9 -7
  111. package/es/components/notification/notification_event_meta.js +1 -1
  112. package/es/components/page/page_header/page_header_content.js +1 -1
  113. package/es/components/pagination/pagination_button.js +8 -6
  114. package/es/components/popover/popover.js +4 -1
  115. package/es/components/resizable_container/resizable_container.a11y.js +4 -8
  116. package/es/components/search_bar/search_bar.a11y.js +3 -6
  117. package/es/components/selectable/selectable.js +16 -1
  118. package/es/components/selectable/selectable_list/selectable_list.js +233 -79
  119. package/es/components/selectable/selectable_list/selectable_list_item.js +1 -1
  120. package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +17 -2
  121. package/es/components/table/table_header_button.js +1 -1
  122. package/es/components/text/text.styles.js +2 -2
  123. package/es/components/text_truncate/text_truncate.js +33 -10
  124. package/es/components/timeline/timeline_item_icon.js +1 -1
  125. package/es/components/toast/global_toast_list.js +1 -1
  126. package/es/components/toast/toast.js +1 -1
  127. package/es/components/tool_tip/icon_tip.js +1 -1
  128. package/eui.d.ts +480 -138
  129. package/i18ntokens.json +224 -260
  130. package/lib/components/accordion/accordion.a11y.js +1 -3
  131. package/lib/components/avatar/avatar.js +1 -1
  132. package/lib/components/badge/badge.js +1 -1
  133. package/lib/components/badge/beta_badge/beta_badge.js +1 -1
  134. package/lib/components/basic_table/action_types.js +8 -2
  135. package/lib/components/basic_table/basic_table.a11y.js +1 -2
  136. package/lib/components/basic_table/basic_table.js +9 -9
  137. package/lib/components/basic_table/collapsed_item_actions.js +128 -257
  138. package/lib/components/basic_table/custom_item_action.js +18 -104
  139. package/lib/components/basic_table/default_item_action.js +23 -14
  140. package/lib/components/basic_table/in_memory_table.a11y.js +13 -11
  141. package/lib/components/basic_table/in_memory_table.js +9 -9
  142. package/lib/components/breadcrumbs/breadcrumb.js +11 -7
  143. package/lib/components/breadcrumbs/breadcrumb.styles.js +5 -0
  144. package/lib/components/button/button_display/_button_display.js +6 -4
  145. package/lib/components/button/button_display/_button_display_content.js +9 -5
  146. package/lib/components/button/button_empty/button_empty.js +10 -8
  147. package/lib/components/button/button_group/button_group.js +6 -4
  148. package/lib/components/button/button_group/button_group_button.js +6 -4
  149. package/lib/components/button/button_icon/button_icon.js +1 -1
  150. package/lib/components/call_out/call_out.js +1 -1
  151. package/lib/components/card/card.a11y.js +5 -18
  152. package/lib/components/card/card.js +1 -1
  153. package/lib/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
  154. package/lib/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +1 -1
  155. package/lib/components/collapsible_nav_beta/collapsible_nav_body_footer.js +4 -1
  156. package/lib/components/collapsible_nav_beta/collapsible_nav_body_footer.styles.js +12 -9
  157. package/lib/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +1 -101
  158. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +21 -59
  159. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +91 -39
  160. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +68 -82
  161. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.styles.js +11 -28
  162. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +7 -104
  163. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.styles.js +4 -4
  164. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_group.js +7 -90
  165. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +154 -134
  166. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_link.js +0 -10
  167. package/lib/components/combo_box/combo_box.js +1 -1
  168. package/lib/components/comment_list/comment.js +2 -2
  169. package/lib/components/comment_list/comment_event.js +1 -1
  170. package/lib/components/comment_list/comment_list.js +2 -2
  171. package/lib/components/comment_list/comment_timeline.js +1 -1
  172. package/lib/components/context_menu/context_menu_item.js +16 -8
  173. package/lib/components/context_menu/context_menu_item.styles.js +1 -1
  174. package/lib/components/datagrid/body/data_grid_body.js +29 -19
  175. package/lib/components/datagrid/body/data_grid_body_custom.js +29 -19
  176. package/lib/components/datagrid/body/data_grid_body_virtualized.js +29 -19
  177. package/lib/components/datagrid/body/data_grid_cell.js +91 -68
  178. package/lib/components/datagrid/body/data_grid_cell_actions.js +12 -13
  179. package/lib/components/datagrid/body/data_grid_cell_popover.js +43 -10
  180. package/lib/components/datagrid/body/header/data_grid_header_cell.js +77 -46
  181. package/lib/components/datagrid/body/header/data_grid_header_row.js +29 -19
  182. package/lib/components/datagrid/controls/column_selector.js +19 -39
  183. package/lib/components/datagrid/controls/column_sorting.js +18 -30
  184. package/lib/components/datagrid/controls/column_sorting_draggable.js +1 -1
  185. package/lib/components/datagrid/controls/data_grid_toolbar_control.js +159 -0
  186. package/lib/components/datagrid/controls/display_selector.js +0 -1
  187. package/lib/components/datagrid/controls/fullscreen_selector.js +2 -7
  188. package/lib/components/datagrid/controls/index.js +8 -1
  189. package/lib/components/datagrid/index.js +8 -1
  190. package/lib/components/datagrid/utils/in_memory.js +28 -18
  191. package/lib/components/datagrid/utils/row_heights.js +1 -1
  192. package/lib/components/date_picker/auto_refresh/auto_refresh.js +6 -4
  193. package/lib/components/date_picker/date_picker.js +2 -2
  194. package/lib/components/date_picker/date_picker_range.js +1 -1
  195. package/lib/components/date_picker/super_date_picker/super_update_button.js +1 -1
  196. package/lib/components/empty_prompt/empty_prompt.js +1 -1
  197. package/lib/components/error_boundary/error_boundary.a11y.js +1 -1
  198. package/lib/components/expression/expression.a11y.js +2 -4
  199. package/lib/components/facet/facet_button.js +6 -4
  200. package/lib/components/filter_group/filter_button.js +2 -2
  201. package/lib/components/focus_trap/focus_trap.a11y.js +3 -3
  202. package/lib/components/form/field_number/field_number.js +1 -1
  203. package/lib/components/form/field_text/field_text.js +2 -2
  204. package/lib/components/form/form_control_layout/form_control_layout.js +2 -2
  205. package/lib/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
  206. package/lib/components/form/form_control_layout/form_control_layout_icons.js +2 -2
  207. package/lib/components/form/range/range.a11y.js +5 -10
  208. package/lib/components/form/super_select/super_select.js +3 -2
  209. package/lib/components/form/super_select/super_select_control.js +12 -19
  210. package/lib/components/header/header.a11y.js +1 -1
  211. package/lib/components/header/header_links/header_link.js +8 -6
  212. package/lib/components/header/header_links/header_links.js +1 -1
  213. package/lib/components/header/header_logo/header_logo.js +1 -1
  214. package/lib/components/header/header_section/header_section_item_button.js +8 -6
  215. package/lib/components/icon/assets/endpoint.js +45 -0
  216. package/lib/components/icon/icon.js +1 -1
  217. package/lib/components/icon/icon_map.js +1 -0
  218. package/lib/components/icon/svgs/endpoint.svg +4 -0
  219. package/lib/components/image/image.a11y.js +1 -2
  220. package/lib/components/key_pad_menu/key_pad_menu.a11y.js +5 -5
  221. package/lib/components/key_pad_menu/key_pad_menu_item.js +1 -1
  222. package/lib/components/link/external_link_icon.js +57 -0
  223. package/lib/components/link/link.js +6 -20
  224. package/lib/components/link/link.styles.js +1 -4
  225. package/lib/components/list_group/list_group.js +8 -3
  226. package/lib/components/list_group/list_group_item.js +16 -6
  227. package/lib/components/list_group/list_group_item.styles.js +2 -1
  228. package/lib/components/list_group/list_group_item_extra_action.js +1 -1
  229. package/lib/components/list_group/pinnable_list_group/pinnable_list_group.js +16 -6
  230. package/lib/components/loading/loading_logo.js +1 -1
  231. package/lib/components/markdown_editor/markdown_editor.js +1 -1
  232. package/lib/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
  233. package/lib/components/markdown_editor/markdown_editor_footer.js +1 -1
  234. package/lib/components/markdown_editor/markdown_editor_toolbar.js +1 -1
  235. package/lib/components/notification/notification_event.a11y.js +1 -2
  236. package/lib/components/notification/notification_event.js +9 -7
  237. package/lib/components/notification/notification_event_meta.js +1 -1
  238. package/lib/components/page/page_header/page_header_content.js +1 -1
  239. package/lib/components/popover/popover.js +4 -1
  240. package/lib/components/resizable_container/resizable_container.a11y.js +4 -8
  241. package/lib/components/search_bar/search_bar.a11y.js +3 -6
  242. package/lib/components/selectable/selectable.js +16 -1
  243. package/lib/components/selectable/selectable_list/selectable_list.js +233 -79
  244. package/lib/components/selectable/selectable_list/selectable_list_item.js +1 -1
  245. package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +17 -2
  246. package/lib/components/table/table_header_button.js +1 -1
  247. package/lib/components/text/text.styles.js +2 -2
  248. package/lib/components/text_truncate/text_truncate.js +32 -9
  249. package/lib/components/timeline/timeline_item_icon.js +1 -1
  250. package/lib/components/toast/global_toast_list.js +1 -1
  251. package/lib/components/toast/toast.js +1 -1
  252. package/lib/components/tool_tip/icon_tip.js +1 -1
  253. package/optimize/es/components/accordion/accordion.a11y.js +1 -3
  254. package/optimize/es/components/basic_table/action_types.js +5 -0
  255. package/optimize/es/components/basic_table/basic_table.a11y.js +1 -2
  256. package/optimize/es/components/basic_table/collapsed_item_actions.js +116 -169
  257. package/optimize/es/components/basic_table/custom_item_action.js +10 -83
  258. package/optimize/es/components/basic_table/default_item_action.js +23 -14
  259. package/optimize/es/components/basic_table/in_memory_table.a11y.js +13 -11
  260. package/optimize/es/components/breadcrumbs/breadcrumb.js +11 -7
  261. package/optimize/es/components/breadcrumbs/breadcrumb.styles.js +5 -0
  262. package/optimize/es/components/button/button_display/_button_display_content.js +3 -1
  263. package/optimize/es/components/button/button_empty/button_empty.js +2 -2
  264. package/optimize/es/components/card/card.a11y.js +5 -18
  265. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +2 -2
  266. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_body_footer.js +4 -1
  267. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_body_footer.styles.js +12 -9
  268. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +1 -3
  269. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +10 -5
  270. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +8 -36
  271. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.styles.js +1 -19
  272. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +6 -23
  273. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.styles.js +4 -4
  274. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_group.js +6 -10
  275. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +9 -5
  276. package/optimize/es/components/context_menu/context_menu_item.js +9 -6
  277. package/optimize/es/components/context_menu/context_menu_item.styles.js +1 -1
  278. package/optimize/es/components/datagrid/body/data_grid_cell.js +38 -30
  279. package/optimize/es/components/datagrid/body/data_grid_cell_actions.js +12 -12
  280. package/optimize/es/components/datagrid/body/data_grid_cell_popover.js +43 -10
  281. package/optimize/es/components/datagrid/body/header/data_grid_header_cell.js +49 -28
  282. package/optimize/es/components/datagrid/controls/column_selector.js +19 -39
  283. package/optimize/es/components/datagrid/controls/column_sorting.js +18 -29
  284. package/optimize/es/components/datagrid/controls/data_grid_toolbar_control.js +70 -0
  285. package/optimize/es/components/datagrid/controls/display_selector.js +0 -1
  286. package/optimize/es/components/datagrid/controls/fullscreen_selector.js +2 -6
  287. package/optimize/es/components/datagrid/controls/index.js +2 -1
  288. package/optimize/es/components/datagrid/index.js +1 -1
  289. package/optimize/es/components/datagrid/utils/row_heights.js +1 -1
  290. package/optimize/es/components/date_picker/super_date_picker/super_update_button.js +1 -1
  291. package/optimize/es/components/error_boundary/error_boundary.a11y.js +1 -1
  292. package/optimize/es/components/expression/expression.a11y.js +2 -4
  293. package/optimize/es/components/filter_group/filter_button.js +2 -2
  294. package/optimize/es/components/focus_trap/focus_trap.a11y.js +3 -3
  295. package/optimize/es/components/form/range/range.a11y.js +5 -10
  296. package/optimize/es/components/form/super_select/super_select.js +3 -2
  297. package/optimize/es/components/form/super_select/super_select_control.js +13 -20
  298. package/optimize/es/components/header/header.a11y.js +1 -1
  299. package/optimize/es/components/icon/assets/endpoint.js +36 -0
  300. package/optimize/es/components/icon/icon_map.js +1 -0
  301. package/optimize/es/components/image/image.a11y.js +1 -2
  302. package/optimize/es/components/key_pad_menu/key_pad_menu.a11y.js +5 -5
  303. package/optimize/es/components/link/external_link_icon.js +41 -0
  304. package/optimize/es/components/link/link.js +6 -20
  305. package/optimize/es/components/link/link.styles.js +2 -5
  306. package/optimize/es/components/list_group/list_group_item.js +8 -3
  307. package/optimize/es/components/list_group/list_group_item.styles.js +2 -1
  308. package/optimize/es/components/notification/notification_event.a11y.js +1 -2
  309. package/optimize/es/components/popover/popover.js +4 -1
  310. package/optimize/es/components/resizable_container/resizable_container.a11y.js +4 -8
  311. package/optimize/es/components/search_bar/search_bar.a11y.js +3 -6
  312. package/optimize/es/components/selectable/selectable_list/selectable_list.js +204 -76
  313. package/optimize/es/components/text/text.styles.js +2 -2
  314. package/optimize/es/components/text_truncate/text_truncate.js +26 -9
  315. package/optimize/lib/components/accordion/accordion.a11y.js +1 -3
  316. package/optimize/lib/components/basic_table/action_types.js +8 -2
  317. package/optimize/lib/components/basic_table/basic_table.a11y.js +1 -2
  318. package/optimize/lib/components/basic_table/collapsed_item_actions.js +123 -174
  319. package/optimize/lib/components/basic_table/custom_item_action.js +17 -91
  320. package/optimize/lib/components/basic_table/default_item_action.js +23 -14
  321. package/optimize/lib/components/basic_table/in_memory_table.a11y.js +13 -11
  322. package/optimize/lib/components/breadcrumbs/breadcrumb.js +11 -7
  323. package/optimize/lib/components/breadcrumbs/breadcrumb.styles.js +5 -0
  324. package/optimize/lib/components/button/button_display/_button_display_content.js +3 -1
  325. package/optimize/lib/components/button/button_empty/button_empty.js +2 -2
  326. package/optimize/lib/components/card/card.a11y.js +5 -18
  327. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +1 -1
  328. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_body_footer.js +4 -1
  329. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_body_footer.styles.js +12 -9
  330. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +1 -3
  331. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +10 -5
  332. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +8 -36
  333. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.styles.js +11 -28
  334. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +6 -26
  335. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.styles.js +4 -4
  336. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_group.js +6 -10
  337. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +9 -5
  338. package/optimize/lib/components/context_menu/context_menu_item.js +9 -6
  339. package/optimize/lib/components/context_menu/context_menu_item.styles.js +1 -1
  340. package/optimize/lib/components/datagrid/body/data_grid_cell.js +38 -30
  341. package/optimize/lib/components/datagrid/body/data_grid_cell_actions.js +12 -12
  342. package/optimize/lib/components/datagrid/body/data_grid_cell_popover.js +43 -10
  343. package/optimize/lib/components/datagrid/body/header/data_grid_header_cell.js +55 -36
  344. package/optimize/lib/components/datagrid/controls/column_selector.js +19 -39
  345. package/optimize/lib/components/datagrid/controls/column_sorting.js +18 -29
  346. package/optimize/lib/components/datagrid/controls/data_grid_toolbar_control.js +75 -0
  347. package/optimize/lib/components/datagrid/controls/display_selector.js +0 -1
  348. package/optimize/lib/components/datagrid/controls/fullscreen_selector.js +2 -6
  349. package/optimize/lib/components/datagrid/controls/index.js +8 -1
  350. package/optimize/lib/components/datagrid/index.js +8 -1
  351. package/optimize/lib/components/datagrid/utils/row_heights.js +1 -1
  352. package/optimize/lib/components/date_picker/super_date_picker/super_update_button.js +1 -1
  353. package/optimize/lib/components/error_boundary/error_boundary.a11y.js +1 -1
  354. package/optimize/lib/components/expression/expression.a11y.js +2 -4
  355. package/optimize/lib/components/filter_group/filter_button.js +2 -2
  356. package/optimize/lib/components/focus_trap/focus_trap.a11y.js +3 -3
  357. package/optimize/lib/components/form/range/range.a11y.js +5 -10
  358. package/optimize/lib/components/form/super_select/super_select.js +3 -2
  359. package/optimize/lib/components/form/super_select/super_select_control.js +12 -19
  360. package/optimize/lib/components/header/header.a11y.js +1 -1
  361. package/optimize/lib/components/icon/assets/endpoint.js +45 -0
  362. package/optimize/lib/components/icon/icon_map.js +1 -0
  363. package/optimize/lib/components/icon/svgs/endpoint.svg +4 -0
  364. package/optimize/lib/components/image/image.a11y.js +1 -2
  365. package/optimize/lib/components/key_pad_menu/key_pad_menu.a11y.js +5 -5
  366. package/optimize/lib/components/link/external_link_icon.js +47 -0
  367. package/optimize/lib/components/link/link.js +6 -20
  368. package/optimize/lib/components/link/link.styles.js +1 -4
  369. package/optimize/lib/components/list_group/list_group_item.js +8 -3
  370. package/optimize/lib/components/list_group/list_group_item.styles.js +2 -1
  371. package/optimize/lib/components/notification/notification_event.a11y.js +1 -2
  372. package/optimize/lib/components/popover/popover.js +4 -1
  373. package/optimize/lib/components/resizable_container/resizable_container.a11y.js +4 -8
  374. package/optimize/lib/components/search_bar/search_bar.a11y.js +3 -6
  375. package/optimize/lib/components/selectable/selectable_list/selectable_list.js +204 -76
  376. package/optimize/lib/components/text/text.styles.js +2 -2
  377. package/optimize/lib/components/text_truncate/text_truncate.js +25 -8
  378. package/package.json +6 -7
  379. package/src/components/datagrid/_data_grid_data_row.scss +139 -100
  380. package/src/components/datagrid/_mixins.scss +2 -2
  381. package/src/components/datagrid/body/header/_data_grid_header_row.scss +36 -28
  382. package/src/components/datagrid/controls/_data_grid_toolbar.scss +0 -5
  383. package/src/components/form/form_row/_form_row.scss +1 -1
  384. package/src/components/table/_responsive.scss +19 -0
  385. package/src/components/table/_table.scss +4 -9
  386. package/test-env/components/accordion/accordion.a11y.js +1 -3
  387. package/test-env/components/auto_sizer/auto_sizer.js +10 -3
  388. package/test-env/components/avatar/avatar.js +1 -1
  389. package/test-env/components/badge/badge.js +1 -1
  390. package/test-env/components/badge/beta_badge/beta_badge.js +1 -1
  391. package/test-env/components/basic_table/action_types.js +8 -2
  392. package/test-env/components/basic_table/basic_table.a11y.js +1 -2
  393. package/test-env/components/basic_table/basic_table.js +9 -9
  394. package/test-env/components/basic_table/collapsed_item_actions.js +124 -251
  395. package/test-env/components/basic_table/custom_item_action.js +18 -100
  396. package/test-env/components/basic_table/default_item_action.js +23 -14
  397. package/test-env/components/basic_table/in_memory_table.a11y.js +13 -11
  398. package/test-env/components/basic_table/in_memory_table.js +9 -9
  399. package/test-env/components/breadcrumbs/breadcrumb.js +11 -7
  400. package/test-env/components/breadcrumbs/breadcrumb.styles.js +5 -0
  401. package/test-env/components/button/button_display/_button_display.js +6 -4
  402. package/test-env/components/button/button_display/_button_display_content.js +9 -5
  403. package/test-env/components/button/button_empty/button_empty.js +10 -8
  404. package/test-env/components/button/button_group/button_group.js +6 -4
  405. package/test-env/components/button/button_group/button_group_button.js +6 -4
  406. package/test-env/components/button/button_icon/button_icon.js +1 -1
  407. package/test-env/components/call_out/call_out.js +1 -1
  408. package/test-env/components/card/card.a11y.js +5 -18
  409. package/test-env/components/card/card.js +1 -1
  410. package/test-env/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
  411. package/test-env/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +1 -1
  412. package/test-env/components/collapsible_nav_beta/collapsible_nav_body_footer.js +4 -1
  413. package/test-env/components/collapsible_nav_beta/collapsible_nav_body_footer.styles.js +12 -9
  414. package/test-env/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +1 -101
  415. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +21 -59
  416. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +91 -39
  417. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +68 -82
  418. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.styles.js +11 -28
  419. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +7 -105
  420. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.styles.js +4 -4
  421. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_group.js +7 -90
  422. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +154 -134
  423. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_link.js +0 -10
  424. package/test-env/components/combo_box/combo_box.js +1 -1
  425. package/test-env/components/comment_list/comment.js +2 -2
  426. package/test-env/components/comment_list/comment_event.js +1 -1
  427. package/test-env/components/comment_list/comment_list.js +2 -2
  428. package/test-env/components/comment_list/comment_timeline.js +1 -1
  429. package/test-env/components/context_menu/context_menu_item.js +16 -8
  430. package/test-env/components/context_menu/context_menu_item.styles.js +1 -1
  431. package/test-env/components/datagrid/body/data_grid_body.js +29 -19
  432. package/test-env/components/datagrid/body/data_grid_body_custom.js +29 -19
  433. package/test-env/components/datagrid/body/data_grid_body_virtualized.js +29 -19
  434. package/test-env/components/datagrid/body/data_grid_cell.js +91 -68
  435. package/test-env/components/datagrid/body/data_grid_cell_actions.js +12 -12
  436. package/test-env/components/datagrid/body/data_grid_cell_popover.js +43 -10
  437. package/test-env/components/datagrid/body/header/data_grid_header_cell.js +83 -54
  438. package/test-env/components/datagrid/body/header/data_grid_header_row.js +29 -19
  439. package/test-env/components/datagrid/controls/column_selector.js +19 -39
  440. package/test-env/components/datagrid/controls/column_sorting.js +18 -29
  441. package/test-env/components/datagrid/controls/column_sorting_draggable.js +1 -1
  442. package/test-env/components/datagrid/controls/data_grid_toolbar_control.js +158 -0
  443. package/test-env/components/datagrid/controls/display_selector.js +0 -1
  444. package/test-env/components/datagrid/controls/fullscreen_selector.js +2 -6
  445. package/test-env/components/datagrid/controls/index.js +8 -1
  446. package/test-env/components/datagrid/index.js +8 -1
  447. package/test-env/components/datagrid/utils/in_memory.js +28 -18
  448. package/test-env/components/datagrid/utils/row_heights.js +1 -1
  449. package/test-env/components/date_picker/auto_refresh/auto_refresh.js +6 -4
  450. package/test-env/components/date_picker/date_picker.js +2 -2
  451. package/test-env/components/date_picker/date_picker_range.js +1 -1
  452. package/test-env/components/date_picker/super_date_picker/super_update_button.js +1 -1
  453. package/test-env/components/empty_prompt/empty_prompt.js +1 -1
  454. package/test-env/components/error_boundary/error_boundary.a11y.js +1 -1
  455. package/test-env/components/expression/expression.a11y.js +2 -4
  456. package/test-env/components/facet/facet_button.js +6 -4
  457. package/test-env/components/filter_group/filter_button.js +2 -2
  458. package/test-env/components/focus_trap/focus_trap.a11y.js +3 -3
  459. package/test-env/components/form/field_number/field_number.js +1 -1
  460. package/test-env/components/form/field_text/field_text.js +2 -2
  461. package/test-env/components/form/form_control_layout/form_control_layout.js +2 -2
  462. package/test-env/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
  463. package/test-env/components/form/form_control_layout/form_control_layout_icons.js +2 -2
  464. package/test-env/components/form/range/range.a11y.js +5 -10
  465. package/test-env/components/form/super_select/super_select.js +3 -2
  466. package/test-env/components/form/super_select/super_select_control.js +12 -19
  467. package/test-env/components/header/header.a11y.js +1 -1
  468. package/test-env/components/header/header_links/header_link.js +8 -6
  469. package/test-env/components/header/header_links/header_links.js +1 -1
  470. package/test-env/components/header/header_logo/header_logo.js +1 -1
  471. package/test-env/components/header/header_section/header_section_item_button.js +8 -6
  472. package/test-env/components/icon/assets/endpoint.js +45 -0
  473. package/test-env/components/icon/icon_map.js +1 -0
  474. package/test-env/components/image/image.a11y.js +1 -2
  475. package/test-env/components/key_pad_menu/key_pad_menu.a11y.js +5 -5
  476. package/test-env/components/key_pad_menu/key_pad_menu_item.js +1 -1
  477. package/test-env/components/link/external_link_icon.js +56 -0
  478. package/test-env/components/link/link.js +6 -20
  479. package/test-env/components/link/link.styles.js +1 -4
  480. package/test-env/components/list_group/list_group.js +8 -3
  481. package/test-env/components/list_group/list_group_item.js +16 -6
  482. package/test-env/components/list_group/list_group_item.styles.js +2 -1
  483. package/test-env/components/list_group/list_group_item_extra_action.js +1 -1
  484. package/test-env/components/list_group/pinnable_list_group/pinnable_list_group.js +16 -6
  485. package/test-env/components/loading/loading_logo.js +1 -1
  486. package/test-env/components/markdown_editor/markdown_editor.js +1 -1
  487. package/test-env/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
  488. package/test-env/components/markdown_editor/markdown_editor_footer.js +1 -1
  489. package/test-env/components/markdown_editor/markdown_editor_toolbar.js +1 -1
  490. package/test-env/components/notification/notification_event.a11y.js +1 -2
  491. package/test-env/components/notification/notification_event.js +9 -7
  492. package/test-env/components/notification/notification_event_meta.js +1 -1
  493. package/test-env/components/page/page_header/page_header_content.js +1 -1
  494. package/test-env/components/popover/popover.js +4 -1
  495. package/test-env/components/resizable_container/resizable_container.a11y.js +4 -8
  496. package/test-env/components/search_bar/search_bar.a11y.js +3 -6
  497. package/test-env/components/selectable/selectable.js +16 -1
  498. package/test-env/components/selectable/selectable_list/selectable_list.js +233 -79
  499. package/test-env/components/selectable/selectable_list/selectable_list_item.js +1 -1
  500. package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +17 -2
  501. package/test-env/components/table/table_header_button.js +1 -1
  502. package/test-env/components/text/text.styles.js +2 -2
  503. package/test-env/components/text_truncate/text_truncate.js +32 -9
  504. package/test-env/components/timeline/timeline_item_icon.js +1 -1
  505. package/test-env/components/toast/global_toast_list.js +1 -1
  506. package/test-env/components/toast/toast.js +1 -1
  507. package/test-env/components/tool_tip/icon_tip.js +1 -1
@@ -8,8 +8,8 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
8
8
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
9
9
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
10
10
  var _excluded = ["data"],
11
- _excluded2 = ["label", "isGroupLabel", "checked", "disabled", "prepend", "append", "ref", "key", "searchableLabel", "data"],
12
- _excluded3 = ["className", "options", "searchValue", "onOptionClick", "renderOption", "height", "windowProps", "rowHeight", "activeOptionIndex", "makeOptionId", "showIcons", "singleSelection", "visibleOptions", "allowExclusions", "bordered", "paddingSize", "searchable", "onFocusBadge", "listId", "setActiveOptionIndex", "aria-label", "aria-labelledby", "aria-describedby", "role", "isVirtualized", "textWrap"];
11
+ _excluded2 = ["label", "isGroupLabel", "checked", "disabled", "prepend", "append", "ref", "key", "searchableLabel", "data", "truncationProps"],
12
+ _excluded3 = ["className", "options", "searchValue", "onOptionClick", "renderOption", "height", "windowProps", "rowHeight", "activeOptionIndex", "makeOptionId", "showIcons", "singleSelection", "visibleOptions", "allowExclusions", "bordered", "paddingSize", "searchable", "onFocusBadge", "listId", "setActiveOptionIndex", "aria-label", "aria-labelledby", "aria-describedby", "role", "isVirtualized", "textWrap", "truncationProps"];
13
13
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
14
14
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
15
15
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
@@ -27,6 +27,8 @@ import classNames from 'classnames';
27
27
  import { FixedSizeList, areEqual } from 'react-window';
28
28
  import { EuiAutoSizer } from '../../auto_sizer';
29
29
  import { EuiHighlight } from '../../highlight';
30
+ import { EuiMark } from '../../mark';
31
+ import { EuiTextTruncate } from '../../text_truncate';
30
32
  import { EuiSelectableListItem } from './selectable_list_item';
31
33
 
32
34
  // Consumer Configurable Props via `EuiSelectable.listProps`
@@ -81,20 +83,23 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
81
83
  }
82
84
  }
83
85
  });
84
- _defineProperty(_assertThisInitialized(_this), "ariaSetSize", 0);
85
- _defineProperty(_assertThisInitialized(_this), "ariaPosInSetMap", {});
86
+ // This utility is necessary to exclude group labels from the aria set count
86
87
  _defineProperty(_assertThisInitialized(_this), "calculateAriaSetAttrs", function (optionArray) {
87
- _this.ariaPosInSetMap = {};
88
+ var ariaPosInSetMap = {};
88
89
  var latestAriaPosIndex = 0;
89
90
  optionArray.forEach(function (option, index) {
90
91
  if (!option.isGroupLabel) {
91
92
  latestAriaPosIndex++;
92
- _this.ariaPosInSetMap[index] = latestAriaPosIndex;
93
+ ariaPosInSetMap[index] = latestAriaPosIndex;
93
94
  }
94
95
  });
95
- _this.ariaSetSize = latestAriaPosIndex;
96
+ return {
97
+ ariaPosInSetMap: ariaPosInSetMap,
98
+ ariaSetSize: latestAriaPosIndex
99
+ };
96
100
  });
97
101
  _defineProperty(_assertThisInitialized(_this), "ListRow", /*#__PURE__*/memo(function (_ref) {
102
+ var _option$textWrap;
98
103
  var data = _ref.data,
99
104
  index = _ref.index,
100
105
  style = _ref.style;
@@ -111,19 +116,20 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
111
116
  key = option.key,
112
117
  searchableLabel = option.searchableLabel,
113
118
  _data = option.data,
119
+ _truncationProps = option.truncationProps,
114
120
  optionRest = _objectWithoutProperties(option, _excluded2);
115
121
  var _this$props2 = _this.props,
116
122
  activeOptionIndex = _this$props2.activeOptionIndex,
117
123
  allowExclusions = _this$props2.allowExclusions,
118
124
  onFocusBadge = _this$props2.onFocusBadge,
119
125
  paddingSize = _this$props2.paddingSize,
120
- searchValue = _this$props2.searchValue,
121
126
  showIcons = _this$props2.showIcons,
122
127
  makeOptionId = _this$props2.makeOptionId,
123
128
  renderOption = _this$props2.renderOption,
124
129
  setActiveOptionIndex = _this$props2.setActiveOptionIndex,
125
130
  searchable = _this$props2.searchable,
126
- textWrap = _this$props2.textWrap;
131
+ searchValue = _this$props2.searchValue,
132
+ isVirtualized = _this$props2.isVirtualized;
127
133
  if (isGroupLabel) {
128
134
  return ___EmotionJSX("li", _extends({
129
135
  role: "presentation",
@@ -133,6 +139,15 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
133
139
  }, optionRest), prepend, label, append);
134
140
  }
135
141
  var id = makeOptionId(index);
142
+ var isFocused = activeOptionIndex === index;
143
+
144
+ // Text wrapping
145
+ var canWrap = !isVirtualized;
146
+ var _textWrap = (_option$textWrap = option.textWrap) !== null && _option$textWrap !== void 0 ? _option$textWrap : _this.props.textWrap;
147
+ var textWrap = canWrap ? _textWrap : 'truncate';
148
+
149
+ // Truncation config (if any). If none, CSS truncation is used
150
+ var truncationProps = textWrap === 'truncate' ? _this.getTruncationProps(option, isFocused) : undefined;
136
151
  return ___EmotionJSX(EuiSelectableListItem, _extends({
137
152
  key: id,
138
153
  id: id,
@@ -145,14 +160,14 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
145
160
  _this.onAddOrRemoveOption(option, event);
146
161
  },
147
162
  ref: ref ? ref.bind(null, index) : undefined,
148
- isFocused: activeOptionIndex === index,
163
+ isFocused: isFocused,
149
164
  title: searchableLabel || label,
150
165
  checked: checked,
151
166
  disabled: disabled,
152
167
  prepend: prepend,
153
168
  append: append,
154
- "aria-posinset": _this.ariaPosInSetMap[index],
155
- "aria-setsize": _this.ariaSetSize,
169
+ "aria-posinset": _this.state.ariaPosInSetMap[index],
170
+ "aria-setsize": _this.state.ariaSetSize,
156
171
  onFocusBadge: onFocusBadge,
157
172
  allowExclusions: allowExclusions,
158
173
  showIcons: showIcons,
@@ -160,16 +175,18 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
160
175
  searchable: searchable,
161
176
  textWrap: textWrap
162
177
  }, optionRest), renderOption ? renderOption( // @ts-ignore complex
163
- _objectSpread(_objectSpread({}, _option), optionData), _this.props.searchValue) : ___EmotionJSX(EuiHighlight, {
164
- search: searchValue
165
- }, label));
178
+ _objectSpread(_objectSpread({}, _option), optionData), searchValue) : searchValue ? _this.renderSearchedText(label, truncationProps) : truncationProps ? _this.renderTruncatedText(label, truncationProps) : label);
166
179
  }, areEqual));
167
- _defineProperty(_assertThisInitialized(_this), "renderVirtualizedList", function (heightIsFull, optionArray) {
180
+ _defineProperty(_assertThisInitialized(_this), "renderVirtualizedList", function () {
168
181
  if (!_this.props.isVirtualized) return null;
182
+ var _this$state = _this.state,
183
+ optionArray = _this$state.optionArray,
184
+ itemData = _this$state.itemData;
169
185
  var _this$props3 = _this.props,
170
186
  windowProps = _this$props3.windowProps,
171
187
  forcedHeight = _this$props3.height,
172
188
  rowHeight = _this$props3.rowHeight;
189
+ var heightIsFull = forcedHeight === 'full';
173
190
  var virtualizationProps = _objectSpread({
174
191
  className: 'euiSelectableList__list',
175
192
  ref: _this.setListRef,
@@ -177,7 +194,7 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
177
194
  innerRef: _this.setListBoxRef,
178
195
  innerElementType: 'ul',
179
196
  itemCount: optionArray.length,
180
- itemData: optionArray,
197
+ itemData: itemData,
181
198
  itemSize: rowHeight,
182
199
  'data-skip-axe': 'scrollable-region-focusable'
183
200
  }, windowProps);
@@ -197,7 +214,9 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
197
214
  calculatedHeight = numVisibleOptions * rowHeight;
198
215
  }
199
216
  }
200
- return heightIsFull ? ___EmotionJSX(EuiAutoSizer, null, function (_ref2) {
217
+ return heightIsFull ? ___EmotionJSX(EuiAutoSizer, {
218
+ onResize: _this.calculateDefaultOptionWidth
219
+ }, function (_ref2) {
201
220
  var width = _ref2.width,
202
221
  height = _ref2.height;
203
222
  return ___EmotionJSX(FixedSizeList, _extends({
@@ -205,7 +224,8 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
205
224
  height: height
206
225
  }, virtualizationProps), _this.ListRow);
207
226
  }) : ___EmotionJSX(EuiAutoSizer, {
208
- disableHeight: true
227
+ disableHeight: true,
228
+ onResize: _this.calculateDefaultOptionWidth
209
229
  }, function (_ref3) {
210
230
  var width = _ref3.width;
211
231
  return ___EmotionJSX(FixedSizeList, _extends({
@@ -214,17 +234,111 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
214
234
  }, virtualizationProps), _this.ListRow);
215
235
  });
216
236
  });
237
+ _defineProperty(_assertThisInitialized(_this), "forceVirtualizedListRowRerender", function () {
238
+ _this.setState({
239
+ itemData: _objectSpread({}, _this.state.optionArray)
240
+ });
241
+ });
242
+ // EuiTextTruncate is expensive perf-wise - we use several utilities here to
243
+ // offset its performance cost
244
+ // and creates a resize observer for
245
+ // each individual item. This logic tries to offset this performance hit by
246
+ // guesstimating a default width for each option
247
+ _defineProperty(_assertThisInitialized(_this), "focusBadgeOffset", 0);
248
+ _defineProperty(_assertThisInitialized(_this), "calculateDefaultOptionWidth", function (_ref4) {
249
+ var containerWidth = _ref4.width;
250
+ var _this$props4 = _this.props,
251
+ truncationProps = _this$props4.truncationProps,
252
+ searchable = _this$props4.searchable,
253
+ searchValue = _this$props4.searchValue;
254
+
255
+ // If it's not likely we'll need to use EuiTextTruncate, don't set state/rerender on every panel resize
256
+ var mayTruncate = searchable || truncationProps;
257
+ if (!mayTruncate) return;
258
+ var paddingOffset = _this.props.paddingSize === 'none' ? 0 : 24; // Defaults to 's'
259
+ var checkedIconOffset = _this.props.showIcons === false ? 0 : 28; // Defaults to true
260
+ _this.focusBadgeOffset = _this.props.onFocusBadge === false ? 0 : 46;
261
+
262
+ // Wait a tick for the listbox ref to update before proceeding
263
+ requestAnimationFrame(function () {
264
+ var scrollbarOffset = _this.listBoxRef ? containerWidth - _this.listBoxRef.offsetWidth : 0;
265
+ _this.setState({
266
+ defaultOptionWidth: containerWidth - scrollbarOffset - paddingOffset - checkedIconOffset
267
+ });
268
+
269
+ // Potentially force list rows to rerender on dynamic resize as well,
270
+ // but try to do it as lightly as possible
271
+ if (truncationProps || searchable && searchValue) {
272
+ _this.forceVirtualizedListRowRerender();
273
+ }
274
+ });
275
+ });
276
+ _defineProperty(_assertThisInitialized(_this), "getTruncationProps", function (option, isFocused) {
277
+ // Individual truncation settings should override component-wide settings
278
+ var truncationProps = _objectSpread(_objectSpread({}, _this.props.truncationProps), option.truncationProps);
279
+
280
+ // If we're not actually using EuiTextTruncate, no need to continue
281
+ var hasComplexTruncation = _this.props.searchValue || Object.keys(truncationProps).length > 0;
282
+ if (!hasComplexTruncation) return undefined;
283
+
284
+ // Determine whether we can use the optimized default option width
285
+ var defaultOptionWidth = _this.state.defaultOptionWidth;
286
+ var useDefaultWidth = !option.append && !option.prepend;
287
+ var defaultWidth = useDefaultWidth && defaultOptionWidth ? isFocused ? defaultOptionWidth - _this.focusBadgeOffset : defaultOptionWidth : undefined;
288
+ return _objectSpread({
289
+ width: defaultWidth
290
+ }, truncationProps);
291
+ });
292
+ _defineProperty(_assertThisInitialized(_this), "renderSearchedText", function (text, truncationProps) {
293
+ var searchValue = _this.props.searchValue;
294
+
295
+ // If truncationProps is undefined, we're using non-virtualized text wrapping
296
+ if (!truncationProps) {
297
+ return ___EmotionJSX(EuiHighlight, {
298
+ search: searchValue
299
+ }, text);
300
+ }
301
+ var searchPositionStart = text.toLowerCase().indexOf(searchValue.toLowerCase());
302
+ var searchPositionCenter = searchPositionStart + Math.floor(searchValue.length / 2);
303
+ return ___EmotionJSX(EuiTextTruncate, _extends({}, truncationProps, {
304
+ // When searching, don't allow overriding the truncation settings
305
+ truncation: "startEnd",
306
+ truncationPosition: searchPositionCenter,
307
+ text: text
308
+ }), function (text) {
309
+ return ___EmotionJSX(React.Fragment, null, text.length >= searchValue.length ? ___EmotionJSX(EuiHighlight, {
310
+ search: searchValue
311
+ }, text) :
312
+ // If the available truncated text is shorter than the full search string,
313
+ // just highlight the entire truncated text
314
+ ___EmotionJSX(EuiMark, null, text));
315
+ });
316
+ });
317
+ _defineProperty(_assertThisInitialized(_this), "renderTruncatedText", function (text, truncationProps) {
318
+ return (
319
+ // For some bizarre reason, truncation in EuiSelectable is off on initial mount
320
+ // (but not on rerender) for Safari and _some_ truncation types in Firefox :|
321
+ // Waiting a tick before calculating truncation seems to smooth over the issue
322
+ ___EmotionJSX(EuiTextTruncate, _extends({
323
+ calculationDelayMs: 2
324
+ }, truncationProps, {
325
+ text: text
326
+ }), function (text) {
327
+ return text;
328
+ })
329
+ );
330
+ });
217
331
  _defineProperty(_assertThisInitialized(_this), "onAddOrRemoveOption", function (option, event) {
218
332
  if (option.disabled) {
219
333
  return;
220
334
  }
221
- var _this$props4 = _this.props,
222
- allowExclusions = _this$props4.allowExclusions,
223
- options = _this$props4.options,
224
- _this$props4$visibleO = _this$props4.visibleOptions,
225
- visibleOptions = _this$props4$visibleO === void 0 ? options : _this$props4$visibleO;
226
- _this.props.setActiveOptionIndex(visibleOptions.findIndex(function (_ref4) {
227
- var label = _ref4.label;
335
+ var _this$props5 = _this.props,
336
+ allowExclusions = _this$props5.allowExclusions,
337
+ options = _this$props5.options,
338
+ _this$props5$visibleO = _this$props5.visibleOptions,
339
+ visibleOptions = _this$props5$visibleO === void 0 ? options : _this$props5$visibleO;
340
+ _this.props.setActiveOptionIndex(visibleOptions.findIndex(function (_ref5) {
341
+ var label = _ref5.label;
228
342
  return label === option.label;
229
343
  }), function () {
230
344
  if (option.checked === 'on' && allowExclusions) {
@@ -237,10 +351,10 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
237
351
  });
238
352
  });
239
353
  _defineProperty(_assertThisInitialized(_this), "onAddOption", function (addedOption, event) {
240
- var _this$props5 = _this.props,
241
- onOptionClick = _this$props5.onOptionClick,
242
- options = _this$props5.options,
243
- singleSelection = _this$props5.singleSelection;
354
+ var _this$props6 = _this.props,
355
+ onOptionClick = _this$props6.onOptionClick,
356
+ options = _this$props6.options,
357
+ singleSelection = _this$props6.singleSelection;
244
358
  var changedOption = _objectSpread({}, addedOption);
245
359
  var updatedOptions = options.map(function (option) {
246
360
  // if singleSelection is enabled, uncheck any selected option(s)
@@ -259,10 +373,10 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
259
373
  onOptionClick(updatedOptions, event, changedOption);
260
374
  });
261
375
  _defineProperty(_assertThisInitialized(_this), "onRemoveOption", function (removedOption, event) {
262
- var _this$props6 = _this.props,
263
- onOptionClick = _this$props6.onOptionClick,
264
- singleSelection = _this$props6.singleSelection,
265
- options = _this$props6.options;
376
+ var _this$props7 = _this.props,
377
+ onOptionClick = _this$props7.onOptionClick,
378
+ singleSelection = _this$props7.singleSelection,
379
+ options = _this$props7.options;
266
380
  var changedOption = _objectSpread({}, removedOption);
267
381
  var updatedOptions = options.map(function (option) {
268
382
  var updatedOption = _objectSpread({}, option);
@@ -275,9 +389,9 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
275
389
  onOptionClick(updatedOptions, event, changedOption);
276
390
  });
277
391
  _defineProperty(_assertThisInitialized(_this), "onExcludeOption", function (excludedOption, event) {
278
- var _this$props7 = _this.props,
279
- onOptionClick = _this$props7.onOptionClick,
280
- options = _this$props7.options;
392
+ var _this$props8 = _this.props,
393
+ onOptionClick = _this$props8.onOptionClick,
394
+ options = _this$props8.options;
281
395
  var changedOption = _objectSpread({}, excludedOption);
282
396
  var updatedOptions = options.map(function (option) {
283
397
  var updatedOption = _objectSpread({}, option);
@@ -289,69 +403,83 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
289
403
  });
290
404
  onOptionClick(updatedOptions, event, changedOption);
291
405
  });
406
+ var _optionArray = props.visibleOptions || props.options;
407
+ _this.state = _objectSpread({
408
+ defaultOptionWidth: 0,
409
+ optionArray: _optionArray,
410
+ itemData: _objectSpread({}, _optionArray)
411
+ }, _this.calculateAriaSetAttrs(_optionArray));
292
412
  return _this;
293
413
  }
294
414
  _createClass(EuiSelectableList, [{
295
415
  key: "componentDidUpdate",
296
- value: function componentDidUpdate() {
297
- var activeOptionIndex = this.props.activeOptionIndex;
416
+ value: function componentDidUpdate(prevProps) {
417
+ var _this$props9 = this.props,
418
+ activeOptionIndex = _this$props9.activeOptionIndex,
419
+ visibleOptions = _this$props9.visibleOptions,
420
+ options = _this$props9.options;
298
421
  if (this.listBoxRef && this.props.searchable !== true) {
299
422
  this.listBoxRef.setAttribute('aria-activedescendant', "".concat(this.props.makeOptionId(activeOptionIndex)));
300
423
  }
301
- if (this.listRef && typeof this.props.activeOptionIndex !== 'undefined') {
302
- this.listRef.scrollToItem(this.props.activeOptionIndex, 'auto');
424
+ if (this.listRef && typeof activeOptionIndex !== 'undefined') {
425
+ this.listRef.scrollToItem(activeOptionIndex, 'auto');
426
+ }
427
+ if (prevProps.visibleOptions !== visibleOptions || prevProps.options !== options) {
428
+ var optionArray = visibleOptions || options;
429
+ this.setState(_objectSpread({
430
+ optionArray: optionArray,
431
+ itemData: _objectSpread({}, optionArray)
432
+ }, this.calculateAriaSetAttrs(optionArray)));
303
433
  }
304
434
  }
305
435
  }, {
306
436
  key: "render",
307
437
  value: function render() {
308
438
  var _this2 = this;
309
- var _this$props8 = this.props,
310
- className = _this$props8.className,
311
- options = _this$props8.options,
312
- searchValue = _this$props8.searchValue,
313
- onOptionClick = _this$props8.onOptionClick,
314
- renderOption = _this$props8.renderOption,
315
- forcedHeight = _this$props8.height,
316
- windowProps = _this$props8.windowProps,
317
- rowHeight = _this$props8.rowHeight,
318
- activeOptionIndex = _this$props8.activeOptionIndex,
319
- makeOptionId = _this$props8.makeOptionId,
320
- showIcons = _this$props8.showIcons,
321
- singleSelection = _this$props8.singleSelection,
322
- visibleOptions = _this$props8.visibleOptions,
323
- allowExclusions = _this$props8.allowExclusions,
324
- bordered = _this$props8.bordered,
325
- paddingSize = _this$props8.paddingSize,
326
- searchable = _this$props8.searchable,
327
- onFocusBadge = _this$props8.onFocusBadge,
328
- listId = _this$props8.listId,
329
- setActiveOptionIndex = _this$props8.setActiveOptionIndex,
330
- ariaLabel = _this$props8['aria-label'],
331
- ariaLabelledby = _this$props8['aria-labelledby'],
332
- ariaDescribedby = _this$props8['aria-describedby'],
333
- role = _this$props8.role,
334
- isVirtualized = _this$props8.isVirtualized,
335
- textWrap = _this$props8.textWrap,
336
- rest = _objectWithoutProperties(_this$props8, _excluded3);
337
- var optionArray = visibleOptions || options;
338
- this.calculateAriaSetAttrs(optionArray);
339
- var heightIsFull = forcedHeight === 'full';
439
+ var _this$props10 = this.props,
440
+ className = _this$props10.className,
441
+ options = _this$props10.options,
442
+ searchValue = _this$props10.searchValue,
443
+ onOptionClick = _this$props10.onOptionClick,
444
+ renderOption = _this$props10.renderOption,
445
+ forcedHeight = _this$props10.height,
446
+ windowProps = _this$props10.windowProps,
447
+ rowHeight = _this$props10.rowHeight,
448
+ activeOptionIndex = _this$props10.activeOptionIndex,
449
+ makeOptionId = _this$props10.makeOptionId,
450
+ showIcons = _this$props10.showIcons,
451
+ singleSelection = _this$props10.singleSelection,
452
+ visibleOptions = _this$props10.visibleOptions,
453
+ allowExclusions = _this$props10.allowExclusions,
454
+ bordered = _this$props10.bordered,
455
+ paddingSize = _this$props10.paddingSize,
456
+ searchable = _this$props10.searchable,
457
+ onFocusBadge = _this$props10.onFocusBadge,
458
+ listId = _this$props10.listId,
459
+ setActiveOptionIndex = _this$props10.setActiveOptionIndex,
460
+ ariaLabel = _this$props10['aria-label'],
461
+ ariaLabelledby = _this$props10['aria-labelledby'],
462
+ ariaDescribedby = _this$props10['aria-describedby'],
463
+ role = _this$props10.role,
464
+ isVirtualized = _this$props10.isVirtualized,
465
+ textWrap = _this$props10.textWrap,
466
+ truncationProps = _this$props10.truncationProps,
467
+ rest = _objectWithoutProperties(_this$props10, _excluded3);
340
468
  var classes = classNames('euiSelectableList', {
341
- 'euiSelectableList-fullHeight': heightIsFull,
469
+ 'euiSelectableList-fullHeight': forcedHeight === 'full',
342
470
  'euiSelectableList-bordered': bordered
343
471
  }, className);
344
472
  return ___EmotionJSX("div", _extends({
345
473
  className: classes
346
- }, rest), isVirtualized ? this.renderVirtualizedList(heightIsFull, optionArray) : ___EmotionJSX("div", {
474
+ }, rest), isVirtualized ? this.renderVirtualizedList() : ___EmotionJSX("div", {
347
475
  className: "euiSelectableList__list",
348
476
  ref: this.removeScrollableTabStop
349
477
  }, ___EmotionJSX("ul", {
350
478
  ref: this.setListBoxRef
351
- }, optionArray.map(function (_, index) {
479
+ }, this.state.optionArray.map(function (_, index) {
352
480
  return /*#__PURE__*/React.createElement(_this2.ListRow, {
353
481
  key: index,
354
- data: optionArray,
482
+ data: _this2.state.optionArray,
355
483
  index: index
356
484
  }, null);
357
485
  }))));
@@ -54,7 +54,7 @@ var euiScaleText = function euiScaleText(euiThemeContext, options) {
54
54
  var blockQuoteBorderWidth = mathWithUnits(fontSize, function (x) {
55
55
  return x / 4;
56
56
  });
57
- return "\n font-size: ".concat(fontSize, ";\n line-height: ").concat(lineHeight, ";\n\n h1 {\n font-size: ").concat(headings.h1.fontSize, ";\n line-height: ").concat(headings.h1.lineHeight, ";\n }\n h1:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n\n h2 {\n font-size: ").concat(headings.h2.fontSize, ";\n line-height: ").concat(headings.h2.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n h3 {\n font-size: ").concat(headings.h3.fontSize, ";\n line-height: ").concat(headings.h3.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n h4 {\n font-size: ").concat(headings.h4.fontSize, ";\n line-height: ").concat(headings.h4.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n h5 {\n font-size: ").concat(headings.h5.fontSize, ";\n line-height: ").concat(headings.h5.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n h6 {\n font-size: ").concat(headings.h6.fontSize, ";\n line-height: ").concat(headings.h6.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n p,\n dl,\n blockquote,\n img,\n pre,\n > ul,\n > ol {\n ").concat(logicalCSS('margin-bottom', lineHeightSize), "\n }\n\n ul,\n ol {\n ").concat(logicalCSS('margin-left', lineHeightSize), "\n }\n\n /* The styles of the nested ordered lists follow the style of GitHub\n which is commonly used in Markdown or MDX formatting. */\n ol ol,\n ul ol {\n list-style-type: lower-roman;\n }\n\n ul ul ol,\n ul ol ol,\n ol ul ol,\n ol ol ol {\n list-style-type: lower-alpha;\n }\n \n blockquote {\n font-size: ").concat(fontSize, ";\n ").concat(logicalShorthandCSS('padding', "0 ".concat(fontSize)), "\n ").concat(logicalCSS('border-left-width', blockQuoteBorderWidth), "\n ").concat(logicalCSS('margin-bottom', fontSize), "\n }\n\n dd + dt {\n ").concat(logicalCSS('margin-top', fontSize), "\n }\n\n dt,\n .eui-definitionListReverse dd {\n font-size: ").concat(fontSize, ";\n line-height: ").concat(lineHeight, ";\n }\n\n .eui-definitionListReverse dt {\n font-size: ").concat(euiFontSize(euiThemeContext, 'xs', options).fontSize, ";\n color: ").concat(euiTheme.colors.text, ";\n }\n\n small {\n font-size: ").concat(euiFontSize(euiThemeContext, 's', options).fontSize, ";\n }\n\n pre:not(.euiCodeBlock__pre) {\n padding: ").concat(lineHeightSize, ";\n }\n\n code:not(.euiCode):not(.euiCodeBlock__code) {\n font-size: .9em; /* 90% of parent font size */\n }\n ").concat(
57
+ return "\n font-size: ".concat(fontSize, ";\n line-height: ").concat(lineHeight, ";\n\n h1 {\n font-size: ").concat(headings.h1.fontSize, ";\n line-height: ").concat(headings.h1.lineHeight, ";\n }\n h1:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n\n h2 {\n font-size: ").concat(headings.h2.fontSize, ";\n line-height: ").concat(headings.h2.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n h3 {\n font-size: ").concat(headings.h3.fontSize, ";\n line-height: ").concat(headings.h3.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n h4 {\n font-size: ").concat(headings.h4.fontSize, ";\n line-height: ").concat(headings.h4.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n h5 {\n font-size: ").concat(headings.h5.fontSize, ";\n line-height: ").concat(headings.h5.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n h6 {\n font-size: ").concat(headings.h6.fontSize, ";\n line-height: ").concat(headings.h6.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n p,\n dl,\n blockquote,\n pre,\n > ul,\n > ol {\n ").concat(logicalCSS('margin-bottom', lineHeightSize), "\n }\n\n ul,\n ol {\n ").concat(logicalCSS('margin-left', lineHeightSize), "\n }\n\n /* The styles of the nested ordered lists follow the style of GitHub\n which is commonly used in Markdown or MDX formatting. */\n ol ol,\n ul ol {\n list-style-type: lower-roman;\n }\n\n ul ul ol,\n ul ol ol,\n ol ul ol,\n ol ol ol {\n list-style-type: lower-alpha;\n }\n \n blockquote {\n font-size: ").concat(fontSize, ";\n ").concat(logicalShorthandCSS('padding', "0 ".concat(fontSize)), "\n ").concat(logicalCSS('border-left-width', blockQuoteBorderWidth), "\n ").concat(logicalCSS('margin-bottom', fontSize), "\n }\n\n dd + dt {\n ").concat(logicalCSS('margin-top', fontSize), "\n }\n\n dt,\n .eui-definitionListReverse dd {\n font-size: ").concat(fontSize, ";\n line-height: ").concat(lineHeight, ";\n }\n\n .eui-definitionListReverse dt {\n font-size: ").concat(euiFontSize(euiThemeContext, 'xs', options).fontSize, ";\n color: ").concat(euiTheme.colors.text, ";\n }\n\n small {\n font-size: ").concat(euiFontSize(euiThemeContext, 's', options).fontSize, ";\n }\n\n pre:not(.euiCodeBlock__pre) {\n padding: ").concat(lineHeightSize, ";\n }\n\n code:not(.euiCode):not(.euiCodeBlock__code) {\n font-size: .9em; /* 90% of parent font size */\n }\n ").concat(
58
58
  // when textSize is 'm', the 'kbd' element gets a line between the text and the border-bottom
59
59
  _customScale === 'm' ? "\n kbd {\n ".concat(logicalCSS('padding-bottom', euiTheme.size.xs), "\n /* Ensures the shape still looks like a square when only one character */\n ").concat(logicalCSS('min-width', euiTheme.size.l), "\n ").concat(logicalTextAlignCSS('center'), "\n }\n \n kbd::after {\n content: '';\n ").concat(logicalCSS('border-bottom', "".concat(euiTheme.border.width.thin, " solid ").concat(euiTheme.colors.text)), "\n position: absolute;\n ").concat(logicalCSS('bottom', euiTheme.size.xxs), "\n ").concat(logicalCSS('left', 0), "\n ").concat(logicalCSS('width', '100%'), "\n }") : '', "\n ");
60
60
  };
@@ -65,7 +65,7 @@ var euiScaleText = function euiScaleText(euiThemeContext, options) {
65
65
  export var euiTextStyles = function euiTextStyles(euiThemeContext) {
66
66
  var euiTheme = euiThemeContext.euiTheme;
67
67
  return {
68
- euiText: /*#__PURE__*/css(euiText(euiTheme, true), "clear:both;a:not([class]){", euiLinkCSS(euiThemeContext), ";}img{display:block;", logicalCSS('max-width', '100%'), ";}ul{list-style:disc;}ol{list-style:decimal;}blockquote{border-inline-start-color:", euiTheme.border.color, ";border-inline-start-style:solid;}blockquote:not(.euiMarkdownFormat__blockquote){color:", euiTheme.colors.subduedText, ";}h1{", euiTitle(euiThemeContext, 'l'), ";}h2{", euiTitle(euiThemeContext, 'm'), ";}h3{", euiTitle(euiThemeContext, 's'), ";}h4,dt{", euiTitle(euiThemeContext, 'xs'), ";}h5{", euiTitle(euiThemeContext, 'xxs'), ";}h6{", euiTitle(euiThemeContext, 'xxxs'), " text-transform:uppercase;}h1,h2,h3,h4,h5,h6,dt{color:inherit;}pre:not(.euiCodeBlock__pre){white-space:pre-wrap;background:", euiBackgroundColor(euiThemeContext, 'subdued'), ";color:", euiTheme.colors.text, ";}pre:not(.euiCodeBlock__pre),pre:not(.euiCodeBlock__pre) code{display:block;}>:last-child{", logicalCSS('margin-bottom', '0 !important'), ";}kbd{position:relative;display:inline-block;", logicalCSS('padding-vertical', euiTheme.size.xxs), " ", logicalCSS('padding-horizontal', euiTheme.size.xs), " line-height:1;border:", euiTheme.border.width.thin, " solid ", euiTheme.colors.text, ";border-radius:", mathWithUnits(euiTheme.border.radius.small, function (x) {
68
+ euiText: /*#__PURE__*/css(euiText(euiTheme, true), "clear:both;a:not([class]){", euiLinkCSS(euiThemeContext), ";}ul{list-style:disc;}ol{list-style:decimal;}blockquote{border-inline-start-color:", euiTheme.border.color, ";border-inline-start-style:solid;}blockquote:not(.euiMarkdownFormat__blockquote){color:", euiTheme.colors.subduedText, ";}h1{", euiTitle(euiThemeContext, 'l'), ";}h2{", euiTitle(euiThemeContext, 'm'), ";}h3{", euiTitle(euiThemeContext, 's'), ";}h4,dt{", euiTitle(euiThemeContext, 'xs'), ";}h5{", euiTitle(euiThemeContext, 'xxs'), ";}h6{", euiTitle(euiThemeContext, 'xxxs'), " text-transform:uppercase;}h1,h2,h3,h4,h5,h6,dt{color:inherit;}pre:not(.euiCodeBlock__pre){white-space:pre-wrap;background:", euiBackgroundColor(euiThemeContext, 'subdued'), ";color:", euiTheme.colors.text, ";}pre:not(.euiCodeBlock__pre),pre:not(.euiCodeBlock__pre) code{display:block;}>:last-child{", logicalCSS('margin-bottom', '0 !important'), ";}kbd{position:relative;display:inline-block;", logicalCSS('padding-vertical', euiTheme.size.xxs), " ", logicalCSS('padding-horizontal', euiTheme.size.xs), " line-height:1;border:", euiTheme.border.width.thin, " solid ", euiTheme.colors.text, ";border-radius:", mathWithUnits(euiTheme.border.radius.small, function (x) {
69
69
  return x / 2;
70
70
  }), ";};label:euiText;"),
71
71
  constrainedWidth: /*#__PURE__*/css(logicalCSS('max-width', euiTextConstrainedMaxWidth), ";;label:constrainedWidth;"),
@@ -2,7 +2,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
4
  var _excluded = ["width", "onResize"],
5
- _excluded2 = ["width", "children", "text", "truncation", "truncationOffset", "truncationPosition", "ellipsis", "containerRef", "className"],
5
+ _excluded2 = ["width", "children", "text", "truncation", "truncationOffset", "truncationPosition", "ellipsis", "calculationDelayMs", "containerRef", "className"],
6
6
  _excluded3 = ["onResize"];
7
7
  /*
8
8
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
@@ -12,7 +12,7 @@ var _excluded = ["width", "onResize"],
12
12
  * Side Public License, v 1.
13
13
  */
14
14
 
15
- import React, { useState, useMemo, useCallback } from 'react';
15
+ import React, { useState, useMemo, useCallback, useEffect } from 'react';
16
16
  import classNames from 'classnames';
17
17
  import { useCombinedRefs } from '../../services';
18
18
  import { EuiResizeObserver } from '../observer/resize_observer';
@@ -41,6 +41,7 @@ var EuiTextTruncateWithWidth = function EuiTextTruncateWithWidth(_ref2) {
41
41
  truncationPosition = _ref2.truncationPosition,
42
42
  _ref2$ellipsis = _ref2.ellipsis,
43
43
  ellipsis = _ref2$ellipsis === void 0 ? '…' : _ref2$ellipsis,
44
+ calculationDelayMs = _ref2.calculationDelayMs,
44
45
  containerRef = _ref2.containerRef,
45
46
  className = _ref2.className,
46
47
  rest = _objectWithoutProperties(_ref2, _excluded2);
@@ -51,6 +52,19 @@ var EuiTextTruncateWithWidth = function EuiTextTruncateWithWidth(_ref2) {
51
52
  setContainerEl = _useState2[1];
52
53
  var refs = useCombinedRefs([setContainerEl, containerRef]);
53
54
 
55
+ // If necessary, wait a tick on mount before truncating
56
+ var _useState3 = useState(!calculationDelayMs),
57
+ _useState4 = _slicedToArray(_useState3, 2),
58
+ ready = _useState4[0],
59
+ setReady = _useState4[1];
60
+ useEffect(function () {
61
+ if (calculationDelayMs) {
62
+ setTimeout(function () {
63
+ return setReady(true);
64
+ }, calculationDelayMs);
65
+ }
66
+ }, [calculationDelayMs]);
67
+
54
68
  // Handle exceptions where we need to override the passed props
55
69
  var _useMemo = useMemo(function () {
56
70
  var truncation = _truncation;
@@ -75,7 +89,8 @@ var EuiTextTruncateWithWidth = function EuiTextTruncateWithWidth(_ref2) {
75
89
  truncationOffset = _useMemo.truncationOffset;
76
90
  var truncatedText = useMemo(function () {
77
91
  var truncatedText = '';
78
- if (!containerEl || !width) return truncatedText;
92
+ if (!ready || !containerEl) return text;
93
+ if (!width) return truncatedText;
79
94
  var utils = new TruncationUtils({
80
95
  fullText: text,
81
96
  ellipsis: ellipsis,
@@ -107,7 +122,7 @@ var EuiTextTruncateWithWidth = function EuiTextTruncateWithWidth(_ref2) {
107
122
  }
108
123
  }
109
124
  return truncatedText;
110
- }, [width, text, truncation, truncationOffset, truncationPosition, ellipsis, containerEl]);
125
+ }, [ready, width, text, truncation, truncationOffset, truncationPosition, ellipsis, containerEl]);
111
126
  var isTruncating = truncatedText !== text;
112
127
  return ___EmotionJSX("div", _extends({
113
128
  className: classNames('euiTextTruncate', className),
@@ -131,10 +146,10 @@ var EuiTextTruncateWithWidth = function EuiTextTruncateWithWidth(_ref2) {
131
146
  var EuiTextTruncateWithResizeObserver = function EuiTextTruncateWithResizeObserver(_ref3) {
132
147
  var _onResize = _ref3.onResize,
133
148
  props = _objectWithoutProperties(_ref3, _excluded3);
134
- var _useState3 = useState(0),
135
- _useState4 = _slicedToArray(_useState3, 2),
136
- width = _useState4[0],
137
- setWidth = _useState4[1];
149
+ var _useState5 = useState(0),
150
+ _useState6 = _slicedToArray(_useState5, 2),
151
+ width = _useState6[0],
152
+ setWidth = _useState6[1];
138
153
  var onResize = useCallback(function (_ref4) {
139
154
  var width = _ref4.width;
140
155
  setWidth(width);
@@ -146,6 +161,8 @@ var EuiTextTruncateWithResizeObserver = function EuiTextTruncateWithResizeObserv
146
161
  return ___EmotionJSX(EuiTextTruncateWithWidth, _extends({
147
162
  width: width,
148
163
  containerRef: ref
149
- }, props));
164
+ }, props, {
165
+ "data-resize-observer": "true"
166
+ }));
150
167
  });
151
168
  };
@@ -32,9 +32,7 @@ describe('EuiAccordion', function () {
32
32
  it('has zero violations when expanded', function () {
33
33
  cy.mount((0, _react2.jsx)(_index.EuiAccordion, noArrowProps, (0, _react2.jsx)(_panel.EuiPanel, {
34
34
  color: "subdued"
35
- }, "Any content inside of ", (0, _react2.jsx)("strong", null, "EuiAccordion"), " will appear here. We will include ", (0, _react2.jsx)("a", {
36
- href: "#"
37
- }, "a link"), " to confirm focus.")));
35
+ }, "Any content inside of ", (0, _react2.jsx)("strong", null, "EuiAccordion"), " will appear here.")));
38
36
  cy.get('button.euiAccordion__button').click();
39
37
  cy.checkAxe();
40
38
  });
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.isCustomItemAction = void 0;
6
+ exports.isCustomItemAction = exports.callWithItemIfFunction = void 0;
7
7
  /*
8
8
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
9
9
  * or more contributor license agreements. Licensed under the Elastic License
@@ -15,4 +15,10 @@ exports.isCustomItemAction = void 0;
15
15
  var isCustomItemAction = function isCustomItemAction(action) {
16
16
  return action.hasOwnProperty('render');
17
17
  };
18
- exports.isCustomItemAction = isCustomItemAction;
18
+ exports.isCustomItemAction = isCustomItemAction;
19
+ var callWithItemIfFunction = function callWithItemIfFunction(item) {
20
+ return function (prop) {
21
+ return typeof prop === 'function' ? prop(item) : prop;
22
+ };
23
+ };
24
+ exports.callWithItemIfFunction = callWithItemIfFunction;
@@ -185,8 +185,7 @@ describe('EuiTable', function () {
185
185
  });
186
186
  describe('Keyboard accessibility', function () {
187
187
  it('has zero violations after expanding a row', function () {
188
- cy.repeatRealPress('Tab');
189
- cy.get('button#1').should('have.focus');
188
+ cy.get('button#1').focus();
190
189
  cy.realPress('Enter');
191
190
  cy.get('tr.euiTableRow-isExpandedRow div.euiTableCellContent').should('exist');
192
191
  cy.checkAxe();