@elastic/eui 94.1.0 → 94.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 (260) hide show
  1. package/dist/eui_theme_dark.css +6 -15
  2. package/dist/eui_theme_dark.min.css +1 -1
  3. package/dist/eui_theme_light.css +6 -15
  4. package/dist/eui_theme_light.min.css +1 -1
  5. package/es/components/accordion/accordion.js +1 -25
  6. package/es/components/accordion/accordion_children/accordion_children.js +3 -7
  7. package/es/components/basic_table/basic_table.js +8 -5
  8. package/es/components/breadcrumbs/_breadcrumb_content.js +1 -1
  9. package/es/components/breadcrumbs/breadcrumbs.js +1 -1
  10. package/es/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +306 -0
  11. package/es/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.styles.js +56 -0
  12. package/{optimize/es/components/collapsible_nav_beta/collapsible_nav_group → es/components/collapsible_nav_beta/_kibana_solution}/index.js +1 -1
  13. package/es/components/collapsible_nav_beta/collapsible_nav_beta.js +3 -3
  14. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +12 -4
  15. package/es/components/color_picker/color_picker.js +9 -1
  16. package/es/components/combo_box/combo_box.js +19 -5
  17. package/es/components/combo_box/index.js +2 -1
  18. package/es/components/combo_box/matching_options.js +34 -5
  19. package/es/components/datagrid/body/cell/data_grid_cell.js +0 -46
  20. package/es/components/datagrid/body/data_grid_body.js +0 -28
  21. package/es/components/datagrid/body/data_grid_body_custom.js +0 -28
  22. package/es/components/datagrid/body/data_grid_body_virtualized.js +0 -28
  23. package/es/components/datagrid/body/header/column_actions.js +17 -5
  24. package/es/components/datagrid/body/header/data_grid_header_cell.js +3 -30
  25. package/es/components/datagrid/body/header/data_grid_header_cell_wrapper.js +7 -9
  26. package/es/components/datagrid/controls/column_sorting.js +0 -28
  27. package/es/components/datagrid/utils/in_memory.js +0 -28
  28. package/es/components/date_picker/super_date_picker/date_popover/absolute_tab.js +6 -3
  29. package/es/components/date_picker/super_date_picker/super_date_picker.js +2 -84
  30. package/es/components/date_picker/super_date_picker/super_update_button.js +1 -62
  31. package/es/components/flex/flex_group.js +21 -35
  32. package/es/components/flex/flex_item.js +18 -18
  33. package/es/components/form/field_number/field_number.js +22 -7
  34. package/es/components/form/field_text/field_text.js +17 -7
  35. package/es/components/form/form_control_layout/_num_icons.js +7 -2
  36. package/es/components/form/form_control_layout/form_control_layout_icons.js +2 -2
  37. package/es/components/form/range/dual_range.js +2 -1
  38. package/es/components/form/range/range.js +12 -1
  39. package/es/components/form/range/range_slider.js +4 -1
  40. package/es/components/form/range/range_track.js +2 -1
  41. package/es/components/form/range/range_wrapper.styles.js +4 -4
  42. package/es/components/header/header_breadcrumbs/header_breadcrumbs.js +1 -1
  43. package/es/components/header/header_links/header_links.js +1 -1
  44. package/es/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +27 -8
  45. package/es/components/markdown_editor/plugins/markdown_default_plugins/processing_plugins.js +32 -9
  46. package/es/components/markdown_editor/plugins/markdown_default_plugins/ui_plugins.js +17 -2
  47. package/es/components/page/page_header/page_header_content.js +1 -1
  48. package/es/components/page_template/outer/page_outer.js +2 -1
  49. package/es/components/page_template/page_template.js +119 -81
  50. package/es/components/popover/input_popover.js +4 -2
  51. package/es/components/popover/popover.js +6 -1
  52. package/es/components/search_bar/filters/field_value_selection_filter.js +3 -5
  53. package/es/components/search_bar/query/default_syntax.js +2 -2
  54. package/es/components/selectable/matching_options.js +43 -5
  55. package/es/components/selectable/selectable.js +55 -13
  56. package/es/components/selectable/selectable_list/selectable_list.js +15 -6
  57. package/es/components/selectable/selectable_search/selectable_search.js +9 -3
  58. package/es/components/steps/step_horizontal.js +1 -0
  59. package/es/components/table/table_row_cell.styles.js +2 -2
  60. package/es/components/tour/tour_step.js +1 -1
  61. package/eui.d.ts +1416 -1177
  62. package/i18ntokens.json +202 -148
  63. package/lib/components/accordion/accordion.js +1 -25
  64. package/lib/components/accordion/accordion_children/accordion_children.js +3 -7
  65. package/lib/components/basic_table/basic_table.js +8 -5
  66. package/lib/components/breadcrumbs/_breadcrumb_content.js +1 -1
  67. package/lib/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +315 -0
  68. package/lib/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.styles.js +61 -0
  69. package/lib/components/collapsible_nav_beta/_kibana_solution/index.js +12 -0
  70. package/lib/components/collapsible_nav_beta/collapsible_nav_beta.js +3 -3
  71. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +11 -4
  72. package/lib/components/color_picker/color_picker.js +9 -1
  73. package/lib/components/combo_box/combo_box.js +18 -4
  74. package/lib/components/combo_box/index.js +10 -2
  75. package/lib/components/combo_box/matching_options.js +37 -7
  76. package/lib/components/datagrid/body/cell/data_grid_cell.js +0 -46
  77. package/lib/components/datagrid/body/data_grid_body.js +0 -28
  78. package/lib/components/datagrid/body/data_grid_body_custom.js +0 -28
  79. package/lib/components/datagrid/body/data_grid_body_virtualized.js +0 -28
  80. package/lib/components/datagrid/body/header/column_actions.js +17 -5
  81. package/lib/components/datagrid/body/header/data_grid_header_cell.js +3 -30
  82. package/lib/components/datagrid/body/header/data_grid_header_cell_wrapper.js +7 -9
  83. package/lib/components/datagrid/controls/column_sorting.js +0 -28
  84. package/lib/components/datagrid/utils/in_memory.js +0 -28
  85. package/lib/components/date_picker/super_date_picker/date_popover/absolute_tab.js +6 -3
  86. package/lib/components/date_picker/super_date_picker/super_date_picker.js +2 -84
  87. package/lib/components/date_picker/super_date_picker/super_update_button.js +1 -62
  88. package/lib/components/flex/flex_group.js +22 -37
  89. package/lib/components/flex/flex_item.js +17 -17
  90. package/lib/components/form/field_number/field_number.js +20 -6
  91. package/lib/components/form/field_text/field_text.js +16 -6
  92. package/lib/components/form/form_control_layout/_num_icons.js +9 -3
  93. package/lib/components/form/form_control_layout/form_control_layout_icons.js +4 -3
  94. package/lib/components/form/range/dual_range.js +2 -1
  95. package/lib/components/form/range/range.js +12 -1
  96. package/lib/components/form/range/range_slider.js +4 -1
  97. package/lib/components/form/range/range_track.js +2 -1
  98. package/lib/components/form/range/range_wrapper.styles.js +4 -4
  99. package/lib/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +33 -18
  100. package/lib/components/markdown_editor/plugins/markdown_default_plugins/processing_plugins.js +38 -16
  101. package/lib/components/markdown_editor/plugins/markdown_default_plugins/ui_plugins.js +23 -10
  102. package/lib/components/page_template/outer/page_outer.js +4 -2
  103. package/lib/components/page_template/page_template.js +117 -79
  104. package/lib/components/popover/input_popover.js +4 -2
  105. package/lib/components/popover/popover.js +6 -1
  106. package/lib/components/search_bar/filters/field_value_selection_filter.js +3 -5
  107. package/lib/components/search_bar/query/default_syntax.js +2 -2
  108. package/lib/components/selectable/matching_options.js +46 -7
  109. package/lib/components/selectable/selectable.js +54 -12
  110. package/lib/components/selectable/selectable_list/selectable_list.js +15 -6
  111. package/lib/components/selectable/selectable_search/selectable_search.js +9 -3
  112. package/lib/components/steps/step_horizontal.js +1 -0
  113. package/lib/components/table/table_row_cell.styles.js +1 -1
  114. package/optimize/es/components/accordion/accordion.js +1 -25
  115. package/optimize/es/components/accordion/accordion_children/accordion_children.js +2 -5
  116. package/optimize/es/components/basic_table/basic_table.js +8 -5
  117. package/optimize/es/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +173 -0
  118. package/optimize/es/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.styles.js +56 -0
  119. package/{es/components/collapsible_nav_beta/collapsible_nav_group → optimize/es/components/collapsible_nav_beta/_kibana_solution}/index.js +1 -1
  120. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_beta.js +3 -3
  121. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +9 -4
  122. package/optimize/es/components/color_picker/color_picker.js +9 -1
  123. package/optimize/es/components/combo_box/combo_box.js +10 -5
  124. package/optimize/es/components/combo_box/index.js +2 -1
  125. package/optimize/es/components/combo_box/matching_options.js +34 -5
  126. package/optimize/es/components/datagrid/body/header/column_actions.js +17 -5
  127. package/optimize/es/components/datagrid/body/header/data_grid_header_cell.js +3 -2
  128. package/optimize/es/components/datagrid/body/header/data_grid_header_cell_wrapper.js +7 -9
  129. package/optimize/es/components/date_picker/super_date_picker/date_popover/absolute_tab.js +6 -3
  130. package/optimize/es/components/flex/flex_group.js +22 -22
  131. package/optimize/es/components/flex/flex_item.js +19 -6
  132. package/optimize/es/components/form/field_number/field_number.js +13 -6
  133. package/optimize/es/components/form/field_text/field_text.js +14 -7
  134. package/optimize/es/components/form/form_control_layout/_num_icons.js +7 -2
  135. package/optimize/es/components/form/form_control_layout/form_control_layout_icons.js +2 -2
  136. package/optimize/es/components/form/range/range.js +10 -0
  137. package/optimize/es/components/form/range/range_slider.js +3 -1
  138. package/optimize/es/components/form/range/range_wrapper.styles.js +4 -4
  139. package/optimize/es/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +22 -8
  140. package/optimize/es/components/markdown_editor/plugins/markdown_default_plugins/processing_plugins.js +24 -9
  141. package/optimize/es/components/markdown_editor/plugins/markdown_default_plugins/ui_plugins.js +12 -2
  142. package/optimize/es/components/page_template/outer/page_outer.js +1 -0
  143. package/optimize/es/components/page_template/page_template.js +79 -80
  144. package/optimize/es/components/popover/input_popover.js +4 -2
  145. package/optimize/es/components/popover/popover.js +5 -0
  146. package/optimize/es/components/search_bar/filters/field_value_selection_filter.js +3 -5
  147. package/optimize/es/components/search_bar/query/default_syntax.js +2 -2
  148. package/optimize/es/components/selectable/matching_options.js +43 -5
  149. package/optimize/es/components/selectable/selectable.js +33 -9
  150. package/optimize/es/components/selectable/selectable_list/selectable_list.js +12 -5
  151. package/optimize/es/components/selectable/selectable_search/selectable_search.js +9 -3
  152. package/optimize/es/components/steps/step_horizontal.js +1 -0
  153. package/optimize/es/components/table/table_row_cell.styles.js +2 -2
  154. package/optimize/lib/components/accordion/accordion.js +1 -25
  155. package/optimize/lib/components/accordion/accordion_children/accordion_children.js +2 -5
  156. package/optimize/lib/components/basic_table/basic_table.js +8 -5
  157. package/optimize/lib/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +182 -0
  158. package/optimize/lib/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.styles.js +61 -0
  159. package/optimize/lib/components/collapsible_nav_beta/_kibana_solution/index.js +12 -0
  160. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_beta.js +3 -3
  161. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +9 -4
  162. package/optimize/lib/components/color_picker/color_picker.js +9 -1
  163. package/optimize/lib/components/combo_box/combo_box.js +9 -4
  164. package/optimize/lib/components/combo_box/index.js +10 -2
  165. package/optimize/lib/components/combo_box/matching_options.js +37 -7
  166. package/optimize/lib/components/datagrid/body/header/column_actions.js +17 -5
  167. package/optimize/lib/components/datagrid/body/header/data_grid_header_cell.js +3 -2
  168. package/optimize/lib/components/datagrid/body/header/data_grid_header_cell_wrapper.js +7 -9
  169. package/optimize/lib/components/date_picker/super_date_picker/date_popover/absolute_tab.js +6 -3
  170. package/optimize/lib/components/flex/flex_group.js +22 -23
  171. package/optimize/lib/components/flex/flex_item.js +18 -5
  172. package/optimize/lib/components/form/field_number/field_number.js +12 -5
  173. package/optimize/lib/components/form/field_text/field_text.js +13 -6
  174. package/optimize/lib/components/form/form_control_layout/_num_icons.js +9 -3
  175. package/optimize/lib/components/form/form_control_layout/form_control_layout_icons.js +4 -3
  176. package/optimize/lib/components/form/range/range.js +10 -0
  177. package/optimize/lib/components/form/range/range_slider.js +3 -1
  178. package/optimize/lib/components/form/range/range_wrapper.styles.js +4 -4
  179. package/optimize/lib/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +22 -8
  180. package/optimize/lib/components/markdown_editor/plugins/markdown_default_plugins/processing_plugins.js +30 -18
  181. package/optimize/lib/components/markdown_editor/plugins/markdown_default_plugins/ui_plugins.js +13 -2
  182. package/optimize/lib/components/page_template/outer/page_outer.js +3 -1
  183. package/optimize/lib/components/page_template/page_template.js +77 -78
  184. package/optimize/lib/components/popover/input_popover.js +4 -2
  185. package/optimize/lib/components/popover/popover.js +5 -0
  186. package/optimize/lib/components/search_bar/filters/field_value_selection_filter.js +3 -5
  187. package/optimize/lib/components/search_bar/query/default_syntax.js +2 -2
  188. package/optimize/lib/components/selectable/matching_options.js +46 -7
  189. package/optimize/lib/components/selectable/selectable.js +32 -8
  190. package/optimize/lib/components/selectable/selectable_list/selectable_list.js +14 -7
  191. package/optimize/lib/components/selectable/selectable_search/selectable_search.js +9 -3
  192. package/optimize/lib/components/steps/step_horizontal.js +1 -0
  193. package/optimize/lib/components/table/table_row_cell.styles.js +1 -1
  194. package/package.json +16 -13
  195. package/src/components/color_picker/_color_picker.scss +0 -16
  196. package/src/components/date_picker/super_date_picker/date_popover/_date_popover_content.scss +4 -7
  197. package/test-env/components/accordion/accordion.js +1 -25
  198. package/test-env/components/accordion/accordion_children/accordion_children.js +3 -7
  199. package/test-env/components/basic_table/basic_table.js +8 -5
  200. package/test-env/components/breadcrumbs/_breadcrumb_content.js +1 -1
  201. package/test-env/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +307 -0
  202. package/test-env/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.styles.js +61 -0
  203. package/test-env/components/collapsible_nav_beta/_kibana_solution/index.js +12 -0
  204. package/test-env/components/collapsible_nav_beta/collapsible_nav_beta.js +3 -3
  205. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +9 -4
  206. package/test-env/components/color_picker/color_picker.js +9 -1
  207. package/test-env/components/combo_box/combo_box.js +18 -4
  208. package/test-env/components/combo_box/index.js +10 -2
  209. package/test-env/components/combo_box/matching_options.js +37 -7
  210. package/test-env/components/datagrid/body/cell/data_grid_cell.js +0 -46
  211. package/test-env/components/datagrid/body/data_grid_body.js +0 -28
  212. package/test-env/components/datagrid/body/data_grid_body_custom.js +0 -28
  213. package/test-env/components/datagrid/body/data_grid_body_virtualized.js +0 -28
  214. package/test-env/components/datagrid/body/header/column_actions.js +17 -5
  215. package/test-env/components/datagrid/body/header/data_grid_header_cell.js +3 -30
  216. package/test-env/components/datagrid/body/header/data_grid_header_cell_wrapper.js +7 -9
  217. package/test-env/components/datagrid/controls/column_sorting.js +0 -28
  218. package/test-env/components/datagrid/utils/in_memory.js +0 -28
  219. package/test-env/components/date_picker/super_date_picker/date_popover/absolute_tab.js +6 -3
  220. package/test-env/components/date_picker/super_date_picker/super_date_picker.js +2 -84
  221. package/test-env/components/date_picker/super_date_picker/super_update_button.js +1 -62
  222. package/test-env/components/flex/flex_group.js +22 -37
  223. package/test-env/components/flex/flex_item.js +17 -17
  224. package/test-env/components/form/field_number/field_number.js +18 -6
  225. package/test-env/components/form/field_text/field_text.js +13 -6
  226. package/test-env/components/form/form_control_layout/_num_icons.js +9 -3
  227. package/test-env/components/form/form_control_layout/form_control_layout_icons.js +4 -3
  228. package/test-env/components/form/range/dual_range.js +2 -1
  229. package/test-env/components/form/range/range.js +12 -1
  230. package/test-env/components/form/range/range_slider.js +4 -1
  231. package/test-env/components/form/range/range_track.js +2 -1
  232. package/test-env/components/form/range/range_wrapper.styles.js +4 -4
  233. package/test-env/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +22 -8
  234. package/test-env/components/markdown_editor/plugins/markdown_default_plugins/processing_plugins.js +30 -18
  235. package/test-env/components/markdown_editor/plugins/markdown_default_plugins/ui_plugins.js +13 -2
  236. package/test-env/components/page_template/outer/page_outer.js +4 -2
  237. package/test-env/components/page_template/page_template.js +112 -79
  238. package/test-env/components/popover/input_popover.js +4 -2
  239. package/test-env/components/popover/popover.js +6 -1
  240. package/test-env/components/search_bar/filters/field_value_selection_filter.js +3 -5
  241. package/test-env/components/search_bar/query/default_syntax.js +2 -2
  242. package/test-env/components/selectable/matching_options.js +46 -7
  243. package/test-env/components/selectable/selectable.js +54 -12
  244. package/test-env/components/selectable/selectable_list/selectable_list.js +17 -7
  245. package/test-env/components/selectable/selectable_search/selectable_search.js +9 -3
  246. package/test-env/components/steps/step_horizontal.js +1 -0
  247. package/test-env/components/table/table_row_cell.styles.js +1 -1
  248. package/es/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +0 -74
  249. package/es/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.styles.js +0 -19
  250. package/lib/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +0 -84
  251. package/lib/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.styles.js +0 -26
  252. package/lib/components/collapsible_nav_beta/collapsible_nav_group/index.js +0 -12
  253. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +0 -52
  254. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.styles.js +0 -19
  255. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +0 -62
  256. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.styles.js +0 -26
  257. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_group/index.js +0 -12
  258. package/test-env/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +0 -83
  259. package/test-env/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.styles.js +0 -26
  260. package/test-env/components/collapsible_nav_beta/collapsible_nav_group/index.js +0 -12
@@ -0,0 +1,173 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ import _extends from "@babel/runtime/helpers/extends";
3
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
5
+ var _excluded = ["title", "icon", "solutions", "items", "className"],
6
+ _excluded2 = ["title", "icon", "isSecondary"];
7
+ 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; }
8
+ 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; }
9
+ /*
10
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
11
+ * or more contributor license agreements. Licensed under the Elastic License
12
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
13
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
14
+ * Side Public License, v 1.
15
+ */
16
+
17
+ import React, { useContext, useState, useMemo, useCallback } from 'react';
18
+ import classNames from 'classnames';
19
+ import { useEuiMemoizedStyles } from '../../../services';
20
+ import { useEuiI18n } from '../../i18n';
21
+ import { EuiIcon } from '../../icon';
22
+ import { EuiInputPopover, EuiPopoverTitle } from '../../popover';
23
+ import { EuiListGroup } from '../../list_group';
24
+ import { EuiCollapsibleNavContext } from '../context';
25
+ import { EuiCollapsibleNavLink } from '../collapsible_nav_item/collapsible_nav_link';
26
+ import { EuiCollapsibleNavSubItems } from '../collapsible_nav_item/collapsible_nav_item';
27
+ import { EuiCollapsedNavPopover } from '../collapsible_nav_item/collapsed/collapsed_nav_popover';
28
+ import { euiCollapsibleNavKibanaSolutionStyles } from './collapsible_nav_kibana_solution.styles';
29
+ import { jsx as ___EmotionJSX } from "@emotion/react";
30
+ /**
31
+ * This component should only ever be used as a **top-level component**.
32
+ * It also should **not** be used in the nav footer.
33
+ *
34
+ * This component is **very** specific to Kibana and is not meant to be a generic component.
35
+ */
36
+ export var KibanaCollapsibleNavSolution = function KibanaCollapsibleNavSolution(_ref) {
37
+ var title = _ref.title,
38
+ icon = _ref.icon,
39
+ _ref$solutions = _ref.solutions,
40
+ solutions = _ref$solutions === void 0 ? [] : _ref$solutions,
41
+ items = _ref.items,
42
+ className = _ref.className,
43
+ props = _objectWithoutProperties(_ref, _excluded);
44
+ var _useContext = useContext(EuiCollapsibleNavContext),
45
+ isCollapsed = _useContext.isCollapsed,
46
+ isPush = _useContext.isPush;
47
+ var _useState = useState(false),
48
+ _useState2 = _slicedToArray(_useState, 2),
49
+ isSolutionSwitcherOpen = _useState2[0],
50
+ setIsSolutionSwitcherOpen = _useState2[1];
51
+ var classes = classNames('kibanaCollapsibleNavSolution', className);
52
+ var styles = useEuiMemoizedStyles(euiCollapsibleNavKibanaSolutionStyles);
53
+ var cssStyles = [styles.euiCollapsibleNavKibanaSolution, isPush && isCollapsed ? styles.collapsed : styles.uncollapsed];
54
+ var solutionSwitcherIcon = 'layers';
55
+ var solutionSolutionSwitcherTitle = useEuiI18n('euiCollapsibleNavKibanaSolution.switcherTitle', 'Solution view');
56
+ var solutionSolutionSwitcherAriaLabel = useEuiI18n('euiCollapsibleNavKibanaSolution.switcherAriaLabel', ' - click to switch to another solution');
57
+ var solutionSolutionGroupLabel = useEuiI18n('euiCollapsibleNavKibanaSolution.groupLabel', 'Navigate to solution');
58
+ var closeSolutionPopover = useCallback(function (event) {
59
+ var _childItem$firstEleme;
60
+ // Allow child items to stop the popover from being closed
61
+ if (event.isPropagationStopped()) return;
62
+ // Only listen for clicks on child items - currentTarget is the parent <ul>
63
+ if (event.target === event.currentTarget) return;
64
+
65
+ // Only close the popover if the item is a clickable link or button
66
+ var target = event.target;
67
+ var childItem = target.closest('.euiListGroupItem');
68
+ if (['A', 'BUTTON'].includes((childItem === null || childItem === void 0 ? void 0 : (_childItem$firstEleme = childItem.firstElementChild) === null || _childItem$firstEleme === void 0 ? void 0 : _childItem$firstEleme.tagName) || '')) {
69
+ setIsSolutionSwitcherOpen(false);
70
+ }
71
+ }, []);
72
+ var solutionSwitcherContent = useMemo(function () {
73
+ var _parseListItems = parseListItems(solutions),
74
+ _parseListItems2 = _slicedToArray(_parseListItems, 2),
75
+ primaryItems = _parseListItems2[0],
76
+ secondaryItems = _parseListItems2[1];
77
+ return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiListGroup, {
78
+ "data-test-subj": "kibanaSolutionSwitcherList",
79
+ "aria-label": solutionSolutionGroupLabel,
80
+ listItems: primaryItems,
81
+ size: "s",
82
+ bordered: true,
83
+ onClick: closeSolutionPopover
84
+ }), secondaryItems.length > 0 && ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiListGroup, {
85
+ listItems: secondaryItems,
86
+ size: "s",
87
+ css: styles.euiCollapsibleNavKibanaSolution__secondaryItems,
88
+ onClick: closeSolutionPopover
89
+ })));
90
+ }, [solutions, solutionSolutionGroupLabel, closeSolutionPopover, styles]);
91
+ var sharedPopoverProps = {
92
+ 'aria-label': solutionSolutionSwitcherTitle,
93
+ panelProps: {
94
+ css: styles.euiCollapsibleNavKibanaSolution__switcherPopover
95
+ },
96
+ panelPaddingSize: 's',
97
+ display: 'block'
98
+ };
99
+ return ___EmotionJSX("div", _extends({
100
+ className: classes,
101
+ css: cssStyles
102
+ }, props), isCollapsed && isPush ? ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiCollapsedNavPopover, {
103
+ icon: icon,
104
+ title: title,
105
+ items: items
106
+ }), ___EmotionJSX(EuiCollapsedNavPopover, _extends({}, sharedPopoverProps, {
107
+ icon: solutionSwitcherIcon,
108
+ title: solutionSolutionSwitcherTitle,
109
+ items: [{
110
+ renderItem: function renderItem() {
111
+ return solutionSwitcherContent;
112
+ }
113
+ }],
114
+ "data-test-subj": "kibanaSolutionSwitcherDocked"
115
+ }))) : ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiInputPopover, _extends({}, sharedPopoverProps, {
116
+ fullWidth: true
117
+ // Use the default EuiPopover focus trap, not the EuiInputPopover focus trap
118
+ ,
119
+ disableFocusTrap: true,
120
+ ownFocus: true,
121
+ isOpen: isSolutionSwitcherOpen,
122
+ closePopover: function closePopover() {
123
+ return setIsSolutionSwitcherOpen(false);
124
+ },
125
+ input: ___EmotionJSX(EuiCollapsibleNavLink, {
126
+ css: styles.euiCollapsibleNavKibanaSolution__title,
127
+ onClick: function onClick() {
128
+ return setIsSolutionSwitcherOpen(function (isOpen) {
129
+ return !isOpen;
130
+ });
131
+ },
132
+ isInteractive: true,
133
+ isSelected: isSolutionSwitcherOpen,
134
+ "data-test-subj": "kibanaSolutionSwitcher"
135
+ }, ___EmotionJSX(EuiIcon, {
136
+ type: icon,
137
+ css: styles.euiCollapsibleNavKibanaSolution__logo
138
+ }), title, ___EmotionJSX(EuiIcon, {
139
+ type: solutionSwitcherIcon,
140
+ css: styles.euiCollapsibleNavKibanaSolution__switcherIcon,
141
+ "aria-label": solutionSolutionSwitcherAriaLabel
142
+ }))
143
+ }), ___EmotionJSX(EuiPopoverTitle, null, solutionSolutionSwitcherTitle), solutionSwitcherContent), ___EmotionJSX(EuiCollapsibleNavSubItems, {
144
+ items: items,
145
+ isGroup: true,
146
+ role: "group",
147
+ "aria-label": title
148
+ })));
149
+ };
150
+
151
+ /**
152
+ * Tweak EuiListGroup's items API to match EuiCollapsibleNav's
153
+ * more closely (primarily label->title, iconType->icon),
154
+ * and also to allow passing secondary items in the same array
155
+ * (which will get rendered in a separate non-bordered group)
156
+ */
157
+
158
+ var parseListItems = function parseListItems(items) {
159
+ var primaryItems = [];
160
+ var secondaryItems = [];
161
+ items.forEach(function (_ref2) {
162
+ var title = _ref2.title,
163
+ icon = _ref2.icon,
164
+ isSecondary = _ref2.isSecondary,
165
+ item = _objectWithoutProperties(_ref2, _excluded2);
166
+ var arrayToPushTo = isSecondary ? secondaryItems : primaryItems;
167
+ arrayToPushTo.push(_objectSpread(_objectSpread({}, item), {}, {
168
+ label: title,
169
+ iconType: icon
170
+ }));
171
+ });
172
+ return [primaryItems, secondaryItems];
173
+ };
@@ -0,0 +1,56 @@
1
+ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
2
+ /*
3
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
4
+ * or more contributor license agreements. Licensed under the Elastic License
5
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
6
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
7
+ * Side Public License, v 1.
8
+ */
9
+
10
+ import { css } from '@emotion/react';
11
+ import { mathWithUnits } from '../../../global_styling';
12
+ import { euiCollapsibleNavItemVariables } from '../collapsible_nav_item/collapsible_nav_item.styles';
13
+ var _ref = process.env.NODE_ENV === "production" ? {
14
+ name: "kimavp-euiCollapsibleNavKibanaSolution__secondaryItems",
15
+ styles: "padding-block-end:0;label:euiCollapsibleNavKibanaSolution__secondaryItems;"
16
+ } : {
17
+ name: "kimavp-euiCollapsibleNavKibanaSolution__secondaryItems",
18
+ styles: "padding-block-end:0;label:euiCollapsibleNavKibanaSolution__secondaryItems;",
19
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
20
+ };
21
+ var _ref2 = process.env.NODE_ENV === "production" ? {
22
+ name: "1fhy01q-euiCollapsibleNavKibanaSolution__switcherIcon",
23
+ styles: "margin-inline-start:auto;label:euiCollapsibleNavKibanaSolution__switcherIcon;"
24
+ } : {
25
+ name: "1fhy01q-euiCollapsibleNavKibanaSolution__switcherIcon",
26
+ styles: "margin-inline-start:auto;label:euiCollapsibleNavKibanaSolution__switcherIcon;",
27
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
28
+ };
29
+ var _ref3 = process.env.NODE_ENV === "production" ? {
30
+ name: "332r3i-euiCollapsibleNavKibanaSolution__logo",
31
+ styles: "transform:scale(1.25);label:euiCollapsibleNavKibanaSolution__logo;"
32
+ } : {
33
+ name: "332r3i-euiCollapsibleNavKibanaSolution__logo",
34
+ styles: "transform:scale(1.25);label:euiCollapsibleNavKibanaSolution__logo;",
35
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
36
+ };
37
+ export var euiCollapsibleNavKibanaSolutionStyles = function euiCollapsibleNavKibanaSolutionStyles(euiThemeContext) {
38
+ var euiTheme = euiThemeContext.euiTheme;
39
+ var sharedStyles = euiCollapsibleNavItemVariables(euiThemeContext);
40
+ return {
41
+ euiCollapsibleNavKibanaSolution: /*#__PURE__*/css(";label:euiCollapsibleNavKibanaSolution;"),
42
+ collapsed: /*#__PURE__*/css("margin-block-start:", euiTheme.size.base, ";;label:collapsed;"),
43
+ uncollapsed: /*#__PURE__*/css("margin:", sharedStyles.padding, ";;label:uncollapsed;"),
44
+ // Solution switcher title (popover toggle)
45
+ euiCollapsibleNavKibanaSolution__title: /*#__PURE__*/css("margin-block-start:", euiTheme.size.base, ";margin-block-end:", euiTheme.size.s, ";&:is(button){inline-size:100%;};label:euiCollapsibleNavKibanaSolution__title;"),
46
+ // Make the solution logo slightly larger
47
+ euiCollapsibleNavKibanaSolution__logo: _ref3,
48
+ // Align the layer icon to the accordion arrows
49
+ euiCollapsibleNavKibanaSolution__switcherIcon: _ref2,
50
+ // Solution switcher popover
51
+ euiCollapsibleNavKibanaSolution__switcherPopover: /*#__PURE__*/css(".euiPopoverTitle{padding:", mathWithUnits([euiTheme.size.s, euiTheme.size.xxs], function (x, y) {
52
+ return x + y;
53
+ }), ";margin-block-end:0;border-block-end:none;}[class*='euiCollapsedNavPopover__title']{padding:0;}[class*='euiCollapsedNavPopover__items']{padding:0;mask-image:none;};label:euiCollapsibleNavKibanaSolution__switcherPopover;"),
54
+ euiCollapsibleNavKibanaSolution__secondaryItems: _ref
55
+ };
56
+ };
@@ -6,4 +6,4 @@
6
6
  * Side Public License, v 1.
7
7
  */
8
8
 
9
- export { EuiCollapsibleNavGroup } from './collapsible_nav_group';
9
+ export { KibanaCollapsibleNavSolution } from './collapsible_nav_kibana_solution';
@@ -164,12 +164,12 @@ var _EuiCollapsibleNavBeta = function _EuiCollapsibleNavBeta(_ref) {
164
164
  */
165
165
 
166
166
  import { EuiCollapsibleNavBody, EuiCollapsibleNavFooter } from './collapsible_nav_body_footer';
167
- import { EuiCollapsibleNavGroup } from './collapsible_nav_group';
168
167
  import { EuiCollapsibleNavItem } from './collapsible_nav_item';
168
+ import { KibanaCollapsibleNavSolution } from './_kibana_solution';
169
169
  import { jsx as ___EmotionJSX } from "@emotion/react";
170
170
  export var EuiCollapsibleNavBeta = Object.assign(_EuiCollapsibleNavBeta, {
171
171
  Body: EuiCollapsibleNavBody,
172
172
  Footer: EuiCollapsibleNavFooter,
173
- Group: EuiCollapsibleNavGroup,
174
- Item: EuiCollapsibleNavItem
173
+ Item: EuiCollapsibleNavItem,
174
+ KibanaSolution: KibanaCollapsibleNavSolution
175
175
  });
@@ -1,7 +1,10 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
3
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
4
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
5
  var _excluded = ["items", "title", "titleElement", "icon", "iconProps", "isSelected"];
6
+ 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; }
7
+ 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; }
5
8
  /*
6
9
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
7
10
  * or more contributor license agreements. Licensed under the Elastic License
@@ -18,6 +21,7 @@ import { EuiCollapsedNavButton } from './collapsed_nav_button';
18
21
  import { euiCollapsedNavPopoverStyles } from './collapsed_nav_popover.styles';
19
22
  import { jsx as ___EmotionJSX } from "@emotion/react";
20
23
  export var EuiCollapsedNavPopover = function EuiCollapsedNavPopover(_ref) {
24
+ var _rest$panelProps;
21
25
  var items = _ref.items,
22
26
  title = _ref.title,
23
27
  _ref$titleElement = _ref.titleElement,
@@ -45,9 +49,6 @@ export var EuiCollapsedNavPopover = function EuiCollapsedNavPopover(_ref) {
45
49
  display: "block",
46
50
  anchorPosition: "rightUp",
47
51
  panelPaddingSize: "none",
48
- panelProps: {
49
- css: styles.euiCollapsedNavPopover__panel
50
- },
51
52
  button: ___EmotionJSX(EuiCollapsedNavButton, {
52
53
  title: title,
53
54
  icon: icon || 'boxesHorizontal',
@@ -56,7 +57,11 @@ export var EuiCollapsedNavPopover = function EuiCollapsedNavPopover(_ref) {
56
57
  onClick: togglePopover,
57
58
  hideToolTip: isPopoverOpen
58
59
  })
59
- }, rest), ___EmotionJSX(EuiPopoverTitle, null, ___EmotionJSX(TitleElement, {
60
+ }, rest, {
61
+ panelProps: _objectSpread(_objectSpread({}, rest.panelProps), {}, {
62
+ css: [styles.euiCollapsedNavPopover__panel, (_rest$panelProps = rest.panelProps) === null || _rest$panelProps === void 0 ? void 0 : _rest$panelProps.css]
63
+ })
64
+ }), ___EmotionJSX(EuiPopoverTitle, null, ___EmotionJSX(TitleElement, {
60
65
  css: styles.euiCollapsedNavPopover__title,
61
66
  className: "eui-textTruncate"
62
67
  }, title)), ___EmotionJSX("div", {
@@ -13,6 +13,7 @@ import React, { cloneElement, useEffect, useMemo, useRef, useState } from 'react
13
13
  import classNames from 'classnames';
14
14
  import chroma from 'chroma-js';
15
15
  import { EuiFieldText, EuiFormControlLayout, EuiFormRow, EuiRange } from '../form';
16
+ import { getFormControlClassNameForIconCount } from '../form/form_control_layout/_num_icons';
16
17
  import { useEuiI18n } from '../i18n';
17
18
  import { EuiPopover } from '../popover';
18
19
  import { EuiSpacer } from '../spacer';
@@ -157,9 +158,16 @@ export var EuiColorPicker = function EuiColorPicker(_ref) {
157
158
  'euiColorPicker__popoverPanel--customButton': button
158
159
  });
159
160
  var swatchClass = 'euiColorPicker__swatchSelect';
161
+ var numIconsClass = getFormControlClassNameForIconCount({
162
+ isDropdown: true,
163
+ clear: isClearable,
164
+ isInvalid: isInvalid
165
+ });
160
166
  var inputClasses = classNames('euiColorPicker__input', {
161
167
  'euiColorPicker__input--inGroup': prepend || append
162
- });
168
+ },
169
+ // Manually account for input padding, since `controlOnly` disables that logic
170
+ 'euiFieldText--withIcon', numIconsClass);
163
171
  var handleOnChange = function handleOnChange(text) {
164
172
  var output = getOutput(text, showAlpha);
165
173
  if (output.isValid) {
@@ -7,7 +7,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
7
7
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
8
8
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
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", "aria-label", "aria-labelledby"];
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"];
11
11
  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; }
12
12
  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; }
13
13
  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); }; }
@@ -29,7 +29,7 @@ import classNames from 'classnames';
29
29
  import { htmlIdGenerator, keys } from '../../services';
30
30
  import { EuiInputPopover } from '../popover';
31
31
  import { EuiI18n } from '../i18n';
32
- import { getMatchingOptions, flattenOptionGroups, getSelectedOptionForSearchValue, transformForCaseSensitivity } from './matching_options';
32
+ import { getMatchingOptions, flattenOptionGroups, getSelectedOptionForSearchValue, transformForCaseSensitivity, createPartialStringEqualityOptionMatcher } from './matching_options';
33
33
  import { EuiComboBoxInput } from './combo_box_input/combo_box_input';
34
34
  import { EuiComboBoxOptionsList } from './combo_box_options_list';
35
35
 
@@ -61,6 +61,7 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
61
61
  options: _this.props.options,
62
62
  selectedOptions: _this.props.selectedOptions,
63
63
  searchValue: initialSearchValue,
64
+ optionMatcher: _this.props.optionMatcher,
64
65
  isCaseSensitive: _this.props.isCaseSensitive,
65
66
  isPreFiltered: _this.props.async,
66
67
  showPrevSelected: Boolean(_this.props.singleSelection),
@@ -464,6 +465,7 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
464
465
  autoFocus = _this$props11.autoFocus,
465
466
  truncationProps = _this$props11.truncationProps,
466
467
  inputPopoverProps = _this$props11.inputPopoverProps,
468
+ optionMatcher = _this$props11.optionMatcher,
467
469
  ariaLabel = _this$props11['aria-label'],
468
470
  ariaLabelledby = _this$props11['aria-labelledby'],
469
471
  rest = _objectWithoutProperties(_this$props11, _excluded);
@@ -594,7 +596,8 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
594
596
  options = nextProps.options,
595
597
  selectedOptions = nextProps.selectedOptions,
596
598
  singleSelection = nextProps.singleSelection,
597
- sortMatchesBy = nextProps.sortMatchesBy;
599
+ sortMatchesBy = nextProps.sortMatchesBy,
600
+ optionMatcher = nextProps.optionMatcher;
598
601
  var activeOptionIndex = prevState.activeOptionIndex,
599
602
  searchValue = prevState.searchValue;
600
603
 
@@ -607,7 +610,8 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
607
610
  isCaseSensitive: isCaseSensitive,
608
611
  isPreFiltered: async,
609
612
  showPrevSelected: Boolean(singleSelection),
610
- sortMatchesBy: sortMatchesBy
613
+ sortMatchesBy: sortMatchesBy,
614
+ optionMatcher: optionMatcher
611
615
  });
612
616
  var stateUpdate = {
613
617
  matchingOptions: matchingOptions
@@ -630,5 +634,6 @@ _defineProperty(EuiComboBox, "defaultProps", {
630
634
  singleSelection: false,
631
635
  prepend: undefined,
632
636
  append: undefined,
633
- sortMatchesBy: 'none'
637
+ sortMatchesBy: 'none',
638
+ optionMatcher: createPartialStringEqualityOptionMatcher()
634
639
  });
@@ -8,4 +8,5 @@
8
8
 
9
9
  export { EuiComboBox } from './combo_box';
10
10
  export * from './combo_box_input';
11
- export * from './combo_box_options_list';
11
+ export * from './combo_box_options_list';
12
+ export { createPartialStringEqualityOptionMatcher } from './matching_options';
@@ -35,10 +35,12 @@ var collectMatchingOption = function collectMatchingOption(_ref2) {
35
35
  var accumulator = _ref2.accumulator,
36
36
  option = _ref2.option,
37
37
  selectedOptions = _ref2.selectedOptions,
38
+ searchValue = _ref2.searchValue,
38
39
  normalizedSearchValue = _ref2.normalizedSearchValue,
39
40
  isCaseSensitive = _ref2.isCaseSensitive,
40
41
  isPreFiltered = _ref2.isPreFiltered,
41
- showPrevSelected = _ref2.showPrevSelected;
42
+ showPrevSelected = _ref2.showPrevSelected,
43
+ optionMatcher = _ref2.optionMatcher;
42
44
  // Only show options which haven't yet been selected unless requested.
43
45
  var selectedOption = getSelectedOptionForSearchValue({
44
46
  isCaseSensitive: isCaseSensitive,
@@ -59,8 +61,13 @@ var collectMatchingOption = function collectMatchingOption(_ref2) {
59
61
  accumulator.push(option);
60
62
  return;
61
63
  }
62
- var normalizedOption = transformForCaseSensitivity(option.label.trim(), isCaseSensitive);
63
- if (normalizedOption.includes(normalizedSearchValue)) {
64
+ var isMatching = optionMatcher({
65
+ option: option,
66
+ searchValue: searchValue,
67
+ normalizedSearchValue: normalizedSearchValue,
68
+ isCaseSensitive: isCaseSensitive !== null && isCaseSensitive !== void 0 ? isCaseSensitive : true
69
+ });
70
+ if (isMatching) {
64
71
  accumulator.push(option);
65
72
  }
66
73
  };
@@ -68,6 +75,7 @@ export var getMatchingOptions = function getMatchingOptions(_ref3) {
68
75
  var options = _ref3.options,
69
76
  selectedOptions = _ref3.selectedOptions,
70
77
  searchValue = _ref3.searchValue,
78
+ optionMatcher = _ref3.optionMatcher,
71
79
  _ref3$isCaseSensitive = _ref3.isCaseSensitive,
72
80
  isCaseSensitive = _ref3$isCaseSensitive === void 0 ? false : _ref3$isCaseSensitive,
73
81
  _ref3$isPreFiltered = _ref3.isPreFiltered,
@@ -86,10 +94,12 @@ export var getMatchingOptions = function getMatchingOptions(_ref3) {
86
94
  accumulator: matchingOptionsForGroup,
87
95
  option: groupOption,
88
96
  selectedOptions: selectedOptions,
97
+ searchValue: searchValue,
89
98
  normalizedSearchValue: normalizedSearchValue,
90
99
  isCaseSensitive: isCaseSensitive,
91
100
  isPreFiltered: isPreFiltered,
92
- showPrevSelected: showPrevSelected
101
+ showPrevSelected: showPrevSelected,
102
+ optionMatcher: optionMatcher
93
103
  });
94
104
  });
95
105
  if (matchingOptionsForGroup.length > 0) {
@@ -108,10 +118,12 @@ export var getMatchingOptions = function getMatchingOptions(_ref3) {
108
118
  accumulator: matchingOptions,
109
119
  option: option,
110
120
  selectedOptions: selectedOptions,
121
+ searchValue: searchValue,
111
122
  normalizedSearchValue: normalizedSearchValue,
112
123
  isCaseSensitive: isCaseSensitive,
113
124
  isPreFiltered: isPreFiltered,
114
- showPrevSelected: showPrevSelected
125
+ showPrevSelected: showPrevSelected,
126
+ optionMatcher: optionMatcher
115
127
  });
116
128
  }
117
129
  });
@@ -131,4 +143,21 @@ export var getMatchingOptions = function getMatchingOptions(_ref3) {
131
143
  return [].concat(_toConsumableArray(refObj.startWith), _toConsumableArray(refObj.others));
132
144
  }
133
145
  return matchingOptions;
146
+ };
147
+
148
+ /**
149
+ * Partial string equality option matcher for EuiComboBox.
150
+ * It matches all options with labels including the searched string.
151
+ */
152
+ export var createPartialStringEqualityOptionMatcher = function createPartialStringEqualityOptionMatcher() {
153
+ return function (_ref4) {
154
+ var option = _ref4.option,
155
+ isCaseSensitive = _ref4.isCaseSensitive,
156
+ normalizedSearchValue = _ref4.normalizedSearchValue;
157
+ if (!normalizedSearchValue) {
158
+ return true;
159
+ }
160
+ var normalizedOption = transformForCaseSensitivity(option.label.trim(), isCaseSensitive);
161
+ return normalizedOption.includes(normalizedSearchValue);
162
+ };
134
163
  };
@@ -27,7 +27,8 @@ export var getColumnActions = function getColumnActions(_ref) {
27
27
  setIsPopoverOpen = _ref.setIsPopoverOpen,
28
28
  sorting = _ref.sorting,
29
29
  switchColumnPos = _ref.switchColumnPos,
30
- setFocusedCell = _ref.setFocusedCell;
30
+ setFocusedCell = _ref.setFocusedCell,
31
+ columnFocusIndex = _ref.columnFocusIndex;
31
32
  if (column.actions === false) {
32
33
  return [];
33
34
  }
@@ -45,7 +46,8 @@ export var getColumnActions = function getColumnActions(_ref) {
45
46
  column: column,
46
47
  columns: columns,
47
48
  switchColumnPos: switchColumnPos,
48
- setFocusedCell: setFocusedCell
49
+ setFocusedCell: setFocusedCell,
50
+ columnFocusIndex: columnFocusIndex
49
51
  })), _toConsumableArray(((_column$actions = column.actions) === null || _column$actions === void 0 ? void 0 : _column$actions.additional) || []));
50
52
  return actions.map(function (action) {
51
53
  return _objectSpread(_objectSpread({}, action), {}, {
@@ -104,17 +106,27 @@ var getMoveColumnActions = function getMoveColumnActions(_ref3) {
104
106
  var column = _ref3.column,
105
107
  columns = _ref3.columns,
106
108
  switchColumnPos = _ref3.switchColumnPos,
107
- setFocusedCell = _ref3.setFocusedCell;
109
+ setFocusedCell = _ref3.setFocusedCell,
110
+ columnFocusIndex = _ref3.columnFocusIndex;
108
111
  var items = [];
109
112
  var colIdx = columns.findIndex(function (col) {
110
113
  return col.id === column.id;
111
114
  });
115
+ var moveFocus = function moveFocus(direction) {
116
+ var newIndex = direction === 'left' ? -1 : 1;
117
+ // Wait a beat to move focus, otherwise the EuiPopover's EuiFocusTrap's
118
+ // returnFocus logic sometimes steals it (depending on rerenders)
119
+ setTimeout(function () {
120
+ setFocusedCell([columnFocusIndex + newIndex, -1]); // -1 is the static y-index of the header
121
+ });
122
+ };
123
+
112
124
  if (isColumnActionEnabled('showMoveLeft', column.actions)) {
113
125
  var onClickMoveLeft = function onClickMoveLeft() {
114
126
  var targetCol = columns[colIdx - 1];
115
127
  if (targetCol) {
116
128
  switchColumnPos(column.id, targetCol.id);
117
- setFocusedCell([colIdx - 1, -1]);
129
+ moveFocus('left');
118
130
  }
119
131
  };
120
132
  var action = {
@@ -135,7 +147,7 @@ var getMoveColumnActions = function getMoveColumnActions(_ref3) {
135
147
  var targetCol = columns[colIdx + 1];
136
148
  if (targetCol) {
137
149
  switchColumnPos(column.id, targetCol.id);
138
- setFocusedCell([colIdx + 1, -1]);
150
+ moveFocus('right');
139
151
  }
140
152
  };
141
153
  var _action = {
@@ -80,9 +80,10 @@ export var EuiDataGridHeaderCell = /*#__PURE__*/memo(function (_ref2) {
80
80
  setIsPopoverOpen: setIsPopoverOpen,
81
81
  sorting: sorting,
82
82
  switchColumnPos: switchColumnPos,
83
- setFocusedCell: setFocusedCell
83
+ setFocusedCell: setFocusedCell,
84
+ columnFocusIndex: index
84
85
  });
85
- }, [column, columns, schema, schemaDetectors, setVisibleColumns, focusFirstVisibleInteractiveCell, setIsPopoverOpen, sorting, switchColumnPos, setFocusedCell]);
86
+ }, [column, columns, schema, schemaDetectors, setVisibleColumns, focusFirstVisibleInteractiveCell, setIsPopoverOpen, sorting, switchColumnPos, setFocusedCell, index]);
86
87
  var showColumnActions = columnActions && columnActions.length > 0;
87
88
  var actionsButtonRef = useRef(null);
88
89
  var focusActionsButton = useCallback(function () {
@@ -51,16 +51,14 @@ export var EuiDataGridHeaderCellWrapper = function EuiDataGridHeaderCellWrapper(
51
51
  useEffect(function () {
52
52
  onFocusUpdate([index, -1], function (isFocused) {
53
53
  setIsFocused(isFocused);
54
- });
55
- }, [index, onFocusUpdate]);
56
- useEffect(function () {
57
- if (isFocused && headerEl) {
58
- // Only focus the cell if not already focused on something in the cell
59
- if (!headerEl.contains(document.activeElement)) {
60
- headerEl.focus();
54
+ if (isFocused && headerEl) {
55
+ // Only focus the cell if not already focused on something in the cell
56
+ if (!headerEl.contains(document.activeElement)) {
57
+ headerEl.focus();
58
+ }
61
59
  }
62
- }
63
- }, [isFocused, headerEl]);
60
+ });
61
+ }, [index, onFocusUpdate, headerEl]);
64
62
 
65
63
  // For cell headers with actions, auto-focus into the button instead of the cell wrapper div
66
64
  // The button text is significantly more useful to screen readers (e.g. contains sort order & hints)
@@ -81,10 +81,13 @@ export var EuiAbsoluteTab = /*#__PURE__*/function (_Component) {
81
81
  }
82
82
  var _this$props = _this.props,
83
83
  onChange = _this$props.onChange,
84
- dateFormat = _this$props.dateFormat;
84
+ dateFormat = _this$props.dateFormat,
85
+ locale = _this$props.locale;
85
86
 
86
- // Attempt to parse with passed `dateFormat`
87
- var valueAsMoment = moment(textInputValue, dateFormat, true);
87
+ // Attempt to parse with passed `dateFormat` and `locale`
88
+ var valueAsMoment = moment(textInputValue, dateFormat, typeof locale === 'string' ? locale : 'en',
89
+ // Narrow the union type to string
90
+ true);
88
91
  var dateIsValid = valueAsMoment.isValid();
89
92
 
90
93
  // If not valid, try a few other other standardized formats