@elastic/eui 89.0.0 → 89.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 (286) hide show
  1. package/dist/eui_charts_theme.js +1 -1
  2. package/dist/eui_charts_theme.js.map +1 -1
  3. package/dist/eui_theme_dark.css +29 -94
  4. package/dist/eui_theme_dark.min.css +1 -1
  5. package/dist/eui_theme_light.css +29 -94
  6. package/dist/eui_theme_light.min.css +1 -1
  7. package/es/components/avatar/avatar.js +1 -1
  8. package/es/components/badge/badge.js +1 -1
  9. package/es/components/badge/beta_badge/beta_badge.js +1 -1
  10. package/es/components/basic_table/basic_table.js +1 -1
  11. package/es/components/basic_table/collapsed_item_actions.js +1 -1
  12. package/es/components/basic_table/in_memory_table.js +1 -1
  13. package/es/components/button/button_display/_button_display.js +1 -1
  14. package/es/components/button/button_display/_button_display_content.js +1 -1
  15. package/es/components/button/button_empty/button_empty.js +1 -1
  16. package/es/components/button/button_group/button_group.js +1 -1
  17. package/es/components/button/button_group/button_group_button.js +1 -1
  18. package/es/components/button/button_icon/button_icon.js +1 -1
  19. package/es/components/call_out/call_out.js +1 -1
  20. package/es/components/card/card.js +1 -1
  21. package/es/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
  22. package/es/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +2 -2
  23. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +2 -2
  24. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +2 -2
  25. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +3 -3
  26. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +1 -1
  27. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +4 -4
  28. package/es/components/comment_list/comment.js +2 -2
  29. package/es/components/comment_list/comment_event.js +1 -1
  30. package/es/components/comment_list/comment_list.js +2 -2
  31. package/es/components/comment_list/comment_timeline.js +1 -1
  32. package/es/components/datagrid/body/data_grid_body.js +13 -13
  33. package/es/components/datagrid/body/data_grid_body_custom.js +13 -13
  34. package/es/components/datagrid/body/data_grid_body_virtualized.js +13 -13
  35. package/es/components/datagrid/body/data_grid_cell.js +100 -73
  36. package/es/components/datagrid/body/data_grid_cell_actions.js +7 -2
  37. package/es/components/datagrid/body/header/data_grid_header_cell.js +12 -12
  38. package/es/components/datagrid/body/header/data_grid_header_row.js +13 -13
  39. package/es/components/datagrid/controls/column_sorting_draggable.js +1 -1
  40. package/es/components/datagrid/data_grid.js +13 -13
  41. package/es/components/datagrid/utils/in_memory.js +12 -12
  42. package/es/components/datagrid/utils/row_heights.js +12 -17
  43. package/es/components/date_picker/date_picker.js +2 -2
  44. package/es/components/date_picker/date_picker_range.js +1 -1
  45. package/es/components/empty_prompt/empty_prompt.js +1 -1
  46. package/es/components/facet/facet_button.js +1 -1
  47. package/es/components/form/field_number/field_number.js +1 -1
  48. package/es/components/form/field_text/field_text.js +2 -2
  49. package/es/components/form/form_control_layout/form_control_layout.js +2 -2
  50. package/es/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
  51. package/es/components/form/form_control_layout/form_control_layout_icons.js +2 -2
  52. package/es/components/header/header_links/header_link.js +1 -1
  53. package/es/components/header/header_links/header_links.js +1 -1
  54. package/es/components/header/header_logo/header_logo.js +1 -1
  55. package/es/components/header/header_section/header_section_item_button.js +1 -1
  56. package/es/components/icon/assets/tokenVectorDense.js +37 -0
  57. package/es/components/icon/assets/{tokenDenseVector.js → tokenVectorSparse.js} +7 -3
  58. package/es/components/icon/icon.js +1 -1
  59. package/es/components/icon/icon_map.js +5 -2
  60. package/es/components/key_pad_menu/key_pad_menu_item.js +1 -1
  61. package/es/components/list_group/list_group.js +2 -2
  62. package/es/components/list_group/list_group_item.js +2 -2
  63. package/es/components/list_group/list_group_item_extra_action.js +1 -1
  64. package/es/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
  65. package/es/components/loading/loading_logo.js +1 -1
  66. package/es/components/markdown_editor/markdown_editor.js +1 -1
  67. package/es/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
  68. package/es/components/markdown_editor/markdown_editor_footer.js +1 -1
  69. package/es/components/markdown_editor/markdown_editor_toolbar.js +1 -1
  70. package/es/components/notification/notification_event.js +2 -2
  71. package/es/components/notification/notification_event_meta.js +1 -1
  72. package/es/components/page/page_header/page_header_content.js +1 -1
  73. package/es/components/pagination/pagination_button.js +1 -1
  74. package/es/components/provider/provider.js +3 -3
  75. package/es/components/selectable/selectable_list/selectable_list.js +1 -1
  76. package/es/components/selectable/selectable_list/selectable_list_item.js +1 -1
  77. package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
  78. package/es/components/table/table_header_button.js +1 -1
  79. package/es/components/timeline/timeline_item_icon.js +1 -1
  80. package/es/components/toast/global_toast_list.js +1 -1
  81. package/es/components/toast/toast.js +1 -1
  82. package/es/components/token/token_map.js +12 -4
  83. package/es/components/tool_tip/icon_tip.js +1 -1
  84. package/es/services/emotion/css.js +28 -0
  85. package/es/services/emotion/index.js +2 -1
  86. package/es/services/emotion/prefixer.js +93 -0
  87. package/es/services/theme/provider.js +8 -7
  88. package/es/services/theme/utils.js +1 -1
  89. package/eui.d.ts +65 -21
  90. package/i18ntokens.json +10 -10
  91. package/lib/components/avatar/avatar.js +1 -1
  92. package/lib/components/badge/badge.js +1 -1
  93. package/lib/components/badge/beta_badge/beta_badge.js +1 -1
  94. package/lib/components/basic_table/basic_table.js +1 -1
  95. package/lib/components/basic_table/collapsed_item_actions.js +1 -1
  96. package/lib/components/basic_table/in_memory_table.js +1 -1
  97. package/lib/components/button/button_display/_button_display.js +1 -1
  98. package/lib/components/button/button_display/_button_display_content.js +1 -1
  99. package/lib/components/button/button_empty/button_empty.js +1 -1
  100. package/lib/components/button/button_group/button_group.js +1 -1
  101. package/lib/components/button/button_group/button_group_button.js +1 -1
  102. package/lib/components/button/button_icon/button_icon.js +1 -1
  103. package/lib/components/call_out/call_out.js +1 -1
  104. package/lib/components/card/card.js +1 -1
  105. package/lib/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
  106. package/lib/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +2 -2
  107. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +2 -2
  108. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +2 -2
  109. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +3 -3
  110. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +1 -1
  111. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +4 -4
  112. package/lib/components/comment_list/comment.js +2 -2
  113. package/lib/components/comment_list/comment_event.js +1 -1
  114. package/lib/components/comment_list/comment_list.js +2 -2
  115. package/lib/components/comment_list/comment_timeline.js +1 -1
  116. package/lib/components/datagrid/body/data_grid_body.js +13 -13
  117. package/lib/components/datagrid/body/data_grid_body_custom.js +13 -13
  118. package/lib/components/datagrid/body/data_grid_body_virtualized.js +13 -13
  119. package/lib/components/datagrid/body/data_grid_cell.js +100 -73
  120. package/lib/components/datagrid/body/data_grid_cell_actions.js +8 -2
  121. package/lib/components/datagrid/body/header/data_grid_header_cell.js +12 -12
  122. package/lib/components/datagrid/body/header/data_grid_header_row.js +13 -13
  123. package/lib/components/datagrid/controls/column_sorting_draggable.js +1 -1
  124. package/lib/components/datagrid/data_grid.js +13 -13
  125. package/lib/components/datagrid/utils/in_memory.js +12 -12
  126. package/lib/components/datagrid/utils/row_heights.js +12 -17
  127. package/lib/components/date_picker/date_picker.js +2 -2
  128. package/lib/components/date_picker/date_picker_range.js +1 -1
  129. package/lib/components/empty_prompt/empty_prompt.js +1 -1
  130. package/lib/components/facet/facet_button.js +1 -1
  131. package/lib/components/form/field_number/field_number.js +1 -1
  132. package/lib/components/form/field_text/field_text.js +2 -2
  133. package/lib/components/form/form_control_layout/form_control_layout.js +2 -2
  134. package/lib/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
  135. package/lib/components/form/form_control_layout/form_control_layout_icons.js +2 -2
  136. package/lib/components/header/header_links/header_link.js +1 -1
  137. package/lib/components/header/header_links/header_links.js +1 -1
  138. package/lib/components/header/header_logo/header_logo.js +1 -1
  139. package/lib/components/header/header_section/header_section_item_button.js +1 -1
  140. package/lib/components/icon/assets/tokenVectorDense.js +45 -0
  141. package/lib/components/icon/assets/{tokenDenseVector.js → tokenVectorSparse.js} +7 -3
  142. package/lib/components/icon/icon.js +1 -1
  143. package/lib/components/icon/icon_map.js +5 -2
  144. package/lib/components/icon/svgs/tokens/tokenVectorDense.svg +5 -0
  145. package/lib/components/icon/svgs/tokens/tokenVectorSparse.svg +5 -0
  146. package/lib/components/key_pad_menu/key_pad_menu_item.js +1 -1
  147. package/lib/components/list_group/list_group.js +2 -2
  148. package/lib/components/list_group/list_group_item.js +2 -2
  149. package/lib/components/list_group/list_group_item_extra_action.js +1 -1
  150. package/lib/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
  151. package/lib/components/loading/loading_logo.js +1 -1
  152. package/lib/components/markdown_editor/markdown_editor.js +1 -1
  153. package/lib/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
  154. package/lib/components/markdown_editor/markdown_editor_footer.js +1 -1
  155. package/lib/components/markdown_editor/markdown_editor_toolbar.js +1 -1
  156. package/lib/components/notification/notification_event.js +2 -2
  157. package/lib/components/notification/notification_event_meta.js +1 -1
  158. package/lib/components/page/page_header/page_header_content.js +1 -1
  159. package/lib/components/provider/provider.js +3 -3
  160. package/lib/components/selectable/selectable_list/selectable_list.js +1 -1
  161. package/lib/components/selectable/selectable_list/selectable_list_item.js +1 -1
  162. package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
  163. package/lib/components/table/table_header_button.js +1 -1
  164. package/lib/components/timeline/timeline_item_icon.js +1 -1
  165. package/lib/components/toast/global_toast_list.js +1 -1
  166. package/lib/components/toast/toast.js +1 -1
  167. package/lib/components/token/token_map.js +12 -4
  168. package/lib/components/tool_tip/icon_tip.js +1 -1
  169. package/lib/services/emotion/css.js +36 -0
  170. package/lib/services/emotion/index.js +11 -0
  171. package/lib/services/emotion/prefixer.js +99 -0
  172. package/lib/services/theme/provider.js +8 -7
  173. package/lib/services/theme/utils.js +1 -1
  174. package/optimize/es/components/datagrid/body/data_grid_cell.js +67 -47
  175. package/optimize/es/components/datagrid/body/data_grid_cell_actions.js +7 -2
  176. package/optimize/es/components/datagrid/utils/row_heights.js +12 -17
  177. package/optimize/es/components/icon/assets/tokenVectorDense.js +36 -0
  178. package/optimize/es/components/icon/assets/{tokenDenseVector.js → tokenVectorSparse.js} +7 -3
  179. package/optimize/es/components/icon/icon_map.js +5 -2
  180. package/optimize/es/components/provider/provider.js +3 -3
  181. package/optimize/es/components/token/token_map.js +12 -4
  182. package/optimize/es/services/emotion/css.js +28 -0
  183. package/optimize/es/services/emotion/index.js +2 -1
  184. package/optimize/es/services/emotion/prefixer.js +93 -0
  185. package/optimize/es/services/theme/provider.js +8 -7
  186. package/optimize/es/services/theme/utils.js +1 -1
  187. package/optimize/lib/components/datagrid/body/data_grid_cell.js +67 -47
  188. package/optimize/lib/components/datagrid/body/data_grid_cell_actions.js +7 -2
  189. package/optimize/lib/components/datagrid/utils/row_heights.js +12 -17
  190. package/optimize/lib/components/icon/assets/tokenVectorDense.js +45 -0
  191. package/optimize/lib/components/icon/assets/{tokenDenseVector.js → tokenVectorSparse.js} +7 -3
  192. package/optimize/lib/components/icon/icon_map.js +5 -2
  193. package/optimize/lib/components/icon/svgs/tokens/tokenVectorDense.svg +5 -0
  194. package/optimize/lib/components/icon/svgs/tokens/tokenVectorSparse.svg +5 -0
  195. package/optimize/lib/components/provider/provider.js +3 -3
  196. package/optimize/lib/components/token/token_map.js +12 -4
  197. package/optimize/lib/services/emotion/css.js +36 -0
  198. package/optimize/lib/services/emotion/index.js +11 -0
  199. package/optimize/lib/services/emotion/prefixer.js +99 -0
  200. package/optimize/lib/services/theme/provider.js +8 -7
  201. package/optimize/lib/services/theme/utils.js +1 -1
  202. package/package.json +4 -9
  203. package/src/components/datagrid/_data_grid_data_row.scss +40 -71
  204. package/src/components/datagrid/_mixins.scss +0 -15
  205. package/test-env/components/avatar/avatar.js +1 -1
  206. package/test-env/components/badge/badge.js +1 -1
  207. package/test-env/components/badge/beta_badge/beta_badge.js +1 -1
  208. package/test-env/components/basic_table/basic_table.js +1 -1
  209. package/test-env/components/basic_table/collapsed_item_actions.js +1 -1
  210. package/test-env/components/basic_table/in_memory_table.js +1 -1
  211. package/test-env/components/button/button_display/_button_display.js +1 -1
  212. package/test-env/components/button/button_display/_button_display_content.js +1 -1
  213. package/test-env/components/button/button_empty/button_empty.js +1 -1
  214. package/test-env/components/button/button_group/button_group.js +1 -1
  215. package/test-env/components/button/button_group/button_group_button.js +1 -1
  216. package/test-env/components/button/button_icon/button_icon.js +1 -1
  217. package/test-env/components/call_out/call_out.js +1 -1
  218. package/test-env/components/card/card.js +1 -1
  219. package/test-env/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
  220. package/test-env/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +2 -2
  221. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +2 -2
  222. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +2 -2
  223. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +3 -3
  224. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +1 -1
  225. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +4 -4
  226. package/test-env/components/comment_list/comment.js +2 -2
  227. package/test-env/components/comment_list/comment_event.js +1 -1
  228. package/test-env/components/comment_list/comment_list.js +2 -2
  229. package/test-env/components/comment_list/comment_timeline.js +1 -1
  230. package/test-env/components/datagrid/body/data_grid_body.js +13 -13
  231. package/test-env/components/datagrid/body/data_grid_body_custom.js +13 -13
  232. package/test-env/components/datagrid/body/data_grid_body_virtualized.js +13 -13
  233. package/test-env/components/datagrid/body/data_grid_cell.js +100 -73
  234. package/test-env/components/datagrid/body/data_grid_cell_actions.js +7 -2
  235. package/test-env/components/datagrid/body/header/data_grid_header_cell.js +12 -12
  236. package/test-env/components/datagrid/body/header/data_grid_header_row.js +13 -13
  237. package/test-env/components/datagrid/controls/column_sorting_draggable.js +1 -1
  238. package/test-env/components/datagrid/data_grid.js +13 -13
  239. package/test-env/components/datagrid/utils/in_memory.js +12 -12
  240. package/test-env/components/datagrid/utils/row_heights.js +12 -17
  241. package/test-env/components/date_picker/date_picker.js +2 -2
  242. package/test-env/components/date_picker/date_picker_range.js +1 -1
  243. package/test-env/components/empty_prompt/empty_prompt.js +1 -1
  244. package/test-env/components/facet/facet_button.js +1 -1
  245. package/test-env/components/form/field_number/field_number.js +1 -1
  246. package/test-env/components/form/field_text/field_text.js +2 -2
  247. package/test-env/components/form/form_control_layout/form_control_layout.js +2 -2
  248. package/test-env/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
  249. package/test-env/components/form/form_control_layout/form_control_layout_icons.js +2 -2
  250. package/test-env/components/header/header_links/header_link.js +1 -1
  251. package/test-env/components/header/header_links/header_links.js +1 -1
  252. package/test-env/components/header/header_logo/header_logo.js +1 -1
  253. package/test-env/components/header/header_section/header_section_item_button.js +1 -1
  254. package/test-env/components/icon/assets/tokenVectorDense.js +45 -0
  255. package/test-env/components/icon/assets/{tokenDenseVector.js → tokenVectorSparse.js} +7 -3
  256. package/test-env/components/icon/icon_map.js +5 -2
  257. package/test-env/components/key_pad_menu/key_pad_menu_item.js +1 -1
  258. package/test-env/components/list_group/list_group.js +2 -2
  259. package/test-env/components/list_group/list_group_item.js +2 -2
  260. package/test-env/components/list_group/list_group_item_extra_action.js +1 -1
  261. package/test-env/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
  262. package/test-env/components/loading/loading_logo.js +1 -1
  263. package/test-env/components/markdown_editor/markdown_editor.js +1 -1
  264. package/test-env/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
  265. package/test-env/components/markdown_editor/markdown_editor_footer.js +1 -1
  266. package/test-env/components/markdown_editor/markdown_editor_toolbar.js +1 -1
  267. package/test-env/components/notification/notification_event.js +2 -2
  268. package/test-env/components/notification/notification_event_meta.js +1 -1
  269. package/test-env/components/page/page_header/page_header_content.js +1 -1
  270. package/test-env/components/provider/provider.js +3 -3
  271. package/test-env/components/selectable/selectable_list/selectable_list.js +1 -1
  272. package/test-env/components/selectable/selectable_list/selectable_list_item.js +1 -1
  273. package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
  274. package/test-env/components/table/table_header_button.js +1 -1
  275. package/test-env/components/timeline/timeline_item_icon.js +1 -1
  276. package/test-env/components/toast/global_toast_list.js +1 -1
  277. package/test-env/components/toast/toast.js +1 -1
  278. package/test-env/components/token/token_map.js +12 -4
  279. package/test-env/components/tool_tip/icon_tip.js +1 -1
  280. package/test-env/services/emotion/css.js +36 -0
  281. package/test-env/services/emotion/index.js +11 -0
  282. package/test-env/services/emotion/prefixer.js +99 -0
  283. package/test-env/services/theme/provider.js +8 -7
  284. package/test-env/services/theme/utils.js +1 -1
  285. package/lib/components/icon/svgs/tokens/tokenDenseVector.svg +0 -3
  286. package/optimize/lib/components/icon/svgs/tokens/tokenDenseVector.svg +0 -3
@@ -23,13 +23,14 @@ var _services = require("../../../services");
23
23
  var _accessibility = require("../../accessibility");
24
24
  var _focus_trap = require("../../focus_trap");
25
25
  var _i18n = require("../../i18n");
26
+ var _text_truncate = require("../../text_truncate");
26
27
  var _resize_observer = require("../../observer/resize_observer/resize_observer");
27
28
  var _focus = require("../utils/focus");
28
29
  var _data_grid_cell_actions = require("./data_grid_cell_actions");
29
30
  var _data_grid_cell_popover = require("./data_grid_cell_popover");
30
31
  var _utils = require("../../../utils");
31
32
  var _react2 = require("@emotion/react");
32
- var _excluded = ["renderCellValue", "column", "setCellContentsRef", "rowHeightsOptions", "rowIndex", "colIndex", "ariaRowIndex", "rowHeightUtils", "isDefinedHeight", "isFocused"],
33
+ var _excluded = ["renderCellValue", "column", "setCellContentsRef", "setPopoverAnchorRef", "rowIndex", "colIndex", "ariaRowIndex", "rowHeight", "rowHeightUtils", "isControlColumn", "isFocused", "cellHeightType", "cellActions"],
33
34
  _excluded2 = ["width", "popoverContext", "interactiveCellId", "columnType", "className", "column", "style", "rowHeightUtils", "rowHeightsOptions", "rowManager", "pagination"],
34
35
  _excluded3 = ["isExpandable", "style", "className", "data-test-subj"];
35
36
  /*
@@ -49,28 +50,52 @@ var EuiDataGridCellContent = /*#__PURE__*/(0, _react.memo)(function (_ref) {
49
50
  var renderCellValue = _ref.renderCellValue,
50
51
  column = _ref.column,
51
52
  setCellContentsRef = _ref.setCellContentsRef,
52
- rowHeightsOptions = _ref.rowHeightsOptions,
53
+ setPopoverAnchorRef = _ref.setPopoverAnchorRef,
53
54
  rowIndex = _ref.rowIndex,
54
55
  colIndex = _ref.colIndex,
55
56
  ariaRowIndex = _ref.ariaRowIndex,
57
+ rowHeight = _ref.rowHeight,
56
58
  rowHeightUtils = _ref.rowHeightUtils,
57
- isDefinedHeight = _ref.isDefinedHeight,
59
+ isControlColumn = _ref.isControlColumn,
58
60
  isFocused = _ref.isFocused,
61
+ cellHeightType = _ref.cellHeightType,
62
+ cellActions = _ref.cellActions,
59
63
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
60
64
  // React is more permissible than the TS types indicate
61
65
  var CellElement = renderCellValue;
62
- return (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)("div", {
63
- ref: setCellContentsRef,
66
+ var wrapperClasses = (0, _classnames.default)('euiDataGridRowCell__contentWrapper', "euiDataGridRowCell__".concat(cellHeightType, "Height"));
67
+ var classes = (0, _classnames.default)('euiDataGridRowCell__content', !isControlColumn && {
68
+ 'eui-textBreakWord': cellHeightType !== 'default',
69
+ 'eui-textTruncate': cellHeightType === 'default'
70
+ });
71
+ var cellContent = (0, _react2.jsx)("div", {
72
+ ref: function ref(el) {
73
+ setCellContentsRef(el);
74
+ setPopoverAnchorRef.current = cellHeightType === 'default' ? // Default height cells need the popover to be anchored on the wrapper,
75
+ // in order for the popover to centered on the full cell width (as content
76
+ // width is affected by the width of cell actions)
77
+ el === null || el === void 0 ? void 0 : el.parentElement :
78
+ // Numerical height cells need the popover anchor to be below the wrapper
79
+ // class, in order to set height: 100% on the portalled popover div wrappers
80
+ el;
81
+ },
64
82
  "data-datagrid-cellcontent": true,
65
- className: isDefinedHeight ? 'euiDataGridRowCell__definedHeight' : 'euiDataGridRowCell__truncate',
66
- style: isDefinedHeight ? rowHeightUtils === null || rowHeightUtils === void 0 ? void 0 : rowHeightUtils.getStylesForCell(rowHeightsOptions, rowIndex) : {}
83
+ className: classes
67
84
  }, (0, _react2.jsx)(CellElement, (0, _extends2.default)({
68
85
  isDetails: false,
69
86
  "data-test-subj": "cell-content",
70
87
  rowIndex: rowIndex,
71
88
  colIndex: colIndex,
72
89
  schema: (column === null || column === void 0 ? void 0 : column.schema) || rest.columnType
73
- }, rest))), (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("p", {
90
+ }, rest)));
91
+ if (cellHeightType === 'lineCount' && !isControlColumn) {
92
+ var lines = rowHeightUtils.getLineCount(rowHeight);
93
+ cellContent = (0, _react2.jsx)(_text_truncate.EuiTextBlockTruncate, {
94
+ lines: lines,
95
+ cloneElement: true
96
+ }, cellContent);
97
+ }
98
+ var screenReaderText = (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("p", {
74
99
  hidden: !isFocused
75
100
  }, '- ', (0, _react2.jsx)(_i18n.EuiI18n, {
76
101
  token: "euiDataGridCell.position",
@@ -80,7 +105,10 @@ var EuiDataGridCellContent = /*#__PURE__*/(0, _react.memo)(function (_ref) {
80
105
  col: colIndex + 1,
81
106
  row: ariaRowIndex
82
107
  }
83
- }))));
108
+ })));
109
+ return (0, _react2.jsx)("div", {
110
+ className: wrapperClasses
111
+ }, cellContent, screenReaderText, cellActions);
84
112
  });
85
113
  var EuiDataGridCell = /*#__PURE__*/function (_Component) {
86
114
  (0, _inherits2.default)(EuiDataGridCell, _Component);
@@ -530,24 +558,43 @@ var EuiDataGridCell = /*#__PURE__*/function (_Component) {
530
558
  }
531
559
  }
532
560
  };
533
- var isDefinedHeight = !!(rowHeightUtils !== null && rowHeightUtils !== void 0 && rowHeightUtils.getRowHeightOption(rowIndex, rowHeightsOptions));
561
+ var rowHeight = rowHeightUtils === null || rowHeightUtils === void 0 ? void 0 : rowHeightUtils.getRowHeightOption(rowIndex, rowHeightsOptions);
562
+ var cellHeightType = (rowHeightUtils === null || rowHeightUtils === void 0 ? void 0 : rowHeightUtils.getHeightType(rowHeight)) || 'default';
534
563
  var cellContentProps = _objectSpread(_objectSpread({}, rest), {}, {
535
564
  setCellProps: this.setCellProps,
536
565
  column: column,
537
566
  columnType: columnType,
567
+ cellHeightType: cellHeightType,
538
568
  isExpandable: isExpandable,
539
569
  isExpanded: popoverIsOpen,
540
570
  isDetails: false,
541
571
  isFocused: this.state.isFocused,
542
572
  setCellContentsRef: this.setCellContentsRef,
543
- rowHeightsOptions: rowHeightsOptions,
573
+ setPopoverAnchorRef: this.popoverAnchorRef,
574
+ rowHeight: rowHeight,
544
575
  rowHeightUtils: rowHeightUtils,
545
- isDefinedHeight: isDefinedHeight,
576
+ isControlColumn: cellClasses.includes('euiDataGridRowCell--controlColumn'),
546
577
  ariaRowIndex: ariaRowIndex
547
578
  });
548
- var anchorClass = 'euiDataGridRowCell__expandFlex';
549
- var expandClass = isDefinedHeight ? 'euiDataGridRowCell__contentByHeight' : 'euiDataGridRowCell__expandContent';
550
- var innerContent = (0, _react2.jsx)(_focus_trap.EuiFocusTrap, {
579
+ var cellActions = showCellActions && (0, _react2.jsx)(_data_grid_cell_actions.EuiDataGridCellActions, {
580
+ rowIndex: rowIndex,
581
+ colIndex: colIndex,
582
+ column: column,
583
+ cellHeightType: cellHeightType,
584
+ onExpandClick: function onExpandClick() {
585
+ if (popoverIsOpen) {
586
+ closeCellPopover();
587
+ } else {
588
+ openCellPopover({
589
+ rowIndex: visibleRowIndex,
590
+ colIndex: colIndex
591
+ });
592
+ }
593
+ }
594
+ });
595
+ var cellContent = isExpandable ? (0, _react2.jsx)(EuiDataGridCellContent, (0, _extends2.default)({}, cellContentProps, {
596
+ cellActions: cellActions
597
+ })) : (0, _react2.jsx)(_focus_trap.EuiFocusTrap, {
551
598
  disabled: !this.state.isEntered,
552
599
  autoFocus: true,
553
600
  onDeactivation: function onDeactivation() {
@@ -556,35 +603,8 @@ var EuiDataGridCell = /*#__PURE__*/function (_Component) {
556
603
  }, _this2.preventTabbing);
557
604
  },
558
605
  clickOutsideDisables: true
559
- }, (0, _react2.jsx)("div", {
560
- className: anchorClass,
561
- ref: this.popoverAnchorRef
562
- }, (0, _react2.jsx)("div", {
563
- className: expandClass
564
- }, (0, _react2.jsx)(EuiDataGridCellContent, cellContentProps))));
565
- if (isExpandable) {
566
- innerContent = (0, _react2.jsx)("div", {
567
- className: anchorClass,
568
- ref: this.popoverAnchorRef
569
- }, (0, _react2.jsx)("div", {
570
- className: expandClass
571
- }, (0, _react2.jsx)(EuiDataGridCellContent, cellContentProps)), showCellActions && (0, _react2.jsx)(_data_grid_cell_actions.EuiDataGridCellActions, {
572
- rowIndex: rowIndex,
573
- colIndex: colIndex,
574
- column: column,
575
- onExpandClick: function onExpandClick() {
576
- if (popoverIsOpen) {
577
- closeCellPopover();
578
- } else {
579
- openCellPopover({
580
- rowIndex: visibleRowIndex,
581
- colIndex: colIndex
582
- });
583
- }
584
- }
585
- }));
586
- }
587
- var content = (0, _react2.jsx)("div", (0, _extends2.default)({
606
+ }, (0, _react2.jsx)(EuiDataGridCellContent, cellContentProps));
607
+ var cell = (0, _react2.jsx)("div", (0, _extends2.default)({
588
608
  role: "gridcell",
589
609
  "aria-rowindex": ariaRowIndex,
590
610
  tabIndex: this.state.isFocused && !this.state.disableCellTabIndex ? 0 : -1,
@@ -614,14 +634,14 @@ var EuiDataGridCell = /*#__PURE__*/function (_Component) {
614
634
  });
615
635
  },
616
636
  onBlur: this.onBlur
617
- }), innerContent);
618
- return rowManager && !_utils.IS_JEST_ENVIRONMENT ? /*#__PURE__*/(0, _reactDom.createPortal)(content, rowManager.getRow({
637
+ }), cellContent);
638
+ return rowManager && !_utils.IS_JEST_ENVIRONMENT ? /*#__PURE__*/(0, _reactDom.createPortal)(cell, rowManager.getRow({
619
639
  rowIndex: rowIndex,
620
640
  visibleRowIndex: visibleRowIndex,
621
641
  top: style.top,
622
642
  // comes in as a `{float}px` string from react-window
623
643
  height: style.height // comes in as an integer from react-window
624
- })) : content;
644
+ })) : cell;
625
645
  }
626
646
  }]);
627
647
  return EuiDataGridCell;
@@ -15,6 +15,7 @@ var _button_icon = require("../../button/button_icon");
15
15
  var _button_empty = require("../../button/button_empty");
16
16
  var _flex = require("../../flex");
17
17
  var _popover = require("../../popover");
18
+ var _classnames = _interopRequireDefault(require("classnames"));
18
19
  var _react2 = require("@emotion/react");
19
20
  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); }
20
21
  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; }
@@ -30,7 +31,8 @@ var EuiDataGridCellActions = function EuiDataGridCellActions(_ref) {
30
31
  var onExpandClick = _ref.onExpandClick,
31
32
  column = _ref.column,
32
33
  rowIndex = _ref.rowIndex,
33
- colIndex = _ref.colIndex;
34
+ colIndex = _ref.colIndex,
35
+ cellHeightType = _ref.cellHeightType;
34
36
  // Note: The cell expand button/expansion popover is *always* rendered if
35
37
  // column.cellActions is present (regardless of column.isExpandable).
36
38
  // This is because cell actions are not otherwise accessible to keyboard
@@ -77,8 +79,11 @@ var EuiDataGridCellActions = function EuiDataGridCellActions(_ref) {
77
79
  });
78
80
  });
79
81
  }, [column, colIndex, rowIndex]);
82
+ var classes = (0, _classnames.default)('euiDataGridRowCell__actions', {
83
+ 'euiDataGridRowCell__actions--overlay': cellHeightType !== 'default'
84
+ });
80
85
  return (0, _react2.jsx)("div", {
81
- className: "euiDataGridRowCell__expandActions"
86
+ className: classes
82
87
  }, [].concat((0, _toConsumableArray2.default)(additionalButtons), [expandButton]));
83
88
  };
84
89
  exports.EuiDataGridCellActions = EuiDataGridCellActions;
@@ -48,25 +48,20 @@ var RowHeightUtils = /*#__PURE__*/function () {
48
48
  paddingTop: 0,
49
49
  paddingBottom: 0
50
50
  });
51
- (0, _defineProperty2.default)(this, "getStylesForCell", function (rowHeightsOptions, rowIndex) {
52
- var height = _this.getRowHeightOption(rowIndex, rowHeightsOptions);
53
- if (height === AUTO_HEIGHT) {
54
- return {};
51
+ /**
52
+ * Height types
53
+ */
54
+ (0, _defineProperty2.default)(this, "getHeightType", function (option) {
55
+ if (option == null) {
56
+ return 'default';
55
57
  }
56
- var lineCount = _this.getLineCount(height);
57
- if (lineCount) {
58
- return {
59
- WebkitLineClamp: lineCount,
60
- display: '-webkit-box',
61
- WebkitBoxOrient: 'vertical',
62
- height: '100%',
63
- overflow: 'hidden'
64
- };
58
+ if (option === AUTO_HEIGHT) {
59
+ return 'auto';
65
60
  }
66
- return {
67
- height: '100%',
68
- overflow: 'hidden'
69
- };
61
+ if (_this.getLineCount(option) != null) {
62
+ return 'lineCount';
63
+ }
64
+ return 'numerical';
70
65
  });
71
66
  /**
72
67
  * Heights cache utils
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.icon = void 0;
9
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
+ var React = _interopRequireWildcard(require("react"));
12
+ var _react2 = require("@emotion/react");
13
+ var _excluded = ["title", "titleId"];
14
+ /*
15
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
16
+ * or more contributor license agreements. Licensed under the Elastic License
17
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
18
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
19
+ * Side Public License, v 1.
20
+ */
21
+ // THIS IS A GENERATED FILE. DO NOT MODIFY MANUALLY. @see scripts/compile-icons.js
22
+ 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); }
23
+ 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; }
24
+ var EuiIconTokenVectorDense = function EuiIconTokenVectorDense(_ref) {
25
+ var title = _ref.title,
26
+ titleId = _ref.titleId,
27
+ props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
28
+ return (0, _react2.jsx)("svg", (0, _extends2.default)({
29
+ xmlns: "http://www.w3.org/2000/svg",
30
+ width: 16,
31
+ height: 16,
32
+ viewBox: "0 0 16 16",
33
+ "aria-labelledby": titleId
34
+ }, props), title ? (0, _react2.jsx)("title", {
35
+ id: titleId
36
+ }, title) : null, (0, _react2.jsx)("path", {
37
+ d: "M2 2.5a.5.5 0 0 1 .5-.5h2a.5.5 0 0 1 0 1H3v10h1.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1-.5-.5v-11Z"
38
+ }), (0, _react2.jsx)("path", {
39
+ d: "M6 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm0 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm-1 4a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm4-7a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM8 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm1 2a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm2-5a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm1 2a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm-1 4a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"
40
+ }), (0, _react2.jsx)("path", {
41
+ d: "M13.5 2a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1H13V3h-1.5a.5.5 0 0 1 0-1h2Z"
42
+ }));
43
+ };
44
+ var icon = EuiIconTokenVectorDense;
45
+ exports.icon = icon;
@@ -21,7 +21,7 @@ var _excluded = ["title", "titleId"];
21
21
  // THIS IS A GENERATED FILE. DO NOT MODIFY MANUALLY. @see scripts/compile-icons.js
22
22
  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); }
23
23
  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; }
24
- var EuiIconTokenDenseVector = function EuiIconTokenDenseVector(_ref) {
24
+ var EuiIconTokenVectorSparse = function EuiIconTokenVectorSparse(_ref) {
25
25
  var title = _ref.title,
26
26
  titleId = _ref.titleId,
27
27
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
@@ -34,8 +34,12 @@ var EuiIconTokenDenseVector = function EuiIconTokenDenseVector(_ref) {
34
34
  }, props), title ? (0, _react2.jsx)("title", {
35
35
  id: titleId
36
36
  }, title) : null, (0, _react2.jsx)("path", {
37
- d: "M4.154 12V4h2.713v1.14H5.658v5.72h1.21V12H4.153Zm7.692-8v8H9.133v-1.14h1.209V5.14h-1.21V4h2.714Z"
37
+ d: "M2 2.5a.5.5 0 0 1 .5-.5h2a.5.5 0 0 1 0 1H3v10h1.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1-.5-.5v-11ZM8 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"
38
+ }), (0, _react2.jsx)("path", {
39
+ d: "M6 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm5 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"
40
+ }), (0, _react2.jsx)("path", {
41
+ d: "M13.5 2a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1H13V3h-1.5a.5.5 0 0 1 0-1h2Z"
38
42
  }));
39
43
  };
40
- var icon = EuiIconTokenDenseVector;
44
+ var icon = EuiIconTokenVectorSparse;
41
45
  exports.icon = icon;
@@ -452,7 +452,6 @@ var typeToPathMap = {
452
452
  tokenCompletionSuggester: 'tokenCompletionSuggester',
453
453
  tokenConstant: 'tokenConstant',
454
454
  tokenDate: 'tokenDate',
455
- tokenDenseVector: 'tokenDenseVector',
456
455
  tokenElement: 'tokenElement',
457
456
  tokenEnum: 'tokenEnum',
458
457
  tokenEnumMember: 'tokenEnumMember',
@@ -495,6 +494,10 @@ var typeToPathMap = {
495
494
  tokenTag: 'tokenTag',
496
495
  tokenText: 'tokenText',
497
496
  tokenTokenCount: 'tokenTokenCount',
498
- tokenVariable: 'tokenVariable'
497
+ tokenVariable: 'tokenVariable',
498
+ tokenVectorDense: 'tokenVectorDense',
499
+ tokenDenseVector: 'tokenVectorDense',
500
+ // NOTE: This is an undocumented alias for `tokenVectorDense`, added for legacy compatability
501
+ tokenVectorSparse: 'tokenVectorSparse'
499
502
  };
500
503
  exports.typeToPathMap = typeToPathMap;
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
2
+ <path d="M2 2.5a.5.5 0 0 1 .5-.5h2a.5.5 0 0 1 0 1H3v10h1.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1-.5-.5v-11Z"/>
3
+ <path d="M6 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm0 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm-1 4a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm4-7a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM8 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm1 2a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm2-5a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm1 2a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm-1 4a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"/>
4
+ <path d="M13.5 2a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1H13V3h-1.5a.5.5 0 0 1 0-1h2Z"/>
5
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
2
+ <path d="M2 2.5a.5.5 0 0 1 .5-.5h2a.5.5 0 0 1 0 1H3v10h1.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1-.5-.5v-11ZM8 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"/>
3
+ <path d="M6 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm5 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"/>
4
+ <path d="M13.5 2a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1H13V3h-1.5a.5.5 0 0 1 0-1h2Z"/>
5
+ </svg>
@@ -6,11 +6,11 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.EuiProvider = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
- var _css = require("@emotion/css");
10
- var _global_styles = require("../../global_styling/reset/global_styles");
11
- var _utility = require("../../global_styling/utility/utility");
12
9
  var _services = require("../../services");
13
10
  var _warning = require("../../services/theme/warning");
11
+ var _css = require("../../services/emotion/css");
12
+ var _global_styles = require("../../global_styling/reset/global_styles");
13
+ var _utility = require("../../global_styling/utility/utility");
14
14
  var _themes = require("../../themes");
15
15
  var _cache = require("./cache");
16
16
  var _nested = require("./nested");
@@ -55,10 +55,6 @@ var TOKEN_MAP = {
55
55
  shape: 'square',
56
56
  color: 'euiColorVis6'
57
57
  },
58
- tokenDenseVector: {
59
- shape: 'square',
60
- color: 'euiColorVis2'
61
- },
62
58
  tokenElement: {
63
59
  shape: 'square',
64
60
  color: 'euiColorVis3'
@@ -230,6 +226,18 @@ var TOKEN_MAP = {
230
226
  tokenVariable: {
231
227
  shape: 'circle',
232
228
  color: 'euiColorVis7'
229
+ },
230
+ tokenVectorDense: {
231
+ shape: 'square',
232
+ color: 'euiColorVis5'
233
+ },
234
+ tokenDenseVector: {
235
+ shape: 'square',
236
+ color: 'euiColorVis5'
237
+ },
238
+ tokenVectorSparse: {
239
+ shape: 'square',
240
+ color: 'euiColorVis1'
233
241
  }
234
242
  };
235
243
  exports.TOKEN_MAP = TOKEN_MAP;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.cx = exports.css = exports.cache = void 0;
8
+ var _createInstance = _interopRequireDefault(require("@emotion/css/create-instance"));
9
+ var _prefixer = require("./prefixer");
10
+ /*
11
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
12
+ * or more contributor license agreements. Licensed under the Elastic License
13
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
14
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
15
+ * Side Public License, v 1.
16
+ */
17
+
18
+ /**
19
+ * This custom instance is needed for internal EUI components to call
20
+ * `@emotion/css` with EUI's custom prefixer plugin
21
+ * @see https://emotion.sh/docs/@emotion/css#custom-instances
22
+ *
23
+ * NOTE: Usage is currently being beta tested internally,
24
+ * and is not yet intended to be a public export
25
+ */
26
+ var _createEmotion = (0, _createInstance.default)({
27
+ key: 'css',
28
+ stylisPlugins: [_prefixer.euiStylisPrefixer],
29
+ speedy: false
30
+ }),
31
+ css = _createEmotion.css,
32
+ cx = _createEmotion.cx,
33
+ cache = _createEmotion.cache;
34
+ exports.cache = cache;
35
+ exports.cx = cx;
36
+ exports.css = css;
@@ -13,4 +13,15 @@ Object.keys(_clone_element).forEach(function (key) {
13
13
  return _clone_element[key];
14
14
  }
15
15
  });
16
+ });
17
+ var _prefixer = require("./prefixer");
18
+ Object.keys(_prefixer).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _prefixer[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function get() {
24
+ return _prefixer[key];
25
+ }
26
+ });
16
27
  });
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.euiStylisPrefixer = void 0;
7
+ var _stylis = require("stylis");
8
+ /*
9
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
10
+ * or more contributor license agreements. Licensed under the Elastic License
11
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
12
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
13
+ * Side Public License, v 1.
14
+ */
15
+
16
+ // This is a heavily modified version of Emotion's default `prefixer` plugin
17
+ // (mostly removing unnecessary prefixes), which is in turn a modified version
18
+ // of stylis's default prefixer.
19
+ // @see https://github.com/emotion-js/emotion/blob/main/packages/cache/src/prefixer.js
20
+ /* eslint-disable prefer-template */
21
+
22
+ /**
23
+ * This is a stylis plugin which handles auto-prefixing CSS output by Emotion.
24
+ *
25
+ * *Please note*: EUI/Elastic targets latest evergreen browsers for support only.
26
+ * @see https://www.elastic.co/support/matrix#matrix_browsers
27
+ */
28
+ var euiStylisPrefixer = function euiStylisPrefixer(element) {
29
+ if (element.length > -1) if (!element.return) switch (element.type) {
30
+ case _stylis.DECLARATION:
31
+ element.return = prefix(element.value, element.length);
32
+ break;
33
+ }
34
+ };
35
+ exports.euiStylisPrefixer = euiStylisPrefixer;
36
+ var prefix = function prefix(value, length) {
37
+ switch ((0, _stylis.hash)(value, length)) {
38
+ /**
39
+ * `-webkit` prefixes
40
+ */
41
+ // user-select - https://caniuse.com/mdn-css_properties_user-select - needed by Safari
42
+ case 4246:
43
+ // text-decoration - https://caniuse.com/text-decoration - iOS Safari is the main one that needs this
44
+ case 5572:
45
+ // text-size-adjust - https://caniuse.com/text-size-adjust - iOS Safari
46
+ case 2756:
47
+ // box-decoration-break - https://caniuse.com/css-boxdecorationbreak - Chrome & Safari
48
+ case 3005:
49
+ // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite - Chrome
50
+ case 6391:
51
+ case 5879:
52
+ case 5623:
53
+ case 6135:
54
+ case 4599:
55
+ case 4855:
56
+ // print-color-adjust - https://caniuse.com/css-color-adjust - Chrome
57
+ case 2282:
58
+ return _stylis.WEBKIT + value + value;
59
+
60
+ // background-clip - https://caniuse.com/background-clip-text - Chrome, only for `text` value
61
+ case 4215:
62
+ if (~(0, _stylis.indexof)(value, 'text')) {
63
+ return _stylis.WEBKIT + value + value;
64
+ }
65
+
66
+ /**
67
+ * Intrinsic/extrinsic sizing value prefixes
68
+ * `stretch` alternatives needed by Chrome & Firefox - https://caniuse.com/intrinsic-width
69
+ */
70
+ // (min|max)?(width|height|inline-size|block-size)
71
+ case 8116:
72
+ case 7059:
73
+ case 5753:
74
+ case 5535:
75
+ case 5445:
76
+ case 5701:
77
+ case 4933:
78
+ case 4677:
79
+ case 5533:
80
+ case 5789:
81
+ case 5021:
82
+ case 4765:
83
+ // stretch, max-content, min-content, fill-available
84
+ if ((0, _stylis.strlen)(value) - 1 - length > 6) switch ((0, _stylis.charat)(value, length + 1)) {
85
+ // (f)ill-available
86
+ case 102:
87
+ if (~(0, _stylis.indexof)(value, 'fill-available')) {
88
+ return (0, _stylis.replace)(value, /(.+:)(.+)-([^]+)/, '$1' + _stylis.WEBKIT + '$2-$3' + '$1' + _stylis.MOZ + ((0, _stylis.charat)(value, length + 3) === 108 ? '$3' : '$2-$3'));
89
+ }
90
+ // (s)tretch
91
+ case 115:
92
+ if (~(0, _stylis.indexof)(value, 'stretch')) {
93
+ return prefix((0, _stylis.replace)(value, 'stretch', 'fill-available'), length) + value;
94
+ }
95
+ }
96
+ break;
97
+ }
98
+ return value;
99
+ };
@@ -8,18 +8,19 @@ Object.defineProperty(exports, "__esModule", {
8
8
  exports.EuiThemeProvider = void 0;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
10
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
11
12
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
12
13
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
14
  var _react = require("@emotion/react");
14
15
  var _react2 = _interopRequireWildcard(require("react"));
15
- var _classnames = _interopRequireDefault(require("classnames"));
16
- var _css2 = require("@emotion/css");
17
16
  var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
18
17
  var _emotion = require("../emotion");
18
+ var _css2 = require("../emotion/css");
19
19
  var _context = require("./context");
20
20
  var _emotion2 = require("./emotion");
21
21
  var _utils = require("./utils");
22
22
  var _excluded = ["cloneElement", "className"];
23
+ var _templateObject;
23
24
  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); }
24
25
  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; }
25
26
  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; }
@@ -110,13 +111,13 @@ var EuiThemeProvider = function EuiThemeProvider(_ref) {
110
111
  // The theme that determines the global body styles
111
112
  bodyColor: isGlobalTheme ? theme.colors.text : bodyColor,
112
113
  hasDifferentColorFromGlobalTheme: isGlobalTheme ? false : bodyColor !== theme.colors.text,
113
- colorClassName: /*#__PURE__*/(0, _css2.css)("label:euiColorMode-", _colorMode, ";color:", theme.colors.text, ";;label:colorClassName;"),
114
+ colorClassName: (0, _css2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n label: euiColorMode-", ";\n color: ", ";\n "])), _colorMode || colorMode, theme.colors.text),
114
115
  setGlobalCSSVariables: isGlobalTheme ? setThemeCSSVariables : setGlobalCSSVariables,
115
116
  globalCSSVariables: isGlobalTheme ? themeCSSVariables : globalCSSVariables,
116
117
  setNearestThemeCSSVariables: setThemeCSSVariables,
117
118
  themeCSSVariables: themeCSSVariables
118
119
  };
119
- }, [theme, isGlobalTheme, bodyColor, _colorMode, setGlobalCSSVariables, globalCSSVariables, setThemeCSSVariables, themeCSSVariables]);
120
+ }, [theme, isGlobalTheme, bodyColor, _colorMode, colorMode, setGlobalCSSVariables, globalCSSVariables, setThemeCSSVariables, themeCSSVariables]);
120
121
  var renderedChildren = (0, _react2.useMemo)(function () {
121
122
  if (isGlobalTheme) {
122
123
  return children; // No wrapper
@@ -127,7 +128,7 @@ var EuiThemeProvider = function EuiThemeProvider(_ref) {
127
128
  className = _ref2.className,
128
129
  rest = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
129
130
  var props = _objectSpread(_objectSpread({}, rest), {}, {
130
- className: (0, _classnames.default)(className, nestedThemeContext.colorClassName)
131
+ className: (0, _css2.cx)(className, nestedThemeContext.colorClassName)
131
132
  });
132
133
  // Condition avoids rendering an empty Emotion selector if no
133
134
  // theme-specific CSS variables have been set by child components
@@ -138,11 +139,11 @@ var EuiThemeProvider = function EuiThemeProvider(_ref) {
138
139
  }
139
140
  if (cloneElement) {
140
141
  return (0, _emotion.cloneElementWithCss)(children, _objectSpread(_objectSpread({}, props), {}, {
141
- className: (0, _classnames.default)(children.props.className, props.className)
142
+ className: (0, _css2.cx)(children.props.className, props.className)
142
143
  }));
143
144
  } else {
144
145
  return (0, _react.jsx)("span", (0, _extends2.default)({}, props, {
145
- className: (0, _classnames.default)('euiThemeProvider', props.className)
146
+ className: (0, _css2.cx)('euiThemeProvider', props.className)
146
147
  }), children);
147
148
  }
148
149
  }, [isGlobalTheme, themeCSSVariables, nestedThemeContext, wrapperProps, children]);
@@ -43,7 +43,7 @@ var isInverseColorMode = function isInverseColorMode(colorMode) {
43
43
  /**
44
44
  * Returns the color mode configured in the current EuiThemeProvider.
45
45
  * Returns the parent color mode if none is explicity set.
46
- * @param {string} coloMode - `light`, `dark`, or `inverse`
46
+ * @param {string} colorMode - `light`, `dark`, or `inverse`
47
47
  * @param {string} parentColorMode - `LIGHT` or `DARK`; used as the fallback
48
48
  */
49
49
  exports.isInverseColorMode = isInverseColorMode;