@elastic/eui 77.0.0 → 77.1.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 (312) hide show
  1. package/dist/eui_theme_dark.css +22 -51
  2. package/dist/eui_theme_dark.min.css +1 -1
  3. package/dist/eui_theme_light.css +22 -51
  4. package/dist/eui_theme_light.min.css +1 -1
  5. package/es/components/accordion/accordion.a11y.js +3 -1
  6. package/es/components/accordion/accordion.js +4 -2
  7. package/es/components/basic_table/table.a11y.js +3 -1
  8. package/es/components/breadcrumbs/breadcrumbs.a11y.js +3 -1
  9. package/es/components/card/card.a11y.js +3 -1
  10. package/es/components/color_picker/color_picker.a11y.js +3 -1
  11. package/es/components/combo_box/combo_box.a11y.js +3 -1
  12. package/es/components/combo_box/combo_box.js +2 -21
  13. package/es/components/combo_box/combo_box_input/combo_box_input.js +66 -36
  14. package/es/components/combo_box/combo_box_options_list/combo_box_options_list.js +1 -1
  15. package/es/components/context_menu/context_menu_panel.a11y.js +3 -1
  16. package/es/components/control_bar/control_bar.a11y.js +3 -1
  17. package/es/components/copy/copy.a11y.js +6 -5
  18. package/es/components/datagrid/data_grid.a11y.js +3 -1
  19. package/es/components/date_picker/date_picker.a11y.js +3 -1
  20. package/es/components/date_picker/date_picker.js +148 -155
  21. package/es/components/date_picker/date_picker_range.js +2 -2
  22. package/es/components/date_picker/super_date_picker/super_date_picker.a11y.js +3 -1
  23. package/es/components/delay_hide/delay_hide.a11y.js +9 -9
  24. package/es/components/delay_render/delay_render.a11y.js +9 -9
  25. package/es/components/drag_and_drop/drag_and_drop.a11y.js +3 -2
  26. package/es/components/empty_prompt/empty_prompt.a11y.js +8 -14
  27. package/es/components/error_boundary/error_boundary.a11y.js +3 -1
  28. package/es/components/expression/expression.a11y.js +3 -1
  29. package/es/components/filter_group/filter_group.a11y.js +4 -3
  30. package/es/components/flyout/flyout.a11y.js +3 -1
  31. package/es/components/focus_trap/focus_trap.a11y.js +3 -1
  32. package/es/components/form/checkbox/checkbox_group.a11y.js +3 -1
  33. package/es/components/form/file_picker/file_picker.js +4 -2
  34. package/es/components/form/radio/radio_group.a11y.js +4 -5
  35. package/es/components/form/range/range.a11y.js +3 -1
  36. package/es/components/form/switch/switch.a11y.js +4 -5
  37. package/es/components/form/text_area/text_area.js +11 -3
  38. package/es/components/form/validatable_control/index.js +1 -1
  39. package/es/components/form/validatable_control/validatable_control.js +49 -13
  40. package/es/components/header/header.a11y.js +3 -1
  41. package/es/components/icon/icon_ML.a11y.js +3 -1
  42. package/es/components/icon/icon_apps.a11y.js +3 -1
  43. package/es/components/icon/icon_editor.a11y.js +3 -1
  44. package/es/components/icon/icon_elastic.a11y.js +3 -1
  45. package/es/components/icon/icon_glyphs.a11y.js +3 -1
  46. package/es/components/icon/icon_tokens.a11y.js +3 -1
  47. package/es/components/image/image.a11y.js +3 -1
  48. package/es/components/index.js +1 -0
  49. package/es/components/inline_edit/index.js +10 -0
  50. package/es/components/inline_edit/inline_edit.styles.js +15 -0
  51. package/es/components/inline_edit/inline_edit_form.js +190 -0
  52. package/es/components/inline_edit/inline_edit_text.js +97 -0
  53. package/es/components/inline_edit/inline_edit_title.js +105 -0
  54. package/es/components/key_pad_menu/key_pad_menu.a11y.js +3 -1
  55. package/es/components/modal/modal.a11y.js +3 -1
  56. package/es/components/notification/notification_event.a11y.js +3 -1
  57. package/es/components/page/page_header/page_header.a11y.js +3 -1
  58. package/es/components/pagination/pagination.a11y.js +3 -1
  59. package/es/components/popover/popover.a11y.js +3 -1
  60. package/es/components/popover/popover_footer.js +4 -4
  61. package/es/components/popover/popover_footer.styles.js +16 -5
  62. package/es/components/popover/popover_panel/_popover_panel.js +8 -5
  63. package/es/components/portal/portal.a11y.js +3 -1
  64. package/es/components/progress/progress.a11y.js +3 -1
  65. package/es/components/resizable_container/resizable_container.a11y.js +3 -1
  66. package/es/components/search_bar/search_bar.a11y.js +8 -7
  67. package/es/components/selectable/selectable.a11y.js +3 -1
  68. package/es/components/side_nav/side_nav.a11y.js +3 -1
  69. package/es/components/tabs/tabs.a11y.js +3 -1
  70. package/es/components/tree_view/tree_view.a11y.js +3 -1
  71. package/eui.d.ts +161 -37
  72. package/i18ntokens.json +40 -4
  73. package/lib/components/accordion/accordion.a11y.js +3 -1
  74. package/lib/components/accordion/accordion.js +4 -2
  75. package/lib/components/basic_table/table.a11y.js +3 -1
  76. package/lib/components/breadcrumbs/breadcrumbs.a11y.js +3 -1
  77. package/lib/components/combo_box/combo_box.js +2 -21
  78. package/lib/components/combo_box/combo_box_input/combo_box_input.js +66 -36
  79. package/lib/components/combo_box/combo_box_options_list/combo_box_options_list.js +1 -1
  80. package/lib/components/context_menu/context_menu_panel.a11y.js +3 -1
  81. package/lib/components/copy/copy.a11y.js +3 -4
  82. package/lib/components/date_picker/date_picker.js +147 -153
  83. package/lib/components/date_picker/date_picker_range.js +2 -2
  84. package/lib/components/delay_hide/delay_hide.a11y.js +6 -8
  85. package/lib/components/delay_render/delay_render.a11y.js +6 -8
  86. package/lib/components/drag_and_drop/drag_and_drop.a11y.js +0 -1
  87. package/lib/components/empty_prompt/empty_prompt.a11y.js +8 -14
  88. package/lib/components/error_boundary/error_boundary.a11y.js +3 -1
  89. package/lib/components/filter_group/filter_group.a11y.js +7 -8
  90. package/lib/components/form/file_picker/file_picker.js +4 -2
  91. package/lib/components/form/radio/radio_group.a11y.js +1 -4
  92. package/lib/components/form/switch/switch.a11y.js +1 -4
  93. package/lib/components/form/text_area/text_area.js +11 -3
  94. package/lib/components/form/validatable_control/index.js +6 -0
  95. package/lib/components/form/validatable_control/validatable_control.js +51 -14
  96. package/lib/components/icon/icon_ML.a11y.js +3 -1
  97. package/lib/components/icon/icon_apps.a11y.js +3 -1
  98. package/lib/components/icon/icon_editor.a11y.js +3 -1
  99. package/lib/components/icon/icon_elastic.a11y.js +3 -1
  100. package/lib/components/icon/icon_glyphs.a11y.js +3 -1
  101. package/lib/components/icon/icon_tokens.a11y.js +3 -1
  102. package/lib/components/image/image.a11y.js +3 -1
  103. package/lib/components/index.js +11 -0
  104. package/lib/components/inline_edit/index.js +19 -0
  105. package/lib/components/inline_edit/inline_edit.styles.js +22 -0
  106. package/lib/components/inline_edit/inline_edit_form.js +193 -0
  107. package/lib/components/inline_edit/inline_edit_text.js +97 -0
  108. package/lib/components/inline_edit/inline_edit_title.js +106 -0
  109. package/lib/components/page/page_header/page_header.a11y.js +3 -1
  110. package/lib/components/popover/popover_footer.js +4 -4
  111. package/lib/components/popover/popover_footer.styles.js +19 -7
  112. package/lib/components/popover/popover_panel/_popover_panel.js +7 -4
  113. package/lib/components/resizable_container/resizable_container.a11y.js +3 -1
  114. package/lib/components/search_bar/search_bar.a11y.js +5 -6
  115. package/lib/components/tree_view/tree_view.a11y.js +3 -1
  116. package/optimize/es/components/accordion/accordion.a11y.js +3 -1
  117. package/optimize/es/components/accordion/accordion.js +4 -2
  118. package/optimize/es/components/basic_table/table.a11y.js +3 -1
  119. package/optimize/es/components/breadcrumbs/breadcrumbs.a11y.js +3 -1
  120. package/optimize/es/components/card/card.a11y.js +3 -1
  121. package/optimize/es/components/color_picker/color_picker.a11y.js +3 -1
  122. package/optimize/es/components/combo_box/combo_box.a11y.js +3 -1
  123. package/optimize/es/components/combo_box/combo_box.js +2 -21
  124. package/optimize/es/components/combo_box/combo_box_input/combo_box_input.js +63 -34
  125. package/optimize/es/components/combo_box/combo_box_options_list/combo_box_options_list.js +1 -1
  126. package/optimize/es/components/context_menu/context_menu_panel.a11y.js +3 -1
  127. package/optimize/es/components/control_bar/control_bar.a11y.js +3 -1
  128. package/optimize/es/components/copy/copy.a11y.js +6 -5
  129. package/optimize/es/components/datagrid/data_grid.a11y.js +3 -1
  130. package/optimize/es/components/date_picker/date_picker.a11y.js +3 -1
  131. package/optimize/es/components/date_picker/date_picker.js +142 -148
  132. package/optimize/es/components/date_picker/date_picker_range.js +1 -1
  133. package/optimize/es/components/date_picker/super_date_picker/super_date_picker.a11y.js +3 -1
  134. package/optimize/es/components/delay_hide/delay_hide.a11y.js +9 -9
  135. package/optimize/es/components/delay_render/delay_render.a11y.js +9 -9
  136. package/optimize/es/components/drag_and_drop/drag_and_drop.a11y.js +3 -2
  137. package/optimize/es/components/empty_prompt/empty_prompt.a11y.js +8 -14
  138. package/optimize/es/components/error_boundary/error_boundary.a11y.js +3 -1
  139. package/optimize/es/components/expression/expression.a11y.js +3 -1
  140. package/optimize/es/components/filter_group/filter_group.a11y.js +4 -3
  141. package/optimize/es/components/flyout/flyout.a11y.js +3 -1
  142. package/optimize/es/components/focus_trap/focus_trap.a11y.js +3 -1
  143. package/optimize/es/components/form/checkbox/checkbox_group.a11y.js +3 -1
  144. package/optimize/es/components/form/file_picker/file_picker.js +4 -2
  145. package/optimize/es/components/form/radio/radio_group.a11y.js +4 -5
  146. package/optimize/es/components/form/range/range.a11y.js +3 -1
  147. package/optimize/es/components/form/switch/switch.a11y.js +4 -5
  148. package/optimize/es/components/form/text_area/text_area.js +10 -3
  149. package/optimize/es/components/form/validatable_control/index.js +1 -1
  150. package/optimize/es/components/form/validatable_control/validatable_control.js +49 -9
  151. package/optimize/es/components/header/header.a11y.js +3 -1
  152. package/optimize/es/components/icon/icon_ML.a11y.js +3 -1
  153. package/optimize/es/components/icon/icon_apps.a11y.js +3 -1
  154. package/optimize/es/components/icon/icon_editor.a11y.js +3 -1
  155. package/optimize/es/components/icon/icon_elastic.a11y.js +3 -1
  156. package/optimize/es/components/icon/icon_glyphs.a11y.js +3 -1
  157. package/optimize/es/components/icon/icon_tokens.a11y.js +3 -1
  158. package/optimize/es/components/image/image.a11y.js +3 -1
  159. package/optimize/es/components/index.js +1 -0
  160. package/optimize/es/components/inline_edit/index.js +10 -0
  161. package/optimize/es/components/inline_edit/inline_edit.styles.js +15 -0
  162. package/optimize/es/components/inline_edit/inline_edit_form.js +133 -0
  163. package/optimize/es/components/inline_edit/inline_edit_text.js +52 -0
  164. package/optimize/es/components/inline_edit/inline_edit_title.js +56 -0
  165. package/optimize/es/components/key_pad_menu/key_pad_menu.a11y.js +3 -1
  166. package/optimize/es/components/modal/modal.a11y.js +3 -1
  167. package/optimize/es/components/notification/notification_event.a11y.js +3 -1
  168. package/optimize/es/components/page/page_header/page_header.a11y.js +3 -1
  169. package/optimize/es/components/pagination/pagination.a11y.js +3 -1
  170. package/optimize/es/components/popover/popover.a11y.js +3 -1
  171. package/optimize/es/components/popover/popover_footer.js +4 -4
  172. package/optimize/es/components/popover/popover_footer.styles.js +16 -5
  173. package/optimize/es/components/popover/popover_panel/_popover_panel.js +8 -5
  174. package/optimize/es/components/portal/portal.a11y.js +3 -1
  175. package/optimize/es/components/progress/progress.a11y.js +3 -1
  176. package/optimize/es/components/resizable_container/resizable_container.a11y.js +3 -1
  177. package/optimize/es/components/search_bar/search_bar.a11y.js +8 -7
  178. package/optimize/es/components/selectable/selectable.a11y.js +3 -1
  179. package/optimize/es/components/side_nav/side_nav.a11y.js +3 -1
  180. package/optimize/es/components/tabs/tabs.a11y.js +3 -1
  181. package/optimize/es/components/tree_view/tree_view.a11y.js +3 -1
  182. package/optimize/lib/components/accordion/accordion.a11y.js +3 -1
  183. package/optimize/lib/components/accordion/accordion.js +4 -2
  184. package/optimize/lib/components/basic_table/table.a11y.js +3 -1
  185. package/optimize/lib/components/breadcrumbs/breadcrumbs.a11y.js +3 -1
  186. package/optimize/lib/components/card/card.a11y.js +3 -1
  187. package/optimize/lib/components/color_picker/color_picker.a11y.js +3 -1
  188. package/optimize/lib/components/combo_box/combo_box.a11y.js +3 -1
  189. package/optimize/lib/components/combo_box/combo_box.js +2 -21
  190. package/optimize/lib/components/combo_box/combo_box_input/combo_box_input.js +63 -34
  191. package/optimize/lib/components/combo_box/combo_box_options_list/combo_box_options_list.js +1 -1
  192. package/optimize/lib/components/context_menu/context_menu_panel.a11y.js +3 -1
  193. package/optimize/lib/components/control_bar/control_bar.a11y.js +3 -1
  194. package/optimize/lib/components/copy/copy.a11y.js +6 -5
  195. package/optimize/lib/components/datagrid/data_grid.a11y.js +3 -1
  196. package/optimize/lib/components/date_picker/date_picker.a11y.js +3 -1
  197. package/optimize/lib/components/date_picker/date_picker.js +141 -147
  198. package/optimize/lib/components/date_picker/date_picker_range.js +1 -1
  199. package/optimize/lib/components/date_picker/super_date_picker/super_date_picker.a11y.js +3 -1
  200. package/optimize/lib/components/delay_hide/delay_hide.a11y.js +9 -9
  201. package/optimize/lib/components/delay_render/delay_render.a11y.js +9 -9
  202. package/optimize/lib/components/drag_and_drop/drag_and_drop.a11y.js +3 -2
  203. package/optimize/lib/components/empty_prompt/empty_prompt.a11y.js +8 -14
  204. package/optimize/lib/components/error_boundary/error_boundary.a11y.js +3 -1
  205. package/optimize/lib/components/filter_group/filter_group.a11y.js +10 -9
  206. package/optimize/lib/components/focus_trap/focus_trap.a11y.js +3 -1
  207. package/optimize/lib/components/form/file_picker/file_picker.js +4 -2
  208. package/optimize/lib/components/form/radio/radio_group.a11y.js +4 -5
  209. package/optimize/lib/components/form/range/range.a11y.js +3 -1
  210. package/optimize/lib/components/form/switch/switch.a11y.js +4 -5
  211. package/optimize/lib/components/form/text_area/text_area.js +10 -3
  212. package/optimize/lib/components/form/validatable_control/index.js +6 -0
  213. package/optimize/lib/components/form/validatable_control/validatable_control.js +52 -12
  214. package/optimize/lib/components/header/header.a11y.js +3 -1
  215. package/optimize/lib/components/icon/icon_ML.a11y.js +3 -1
  216. package/optimize/lib/components/icon/icon_apps.a11y.js +3 -1
  217. package/optimize/lib/components/icon/icon_editor.a11y.js +3 -1
  218. package/optimize/lib/components/icon/icon_elastic.a11y.js +3 -1
  219. package/optimize/lib/components/icon/icon_glyphs.a11y.js +3 -1
  220. package/optimize/lib/components/icon/icon_tokens.a11y.js +3 -1
  221. package/optimize/lib/components/image/image.a11y.js +3 -1
  222. package/optimize/lib/components/index.js +11 -0
  223. package/optimize/lib/components/inline_edit/index.js +19 -0
  224. package/optimize/lib/components/inline_edit/inline_edit.styles.js +22 -0
  225. package/optimize/lib/components/inline_edit/inline_edit_form.js +144 -0
  226. package/optimize/lib/components/inline_edit/inline_edit_text.js +52 -0
  227. package/optimize/lib/components/inline_edit/inline_edit_title.js +57 -0
  228. package/optimize/lib/components/key_pad_menu/key_pad_menu.a11y.js +3 -1
  229. package/optimize/lib/components/modal/modal.a11y.js +3 -1
  230. package/optimize/lib/components/notification/notification_event.a11y.js +3 -1
  231. package/optimize/lib/components/page/page_header/page_header.a11y.js +3 -1
  232. package/optimize/lib/components/pagination/pagination.a11y.js +3 -1
  233. package/optimize/lib/components/popover/popover.a11y.js +3 -1
  234. package/optimize/lib/components/popover/popover_footer.js +4 -4
  235. package/optimize/lib/components/popover/popover_footer.styles.js +19 -7
  236. package/optimize/lib/components/popover/popover_panel/_popover_panel.js +7 -4
  237. package/optimize/lib/components/portal/portal.a11y.js +3 -1
  238. package/optimize/lib/components/progress/progress.a11y.js +3 -1
  239. package/optimize/lib/components/resizable_container/resizable_container.a11y.js +3 -1
  240. package/optimize/lib/components/search_bar/search_bar.a11y.js +8 -7
  241. package/optimize/lib/components/selectable/selectable.a11y.js +3 -1
  242. package/optimize/lib/components/side_nav/side_nav.a11y.js +3 -1
  243. package/optimize/lib/components/tree_view/tree_view.a11y.js +3 -1
  244. package/package.json +1 -1
  245. package/src/components/combo_box/_combo_box.scss +2 -38
  246. package/src/components/date_picker/_date_picker_range.scss +1 -1
  247. package/src/components/form/field_text/_field_text.scss +0 -7
  248. package/src/components/form/file_picker/_file_picker.scss +3 -2
  249. package/src/components/form/form_control_layout/_form_control_layout.scss +7 -2
  250. package/src/components/form/text_area/_text_area.scss +9 -0
  251. package/test-env/components/accordion/accordion.a11y.js +3 -1
  252. package/test-env/components/accordion/accordion.js +4 -2
  253. package/test-env/components/basic_table/table.a11y.js +3 -1
  254. package/test-env/components/breadcrumbs/breadcrumbs.a11y.js +3 -1
  255. package/test-env/components/card/card.a11y.js +3 -1
  256. package/test-env/components/color_picker/color_picker.a11y.js +3 -1
  257. package/test-env/components/combo_box/combo_box.a11y.js +3 -1
  258. package/test-env/components/combo_box/combo_box.js +2 -21
  259. package/test-env/components/combo_box/combo_box_input/combo_box_input.js +66 -36
  260. package/test-env/components/combo_box/combo_box_options_list/combo_box_options_list.js +1 -1
  261. package/test-env/components/context_menu/context_menu_panel.a11y.js +3 -1
  262. package/test-env/components/control_bar/control_bar.a11y.js +3 -1
  263. package/test-env/components/copy/copy.a11y.js +6 -5
  264. package/test-env/components/datagrid/data_grid.a11y.js +3 -1
  265. package/test-env/components/date_picker/date_picker.a11y.js +3 -1
  266. package/test-env/components/date_picker/date_picker.js +141 -147
  267. package/test-env/components/date_picker/date_picker_range.js +2 -2
  268. package/test-env/components/date_picker/super_date_picker/super_date_picker.a11y.js +3 -1
  269. package/test-env/components/delay_hide/delay_hide.a11y.js +9 -9
  270. package/test-env/components/delay_render/delay_render.a11y.js +9 -9
  271. package/test-env/components/drag_and_drop/drag_and_drop.a11y.js +3 -2
  272. package/test-env/components/empty_prompt/empty_prompt.a11y.js +8 -14
  273. package/test-env/components/error_boundary/error_boundary.a11y.js +3 -1
  274. package/test-env/components/filter_group/filter_group.a11y.js +10 -9
  275. package/test-env/components/focus_trap/focus_trap.a11y.js +3 -1
  276. package/test-env/components/form/file_picker/file_picker.js +4 -2
  277. package/test-env/components/form/radio/radio_group.a11y.js +4 -5
  278. package/test-env/components/form/range/range.a11y.js +3 -1
  279. package/test-env/components/form/switch/switch.a11y.js +4 -5
  280. package/test-env/components/form/text_area/text_area.js +11 -3
  281. package/test-env/components/form/validatable_control/index.js +6 -0
  282. package/test-env/components/form/validatable_control/validatable_control.js +51 -14
  283. package/test-env/components/header/header.a11y.js +3 -1
  284. package/test-env/components/icon/icon_ML.a11y.js +3 -1
  285. package/test-env/components/icon/icon_apps.a11y.js +3 -1
  286. package/test-env/components/icon/icon_editor.a11y.js +3 -1
  287. package/test-env/components/icon/icon_elastic.a11y.js +3 -1
  288. package/test-env/components/icon/icon_glyphs.a11y.js +3 -1
  289. package/test-env/components/icon/icon_tokens.a11y.js +3 -1
  290. package/test-env/components/image/image.a11y.js +3 -1
  291. package/test-env/components/index.js +11 -0
  292. package/test-env/components/inline_edit/index.js +19 -0
  293. package/test-env/components/inline_edit/inline_edit.styles.js +22 -0
  294. package/test-env/components/inline_edit/inline_edit_form.js +196 -0
  295. package/test-env/components/inline_edit/inline_edit_text.js +96 -0
  296. package/test-env/components/inline_edit/inline_edit_title.js +105 -0
  297. package/test-env/components/key_pad_menu/key_pad_menu.a11y.js +3 -1
  298. package/test-env/components/modal/modal.a11y.js +3 -1
  299. package/test-env/components/notification/notification_event.a11y.js +3 -1
  300. package/test-env/components/page/page_header/page_header.a11y.js +3 -1
  301. package/test-env/components/pagination/pagination.a11y.js +3 -1
  302. package/test-env/components/popover/popover.a11y.js +3 -1
  303. package/test-env/components/popover/popover_footer.js +4 -4
  304. package/test-env/components/popover/popover_footer.styles.js +19 -7
  305. package/test-env/components/popover/popover_panel/_popover_panel.js +7 -4
  306. package/test-env/components/portal/portal.a11y.js +3 -1
  307. package/test-env/components/progress/progress.a11y.js +3 -1
  308. package/test-env/components/resizable_container/resizable_container.a11y.js +3 -1
  309. package/test-env/components/search_bar/search_bar.a11y.js +8 -7
  310. package/test-env/components/selectable/selectable.a11y.js +3 -1
  311. package/test-env/components/side_nav/side_nav.a11y.js +3 -1
  312. package/test-env/components/tree_view/tree_view.a11y.js +3 -1
@@ -8,8 +8,10 @@ var _react = _interopRequireWildcard(require("react"));
8
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
  var _classnames = _interopRequireDefault(require("classnames"));
10
10
  var _reactInputAutosize = _interopRequireDefault(require("react-input-autosize"));
11
+ var _services = require("../../../services");
11
12
  var _accessibility = require("../../accessibility");
12
13
  var _form_control_layout = require("../../form/form_control_layout");
14
+ var _num_icons = require("../../form/form_control_layout/_num_icons");
13
15
  var _combo_box_pill = require("./combo_box_pill");
14
16
  var _react2 = require("@emotion/react");
15
17
  var _excluded = ["key", "label", "color", "onClick"];
@@ -66,10 +68,29 @@ var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
66
68
  hasFocus: false
67
69
  });
68
70
  });
69
- _defineProperty(_assertThisInitialized(_this), "inputOnChange", function (event) {
71
+ _defineProperty(_assertThisInitialized(_this), "onKeyDown", function (event) {
70
72
  var _this$props = _this.props,
71
- onChange = _this$props.onChange,
72
- searchValue = _this$props.searchValue;
73
+ searchValue = _this$props.searchValue,
74
+ selectedOptions = _this$props.selectedOptions,
75
+ onRemoveOption = _this$props.onRemoveOption,
76
+ singleSelection = _this$props.singleSelection,
77
+ isListOpen = _this$props.isListOpen,
78
+ onOpenListClick = _this$props.onOpenListClick;
79
+
80
+ // When backspacing from an empty input, delete the last pill option in the list
81
+ var searchIsEmpty = !searchValue.length;
82
+ var hasPills = selectedOptions.length;
83
+ if (event.key === _services.keys.BACKSPACE && searchIsEmpty && hasPills) {
84
+ onRemoveOption(selectedOptions[selectedOptions.length - 1]);
85
+ if (!!singleSelection && !isListOpen) {
86
+ onOpenListClick();
87
+ }
88
+ }
89
+ });
90
+ _defineProperty(_assertThisInitialized(_this), "inputOnChange", function (event) {
91
+ var _this$props2 = _this.props,
92
+ onChange = _this$props2.onChange,
93
+ searchValue = _this$props2.searchValue;
73
94
  if (onChange) {
74
95
  onChange(event.target.value);
75
96
  }
@@ -96,34 +117,35 @@ var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
96
117
  }, {
97
118
  key: "render",
98
119
  value: function render() {
99
- var _this$props2 = this.props,
100
- compressed = _this$props2.compressed,
101
- focusedOptionId = _this$props2.focusedOptionId,
102
- fullWidth = _this$props2.fullWidth,
103
- hasSelectedOptions = _this$props2.hasSelectedOptions,
104
- id = _this$props2.id,
105
- inputRef = _this$props2.inputRef,
106
- isDisabled = _this$props2.isDisabled,
107
- isListOpen = _this$props2.isListOpen,
108
- noIcon = _this$props2.noIcon,
109
- onClear = _this$props2.onClear,
110
- onClick = _this$props2.onClick,
111
- onCloseListClick = _this$props2.onCloseListClick,
112
- onOpenListClick = _this$props2.onOpenListClick,
113
- onRemoveOption = _this$props2.onRemoveOption,
114
- placeholder = _this$props2.placeholder,
115
- rootId = _this$props2.rootId,
116
- searchValue = _this$props2.searchValue,
117
- selectedOptions = _this$props2.selectedOptions,
118
- singleSelectionProp = _this$props2.singleSelection,
119
- toggleButtonRef = _this$props2.toggleButtonRef,
120
- value = _this$props2.value,
121
- prepend = _this$props2.prepend,
122
- append = _this$props2.append,
123
- isLoading = _this$props2.isLoading,
124
- autoFocus = _this$props2.autoFocus,
125
- ariaLabel = _this$props2['aria-label'],
126
- ariaLabelledby = _this$props2['aria-labelledby'];
120
+ var _this$props3 = this.props,
121
+ compressed = _this$props3.compressed,
122
+ focusedOptionId = _this$props3.focusedOptionId,
123
+ fullWidth = _this$props3.fullWidth,
124
+ hasSelectedOptions = _this$props3.hasSelectedOptions,
125
+ id = _this$props3.id,
126
+ inputRef = _this$props3.inputRef,
127
+ isDisabled = _this$props3.isDisabled,
128
+ isListOpen = _this$props3.isListOpen,
129
+ noIcon = _this$props3.noIcon,
130
+ onClear = _this$props3.onClear,
131
+ onClick = _this$props3.onClick,
132
+ onCloseListClick = _this$props3.onCloseListClick,
133
+ onOpenListClick = _this$props3.onOpenListClick,
134
+ onRemoveOption = _this$props3.onRemoveOption,
135
+ placeholder = _this$props3.placeholder,
136
+ rootId = _this$props3.rootId,
137
+ searchValue = _this$props3.searchValue,
138
+ selectedOptions = _this$props3.selectedOptions,
139
+ singleSelectionProp = _this$props3.singleSelection,
140
+ toggleButtonRef = _this$props3.toggleButtonRef,
141
+ value = _this$props3.value,
142
+ prepend = _this$props3.prepend,
143
+ append = _this$props3.append,
144
+ isLoading = _this$props3.isLoading,
145
+ isInvalid = _this$props3.isInvalid,
146
+ autoFocus = _this$props3.autoFocus,
147
+ ariaLabel = _this$props3['aria-label'],
148
+ ariaLabelledby = _this$props3['aria-labelledby'];
127
149
  var singleSelection = Boolean(singleSelectionProp);
128
150
  var asPlainText = singleSelectionProp && _typeof(singleSelectionProp) === 'object' && singleSelectionProp.asPlainText || false;
129
151
  var pills = selectedOptions ? selectedOptions.map(function (option) {
@@ -185,12 +207,16 @@ var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
185
207
  type: 'arrowDown'
186
208
  };
187
209
  }
188
- var wrapClasses = (0, _classnames.default)('euiComboBox__inputWrap', {
210
+ var numIconsClass = (0, _num_icons.getFormControlClassNameForIconCount)({
211
+ isDropdown: !noIcon,
212
+ clear: !!clickProps.clear,
213
+ isInvalid: isInvalid,
214
+ isLoading: isLoading
215
+ });
216
+ var wrapClasses = (0, _classnames.default)('euiComboBox__inputWrap', numIconsClass, {
189
217
  'euiComboBox__inputWrap--compressed': compressed,
190
218
  'euiComboBox__inputWrap--fullWidth': fullWidth,
191
219
  'euiComboBox__inputWrap--noWrap': singleSelection,
192
- 'euiComboBox__inputWrap-isLoading': isLoading,
193
- 'euiComboBox__inputWrap-isClearable': onClear,
194
220
  'euiComboBox__inputWrap--inGroup': prepend || append
195
221
  });
196
222
  return (0, _react2.jsx)(_form_control_layout.EuiFormControlLayout, _extends({
@@ -198,6 +224,7 @@ var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
198
224
  }, clickProps, {
199
225
  inputId: id,
200
226
  isLoading: isLoading,
227
+ isInvalid: isInvalid,
201
228
  compressed: compressed,
202
229
  fullWidth: fullWidth,
203
230
  prepend: prepend,
@@ -214,6 +241,7 @@ var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
214
241
  "aria-expanded": isListOpen,
215
242
  "aria-label": ariaLabel,
216
243
  "aria-labelledby": ariaLabelledby,
244
+ "aria-invalid": isInvalid,
217
245
  className: "euiComboBox__input",
218
246
  "data-test-subj": "comboBoxSearchInput",
219
247
  disabled: isDisabled,
@@ -222,6 +250,7 @@ var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
222
250
  onBlur: this.onBlur,
223
251
  onChange: this.inputOnChange,
224
252
  onFocus: this.onFocus,
253
+ onKeyDown: this.onKeyDown,
225
254
  ref: this.inputRefCallback,
226
255
  role: "combobox",
227
256
  style: {
@@ -253,7 +282,7 @@ EuiComboBoxInput.propTypes = {
253
282
  onCloseListClick: _propTypes.default.func.isRequired,
254
283
  onFocus: _propTypes.default.any.isRequired,
255
284
  onOpenListClick: _propTypes.default.func.isRequired,
256
- onRemoveOption: _propTypes.default.func,
285
+ onRemoveOption: _propTypes.default.func.isRequired,
257
286
  placeholder: _propTypes.default.string,
258
287
  rootId: _propTypes.default.any.isRequired,
259
288
  searchValue: _propTypes.default.string.isRequired,
@@ -277,7 +306,7 @@ EuiComboBoxInput.propTypes = {
277
306
  "aria-label": _propTypes.default.string,
278
307
  "data-test-subj": _propTypes.default.string,
279
308
  css: _propTypes.default.any
280
- }).isRequired),
309
+ }).isRequired).isRequired,
281
310
  singleSelection: _propTypes.default.oneOfType([_propTypes.default.bool.isRequired, _propTypes.default.shape({
282
311
  asPlainText: _propTypes.default.bool
283
312
  }).isRequired]),
@@ -287,6 +316,7 @@ EuiComboBoxInput.propTypes = {
287
316
  prepend: _propTypes.default.oneOfType([_propTypes.default.oneOfType([_propTypes.default.string.isRequired, _propTypes.default.element.isRequired]).isRequired, _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.string.isRequired, _propTypes.default.element.isRequired]).isRequired).isRequired]),
288
317
  append: _propTypes.default.oneOfType([_propTypes.default.oneOfType([_propTypes.default.string.isRequired, _propTypes.default.element.isRequired]).isRequired, _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.string.isRequired, _propTypes.default.element.isRequired]).isRequired).isRequired]),
289
318
  isLoading: _propTypes.default.bool,
319
+ isInvalid: _propTypes.default.bool,
290
320
  autoFocus: _propTypes.default.bool,
291
321
  "aria-label": _propTypes.default.string,
292
322
  "aria-labelledby": _propTypes.default.string,
@@ -351,7 +351,7 @@ var EuiComboBoxOptionsList = /*#__PURE__*/function (_Component) {
351
351
  hasShadow: false,
352
352
  className: classes,
353
353
  panelRef: this.listRefCallback,
354
- "data-test-subj": "comboBoxOptionsList ".concat(dataTestSubj),
354
+ "data-test-subj": (0, _classnames.default)('comboBoxOptionsList', dataTestSubj),
355
355
  style: _objectSpread(_objectSpread({}, style), {}, {
356
356
  zIndex: zIndex
357
357
  }),
@@ -13,7 +13,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
13
13
  * Side Public License, v 1.
14
14
  */
15
15
 
16
- /// <reference types="../../../cypress/support"/>
16
+ /// <reference types="cypress" />
17
+ /// <reference types="cypress-real-events" />
18
+ /// <reference types="../../../cypress/support" />
17
19
 
18
20
  var items = [(0, _react2.jsx)(_context_menu_item.EuiContextMenuItem, {
19
21
  key: "A",
@@ -20,14 +20,13 @@ var Copy = function Copy() {
20
20
  _useState2 = _slicedToArray(_useState, 2),
21
21
  copyText = _useState2[0],
22
22
  setCopyText = _useState2[1];
23
- var onChange = function onChange(e) {
24
- setCopyText(e.target.value);
25
- };
26
23
  return (0, _react2.jsx)("div", null, (0, _react2.jsx)(_form.EuiFormRow, {
27
24
  label: "Enter text that will be copied to clipboard"
28
25
  }, (0, _react2.jsx)(_form.EuiFieldText, {
29
26
  value: copyText,
30
- onChange: onChange
27
+ onChange: function onChange(e) {
28
+ return setCopyText(e.target.value);
29
+ }
31
30
  })), (0, _react2.jsx)(_spacer.EuiSpacer, {
32
31
  size: "m"
33
32
  }), (0, _react2.jsx)(_copy.EuiCopy, {
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
 
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
@@ -8,6 +9,8 @@ var _react = _interopRequireWildcard(require("react"));
8
9
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
10
  var _classnames = _interopRequireDefault(require("classnames"));
10
11
  var _form = require("../form");
12
+ var _num_icons = require("../form/form_control_layout/_num_icons");
13
+ var _services = require("../../services");
11
14
  var _context = require("../context");
12
15
  var _reactDatepicker = require("./react-datepicker");
13
16
  var _react2 = require("@emotion/react");
@@ -15,23 +18,15 @@ var _excluded = ["adjustDateOnChange", "calendarClassName", "className", "custom
15
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
19
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
20
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
18
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
19
21
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
22
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
23
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
24
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
25
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
26
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
27
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
20
28
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
21
29
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
22
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
23
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
24
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
25
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
26
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
27
- 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); }; }
28
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
29
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
30
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
31
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
32
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
33
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
34
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
35
30
  var euiDatePickerDefaultDateFormat = 'MM/DD/YYYY';
36
31
  exports.euiDatePickerDefaultDateFormat = euiDatePickerDefaultDateFormat;
37
32
  var euiDatePickerDefaultTimeFormat = 'hh:mm A';
@@ -63,147 +58,146 @@ var unsupportedProps = [
63
58
  'showMonthYearDropdown',
64
59
  // We overridde this with `popoverPlacement`
65
60
  'popperPlacement'];
66
- var EuiDatePicker = /*#__PURE__*/function (_Component) {
67
- _inherits(EuiDatePicker, _Component);
68
- var _super = _createSuper(EuiDatePicker);
69
- function EuiDatePicker() {
70
- _classCallCheck(this, EuiDatePicker);
71
- return _super.apply(this, arguments);
61
+ var EuiDatePicker = function EuiDatePicker(_ref) {
62
+ var _ref$adjustDateOnChan = _ref.adjustDateOnChange,
63
+ adjustDateOnChange = _ref$adjustDateOnChan === void 0 ? true : _ref$adjustDateOnChan,
64
+ calendarClassName = _ref.calendarClassName,
65
+ className = _ref.className,
66
+ customInput = _ref.customInput,
67
+ _ref$dateFormat = _ref.dateFormat,
68
+ dateFormat = _ref$dateFormat === void 0 ? euiDatePickerDefaultDateFormat : _ref$dateFormat,
69
+ dayClassName = _ref.dayClassName,
70
+ disabled = _ref.disabled,
71
+ excludeDates = _ref.excludeDates,
72
+ filterDate = _ref.filterDate,
73
+ _ref$fullWidth = _ref.fullWidth,
74
+ fullWidth = _ref$fullWidth === void 0 ? false : _ref$fullWidth,
75
+ iconType = _ref.iconType,
76
+ injectTimes = _ref.injectTimes,
77
+ inline = _ref.inline,
78
+ inputRef = _ref.inputRef,
79
+ isInvalid = _ref.isInvalid,
80
+ isLoading = _ref.isLoading,
81
+ locale = _ref.locale,
82
+ maxDate = _ref.maxDate,
83
+ maxTime = _ref.maxTime,
84
+ minDate = _ref.minDate,
85
+ minTime = _ref.minTime,
86
+ onChange = _ref.onChange,
87
+ onClear = _ref.onClear,
88
+ openToDate = _ref.openToDate,
89
+ placeholder = _ref.placeholder,
90
+ popperClassName = _ref.popperClassName,
91
+ _ref$popoverPlacement = _ref.popoverPlacement,
92
+ popoverPlacement = _ref$popoverPlacement === void 0 ? 'downLeft' : _ref$popoverPlacement,
93
+ selected = _ref.selected,
94
+ _ref$shadow = _ref.shadow,
95
+ shadow = _ref$shadow === void 0 ? true : _ref$shadow,
96
+ _ref$shouldCloseOnSel = _ref.shouldCloseOnSelect,
97
+ shouldCloseOnSelect = _ref$shouldCloseOnSel === void 0 ? true : _ref$shouldCloseOnSel,
98
+ _ref$showIcon = _ref.showIcon,
99
+ showIcon = _ref$showIcon === void 0 ? true : _ref$showIcon,
100
+ _ref$showTimeSelect = _ref.showTimeSelect,
101
+ showTimeSelect = _ref$showTimeSelect === void 0 ? false : _ref$showTimeSelect,
102
+ showTimeSelectOnly = _ref.showTimeSelectOnly,
103
+ _ref$timeFormat = _ref.timeFormat,
104
+ timeFormat = _ref$timeFormat === void 0 ? euiDatePickerDefaultTimeFormat : _ref$timeFormat,
105
+ utcOffset = _ref.utcOffset,
106
+ rest = _objectWithoutProperties(_ref, _excluded);
107
+ var classes = (0, _classnames.default)('euiDatePicker', {
108
+ 'euiDatePicker--shadow': shadow,
109
+ 'euiDatePicker--inline': inline
110
+ });
111
+ var numIconsClass = (0, _num_icons.getFormControlClassNameForIconCount)({
112
+ isInvalid: isInvalid,
113
+ isLoading: isLoading
114
+ });
115
+ var datePickerClasses = (0, _classnames.default)('euiDatePicker', 'euiFieldText', numIconsClass, {
116
+ 'euiFieldText--fullWidth': fullWidth,
117
+ 'euiFieldText-isLoading': isLoading,
118
+ 'euiFieldText--withIcon': !inline && showIcon,
119
+ 'euiFieldText--isClearable': !inline && selected && onClear
120
+ }, className);
121
+ var optionalIcon;
122
+ if (inline || customInput || !showIcon) {
123
+ optionalIcon = undefined;
124
+ } else if (iconType) {
125
+ optionalIcon = iconType;
126
+ } else if (showTimeSelectOnly) {
127
+ optionalIcon = 'clock';
128
+ } else {
129
+ optionalIcon = 'calendar';
72
130
  }
73
- _createClass(EuiDatePicker, [{
74
- key: "render",
75
- value: function render() {
76
- var _this$props = this.props,
77
- adjustDateOnChange = _this$props.adjustDateOnChange,
78
- calendarClassName = _this$props.calendarClassName,
79
- className = _this$props.className,
80
- customInput = _this$props.customInput,
81
- dateFormat = _this$props.dateFormat,
82
- dayClassName = _this$props.dayClassName,
83
- disabled = _this$props.disabled,
84
- excludeDates = _this$props.excludeDates,
85
- filterDate = _this$props.filterDate,
86
- fullWidth = _this$props.fullWidth,
87
- iconType = _this$props.iconType,
88
- injectTimes = _this$props.injectTimes,
89
- inline = _this$props.inline,
90
- inputRef = _this$props.inputRef,
91
- isInvalid = _this$props.isInvalid,
92
- isLoading = _this$props.isLoading,
93
- locale = _this$props.locale,
94
- maxDate = _this$props.maxDate,
95
- maxTime = _this$props.maxTime,
96
- minDate = _this$props.minDate,
97
- minTime = _this$props.minTime,
98
- onChange = _this$props.onChange,
99
- onClear = _this$props.onClear,
100
- openToDate = _this$props.openToDate,
101
- placeholder = _this$props.placeholder,
102
- popperClassName = _this$props.popperClassName,
103
- popoverPlacement = _this$props.popoverPlacement,
104
- selected = _this$props.selected,
105
- shadow = _this$props.shadow,
106
- shouldCloseOnSelect = _this$props.shouldCloseOnSelect,
107
- showIcon = _this$props.showIcon,
108
- showTimeSelect = _this$props.showTimeSelect,
109
- showTimeSelectOnly = _this$props.showTimeSelectOnly,
110
- timeFormat = _this$props.timeFormat,
111
- utcOffset = _this$props.utcOffset,
112
- rest = _objectWithoutProperties(_this$props, _excluded);
113
- var classes = (0, _classnames.default)('euiDatePicker', {
114
- 'euiDatePicker--shadow': shadow,
115
- 'euiDatePicker--inline': inline
116
- });
117
- var datePickerClasses = (0, _classnames.default)('euiDatePicker', 'euiFieldText', {
118
- 'euiFieldText--fullWidth': fullWidth,
119
- 'euiFieldText-isLoading': isLoading,
120
- 'euiFieldText--withIcon': !inline && showIcon,
121
- 'euiFieldText--isClearable': !inline && selected && onClear,
122
- 'euiFieldText-isInvalid': isInvalid
123
- }, className);
124
- var optionalIcon;
125
- if (inline || customInput || !showIcon) {
126
- optionalIcon = undefined;
127
- } else if (iconType) {
128
- optionalIcon = iconType;
129
- } else if (showTimeSelectOnly) {
130
- optionalIcon = 'clock';
131
- } else {
132
- optionalIcon = 'calendar';
133
- }
134
131
 
135
- // In case the consumer did not alter the default date format but wants
136
- // to add the time select, we append the default time format
137
- var fullDateFormat = dateFormat;
138
- if (showTimeSelect && dateFormat === euiDatePickerDefaultDateFormat) {
139
- fullDateFormat = "".concat(dateFormat, " ").concat(timeFormat);
140
- }
141
- return (0, _react2.jsx)("span", {
142
- className: classes
143
- }, (0, _react2.jsx)(_form.EuiFormControlLayout, {
144
- icon: optionalIcon,
145
- fullWidth: fullWidth,
146
- clear: selected && onClear ? {
147
- onClick: onClear
148
- } : undefined,
149
- isLoading: isLoading
150
- }, (0, _react2.jsx)(_form.EuiValidatableControl, {
151
- isInvalid: isInvalid
152
- }, (0, _react2.jsx)(_context.EuiI18nConsumer, null, function (_ref) {
153
- var contextLocale = _ref.locale;
154
- return (0, _react2.jsx)(_reactDatepicker.ReactDatePicker, _extends({
155
- adjustDateOnChange: adjustDateOnChange,
156
- calendarClassName: calendarClassName,
157
- className: datePickerClasses,
158
- customInput: customInput,
159
- dateFormat: fullDateFormat,
160
- dayClassName: dayClassName,
161
- disabled: disabled,
162
- excludeDates: excludeDates,
163
- filterDate: filterDate,
164
- injectTimes: injectTimes,
165
- inline: inline,
166
- locale: locale || contextLocale,
167
- maxDate: maxDate,
168
- maxTime: maxTime,
169
- minDate: minDate,
170
- minTime: minTime,
171
- onChange: onChange,
172
- openToDate: openToDate,
173
- placeholderText: placeholder,
174
- popperClassName: popperClassName,
175
- ref: inputRef,
176
- selected: selected,
177
- shouldCloseOnSelect: shouldCloseOnSelect,
178
- showMonthDropdown: true,
179
- showTimeSelect: showTimeSelectOnly ? true : showTimeSelect,
180
- showTimeSelectOnly: showTimeSelectOnly,
181
- showYearDropdown: true,
182
- timeFormat: timeFormat,
183
- utcOffset: utcOffset,
184
- yearDropdownItemNumber: 7,
185
- accessibleMode: true,
186
- popperPlacement: popoverPlacement
187
- }, rest));
188
- }))));
189
- }
190
- }]);
191
- return EuiDatePicker;
192
- }(_react.Component);
132
+ // In case the consumer did not alter the default date format but wants
133
+ // to add the time select, we append the default time format
134
+ var fullDateFormat = dateFormat;
135
+ if (showTimeSelect && dateFormat === euiDatePickerDefaultDateFormat) {
136
+ fullDateFormat = "".concat(dateFormat, " ").concat(timeFormat);
137
+ }
138
+
139
+ // Set an internal ref on ReactDatePicker's `input` so we can set its :invalid state via useEuiValidatableControl
140
+ var _useState = (0, _react.useState)(null),
141
+ _useState2 = _slicedToArray(_useState, 2),
142
+ inputValidityRef = _useState2[0],
143
+ _setInputValidityRef = _useState2[1];
144
+ var setInputValidityRef = (0, _react.useCallback)(function (ref) {
145
+ _setInputValidityRef(ref === null || ref === void 0 ? void 0 : ref.input);
146
+ }, []);
147
+ (0, _form.useEuiValidatableControl)({
148
+ isInvalid: isInvalid,
149
+ controlEl: inputValidityRef
150
+ });
151
+ var inputRefs = (0, _services.useCombinedRefs)([inputRef, setInputValidityRef]);
152
+ return (0, _react2.jsx)("span", {
153
+ className: classes
154
+ }, (0, _react2.jsx)(_form.EuiFormControlLayout, {
155
+ icon: optionalIcon,
156
+ fullWidth: fullWidth,
157
+ clear: selected && onClear ? {
158
+ onClick: onClear
159
+ } : undefined,
160
+ isLoading: isLoading,
161
+ isInvalid: isInvalid
162
+ }, (0, _react2.jsx)(_context.EuiI18nConsumer, null, function (_ref2) {
163
+ var contextLocale = _ref2.locale;
164
+ return (0, _react2.jsx)(_reactDatepicker.ReactDatePicker, _extends({
165
+ adjustDateOnChange: adjustDateOnChange,
166
+ calendarClassName: calendarClassName,
167
+ className: datePickerClasses,
168
+ customInput: customInput,
169
+ dateFormat: fullDateFormat,
170
+ dayClassName: dayClassName,
171
+ disabled: disabled,
172
+ excludeDates: excludeDates,
173
+ filterDate: filterDate,
174
+ injectTimes: injectTimes,
175
+ inline: inline,
176
+ locale: locale || contextLocale,
177
+ maxDate: maxDate,
178
+ maxTime: maxTime,
179
+ minDate: minDate,
180
+ minTime: minTime,
181
+ onChange: onChange,
182
+ openToDate: openToDate,
183
+ placeholderText: placeholder,
184
+ popperClassName: popperClassName,
185
+ ref: inputRefs,
186
+ selected: selected,
187
+ shouldCloseOnSelect: shouldCloseOnSelect,
188
+ showMonthDropdown: true,
189
+ showTimeSelect: showTimeSelectOnly ? true : showTimeSelect,
190
+ showTimeSelectOnly: showTimeSelectOnly,
191
+ showYearDropdown: true,
192
+ timeFormat: timeFormat,
193
+ utcOffset: utcOffset,
194
+ yearDropdownItemNumber: 7,
195
+ accessibleMode: true,
196
+ popperPlacement: popoverPlacement
197
+ }, rest));
198
+ })));
199
+ };
193
200
  exports.EuiDatePicker = EuiDatePicker;
194
- _defineProperty(EuiDatePicker, "defaultProps", {
195
- adjustDateOnChange: true,
196
- dateFormat: euiDatePickerDefaultDateFormat,
197
- fullWidth: false,
198
- inputRef: function inputRef() {},
199
- isLoading: false,
200
- shadow: true,
201
- shouldCloseOnSelect: true,
202
- showIcon: true,
203
- showTimeSelect: false,
204
- timeFormat: euiDatePickerDefaultTimeFormat,
205
- popoverPlacement: 'downLeft'
206
- });
207
201
  EuiDatePicker.propTypes = {
208
202
  className: _propTypes.default.string,
209
203
  "aria-label": _propTypes.default.string,
@@ -220,7 +214,7 @@ EuiDatePicker.propTypes = {
220
214
  /**
221
215
  * ref for the ReactDatePicker instance
222
216
  */
223
- inputRef: _propTypes.default.any.isRequired,
217
+ inputRef: _propTypes.default.any,
224
218
  /**
225
219
  * Provides styling to the input when invalid
226
220
  */
@@ -84,7 +84,7 @@ var EuiDatePickerRange = function EuiDatePickerRange(_ref) {
84
84
  className: "euiDatePickerRange__delimeter"
85
85
  }, (0, _react2.jsx)(_icon.EuiIcon, {
86
86
  color: isInvalid ? 'danger' : 'subdued',
87
- type: isInvalid ? 'warning' : 'sortRight'
87
+ type: "sortRight"
88
88
  }));
89
89
  return (0, _react2.jsx)("div", _extends({
90
90
  className: classes
@@ -117,7 +117,7 @@ EuiDatePickerRange.propTypes = {
117
117
  */
118
118
  isCustom: _propTypes.default.bool,
119
119
  /**
120
- * Will turn the range delimeter into an alert icon and pass through to each control
120
+ * Will color the range delimiter the `danger` color and pass through to each control
121
121
  */
122
122
  isInvalid: _propTypes.default.bool,
123
123
  /**
@@ -24,22 +24,20 @@ var DelayHide = function DelayHide() {
24
24
  _useState4 = _slicedToArray(_useState3, 2),
25
25
  hide = _useState4[0],
26
26
  setHide = _useState4[1];
27
- var onChangeMinimumDuration = function onChangeMinimumDuration(event) {
28
- setDuration(parseInt(event.target.value, 10));
29
- };
30
- var onChangeHide = function onChangeHide(event) {
31
- setHide(event.target.checked);
32
- };
33
27
  return (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_flex.EuiFlexItem, null, (0, _react2.jsx)(_form.EuiFormRow, null, (0, _react2.jsx)(_form.EuiCheckbox, {
34
28
  id: "dummy-id",
35
29
  checked: hide,
36
- onChange: onChangeHide,
30
+ onChange: function onChange(event) {
31
+ return setHide(event.target.checked);
32
+ },
37
33
  label: "Hide child"
38
34
  })), (0, _react2.jsx)(_form.EuiFormRow, {
39
35
  label: "Minimum duration"
40
36
  }, (0, _react2.jsx)(_form.EuiFieldNumber, {
41
37
  value: minimumDuration,
42
- onChange: onChangeMinimumDuration
38
+ onChange: function onChange(event) {
39
+ return setDuration(parseInt(event.target.value, 10));
40
+ }
43
41
  })), (0, _react2.jsx)(_form.EuiFormRow, {
44
42
  label: "Child to render"
45
43
  }, (0, _react2.jsx)(_delay_hide.EuiDelayHide, {
@@ -24,24 +24,22 @@ var DelayRender = function DelayRender() {
24
24
  _useState4 = _slicedToArray(_useState3, 2),
25
25
  render = _useState4[0],
26
26
  setRender = _useState4[1];
27
- var onChangeMinimumDelay = function onChangeMinimumDelay(event) {
28
- setDelay(parseInt(event.target.value, 10));
29
- };
30
- var onChangeHide = function onChangeHide(event) {
31
- setRender(event.target.checked);
32
- };
33
27
  var status = render ? 'showing' : 'hidden';
34
28
  var label = "Child (".concat(status, ")");
35
29
  return (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_flex.EuiFlexItem, null, (0, _react2.jsx)(_form.EuiFormRow, null, (0, _react2.jsx)(_form.EuiCheckbox, {
36
30
  id: "dummy-id",
37
31
  checked: render,
38
- onChange: onChangeHide,
32
+ onChange: function onChange(event) {
33
+ return setRender(event.target.checked);
34
+ },
39
35
  label: "Show child"
40
36
  })), (0, _react2.jsx)(_form.EuiFormRow, {
41
37
  label: "Minimum delay"
42
38
  }, (0, _react2.jsx)(_form.EuiFieldNumber, {
43
39
  value: minimumDelay,
44
- onChange: onChangeMinimumDelay
40
+ onChange: function onChange(event) {
41
+ return setDelay(parseInt(event.target.value, 10));
42
+ }
45
43
  })), (0, _react2.jsx)(_form.EuiFormRow, {
46
44
  label: label
47
45
  }, render ? (0, _react2.jsx)(_delay_render.EuiDelayRender, {
@@ -36,7 +36,6 @@ var DragAndDrop = function DragAndDrop() {
36
36
  _useState2 = _slicedToArray(_useState, 2),
37
37
  list = _useState2[0],
38
38
  setList = _useState2[1];
39
- console.log(list);
40
39
  var onDragEnd = function onDragEnd(_ref) {
41
40
  var source = _ref.source,
42
41
  destination = _ref.destination;