@elastic/eui 75.1.2 → 76.0.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.
- package/es/components/accessibility/skip_link/skip_link.js +11 -42
- package/es/components/avatar/avatar.js +1 -1
- package/es/components/badge/badge.js +1 -1
- package/es/components/badge/badge_group/badge_group.styles.js +1 -1
- package/es/components/badge/beta_badge/beta_badge.js +1 -1
- package/es/components/basic_table/basic_table.js +1 -1
- package/es/components/basic_table/collapsed_item_actions.js +1 -1
- package/es/components/basic_table/in_memory_table.js +1 -1
- package/es/components/button/_button_content_deprecated.js +1 -1
- package/es/components/button/button_display/_button_display.js +1 -1
- package/es/components/button/button_display/_button_display_content.js +1 -1
- package/es/components/button/button_empty/button_empty.js +1 -1
- package/es/components/button/button_group/button_group.js +1 -1
- package/es/components/button/button_group/button_group_button.js +1 -1
- package/es/components/button/button_icon/button_icon.js +1 -1
- package/es/components/call_out/call_out.js +1 -1
- package/es/components/card/card.js +1 -1
- package/es/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
- package/es/components/comment_list/comment.js +2 -2
- package/es/components/comment_list/comment_event.js +1 -1
- package/es/components/comment_list/comment_list.js +2 -2
- package/es/components/comment_list/comment_timeline.js +1 -1
- package/es/components/control_bar/control_bar.a11y.js +1 -1
- package/es/components/datagrid/body/data_grid_body.js +89 -94
- package/es/components/datagrid/body/data_grid_cell.js +34 -24
- package/es/components/datagrid/body/{data_grid_footer_row.js → footer/data_grid_footer_row.js} +22 -15
- package/es/components/datagrid/body/footer/index.js +9 -0
- package/es/components/datagrid/body/footer/use_data_grid_footer.js +60 -0
- package/es/components/datagrid/body/header/data_grid_control_header_cell.js +24 -5
- package/es/components/datagrid/body/header/data_grid_header_cell.js +23 -17
- package/es/components/datagrid/body/header/data_grid_header_row.js +52 -17
- package/es/components/datagrid/body/header/index.js +2 -1
- package/es/components/datagrid/body/header/use_data_grid_header.js +66 -0
- package/es/components/datagrid/controls/column_sorting_draggable.js +1 -1
- package/es/components/datagrid/data_grid.js +52 -17
- package/es/components/datagrid/utils/in_memory.js +17 -12
- package/es/components/date_picker/date_picker.js +2 -2
- package/es/components/date_picker/date_picker_range.js +2 -2
- package/es/components/empty_prompt/empty_prompt.js +1 -1
- package/es/components/expression/expression.js +3 -3
- package/es/components/facet/facet_button.js +1 -1
- package/es/components/form/field_number/field_number.js +1 -1
- package/es/components/form/field_text/field_text.js +2 -2
- package/es/components/form/form_control_layout/form_control_layout.js +2 -2
- package/es/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
- package/es/components/form/form_control_layout/form_control_layout_icons.js +2 -2
- package/es/components/header/header_links/header_link.js +1 -1
- package/es/components/header/header_links/header_links.js +1 -1
- package/es/components/header/header_logo.js +1 -1
- package/es/components/icon/assets/pivot.js +41 -0
- package/es/components/icon/assets/{crossInACircleFilled.js → warning.js} +5 -3
- package/es/components/icon/icon.js +1 -1
- package/es/components/icon/icon_glyphs.a11y.js +1 -1
- package/es/components/icon/icon_map.js +2 -2
- package/es/components/key_pad_menu/key_pad_menu_item.js +1 -1
- package/es/components/list_group/list_group.js +2 -2
- package/es/components/list_group/list_group_item.js +2 -2
- package/es/components/list_group/list_group_item_extra_action.js +1 -1
- package/es/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
- package/es/components/loading/loading_logo.js +1 -1
- package/es/components/markdown_editor/markdown_editor.js +1 -1
- package/es/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
- package/es/components/markdown_editor/markdown_editor_footer.js +2 -2
- package/es/components/markdown_editor/markdown_editor_toolbar.js +1 -1
- package/es/components/notification/notification_event.js +2 -2
- package/es/components/notification/notification_event_meta.js +1 -1
- package/es/components/page/page_header/page_header_content.js +1 -1
- package/es/components/pagination/pagination_button.js +1 -1
- package/es/components/selectable/selectable_list/selectable_list.js +1 -1
- package/es/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
- package/es/components/steps/step_number.js +1 -1
- package/es/components/suggest/suggest.js +1 -1
- package/es/components/suggest/suggest_item.js +1 -1
- package/es/components/table/table_header_button.js +1 -1
- package/es/components/text/text.styles.js +1 -1
- package/es/components/timeline/timeline_item_icon.js +1 -1
- package/es/components/toast/global_toast_list.js +1 -1
- package/es/components/toast/toast.js +1 -1
- package/es/components/tool_tip/icon_tip.js +1 -1
- package/eui.d.ts +98 -36
- package/i18ntokens.json +16 -16
- package/lib/components/accessibility/skip_link/skip_link.js +10 -41
- package/lib/components/avatar/avatar.js +1 -1
- package/lib/components/badge/badge.js +1 -1
- package/lib/components/badge/badge_group/badge_group.styles.js +1 -1
- package/lib/components/badge/beta_badge/beta_badge.js +1 -1
- package/lib/components/basic_table/basic_table.js +1 -1
- package/lib/components/basic_table/collapsed_item_actions.js +1 -1
- package/lib/components/basic_table/in_memory_table.js +1 -1
- package/lib/components/button/_button_content_deprecated.js +1 -1
- package/lib/components/button/button_display/_button_display.js +1 -1
- package/lib/components/button/button_display/_button_display_content.js +1 -1
- package/lib/components/button/button_empty/button_empty.js +1 -1
- package/lib/components/button/button_group/button_group.js +1 -1
- package/lib/components/button/button_group/button_group_button.js +1 -1
- package/lib/components/button/button_icon/button_icon.js +1 -1
- package/lib/components/call_out/call_out.js +1 -1
- package/lib/components/card/card.js +1 -1
- package/lib/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
- package/lib/components/comment_list/comment.js +2 -2
- package/lib/components/comment_list/comment_event.js +1 -1
- package/lib/components/comment_list/comment_list.js +2 -2
- package/lib/components/comment_list/comment_timeline.js +1 -1
- package/lib/components/control_bar/control_bar.a11y.js +1 -1
- package/lib/components/datagrid/body/data_grid_body.js +88 -95
- package/lib/components/datagrid/body/data_grid_cell.js +34 -24
- package/lib/components/datagrid/body/{data_grid_footer_row.js → footer/data_grid_footer_row.js} +21 -15
- package/lib/components/datagrid/body/footer/index.js +21 -0
- package/lib/components/datagrid/body/footer/use_data_grid_footer.js +71 -0
- package/lib/components/datagrid/body/header/data_grid_control_header_cell.js +25 -12
- package/lib/components/datagrid/body/header/data_grid_header_cell.js +23 -17
- package/lib/components/datagrid/body/header/data_grid_header_row.js +52 -17
- package/lib/components/datagrid/body/header/index.js +9 -1
- package/lib/components/datagrid/body/header/use_data_grid_header.js +79 -0
- package/lib/components/datagrid/controls/column_sorting_draggable.js +1 -1
- package/lib/components/datagrid/data_grid.js +52 -17
- package/lib/components/datagrid/utils/in_memory.js +17 -12
- package/lib/components/date_picker/date_picker.js +2 -2
- package/lib/components/date_picker/date_picker_range.js +2 -2
- package/lib/components/empty_prompt/empty_prompt.js +1 -1
- package/lib/components/expression/expression.js +3 -3
- package/lib/components/facet/facet_button.js +1 -1
- package/lib/components/form/field_number/field_number.js +1 -1
- package/lib/components/form/field_text/field_text.js +2 -2
- package/lib/components/form/form_control_layout/form_control_layout.js +2 -2
- package/lib/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
- package/lib/components/form/form_control_layout/form_control_layout_icons.js +2 -2
- package/lib/components/header/header_links/header_link.js +1 -1
- package/lib/components/header/header_links/header_links.js +1 -1
- package/lib/components/header/header_logo.js +1 -1
- package/lib/components/icon/assets/pivot.js +48 -0
- package/lib/components/icon/assets/{crossInACircleFilled.js → warning.js} +5 -3
- package/lib/components/icon/icon.js +1 -1
- package/lib/components/icon/icon_glyphs.a11y.js +1 -1
- package/lib/components/icon/icon_map.js +2 -2
- package/lib/components/icon/svgs/pivot.svg +3 -0
- package/lib/components/key_pad_menu/key_pad_menu_item.js +1 -1
- package/lib/components/list_group/list_group.js +2 -2
- package/lib/components/list_group/list_group_item.js +2 -2
- package/lib/components/list_group/list_group_item_extra_action.js +1 -1
- package/lib/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
- package/lib/components/loading/loading_logo.js +1 -1
- package/lib/components/markdown_editor/markdown_editor.js +1 -1
- package/lib/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
- package/lib/components/markdown_editor/markdown_editor_footer.js +2 -2
- package/lib/components/markdown_editor/markdown_editor_toolbar.js +1 -1
- package/lib/components/notification/notification_event.js +2 -2
- package/lib/components/notification/notification_event_meta.js +1 -1
- package/lib/components/page/page_header/page_header_content.js +1 -1
- package/lib/components/selectable/selectable_list/selectable_list.js +1 -1
- package/lib/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
- package/lib/components/steps/step_number.js +1 -1
- package/lib/components/suggest/suggest.js +1 -1
- package/lib/components/suggest/suggest_item.js +1 -1
- package/lib/components/table/table_header_button.js +1 -1
- package/lib/components/text/text.styles.js +1 -1
- package/lib/components/timeline/timeline_item_icon.js +1 -1
- package/lib/components/toast/global_toast_list.js +1 -1
- package/lib/components/toast/toast.js +1 -1
- package/lib/components/tool_tip/icon_tip.js +1 -1
- package/optimize/es/components/accessibility/skip_link/skip_link.js +11 -31
- package/optimize/es/components/badge/badge_group/badge_group.styles.js +1 -1
- package/optimize/es/components/control_bar/control_bar.a11y.js +1 -1
- package/optimize/es/components/datagrid/body/data_grid_body.js +37 -66
- package/optimize/es/components/datagrid/body/{data_grid_footer_row.js → footer/data_grid_footer_row.js} +22 -15
- package/optimize/es/components/datagrid/body/footer/index.js +9 -0
- package/optimize/es/components/datagrid/body/footer/use_data_grid_footer.js +45 -0
- package/optimize/es/components/datagrid/body/header/data_grid_control_header_cell.js +7 -3
- package/optimize/es/components/datagrid/body/header/data_grid_header_cell.js +6 -5
- package/optimize/es/components/datagrid/body/header/index.js +2 -1
- package/optimize/es/components/datagrid/body/header/use_data_grid_header.js +51 -0
- package/optimize/es/components/date_picker/date_picker_range.js +1 -1
- package/optimize/es/components/expression/expression.js +1 -1
- package/optimize/es/components/icon/assets/pivot.js +37 -0
- package/optimize/es/components/icon/assets/{crossInACircleFilled.js → warning.js} +5 -3
- package/optimize/es/components/icon/icon_glyphs.a11y.js +1 -1
- package/optimize/es/components/icon/icon_map.js +2 -2
- package/optimize/es/components/markdown_editor/markdown_editor_footer.js +1 -1
- package/optimize/es/components/steps/step_number.js +1 -1
- package/optimize/es/components/text/text.styles.js +1 -1
- package/optimize/lib/components/accessibility/skip_link/skip_link.js +10 -31
- package/optimize/lib/components/badge/badge_group/badge_group.styles.js +1 -1
- package/optimize/lib/components/control_bar/control_bar.a11y.js +1 -1
- package/optimize/lib/components/datagrid/body/data_grid_body.js +36 -68
- package/{test-env/components/datagrid/body → optimize/lib/components/datagrid/body/footer}/data_grid_footer_row.js +21 -15
- package/optimize/lib/components/datagrid/body/footer/index.js +21 -0
- package/optimize/lib/components/datagrid/body/footer/use_data_grid_footer.js +60 -0
- package/optimize/lib/components/datagrid/body/header/data_grid_control_header_cell.js +8 -3
- package/optimize/lib/components/datagrid/body/header/data_grid_header_cell.js +6 -5
- package/optimize/lib/components/datagrid/body/header/index.js +9 -1
- package/optimize/lib/components/datagrid/body/header/use_data_grid_header.js +69 -0
- package/optimize/lib/components/date_picker/date_picker_range.js +1 -1
- package/optimize/lib/components/expression/expression.js +1 -1
- package/optimize/lib/components/icon/assets/pivot.js +47 -0
- package/optimize/lib/components/icon/assets/{crossInACircleFilled.js → warning.js} +5 -3
- package/optimize/lib/components/icon/icon_glyphs.a11y.js +1 -1
- package/optimize/lib/components/icon/icon_map.js +2 -2
- package/optimize/lib/components/icon/svgs/pivot.svg +3 -0
- package/optimize/lib/components/markdown_editor/markdown_editor_footer.js +1 -1
- package/optimize/lib/components/steps/step_number.js +1 -1
- package/optimize/lib/components/text/text.styles.js +1 -1
- package/package.json +1 -1
- package/src/components/datagrid/_index.scss +1 -1
- package/test-env/components/accessibility/skip_link/skip_link.js +10 -31
- package/test-env/components/avatar/avatar.js +1 -1
- package/test-env/components/badge/badge.js +1 -1
- package/test-env/components/badge/badge_group/badge_group.styles.js +1 -1
- package/test-env/components/badge/beta_badge/beta_badge.js +1 -1
- package/test-env/components/basic_table/basic_table.js +1 -1
- package/test-env/components/basic_table/collapsed_item_actions.js +1 -1
- package/test-env/components/basic_table/in_memory_table.js +1 -1
- package/test-env/components/button/_button_content_deprecated.js +1 -1
- package/test-env/components/button/button_display/_button_display.js +1 -1
- package/test-env/components/button/button_display/_button_display_content.js +1 -1
- package/test-env/components/button/button_empty/button_empty.js +1 -1
- package/test-env/components/button/button_group/button_group.js +1 -1
- package/test-env/components/button/button_group/button_group_button.js +1 -1
- package/test-env/components/button/button_icon/button_icon.js +1 -1
- package/test-env/components/call_out/call_out.js +1 -1
- package/test-env/components/card/card.js +1 -1
- package/test-env/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
- package/test-env/components/comment_list/comment.js +2 -2
- package/test-env/components/comment_list/comment_event.js +1 -1
- package/test-env/components/comment_list/comment_list.js +2 -2
- package/test-env/components/comment_list/comment_timeline.js +1 -1
- package/test-env/components/control_bar/control_bar.a11y.js +1 -1
- package/test-env/components/datagrid/body/data_grid_body.js +88 -85
- package/test-env/components/datagrid/body/data_grid_cell.js +34 -24
- package/{optimize/lib/components/datagrid/body → test-env/components/datagrid/body/footer}/data_grid_footer_row.js +21 -15
- package/test-env/components/datagrid/body/footer/index.js +21 -0
- package/test-env/components/datagrid/body/footer/use_data_grid_footer.js +60 -0
- package/test-env/components/datagrid/body/header/data_grid_control_header_cell.js +25 -5
- package/test-env/components/datagrid/body/header/data_grid_header_cell.js +23 -17
- package/test-env/components/datagrid/body/header/data_grid_header_row.js +52 -17
- package/test-env/components/datagrid/body/header/index.js +9 -1
- package/test-env/components/datagrid/body/header/use_data_grid_header.js +69 -0
- package/test-env/components/datagrid/controls/column_sorting_draggable.js +1 -1
- package/test-env/components/datagrid/data_grid.js +52 -17
- package/test-env/components/datagrid/utils/in_memory.js +17 -12
- package/test-env/components/date_picker/date_picker.js +2 -2
- package/test-env/components/date_picker/date_picker_range.js +2 -2
- package/test-env/components/empty_prompt/empty_prompt.js +1 -1
- package/test-env/components/expression/expression.js +3 -3
- package/test-env/components/facet/facet_button.js +1 -1
- package/test-env/components/form/field_number/field_number.js +1 -1
- package/test-env/components/form/field_text/field_text.js +2 -2
- package/test-env/components/form/form_control_layout/form_control_layout.js +2 -2
- package/test-env/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
- package/test-env/components/form/form_control_layout/form_control_layout_icons.js +2 -2
- package/test-env/components/header/header_links/header_link.js +1 -1
- package/test-env/components/header/header_links/header_links.js +1 -1
- package/test-env/components/header/header_logo.js +1 -1
- package/test-env/components/icon/assets/pivot.js +47 -0
- package/test-env/components/icon/assets/{crossInACircleFilled.js → warning.js} +5 -3
- package/test-env/components/icon/icon_glyphs.a11y.js +1 -1
- package/test-env/components/icon/icon_map.js +2 -2
- package/test-env/components/key_pad_menu/key_pad_menu_item.js +1 -1
- package/test-env/components/list_group/list_group.js +2 -2
- package/test-env/components/list_group/list_group_item.js +2 -2
- package/test-env/components/list_group/list_group_item_extra_action.js +1 -1
- package/test-env/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
- package/test-env/components/loading/loading_logo.js +1 -1
- package/test-env/components/markdown_editor/markdown_editor.js +1 -1
- package/test-env/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
- package/test-env/components/markdown_editor/markdown_editor_footer.js +2 -2
- package/test-env/components/markdown_editor/markdown_editor_toolbar.js +1 -1
- package/test-env/components/notification/notification_event.js +2 -2
- package/test-env/components/notification/notification_event_meta.js +1 -1
- package/test-env/components/page/page_header/page_header_content.js +1 -1
- package/test-env/components/selectable/selectable_list/selectable_list.js +1 -1
- package/test-env/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
- package/test-env/components/steps/step_number.js +1 -1
- package/test-env/components/suggest/suggest.js +1 -1
- package/test-env/components/suggest/suggest_item.js +1 -1
- package/test-env/components/table/table_header_button.js +1 -1
- package/test-env/components/text/text.styles.js +1 -1
- package/test-env/components/timeline/timeline_item_icon.js +1 -1
- package/test-env/components/toast/global_toast_list.js +1 -1
- package/test-env/components/toast/toast.js +1 -1
- package/test-env/components/tool_tip/icon_tip.js +1 -1
- package/lib/components/icon/svgs/crossInACircleFilled.svg +0 -3
- package/optimize/lib/components/icon/svgs/crossInACircleFilled.svg +0 -3
- /package/lib/components/icon/svgs/{alert.svg → warning.svg} +0 -0
- /package/optimize/lib/components/icon/svgs/{alert.svg → warning.svg} +0 -0
- /package/src/components/datagrid/body/{_data_grid_footer_row.scss → footer/_data_grid_footer_row.scss} +0 -0
package/es/components/datagrid/body/{data_grid_footer_row.js → footer/data_grid_footer_row.js}
RENAMED
|
@@ -15,9 +15,14 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
15
15
|
*/
|
|
16
16
|
import classnames from 'classnames';
|
|
17
17
|
import React, { forwardRef, memo, useContext } from 'react';
|
|
18
|
-
import { EuiDataGridCell } from '
|
|
19
|
-
import { DataGridCellPopoverContext } from '
|
|
18
|
+
import { EuiDataGridCell } from '../data_grid_cell';
|
|
19
|
+
import { DataGridCellPopoverContext } from '../data_grid_cell_popover';
|
|
20
20
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
21
|
+
|
|
22
|
+
var renderEmpty = function renderEmpty() {
|
|
23
|
+
return null;
|
|
24
|
+
};
|
|
25
|
+
|
|
21
26
|
var EuiDataGridFooterRow = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
22
27
|
var leadingControlColumns = _ref.leadingControlColumns,
|
|
23
28
|
trailingControlColumns = _ref.trailingControlColumns,
|
|
@@ -44,7 +49,6 @@ var EuiDataGridFooterRow = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (
|
|
|
44
49
|
rowIndex: rowIndex,
|
|
45
50
|
visibleRowIndex: visibleRowIndex,
|
|
46
51
|
interactiveCellId: interactiveCellId,
|
|
47
|
-
isExpandable: true,
|
|
48
52
|
popoverContext: popoverContext
|
|
49
53
|
};
|
|
50
54
|
return ___EmotionJSX("div", _extends({
|
|
@@ -54,16 +58,17 @@ var EuiDataGridFooterRow = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (
|
|
|
54
58
|
"data-test-subj": dataTestSubj
|
|
55
59
|
}, rest), leadingControlColumns.map(function (_ref2, i) {
|
|
56
60
|
var id = _ref2.id,
|
|
57
|
-
width = _ref2.width
|
|
58
|
-
|
|
61
|
+
width = _ref2.width,
|
|
62
|
+
footerCellRender = _ref2.footerCellRender,
|
|
63
|
+
footerCellProps = _ref2.footerCellProps;
|
|
64
|
+
return ___EmotionJSX(EuiDataGridCell, _extends({}, footerCellProps, sharedCellProps, {
|
|
59
65
|
key: "".concat(id, "-").concat(rowIndex),
|
|
60
66
|
colIndex: i,
|
|
61
67
|
columnId: id,
|
|
62
68
|
width: width,
|
|
63
|
-
renderCellValue:
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
className: "euiDataGridFooterCell euiDataGridRowCell--controlColumn"
|
|
69
|
+
renderCellValue: footerCellRender !== null && footerCellRender !== void 0 ? footerCellRender : renderEmpty,
|
|
70
|
+
isExpandable: false,
|
|
71
|
+
className: classnames('euiDataGridFooterCell', 'euiDataGridRowCell--controlColumn', footerCellProps === null || footerCellProps === void 0 ? void 0 : footerCellProps.className)
|
|
67
72
|
}));
|
|
68
73
|
}), columns.map(function (_ref3, i) {
|
|
69
74
|
var id = _ref3.id;
|
|
@@ -79,21 +84,23 @@ var EuiDataGridFooterRow = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (
|
|
|
79
84
|
width: width || undefined,
|
|
80
85
|
renderCellValue: renderCellValue,
|
|
81
86
|
renderCellPopover: renderCellPopover,
|
|
87
|
+
isExpandable: true,
|
|
82
88
|
className: "euiDataGridFooterCell"
|
|
83
89
|
}));
|
|
84
90
|
}), trailingControlColumns.map(function (_ref4, i) {
|
|
85
91
|
var id = _ref4.id,
|
|
86
|
-
width = _ref4.width
|
|
92
|
+
width = _ref4.width,
|
|
93
|
+
footerCellRender = _ref4.footerCellRender,
|
|
94
|
+
footerCellProps = _ref4.footerCellProps;
|
|
87
95
|
var colIndex = i + columns.length + leadingControlColumns.length;
|
|
88
|
-
return ___EmotionJSX(EuiDataGridCell, _extends({}, sharedCellProps, {
|
|
96
|
+
return ___EmotionJSX(EuiDataGridCell, _extends({}, footerCellProps, sharedCellProps, {
|
|
89
97
|
key: "".concat(id, "-").concat(rowIndex),
|
|
90
98
|
colIndex: colIndex,
|
|
91
99
|
columnId: id,
|
|
92
100
|
width: width,
|
|
93
|
-
renderCellValue:
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
className: "euiDataGridFooterCell euiDataGridRowCell--controlColumn"
|
|
101
|
+
renderCellValue: footerCellRender !== null && footerCellRender !== void 0 ? footerCellRender : renderEmpty,
|
|
102
|
+
isExpandable: false,
|
|
103
|
+
className: classnames('euiDataGridFooterCell', 'euiDataGridRowCell--controlColumn', footerCellProps === null || footerCellProps === void 0 ? void 0 : footerCellProps.className)
|
|
97
104
|
}));
|
|
98
105
|
}));
|
|
99
106
|
}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
5
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
|
+
* Side Public License, v 1.
|
|
7
|
+
*/
|
|
8
|
+
export { EuiDataGridFooterRow } from './data_grid_footer_row';
|
|
9
|
+
export { useDataGridFooter } from './use_data_grid_footer';
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
var _excluded = ["renderFooterCellValue"];
|
|
2
|
+
|
|
3
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
+
|
|
5
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
6
|
+
|
|
7
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
8
|
+
|
|
9
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
10
|
+
|
|
11
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
12
|
+
|
|
13
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
14
|
+
|
|
15
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
16
|
+
|
|
17
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
18
|
+
|
|
19
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
20
|
+
|
|
21
|
+
/*
|
|
22
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
23
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
24
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
25
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
26
|
+
* Side Public License, v 1.
|
|
27
|
+
*/
|
|
28
|
+
import React, { useState, useMemo } from 'react';
|
|
29
|
+
import { useResizeObserver } from '../../../observer/resize_observer';
|
|
30
|
+
import { EuiDataGridFooterRow } from './data_grid_footer_row';
|
|
31
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* DRY out setting up the grid footer and its refs & observers
|
|
35
|
+
*/
|
|
36
|
+
export var useDataGridFooter = function useDataGridFooter(props) {
|
|
37
|
+
var _useState = useState(null),
|
|
38
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
39
|
+
footerRowRef = _useState2[0],
|
|
40
|
+
setFooterRowRef = _useState2[1];
|
|
41
|
+
|
|
42
|
+
var _useResizeObserver = useResizeObserver(footerRowRef, 'height'),
|
|
43
|
+
footerRowHeight = _useResizeObserver.height;
|
|
44
|
+
|
|
45
|
+
var footerRow = useMemo(function () {
|
|
46
|
+
var renderFooterCellValue = props.renderFooterCellValue,
|
|
47
|
+
footerProps = _objectWithoutProperties(props, _excluded);
|
|
48
|
+
|
|
49
|
+
if (renderFooterCellValue == null) return null;
|
|
50
|
+
return ___EmotionJSX(EuiDataGridFooterRow, _extends({
|
|
51
|
+
ref: setFooterRowRef,
|
|
52
|
+
renderCellValue: renderFooterCellValue
|
|
53
|
+
}, footerProps));
|
|
54
|
+
}, Object.values(props)); // eslint-disable-line react-hooks/exhaustive-deps
|
|
55
|
+
|
|
56
|
+
return {
|
|
57
|
+
footerRow: footerRow,
|
|
58
|
+
footerRowHeight: footerRowHeight
|
|
59
|
+
};
|
|
60
|
+
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
1
3
|
/*
|
|
2
4
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
5
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -7,6 +9,7 @@
|
|
|
7
9
|
*/
|
|
8
10
|
import React from 'react';
|
|
9
11
|
import PropTypes from "prop-types";
|
|
12
|
+
import classNames from 'classnames';
|
|
10
13
|
import { EuiDataGridHeaderCellWrapper } from './data_grid_header_cell_wrapper';
|
|
11
14
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
12
15
|
export var EuiDataGridControlHeaderCell = function EuiDataGridControlHeaderCell(_ref) {
|
|
@@ -14,15 +17,16 @@ export var EuiDataGridControlHeaderCell = function EuiDataGridControlHeaderCell(
|
|
|
14
17
|
index = _ref.index,
|
|
15
18
|
headerIsInteractive = _ref.headerIsInteractive;
|
|
16
19
|
var HeaderCellRender = controlColumn.headerCellRender,
|
|
20
|
+
headerCellProps = controlColumn.headerCellProps,
|
|
17
21
|
width = controlColumn.width,
|
|
18
22
|
id = controlColumn.id;
|
|
19
|
-
return ___EmotionJSX(EuiDataGridHeaderCellWrapper, {
|
|
20
|
-
className:
|
|
23
|
+
return ___EmotionJSX(EuiDataGridHeaderCellWrapper, _extends({}, headerCellProps, {
|
|
24
|
+
className: classNames('euiDataGridHeaderCell--controlColumn', headerCellProps === null || headerCellProps === void 0 ? void 0 : headerCellProps.className),
|
|
21
25
|
id: id,
|
|
22
26
|
index: index,
|
|
23
27
|
width: width,
|
|
24
28
|
headerIsInteractive: headerIsInteractive
|
|
25
|
-
}, ___EmotionJSX("div", {
|
|
29
|
+
}), ___EmotionJSX("div", {
|
|
26
30
|
className: "euiDataGridHeaderCell__content"
|
|
27
31
|
}, ___EmotionJSX(HeaderCellRender, null)));
|
|
28
32
|
};
|
|
@@ -34,20 +38,35 @@ EuiDataGridControlHeaderCell.propTypes = {
|
|
|
34
38
|
*/
|
|
35
39
|
id: PropTypes.string.isRequired,
|
|
36
40
|
|
|
41
|
+
/**
|
|
42
|
+
* Width of the column, users are unable to change this
|
|
43
|
+
*/
|
|
44
|
+
width: PropTypes.number.isRequired,
|
|
45
|
+
|
|
37
46
|
/**
|
|
38
47
|
* Component to render in the column header
|
|
39
48
|
*/
|
|
40
49
|
headerCellRender: PropTypes.elementType.isRequired,
|
|
41
50
|
|
|
51
|
+
/**
|
|
52
|
+
* Optional props to pass to the column header cell
|
|
53
|
+
*/
|
|
54
|
+
headerCellProps: PropTypes.any,
|
|
55
|
+
|
|
42
56
|
/**
|
|
43
57
|
* Component to render for each row in the column
|
|
44
58
|
*/
|
|
45
59
|
rowCellRender: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.func.isRequired]).isRequired,
|
|
46
60
|
|
|
47
61
|
/**
|
|
48
|
-
*
|
|
62
|
+
* Component to render in the optional column footer
|
|
63
|
+
*/
|
|
64
|
+
footerCellRender: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.func.isRequired]),
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Optional props to pass to the column footer cell
|
|
49
68
|
*/
|
|
50
|
-
|
|
69
|
+
footerCellProps: PropTypes.any
|
|
51
70
|
}).isRequired,
|
|
52
71
|
headerIsInteractive: PropTypes.bool.isRequired
|
|
53
72
|
};
|