@elastic/eui 76.1.0 → 76.3.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 (259) hide show
  1. package/dist/eui_theme_dark.css +33 -6
  2. package/dist/eui_theme_dark.min.css +1 -1
  3. package/dist/eui_theme_light.css +33 -6
  4. package/dist/eui_theme_light.min.css +1 -1
  5. package/es/components/accessibility/skip_link/skip_link.js +15 -4
  6. package/es/components/avatar/avatar.js +1 -1
  7. package/es/components/badge/badge.js +1 -1
  8. package/es/components/badge/beta_badge/beta_badge.js +1 -1
  9. package/es/components/basic_table/basic_table.js +1 -1
  10. package/es/components/basic_table/collapsed_item_actions.js +1 -1
  11. package/es/components/basic_table/in_memory_table.js +1 -1
  12. package/es/components/button/_button_content_deprecated.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/code/code_block_full_screen.js +2 -0
  22. package/es/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
  23. package/es/components/comment_list/comment.js +2 -2
  24. package/es/components/comment_list/comment_event.js +1 -1
  25. package/es/components/comment_list/comment_list.js +2 -2
  26. package/es/components/comment_list/comment_timeline.js +1 -1
  27. package/es/components/datagrid/body/data_grid_body.js +32 -408
  28. package/es/components/datagrid/body/data_grid_body_custom.js +908 -0
  29. package/es/components/datagrid/body/data_grid_body_virtualized.js +1031 -0
  30. package/es/components/datagrid/body/data_grid_cell.js +34 -33
  31. package/es/components/datagrid/body/data_grid_cell_wrapper.js +132 -0
  32. package/es/components/datagrid/body/header/data_grid_header_cell.js +12 -12
  33. package/es/components/datagrid/body/header/data_grid_header_row.js +16 -15
  34. package/es/components/datagrid/controls/column_sorting_draggable.js +1 -1
  35. package/es/components/datagrid/data_grid.js +34 -18
  36. package/es/components/datagrid/data_grid_types.js +18 -1
  37. package/es/components/datagrid/utils/in_memory.js +12 -12
  38. package/es/components/datagrid/utils/row_heights.js +111 -31
  39. package/es/components/date_picker/date_picker.js +2 -2
  40. package/es/components/date_picker/date_picker_range.js +1 -1
  41. package/es/components/empty_prompt/empty_prompt.js +1 -1
  42. package/es/components/facet/facet_button.js +1 -1
  43. package/es/components/flyout/flyout.js +1 -0
  44. package/es/components/form/field_number/field_number.js +1 -1
  45. package/es/components/form/field_text/field_text.js +2 -2
  46. package/es/components/form/form_control_layout/form_control_layout.js +2 -2
  47. package/es/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
  48. package/es/components/form/form_control_layout/form_control_layout_icons.js +2 -2
  49. package/es/components/header/header_links/header_link.js +1 -1
  50. package/es/components/header/header_links/header_links.js +1 -1
  51. package/es/components/header/header_logo.js +1 -1
  52. package/es/components/icon/icon.js +1 -1
  53. package/es/components/icon/icon_map.js +2 -0
  54. package/es/components/image/image_fullscreen_wrapper.js +2 -0
  55. package/es/components/key_pad_menu/key_pad_menu_item.js +1 -1
  56. package/es/components/list_group/list_group.js +2 -2
  57. package/es/components/list_group/list_group_item.js +2 -2
  58. package/es/components/list_group/list_group_item_extra_action.js +1 -1
  59. package/es/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
  60. package/es/components/loading/loading_logo.js +1 -1
  61. package/es/components/markdown_editor/markdown_editor.js +1 -1
  62. package/es/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
  63. package/es/components/markdown_editor/markdown_editor_footer.js +1 -1
  64. package/es/components/markdown_editor/markdown_editor_toolbar.js +1 -1
  65. package/es/components/notification/notification_event.js +2 -2
  66. package/es/components/notification/notification_event_meta.js +1 -1
  67. package/es/components/page/page_header/page_header_content.js +1 -1
  68. package/es/components/pagination/pagination_button.js +1 -1
  69. package/es/components/selectable/selectable_list/selectable_list.js +1 -1
  70. package/es/components/selectable/selectable_list/selectable_list_item.js +1 -1
  71. package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
  72. package/es/components/suggest/suggest.js +1 -1
  73. package/es/components/suggest/suggest_item.js +1 -1
  74. package/es/components/table/table_header_button.js +1 -1
  75. package/es/components/timeline/timeline_item_icon.js +1 -1
  76. package/es/components/toast/global_toast_list.js +1 -1
  77. package/es/components/toast/toast.js +1 -1
  78. package/es/components/tool_tip/icon_tip.js +1 -1
  79. package/eui.d.ts +236 -139
  80. package/i18ntokens.json +8 -8
  81. package/lib/components/accessibility/skip_link/skip_link.js +15 -4
  82. package/lib/components/avatar/avatar.js +1 -1
  83. package/lib/components/badge/badge.js +1 -1
  84. package/lib/components/badge/beta_badge/beta_badge.js +1 -1
  85. package/lib/components/basic_table/basic_table.js +1 -1
  86. package/lib/components/basic_table/collapsed_item_actions.js +1 -1
  87. package/lib/components/basic_table/in_memory_table.js +1 -1
  88. package/lib/components/button/_button_content_deprecated.js +1 -1
  89. package/lib/components/button/button_display/_button_display.js +1 -1
  90. package/lib/components/button/button_display/_button_display_content.js +1 -1
  91. package/lib/components/button/button_empty/button_empty.js +1 -1
  92. package/lib/components/button/button_group/button_group.js +1 -1
  93. package/lib/components/button/button_group/button_group_button.js +1 -1
  94. package/lib/components/button/button_icon/button_icon.js +1 -1
  95. package/lib/components/call_out/call_out.js +1 -1
  96. package/lib/components/card/card.js +1 -1
  97. package/lib/components/code/code_block_full_screen.js +2 -0
  98. package/lib/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
  99. package/lib/components/comment_list/comment.js +2 -2
  100. package/lib/components/comment_list/comment_event.js +1 -1
  101. package/lib/components/comment_list/comment_list.js +2 -2
  102. package/lib/components/comment_list/comment_timeline.js +1 -1
  103. package/lib/components/datagrid/body/data_grid_body.js +32 -429
  104. package/lib/components/datagrid/body/data_grid_body_custom.js +927 -0
  105. package/lib/components/datagrid/body/data_grid_body_virtualized.js +1059 -0
  106. package/lib/components/datagrid/body/data_grid_cell.js +34 -33
  107. package/lib/components/datagrid/body/data_grid_cell_wrapper.js +147 -0
  108. package/lib/components/datagrid/body/header/data_grid_header_cell.js +12 -12
  109. package/lib/components/datagrid/body/header/data_grid_header_row.js +17 -15
  110. package/lib/components/datagrid/controls/column_sorting_draggable.js +1 -1
  111. package/lib/components/datagrid/data_grid.js +34 -17
  112. package/lib/components/datagrid/data_grid_types.js +22 -1
  113. package/lib/components/datagrid/utils/in_memory.js +12 -12
  114. package/lib/components/datagrid/utils/row_heights.js +116 -33
  115. package/lib/components/date_picker/date_picker.js +2 -2
  116. package/lib/components/date_picker/date_picker_range.js +1 -1
  117. package/lib/components/empty_prompt/empty_prompt.js +1 -1
  118. package/lib/components/facet/facet_button.js +1 -1
  119. package/lib/components/flyout/flyout.js +1 -0
  120. package/lib/components/form/field_number/field_number.js +1 -1
  121. package/lib/components/form/field_text/field_text.js +2 -2
  122. package/lib/components/form/form_control_layout/form_control_layout.js +2 -2
  123. package/lib/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
  124. package/lib/components/form/form_control_layout/form_control_layout_icons.js +2 -2
  125. package/lib/components/header/header_links/header_link.js +1 -1
  126. package/lib/components/header/header_links/header_links.js +1 -1
  127. package/lib/components/header/header_logo.js +1 -1
  128. package/lib/components/icon/icon.js +1 -1
  129. package/lib/components/icon/icon_map.js +2 -0
  130. package/lib/components/image/image_fullscreen_wrapper.js +2 -0
  131. package/lib/components/key_pad_menu/key_pad_menu_item.js +1 -1
  132. package/lib/components/list_group/list_group.js +2 -2
  133. package/lib/components/list_group/list_group_item.js +2 -2
  134. package/lib/components/list_group/list_group_item_extra_action.js +1 -1
  135. package/lib/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
  136. package/lib/components/loading/loading_logo.js +1 -1
  137. package/lib/components/markdown_editor/markdown_editor.js +1 -1
  138. package/lib/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
  139. package/lib/components/markdown_editor/markdown_editor_footer.js +1 -1
  140. package/lib/components/markdown_editor/markdown_editor_toolbar.js +1 -1
  141. package/lib/components/notification/notification_event.js +2 -2
  142. package/lib/components/notification/notification_event_meta.js +1 -1
  143. package/lib/components/page/page_header/page_header_content.js +1 -1
  144. package/lib/components/selectable/selectable_list/selectable_list.js +1 -1
  145. package/lib/components/selectable/selectable_list/selectable_list_item.js +1 -1
  146. package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
  147. package/lib/components/suggest/suggest.js +1 -1
  148. package/lib/components/suggest/suggest_item.js +1 -1
  149. package/lib/components/table/table_header_button.js +1 -1
  150. package/lib/components/timeline/timeline_item_icon.js +1 -1
  151. package/lib/components/toast/global_toast_list.js +1 -1
  152. package/lib/components/toast/toast.js +1 -1
  153. package/lib/components/tool_tip/icon_tip.js +1 -1
  154. package/optimize/es/components/accessibility/skip_link/skip_link.js +8 -1
  155. package/optimize/es/components/code/code_block_full_screen.js +2 -0
  156. package/optimize/es/components/datagrid/body/data_grid_body.js +17 -387
  157. package/optimize/es/components/datagrid/body/data_grid_body_custom.js +176 -0
  158. package/optimize/es/components/datagrid/body/data_grid_body_virtualized.js +311 -0
  159. package/optimize/es/components/datagrid/body/data_grid_cell.js +8 -7
  160. package/optimize/es/components/datagrid/body/data_grid_cell_wrapper.js +127 -0
  161. package/optimize/es/components/datagrid/body/header/data_grid_header_row.js +3 -2
  162. package/optimize/es/components/datagrid/data_grid.js +8 -5
  163. package/optimize/es/components/datagrid/data_grid_types.js +18 -1
  164. package/optimize/es/components/datagrid/utils/row_heights.js +100 -31
  165. package/optimize/es/components/flyout/flyout.js +1 -0
  166. package/optimize/es/components/icon/icon_map.js +2 -0
  167. package/optimize/es/components/image/image_fullscreen_wrapper.js +2 -0
  168. package/optimize/lib/components/accessibility/skip_link/skip_link.js +8 -1
  169. package/optimize/lib/components/code/code_block_full_screen.js +2 -0
  170. package/optimize/lib/components/datagrid/body/data_grid_body.js +16 -409
  171. package/optimize/lib/components/datagrid/body/data_grid_body_custom.js +198 -0
  172. package/optimize/lib/components/datagrid/body/data_grid_body_virtualized.js +342 -0
  173. package/optimize/lib/components/datagrid/body/data_grid_cell.js +8 -7
  174. package/optimize/lib/components/datagrid/body/data_grid_cell_wrapper.js +144 -0
  175. package/optimize/lib/components/datagrid/body/header/data_grid_header_row.js +4 -2
  176. package/optimize/lib/components/datagrid/data_grid.js +8 -4
  177. package/optimize/lib/components/datagrid/data_grid_types.js +22 -1
  178. package/optimize/lib/components/datagrid/utils/row_heights.js +103 -37
  179. package/optimize/lib/components/flyout/flyout.js +1 -0
  180. package/optimize/lib/components/icon/icon_map.js +2 -0
  181. package/optimize/lib/components/image/image_fullscreen_wrapper.js +2 -0
  182. package/package.json +1 -1
  183. package/src/components/datagrid/_data_grid.scss +7 -0
  184. package/src/components/datagrid/_data_grid_data_row.scss +1 -0
  185. package/src/components/datagrid/body/footer/_data_grid_footer_row.scss +1 -0
  186. package/src/components/datagrid/body/header/_data_grid_header_row.scss +1 -0
  187. package/src/components/selectable/selectable_list/_selectable_list.scss +10 -3
  188. package/src/themes/amsterdam/global_styling/mixins/_states.scss +17 -8
  189. package/test-env/components/accessibility/skip_link/skip_link.js +15 -4
  190. package/test-env/components/avatar/avatar.js +1 -1
  191. package/test-env/components/badge/badge.js +1 -1
  192. package/test-env/components/badge/beta_badge/beta_badge.js +1 -1
  193. package/test-env/components/basic_table/basic_table.js +1 -1
  194. package/test-env/components/basic_table/collapsed_item_actions.js +1 -1
  195. package/test-env/components/basic_table/in_memory_table.js +1 -1
  196. package/test-env/components/button/_button_content_deprecated.js +1 -1
  197. package/test-env/components/button/button_display/_button_display.js +1 -1
  198. package/test-env/components/button/button_display/_button_display_content.js +1 -1
  199. package/test-env/components/button/button_empty/button_empty.js +1 -1
  200. package/test-env/components/button/button_group/button_group.js +1 -1
  201. package/test-env/components/button/button_group/button_group_button.js +1 -1
  202. package/test-env/components/button/button_icon/button_icon.js +1 -1
  203. package/test-env/components/call_out/call_out.js +1 -1
  204. package/test-env/components/card/card.js +1 -1
  205. package/test-env/components/code/code_block_full_screen.js +2 -0
  206. package/test-env/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
  207. package/test-env/components/comment_list/comment.js +2 -2
  208. package/test-env/components/comment_list/comment_event.js +1 -1
  209. package/test-env/components/comment_list/comment_list.js +2 -2
  210. package/test-env/components/comment_list/comment_timeline.js +1 -1
  211. package/test-env/components/datagrid/body/data_grid_body.js +31 -428
  212. package/test-env/components/datagrid/body/data_grid_body_custom.js +908 -0
  213. package/test-env/components/datagrid/body/data_grid_body_virtualized.js +1057 -0
  214. package/test-env/components/datagrid/body/data_grid_cell.js +34 -33
  215. package/test-env/components/datagrid/body/data_grid_cell_wrapper.js +144 -0
  216. package/test-env/components/datagrid/body/header/data_grid_header_cell.js +12 -12
  217. package/test-env/components/datagrid/body/header/data_grid_header_row.js +17 -15
  218. package/test-env/components/datagrid/controls/column_sorting_draggable.js +1 -1
  219. package/test-env/components/datagrid/data_grid.js +34 -17
  220. package/test-env/components/datagrid/data_grid_types.js +22 -1
  221. package/test-env/components/datagrid/utils/in_memory.js +12 -12
  222. package/test-env/components/datagrid/utils/row_heights.js +103 -37
  223. package/test-env/components/date_picker/date_picker.js +2 -2
  224. package/test-env/components/date_picker/date_picker_range.js +1 -1
  225. package/test-env/components/empty_prompt/empty_prompt.js +1 -1
  226. package/test-env/components/facet/facet_button.js +1 -1
  227. package/test-env/components/form/field_number/field_number.js +1 -1
  228. package/test-env/components/form/field_text/field_text.js +2 -2
  229. package/test-env/components/form/form_control_layout/form_control_layout.js +2 -2
  230. package/test-env/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
  231. package/test-env/components/form/form_control_layout/form_control_layout_icons.js +2 -2
  232. package/test-env/components/header/header_links/header_link.js +1 -1
  233. package/test-env/components/header/header_links/header_links.js +1 -1
  234. package/test-env/components/header/header_logo.js +1 -1
  235. package/test-env/components/icon/icon_map.js +2 -0
  236. package/test-env/components/image/image_fullscreen_wrapper.js +2 -0
  237. package/test-env/components/key_pad_menu/key_pad_menu_item.js +1 -1
  238. package/test-env/components/list_group/list_group.js +2 -2
  239. package/test-env/components/list_group/list_group_item.js +2 -2
  240. package/test-env/components/list_group/list_group_item_extra_action.js +1 -1
  241. package/test-env/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
  242. package/test-env/components/loading/loading_logo.js +1 -1
  243. package/test-env/components/markdown_editor/markdown_editor.js +1 -1
  244. package/test-env/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
  245. package/test-env/components/markdown_editor/markdown_editor_footer.js +1 -1
  246. package/test-env/components/markdown_editor/markdown_editor_toolbar.js +1 -1
  247. package/test-env/components/notification/notification_event.js +2 -2
  248. package/test-env/components/notification/notification_event_meta.js +1 -1
  249. package/test-env/components/page/page_header/page_header_content.js +1 -1
  250. package/test-env/components/selectable/selectable_list/selectable_list.js +1 -1
  251. package/test-env/components/selectable/selectable_list/selectable_list_item.js +1 -1
  252. package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
  253. package/test-env/components/suggest/suggest.js +1 -1
  254. package/test-env/components/suggest/suggest_item.js +1 -1
  255. package/test-env/components/table/table_header_button.js +1 -1
  256. package/test-env/components/timeline/timeline_item_icon.js +1 -1
  257. package/test-env/components/toast/global_toast_list.js +1 -1
  258. package/test-env/components/toast/toast.js +1 -1
  259. package/test-env/components/tool_tip/icon_tip.js +1 -1
@@ -2,430 +2,37 @@
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
4
 
5
- var _typeof = require("@babel/runtime/helpers/typeof");
6
-
7
5
  Object.defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
10
- exports.EuiDataGridBody = exports.DataGridWrapperRowsContext = exports.Cell = void 0;
11
-
12
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
8
+ exports.EuiDataGridBody = void 0;
13
9
 
14
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
15
11
 
16
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
17
-
18
- var _classnames = _interopRequireDefault(require("classnames"));
19
-
20
- var _react = _interopRequireWildcard(require("react"));
21
-
22
- var _reactWindow = require("react-window");
23
-
24
- var _resize_observer = require("../../observer/resize_observer");
25
-
26
- var _data_grid_cell = require("./data_grid_cell");
27
-
28
- var _header = require("./header");
29
-
30
- var _footer = require("./footer");
31
-
32
- var _data_grid_cell_popover = require("./data_grid_cell_popover");
33
-
34
- var _data_grid_row_manager = require("./data_grid_row_manager");
35
-
36
- var _grid_height_width = require("../utils/grid_height_width");
37
-
38
- var _col_widths = require("../utils/col_widths");
39
-
40
- var _row_heights = require("../utils/row_heights");
12
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
41
13
 
42
- var _scrolling = require("../utils/scrolling");
14
+ var _react = _interopRequireDefault(require("react"));
43
15
 
44
- var _sorting = require("../utils/sorting");
16
+ var _data_grid_body_virtualized = require("./data_grid_body_virtualized");
45
17
 
46
- var _utils = require("../../../utils");
18
+ var _data_grid_body_custom = require("./data_grid_body_custom");
47
19
 
48
20
  var _react2 = require("@emotion/react");
49
21
 
50
- var _excluded = ["children", "style"];
51
-
52
- 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); }
53
-
54
- 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; }
55
-
56
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
57
-
58
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
59
-
60
- var Cell = function Cell(_ref) {
61
- var columnIndex = _ref.columnIndex,
62
- visibleRowIndex = _ref.rowIndex,
63
- style = _ref.style,
64
- data = _ref.data;
65
- var leadingControlColumns = data.leadingControlColumns,
66
- trailingControlColumns = data.trailingControlColumns,
67
- columns = data.columns,
68
- visibleColCount = data.visibleColCount,
69
- schema = data.schema,
70
- columnWidths = data.columnWidths,
71
- defaultColumnWidth = data.defaultColumnWidth,
72
- renderCellValue = data.renderCellValue,
73
- renderCellPopover = data.renderCellPopover,
74
- interactiveCellId = data.interactiveCellId,
75
- setRowHeight = data.setRowHeight,
76
- schemaDetectors = data.schemaDetectors,
77
- rowHeightsOptions = data.rowHeightsOptions,
78
- rowHeightUtils = data.rowHeightUtils,
79
- rowManager = data.rowManager,
80
- pagination = data.pagination;
81
- var popoverContext = (0, _react.useContext)(_data_grid_cell_popover.DataGridCellPopoverContext);
82
-
83
- var _useContext = (0, _react.useContext)(DataGridWrapperRowsContext),
84
- headerRowHeight = _useContext.headerRowHeight;
85
-
86
- var _useContext2 = (0, _react.useContext)(_sorting.DataGridSortingContext),
87
- getCorrectRowIndex = _useContext2.getCorrectRowIndex;
88
-
89
- var cellContent;
90
- var isFirstColumn = columnIndex === 0;
91
- var isLastColumn = columnIndex === visibleColCount - 1;
92
- var isLeadingControlColumn = columnIndex < leadingControlColumns.length;
93
- var isTrailingControlColumn = columnIndex >= leadingControlColumns.length + columns.length;
94
- var dataColumnIndex = columnIndex - leadingControlColumns.length;
95
- var column = columns[dataColumnIndex];
96
- var columnId = column === null || column === void 0 ? void 0 : column.id;
97
- var transformClass = schemaDetectors.filter(function (row) {
98
- return column !== null && column !== void 0 && column.schema ? (column === null || column === void 0 ? void 0 : column.schema) === row.type : columnId === row.type;
99
- })[0];
100
- var textTransform = transformClass === null || transformClass === void 0 ? void 0 : transformClass.textTransform;
101
- var classes = (0, _classnames.default)((0, _defineProperty2.default)({
102
- 'euiDataGridRowCell--firstColumn': isFirstColumn,
103
- 'euiDataGridRowCell--lastColumn': isLastColumn,
104
- 'euiDataGridRowCell--controlColumn': isLeadingControlColumn || isTrailingControlColumn
105
- }, "euiDataGridRowCell--".concat(textTransform), textTransform));
106
- var sharedCellProps = {
107
- rowIndex: getCorrectRowIndex(visibleRowIndex),
108
- visibleRowIndex: visibleRowIndex,
109
- colIndex: columnIndex,
110
- interactiveCellId: interactiveCellId,
111
- className: classes,
112
- style: _objectSpread(_objectSpread({}, style), {}, {
113
- top: "".concat(parseFloat(style.top) + headerRowHeight, "px")
114
- }),
115
- rowHeightsOptions: rowHeightsOptions,
116
- rowHeightUtils: rowHeightUtils,
117
- setRowHeight: isFirstColumn ? setRowHeight : undefined,
118
- rowManager: rowManager,
119
- popoverContext: popoverContext,
120
- pagination: pagination
121
- };
122
-
123
- if (isLeadingControlColumn) {
124
- var leadingColumn = leadingControlColumns[columnIndex];
125
- var id = leadingColumn.id,
126
- rowCellRender = leadingColumn.rowCellRender;
127
- cellContent = (0, _react2.jsx)(_data_grid_cell.EuiDataGridCell, (0, _extends2.default)({}, sharedCellProps, {
128
- columnId: id,
129
- width: leadingColumn.width,
130
- renderCellValue: rowCellRender,
131
- isExpandable: false
132
- }));
133
- } else if (isTrailingControlColumn) {
134
- var columnOffset = columns.length + leadingControlColumns.length;
135
- var trailingColumnIndex = columnIndex - columnOffset;
136
- var trailingColumn = trailingControlColumns[trailingColumnIndex];
137
- var _id = trailingColumn.id,
138
- _rowCellRender = trailingColumn.rowCellRender;
139
- cellContent = (0, _react2.jsx)(_data_grid_cell.EuiDataGridCell, (0, _extends2.default)({}, sharedCellProps, {
140
- columnId: _id,
141
- width: trailingColumn.width,
142
- renderCellValue: _rowCellRender,
143
- isExpandable: false
144
- }));
145
- } else {
146
- // this is a normal data cell
147
- var columnType = schema[columnId] ? schema[columnId].columnType : null;
148
- var isExpandable = column.isExpandable !== undefined ? column.isExpandable : true;
149
- var width = columnWidths[columnId] || defaultColumnWidth;
150
- cellContent = (0, _react2.jsx)(_data_grid_cell.EuiDataGridCell, (0, _extends2.default)({}, sharedCellProps, {
151
- columnId: columnId,
152
- column: column,
153
- columnType: columnType,
154
- width: width || undefined,
155
- renderCellValue: renderCellValue,
156
- renderCellPopover: renderCellPopover,
157
- interactiveCellId: interactiveCellId,
158
- isExpandable: isExpandable
159
- }));
160
- }
161
-
162
- return cellContent;
163
- }; // Context is required to pass props to react-window's innerElementType
164
- // @see https://github.com/bvaughn/react-window/issues/404
165
-
166
-
167
- exports.Cell = Cell;
168
- var DataGridWrapperRowsContext = /*#__PURE__*/(0, _react.createContext)({
169
- headerRow: (0, _react2.jsx)("div", null),
170
- headerRowHeight: 0,
171
- footerRow: null
172
- });
173
- exports.DataGridWrapperRowsContext = DataGridWrapperRowsContext;
174
- var InnerElement = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
175
- var children = _ref2.children,
176
- style = _ref2.style,
177
- rest = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
178
-
179
- var _useContext3 = (0, _react.useContext)(DataGridWrapperRowsContext),
180
- headerRowHeight = _useContext3.headerRowHeight,
181
- headerRow = _useContext3.headerRow,
182
- footerRow = _useContext3.footerRow;
183
-
184
- return (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)("div", (0, _extends2.default)({
185
- ref: ref,
186
- style: _objectSpread(_objectSpread({}, style), {}, {
187
- height: style.height + headerRowHeight
188
- })
189
- }, rest), headerRow, children), footerRow);
190
- });
191
- InnerElement.displayName = 'EuiDataGridInnerElement';
192
-
193
- var EuiDataGridBody = function EuiDataGridBody(props) {
194
- var leadingControlColumns = props.leadingControlColumns,
195
- trailingControlColumns = props.trailingControlColumns,
196
- columns = props.columns,
197
- visibleColCount = props.visibleColCount,
198
- schema = props.schema,
199
- schemaDetectors = props.schemaDetectors,
200
- rowCount = props.rowCount,
201
- _props$visibleRows = props.visibleRows,
202
- startRow = _props$visibleRows.startRow,
203
- endRow = _props$visibleRows.endRow,
204
- visibleRowCount = _props$visibleRows.visibleRowCount,
205
- renderCellValue = props.renderCellValue,
206
- renderCellPopover = props.renderCellPopover,
207
- renderFooterCellValue = props.renderFooterCellValue,
208
- interactiveCellId = props.interactiveCellId,
209
- pagination = props.pagination,
210
- headerIsInteractive = props.headerIsInteractive,
211
- handleHeaderMutation = props.handleHeaderMutation,
212
- setVisibleColumns = props.setVisibleColumns,
213
- switchColumnPos = props.switchColumnPos,
214
- onColumnResize = props.onColumnResize,
215
- rowHeightsOptions = props.rowHeightsOptions,
216
- virtualizationOptions = props.virtualizationOptions,
217
- isFullScreen = props.isFullScreen,
218
- gridStyles = props.gridStyles,
219
- gridWidth = props.gridWidth,
220
- gridRef = props.gridRef,
221
- gridItemsRendered = props.gridItemsRendered,
222
- wrapperRef = props.wrapperRef;
223
- /**
224
- * Grid refs & observers
225
- */
226
-
227
- var wrapperDimensions = (0, _resize_observer.useResizeObserver)(wrapperRef.current);
228
- var outerGridRef = (0, _react.useRef)(null); // container that becomes scrollable
229
-
230
- var innerGridRef = (0, _react.useRef)(null); // container sized to fit all content
231
-
232
- /**
233
- * Scroll bars
234
- */
235
-
236
- var _useScrollBars = (0, _scrolling.useScrollBars)(outerGridRef, gridStyles.border),
237
- scrollBarHeight = _useScrollBars.scrollBarHeight,
238
- hasVerticalScroll = _useScrollBars.hasVerticalScroll,
239
- hasHorizontalScroll = _useScrollBars.hasHorizontalScroll,
240
- scrollBorderOverlay = _useScrollBars.scrollBorderOverlay;
241
- /**
242
- * Widths
243
- */
244
-
245
-
246
- var virtualizeContainerWidth = (0, _grid_height_width.useVirtualizeContainerWidth)(outerGridRef.current, gridWidth, pagination === null || pagination === void 0 ? void 0 : pagination.pageSize); // compute the default column width from the container's width and count of visible columns
247
-
248
- var defaultColumnWidth = (0, _col_widths.useDefaultColumnWidth)(virtualizeContainerWidth, leadingControlColumns, trailingControlColumns, columns);
249
-
250
- var _useColumnWidths = (0, _col_widths.useColumnWidths)({
251
- columns: columns,
252
- leadingControlColumns: leadingControlColumns,
253
- trailingControlColumns: trailingControlColumns,
254
- defaultColumnWidth: defaultColumnWidth,
255
- onColumnResize: onColumnResize
256
- }),
257
- columnWidths = _useColumnWidths.columnWidths,
258
- setColumnWidth = _useColumnWidths.setColumnWidth,
259
- getColumnWidth = _useColumnWidths.getColumnWidth;
260
- /**
261
- * Header & footer
262
- */
22
+ var _excluded = ["renderCustomGridBody"];
263
23
 
24
+ var EuiDataGridBody = function EuiDataGridBody(_ref) {
25
+ var renderCustomGridBody = _ref.renderCustomGridBody,
26
+ props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
264
27
 
265
- var _useDataGridHeader = (0, _header.useDataGridHeader)({
266
- headerIsInteractive: headerIsInteractive,
267
- handleHeaderMutation: handleHeaderMutation,
268
- switchColumnPos: switchColumnPos,
269
- setVisibleColumns: setVisibleColumns,
270
- leadingControlColumns: leadingControlColumns,
271
- trailingControlColumns: trailingControlColumns,
272
- columns: columns,
273
- columnWidths: columnWidths,
274
- defaultColumnWidth: defaultColumnWidth,
275
- setColumnWidth: setColumnWidth,
276
- schema: schema,
277
- schemaDetectors: schemaDetectors
278
- }),
279
- headerRow = _useDataGridHeader.headerRow,
280
- headerRowHeight = _useDataGridHeader.headerRowHeight;
281
-
282
- var _useDataGridFooter = (0, _footer.useDataGridFooter)({
283
- renderFooterCellValue: renderFooterCellValue,
284
- renderCellPopover: renderCellPopover,
285
- rowIndex: visibleRowCount,
286
- visibleRowIndex: visibleRowCount,
287
- interactiveCellId: interactiveCellId,
288
- leadingControlColumns: leadingControlColumns,
289
- trailingControlColumns: trailingControlColumns,
290
- columns: columns,
291
- columnWidths: columnWidths,
292
- defaultColumnWidth: defaultColumnWidth,
293
- schema: schema
294
- }),
295
- footerRow = _useDataGridFooter.footerRow,
296
- footerRowHeight = _useDataGridFooter.footerRowHeight;
297
- /**
298
- * Handle scrolling cells fully into view
299
- */
300
-
301
-
302
- (0, _scrolling.useScroll)({
303
- gridRef: gridRef,
304
- outerGridRef: outerGridRef,
305
- hasGridScrolling: hasVerticalScroll || hasHorizontalScroll,
306
- headerRowHeight: headerRowHeight,
307
- footerRowHeight: footerRowHeight,
308
- visibleRowCount: visibleRowCount,
309
- hasStickyFooter: !!(renderFooterCellValue && gridStyles.stickyFooter)
310
- });
311
- /**
312
- * Row manager
28
+ /*
29
+ * Determine whether we should use the default EuiDataGridBody
30
+ * + virtualization library for rendering content, or if consumers have
31
+ * passed their own custom renderer
313
32
  */
314
-
315
- var rowManager = (0, _data_grid_row_manager.useRowManager)({
316
- innerGridRef: innerGridRef,
317
- rowClasses: gridStyles.rowClasses
318
- });
319
- /**
320
- * Heights
321
- */
322
-
323
- var rowHeightUtils = (0, _row_heights.useRowHeightUtils)({
324
- gridRef: gridRef,
325
- outerGridElementRef: outerGridRef,
326
- gridItemsRenderedRef: gridItemsRendered,
327
- gridStyles: gridStyles,
328
- columns: columns,
329
- rowHeightsOptions: rowHeightsOptions
330
- });
331
-
332
- var _useDefaultRowHeight = (0, _row_heights.useDefaultRowHeight)({
333
- rowHeightsOptions: rowHeightsOptions,
334
- rowHeightUtils: rowHeightUtils
335
- }),
336
- defaultRowHeight = _useDefaultRowHeight.defaultRowHeight,
337
- setRowHeight = _useDefaultRowHeight.setRowHeight,
338
- getRowHeight = _useDefaultRowHeight.getRowHeight;
339
-
340
- var unconstrainedHeight = (0, _grid_height_width.useUnconstrainedHeight)({
341
- rowHeightUtils: rowHeightUtils,
342
- startRow: startRow,
343
- endRow: endRow,
344
- rowHeightsOptions: rowHeightsOptions,
345
- defaultRowHeight: defaultRowHeight,
346
- headerRowHeight: headerRowHeight,
347
- footerRowHeight: footerRowHeight,
348
- scrollBarHeight: scrollBarHeight,
349
- innerGridRef: innerGridRef
350
- });
351
- /**
352
- * Final grid height & width
353
- */
354
-
355
- var _useFinalGridDimensio = (0, _grid_height_width.useFinalGridDimensions)({
356
- unconstrainedHeight: unconstrainedHeight,
357
- unconstrainedWidth: 0,
358
- // unable to determine this until the container's size is known
359
- wrapperDimensions: wrapperDimensions,
360
- wrapperRef: wrapperRef,
361
- isFullScreen: isFullScreen,
362
- rowCount: rowCount
363
- }),
364
- finalWidth = _useFinalGridDimensio.finalWidth,
365
- finalHeight = _useFinalGridDimensio.finalHeight;
366
- /**
367
- * Grid resets
368
- */
369
-
370
-
371
- (0, _react.useEffect)(function () {
372
- if (gridRef.current) {
373
- gridRef.current.resetAfterColumnIndex(0);
374
- }
375
- }, [gridRef, columns, columnWidths, defaultColumnWidth]);
376
- (0, _react.useEffect)(function () {
377
- if (gridRef.current && rowHeightsOptions) {
378
- gridRef.current.resetAfterRowIndex(0);
379
- }
380
- }, [gridRef, pagination === null || pagination === void 0 ? void 0 : pagination.pageIndex, rowHeightsOptions, gridStyles === null || gridStyles === void 0 ? void 0 : gridStyles.cellPadding, gridStyles === null || gridStyles === void 0 ? void 0 : gridStyles.fontSize]);
381
- (0, _react.useEffect)(function () {
382
- if (gridRef.current) {
383
- gridRef.current.resetAfterRowIndex(0);
384
- }
385
- }, [gridRef, getRowHeight]);
386
- return _utils.IS_JEST_ENVIRONMENT || finalWidth > 0 ? (0, _react2.jsx)(DataGridWrapperRowsContext.Provider, {
387
- value: {
388
- headerRowHeight: headerRowHeight,
389
- headerRow: headerRow,
390
- footerRow: footerRow
391
- }
392
- }, (0, _react2.jsx)(_reactWindow.VariableSizeGrid, (0, _extends2.default)({}, virtualizationOptions ? virtualizationOptions : {}, {
393
- ref: gridRef,
394
- className: (0, _classnames.default)('euiDataGrid__virtualized', virtualizationOptions === null || virtualizationOptions === void 0 ? void 0 : virtualizationOptions.className),
395
- onItemsRendered: function onItemsRendered(itemsRendered) {
396
- var _virtualizationOption;
397
-
398
- gridItemsRendered.current = itemsRendered;
399
- virtualizationOptions === null || virtualizationOptions === void 0 ? void 0 : (_virtualizationOption = virtualizationOptions.onItemsRendered) === null || _virtualizationOption === void 0 ? void 0 : _virtualizationOption.call(virtualizationOptions, itemsRendered);
400
- },
401
- innerElementType: InnerElement,
402
- outerRef: outerGridRef,
403
- innerRef: innerGridRef,
404
- columnCount: visibleColCount,
405
- width: finalWidth,
406
- columnWidth: getColumnWidth,
407
- height: finalHeight,
408
- rowHeight: getRowHeight,
409
- itemData: {
410
- schemaDetectors: schemaDetectors,
411
- setRowHeight: setRowHeight,
412
- leadingControlColumns: leadingControlColumns,
413
- trailingControlColumns: trailingControlColumns,
414
- columns: columns,
415
- visibleColCount: visibleColCount,
416
- schema: schema,
417
- columnWidths: columnWidths,
418
- defaultColumnWidth: defaultColumnWidth,
419
- renderCellValue: renderCellValue,
420
- renderCellPopover: renderCellPopover,
421
- interactiveCellId: interactiveCellId,
422
- rowHeightsOptions: rowHeightsOptions,
423
- rowHeightUtils: rowHeightUtils,
424
- rowManager: rowManager,
425
- pagination: pagination
426
- },
427
- rowCount: _utils.IS_JEST_ENVIRONMENT || headerRowHeight > 0 ? visibleRowCount : 0
428
- }), Cell), scrollBorderOverlay) : null;
33
+ return renderCustomGridBody ? (0, _react2.jsx)(_data_grid_body_custom.EuiDataGridBodyCustomRender, (0, _extends2.default)({
34
+ renderCustomGridBody: renderCustomGridBody
35
+ }, props)) : (0, _react2.jsx)(_data_grid_body_virtualized.EuiDataGridBodyVirtualized, props);
429
36
  };
430
37
 
431
38
  exports.EuiDataGridBody = EuiDataGridBody;
@@ -0,0 +1,198 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ var _typeof = require("@babel/runtime/helpers/typeof");
6
+
7
+ Object.defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
10
+ exports.EuiDataGridBodyCustomRender = void 0;
11
+
12
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
+
14
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
15
+
16
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
17
+
18
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
19
+
20
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
21
+
22
+ var _react = _interopRequireWildcard(require("react"));
23
+
24
+ var _classnames = _interopRequireDefault(require("classnames"));
25
+
26
+ var _col_widths = require("../utils/col_widths");
27
+
28
+ var _row_heights = require("../utils/row_heights");
29
+
30
+ var _header = require("./header");
31
+
32
+ var _footer = require("./footer");
33
+
34
+ var _data_grid_cell_wrapper = require("./data_grid_cell_wrapper");
35
+
36
+ var _react2 = require("@emotion/react");
37
+
38
+ var _excluded = ["colIndex", "visibleRowIndex"];
39
+
40
+ 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); }
41
+
42
+ 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; }
43
+
44
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
45
+
46
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
47
+
48
+ var EuiDataGridBodyCustomRender = function EuiDataGridBodyCustomRender(_ref) {
49
+ var renderCustomGridBody = _ref.renderCustomGridBody,
50
+ leadingControlColumns = _ref.leadingControlColumns,
51
+ trailingControlColumns = _ref.trailingControlColumns,
52
+ columns = _ref.columns,
53
+ visibleColCount = _ref.visibleColCount,
54
+ schema = _ref.schema,
55
+ schemaDetectors = _ref.schemaDetectors,
56
+ visibleRows = _ref.visibleRows,
57
+ renderCellValue = _ref.renderCellValue,
58
+ renderCellPopover = _ref.renderCellPopover,
59
+ renderFooterCellValue = _ref.renderFooterCellValue,
60
+ interactiveCellId = _ref.interactiveCellId,
61
+ headerIsInteractive = _ref.headerIsInteractive,
62
+ handleHeaderMutation = _ref.handleHeaderMutation,
63
+ setVisibleColumns = _ref.setVisibleColumns,
64
+ switchColumnPos = _ref.switchColumnPos,
65
+ onColumnResize = _ref.onColumnResize,
66
+ gridWidth = _ref.gridWidth,
67
+ gridStyles = _ref.gridStyles,
68
+ pagination = _ref.pagination,
69
+ rowHeightsOptions = _ref.rowHeightsOptions;
70
+
71
+ /**
72
+ * Columns & widths
73
+ */
74
+ var visibleColumns = (0, _react.useMemo)(function () {
75
+ return [].concat((0, _toConsumableArray2.default)(leadingControlColumns), (0, _toConsumableArray2.default)(columns), (0, _toConsumableArray2.default)(trailingControlColumns));
76
+ }, [columns, leadingControlColumns, trailingControlColumns]); // compute the default column width from the container's width and count of visible columns
77
+
78
+ var defaultColumnWidth = (0, _col_widths.useDefaultColumnWidth)(gridWidth, leadingControlColumns, trailingControlColumns, columns);
79
+
80
+ var _useColumnWidths = (0, _col_widths.useColumnWidths)({
81
+ columns: columns,
82
+ leadingControlColumns: leadingControlColumns,
83
+ trailingControlColumns: trailingControlColumns,
84
+ defaultColumnWidth: defaultColumnWidth,
85
+ onColumnResize: onColumnResize
86
+ }),
87
+ columnWidths = _useColumnWidths.columnWidths,
88
+ setColumnWidth = _useColumnWidths.setColumnWidth;
89
+ /**
90
+ * Row heights
91
+ */
92
+
93
+
94
+ var rowHeightUtils = (0, _row_heights.useRowHeightUtils)({
95
+ rowHeightsOptions: rowHeightsOptions,
96
+ gridStyles: gridStyles,
97
+ columns: columns
98
+ });
99
+
100
+ var _useDefaultRowHeight = (0, _row_heights.useDefaultRowHeight)({
101
+ rowHeightsOptions: rowHeightsOptions,
102
+ rowHeightUtils: rowHeightUtils
103
+ }),
104
+ setRowHeight = _useDefaultRowHeight.setRowHeight,
105
+ getRowHeight = _useDefaultRowHeight.getRowHeight;
106
+ /**
107
+ * Header & footer
108
+ */
109
+
110
+
111
+ var _useDataGridHeader = (0, _header.useDataGridHeader)({
112
+ headerIsInteractive: headerIsInteractive,
113
+ handleHeaderMutation: handleHeaderMutation,
114
+ switchColumnPos: switchColumnPos,
115
+ setVisibleColumns: setVisibleColumns,
116
+ leadingControlColumns: leadingControlColumns,
117
+ trailingControlColumns: trailingControlColumns,
118
+ columns: columns,
119
+ columnWidths: columnWidths,
120
+ defaultColumnWidth: defaultColumnWidth,
121
+ setColumnWidth: setColumnWidth,
122
+ schema: schema,
123
+ schemaDetectors: schemaDetectors
124
+ }),
125
+ headerRow = _useDataGridHeader.headerRow;
126
+
127
+ var _useDataGridFooter = (0, _footer.useDataGridFooter)({
128
+ renderFooterCellValue: renderFooterCellValue,
129
+ renderCellPopover: renderCellPopover,
130
+ rowIndex: visibleRows.visibleRowCount,
131
+ visibleRowIndex: visibleRows.visibleRowCount,
132
+ interactiveCellId: interactiveCellId,
133
+ leadingControlColumns: leadingControlColumns,
134
+ trailingControlColumns: trailingControlColumns,
135
+ columns: columns,
136
+ columnWidths: columnWidths,
137
+ defaultColumnWidth: defaultColumnWidth,
138
+ schema: schema
139
+ }),
140
+ footerRow = _useDataGridFooter.footerRow;
141
+ /**
142
+ * Cell render fn
143
+ */
144
+
145
+
146
+ var cellProps = {
147
+ schema: schema,
148
+ schemaDetectors: schemaDetectors,
149
+ pagination: pagination,
150
+ columns: columns,
151
+ leadingControlColumns: leadingControlColumns,
152
+ trailingControlColumns: trailingControlColumns,
153
+ visibleColCount: visibleColCount,
154
+ columnWidths: columnWidths,
155
+ defaultColumnWidth: defaultColumnWidth,
156
+ renderCellValue: renderCellValue,
157
+ renderCellPopover: renderCellPopover,
158
+ interactiveCellId: interactiveCellId,
159
+ setRowHeight: setRowHeight,
160
+ rowHeightsOptions: rowHeightsOptions,
161
+ rowHeightUtils: rowHeightUtils
162
+ };
163
+
164
+ var _Cell = (0, _react.useCallback)(function (_ref2) {
165
+ var colIndex = _ref2.colIndex,
166
+ visibleRowIndex = _ref2.visibleRowIndex,
167
+ rest = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
168
+ var style = {
169
+ height: rowHeightUtils.isAutoHeight(visibleRowIndex, rowHeightsOptions) ? 'auto' : getRowHeight(visibleRowIndex)
170
+ };
171
+
172
+ var props = _objectSpread({
173
+ colIndex: colIndex,
174
+ visibleRowIndex: visibleRowIndex,
175
+ style: style
176
+ }, cellProps);
177
+
178
+ return (0, _react2.jsx)(_data_grid_cell_wrapper.Cell, (0, _extends2.default)({}, props, rest));
179
+ }, [].concat((0, _toConsumableArray2.default)(Object.values(cellProps)), [getRowHeight]) // eslint-disable-line react-hooks/exhaustive-deps
180
+ ); // Allow consumers to pass custom props/attributes/listeners etc. to the wrapping div
181
+
182
+
183
+ var _useState = (0, _react.useState)({}),
184
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
185
+ customGridBodyProps = _useState2[0],
186
+ setCustomGridBodyProps = _useState2[1];
187
+
188
+ return (0, _react2.jsx)("div", (0, _extends2.default)({}, customGridBodyProps, {
189
+ className: (0, _classnames.default)('euiDataGrid__customRenderBody', customGridBodyProps === null || customGridBodyProps === void 0 ? void 0 : customGridBodyProps.className)
190
+ }), headerRow, renderCustomGridBody({
191
+ visibleColumns: visibleColumns,
192
+ visibleRowData: visibleRows,
193
+ Cell: _Cell,
194
+ setCustomGridBodyProps: setCustomGridBodyProps
195
+ }), footerRow);
196
+ };
197
+
198
+ exports.EuiDataGridBodyCustomRender = EuiDataGridBodyCustomRender;