@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.
- package/dist/eui_charts_theme.js +1 -1
- package/dist/eui_charts_theme.js.map +1 -1
- package/dist/eui_theme_dark.css +29 -94
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +29 -94
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/avatar/avatar.js +1 -1
- package/es/components/badge/badge.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_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/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +2 -2
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +2 -2
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +2 -2
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +3 -3
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +1 -1
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +4 -4
- 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/datagrid/body/data_grid_body.js +13 -13
- package/es/components/datagrid/body/data_grid_body_custom.js +13 -13
- package/es/components/datagrid/body/data_grid_body_virtualized.js +13 -13
- package/es/components/datagrid/body/data_grid_cell.js +100 -73
- package/es/components/datagrid/body/data_grid_cell_actions.js +7 -2
- package/es/components/datagrid/body/header/data_grid_header_cell.js +12 -12
- package/es/components/datagrid/body/header/data_grid_header_row.js +13 -13
- package/es/components/datagrid/controls/column_sorting_draggable.js +1 -1
- package/es/components/datagrid/data_grid.js +13 -13
- package/es/components/datagrid/utils/in_memory.js +12 -12
- package/es/components/datagrid/utils/row_heights.js +12 -17
- package/es/components/date_picker/date_picker.js +2 -2
- package/es/components/date_picker/date_picker_range.js +1 -1
- package/es/components/empty_prompt/empty_prompt.js +1 -1
- 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/header_logo.js +1 -1
- package/es/components/header/header_section/header_section_item_button.js +1 -1
- package/es/components/icon/assets/tokenVectorDense.js +37 -0
- package/es/components/icon/assets/{tokenDenseVector.js → tokenVectorSparse.js} +7 -3
- package/es/components/icon/icon.js +1 -1
- package/es/components/icon/icon_map.js +5 -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 +1 -1
- 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/provider/provider.js +3 -3
- 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/table/table_header_button.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/token/token_map.js +12 -4
- package/es/components/tool_tip/icon_tip.js +1 -1
- package/es/services/emotion/css.js +28 -0
- package/es/services/emotion/index.js +2 -1
- package/es/services/emotion/prefixer.js +93 -0
- package/es/services/theme/provider.js +8 -7
- package/es/services/theme/utils.js +1 -1
- package/eui.d.ts +65 -21
- package/i18ntokens.json +10 -10
- package/lib/components/avatar/avatar.js +1 -1
- package/lib/components/badge/badge.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_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/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +2 -2
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +2 -2
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +2 -2
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +3 -3
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +1 -1
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +4 -4
- 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/datagrid/body/data_grid_body.js +13 -13
- package/lib/components/datagrid/body/data_grid_body_custom.js +13 -13
- package/lib/components/datagrid/body/data_grid_body_virtualized.js +13 -13
- package/lib/components/datagrid/body/data_grid_cell.js +100 -73
- package/lib/components/datagrid/body/data_grid_cell_actions.js +8 -2
- package/lib/components/datagrid/body/header/data_grid_header_cell.js +12 -12
- package/lib/components/datagrid/body/header/data_grid_header_row.js +13 -13
- package/lib/components/datagrid/controls/column_sorting_draggable.js +1 -1
- package/lib/components/datagrid/data_grid.js +13 -13
- package/lib/components/datagrid/utils/in_memory.js +12 -12
- package/lib/components/datagrid/utils/row_heights.js +12 -17
- package/lib/components/date_picker/date_picker.js +2 -2
- package/lib/components/date_picker/date_picker_range.js +1 -1
- package/lib/components/empty_prompt/empty_prompt.js +1 -1
- 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/header_logo.js +1 -1
- package/lib/components/header/header_section/header_section_item_button.js +1 -1
- package/lib/components/icon/assets/tokenVectorDense.js +45 -0
- package/lib/components/icon/assets/{tokenDenseVector.js → tokenVectorSparse.js} +7 -3
- package/lib/components/icon/icon.js +1 -1
- package/lib/components/icon/icon_map.js +5 -2
- package/lib/components/icon/svgs/tokens/tokenVectorDense.svg +5 -0
- package/lib/components/icon/svgs/tokens/tokenVectorSparse.svg +5 -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 +1 -1
- 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/provider/provider.js +3 -3
- 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/table/table_header_button.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/token/token_map.js +12 -4
- package/lib/components/tool_tip/icon_tip.js +1 -1
- package/lib/services/emotion/css.js +36 -0
- package/lib/services/emotion/index.js +11 -0
- package/lib/services/emotion/prefixer.js +99 -0
- package/lib/services/theme/provider.js +8 -7
- package/lib/services/theme/utils.js +1 -1
- package/optimize/es/components/datagrid/body/data_grid_cell.js +67 -47
- package/optimize/es/components/datagrid/body/data_grid_cell_actions.js +7 -2
- package/optimize/es/components/datagrid/utils/row_heights.js +12 -17
- package/optimize/es/components/icon/assets/tokenVectorDense.js +36 -0
- package/optimize/es/components/icon/assets/{tokenDenseVector.js → tokenVectorSparse.js} +7 -3
- package/optimize/es/components/icon/icon_map.js +5 -2
- package/optimize/es/components/provider/provider.js +3 -3
- package/optimize/es/components/token/token_map.js +12 -4
- package/optimize/es/services/emotion/css.js +28 -0
- package/optimize/es/services/emotion/index.js +2 -1
- package/optimize/es/services/emotion/prefixer.js +93 -0
- package/optimize/es/services/theme/provider.js +8 -7
- package/optimize/es/services/theme/utils.js +1 -1
- package/optimize/lib/components/datagrid/body/data_grid_cell.js +67 -47
- package/optimize/lib/components/datagrid/body/data_grid_cell_actions.js +7 -2
- package/optimize/lib/components/datagrid/utils/row_heights.js +12 -17
- package/optimize/lib/components/icon/assets/tokenVectorDense.js +45 -0
- package/optimize/lib/components/icon/assets/{tokenDenseVector.js → tokenVectorSparse.js} +7 -3
- package/optimize/lib/components/icon/icon_map.js +5 -2
- package/optimize/lib/components/icon/svgs/tokens/tokenVectorDense.svg +5 -0
- package/optimize/lib/components/icon/svgs/tokens/tokenVectorSparse.svg +5 -0
- package/optimize/lib/components/provider/provider.js +3 -3
- package/optimize/lib/components/token/token_map.js +12 -4
- package/optimize/lib/services/emotion/css.js +36 -0
- package/optimize/lib/services/emotion/index.js +11 -0
- package/optimize/lib/services/emotion/prefixer.js +99 -0
- package/optimize/lib/services/theme/provider.js +8 -7
- package/optimize/lib/services/theme/utils.js +1 -1
- package/package.json +4 -9
- package/src/components/datagrid/_data_grid_data_row.scss +40 -71
- package/src/components/datagrid/_mixins.scss +0 -15
- package/test-env/components/avatar/avatar.js +1 -1
- package/test-env/components/badge/badge.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_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/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +2 -2
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +2 -2
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +2 -2
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +3 -3
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +1 -1
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +4 -4
- 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/datagrid/body/data_grid_body.js +13 -13
- package/test-env/components/datagrid/body/data_grid_body_custom.js +13 -13
- package/test-env/components/datagrid/body/data_grid_body_virtualized.js +13 -13
- package/test-env/components/datagrid/body/data_grid_cell.js +100 -73
- package/test-env/components/datagrid/body/data_grid_cell_actions.js +7 -2
- package/test-env/components/datagrid/body/header/data_grid_header_cell.js +12 -12
- package/test-env/components/datagrid/body/header/data_grid_header_row.js +13 -13
- package/test-env/components/datagrid/controls/column_sorting_draggable.js +1 -1
- package/test-env/components/datagrid/data_grid.js +13 -13
- package/test-env/components/datagrid/utils/in_memory.js +12 -12
- package/test-env/components/datagrid/utils/row_heights.js +12 -17
- package/test-env/components/date_picker/date_picker.js +2 -2
- package/test-env/components/date_picker/date_picker_range.js +1 -1
- package/test-env/components/empty_prompt/empty_prompt.js +1 -1
- 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/header_logo.js +1 -1
- package/test-env/components/header/header_section/header_section_item_button.js +1 -1
- package/test-env/components/icon/assets/tokenVectorDense.js +45 -0
- package/test-env/components/icon/assets/{tokenDenseVector.js → tokenVectorSparse.js} +7 -3
- package/test-env/components/icon/icon_map.js +5 -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 +1 -1
- 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/provider/provider.js +3 -3
- 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/table/table_header_button.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/token/token_map.js +12 -4
- package/test-env/components/tool_tip/icon_tip.js +1 -1
- package/test-env/services/emotion/css.js +36 -0
- package/test-env/services/emotion/index.js +11 -0
- package/test-env/services/emotion/prefixer.js +99 -0
- package/test-env/services/theme/provider.js +8 -7
- package/test-env/services/theme/utils.js +1 -1
- package/lib/components/icon/svgs/tokens/tokenDenseVector.svg +0 -3
- package/optimize/lib/components/icon/svgs/tokens/tokenDenseVector.svg +0 -3
|
@@ -7,7 +7,7 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
8
|
import _extends from "@babel/runtime/helpers/extends";
|
|
9
9
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
10
|
-
var _excluded = ["renderCellValue", "column", "setCellContentsRef", "
|
|
10
|
+
var _excluded = ["renderCellValue", "column", "setCellContentsRef", "setPopoverAnchorRef", "rowIndex", "colIndex", "ariaRowIndex", "rowHeight", "rowHeightUtils", "isControlColumn", "isFocused", "cellHeightType", "cellActions"],
|
|
11
11
|
_excluded2 = ["width", "popoverContext", "interactiveCellId", "columnType", "className", "column", "style", "rowHeightUtils", "rowHeightsOptions", "rowManager", "pagination"],
|
|
12
12
|
_excluded3 = ["isExpandable", "style", "className", "data-test-subj"];
|
|
13
13
|
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; }
|
|
@@ -30,6 +30,7 @@ import { keys } from '../../../services';
|
|
|
30
30
|
import { EuiScreenReaderOnly } from '../../accessibility';
|
|
31
31
|
import { EuiFocusTrap } from '../../focus_trap';
|
|
32
32
|
import { EuiI18n } from '../../i18n';
|
|
33
|
+
import { EuiTextBlockTruncate } from '../../text_truncate';
|
|
33
34
|
import { hasResizeObserver } from '../../observer/resize_observer/resize_observer';
|
|
34
35
|
import { DataGridFocusContext } from '../utils/focus';
|
|
35
36
|
import { EuiDataGridCellActions, EuiDataGridCellPopoverActions } from './data_grid_cell_actions';
|
|
@@ -40,28 +41,52 @@ var EuiDataGridCellContent = /*#__PURE__*/memo(function (_ref) {
|
|
|
40
41
|
var renderCellValue = _ref.renderCellValue,
|
|
41
42
|
column = _ref.column,
|
|
42
43
|
setCellContentsRef = _ref.setCellContentsRef,
|
|
43
|
-
|
|
44
|
+
setPopoverAnchorRef = _ref.setPopoverAnchorRef,
|
|
44
45
|
rowIndex = _ref.rowIndex,
|
|
45
46
|
colIndex = _ref.colIndex,
|
|
46
47
|
ariaRowIndex = _ref.ariaRowIndex,
|
|
48
|
+
rowHeight = _ref.rowHeight,
|
|
47
49
|
rowHeightUtils = _ref.rowHeightUtils,
|
|
48
|
-
|
|
50
|
+
isControlColumn = _ref.isControlColumn,
|
|
49
51
|
isFocused = _ref.isFocused,
|
|
52
|
+
cellHeightType = _ref.cellHeightType,
|
|
53
|
+
cellActions = _ref.cellActions,
|
|
50
54
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
51
55
|
// React is more permissible than the TS types indicate
|
|
52
56
|
var CellElement = renderCellValue;
|
|
53
|
-
|
|
54
|
-
|
|
57
|
+
var wrapperClasses = classNames('euiDataGridRowCell__contentWrapper', "euiDataGridRowCell__".concat(cellHeightType, "Height"));
|
|
58
|
+
var classes = classNames('euiDataGridRowCell__content', !isControlColumn && {
|
|
59
|
+
'eui-textBreakWord': cellHeightType !== 'default',
|
|
60
|
+
'eui-textTruncate': cellHeightType === 'default'
|
|
61
|
+
});
|
|
62
|
+
var cellContent = ___EmotionJSX("div", {
|
|
63
|
+
ref: function ref(el) {
|
|
64
|
+
setCellContentsRef(el);
|
|
65
|
+
setPopoverAnchorRef.current = cellHeightType === 'default' ? // Default height cells need the popover to be anchored on the wrapper,
|
|
66
|
+
// in order for the popover to centered on the full cell width (as content
|
|
67
|
+
// width is affected by the width of cell actions)
|
|
68
|
+
el === null || el === void 0 ? void 0 : el.parentElement :
|
|
69
|
+
// Numerical height cells need the popover anchor to be below the wrapper
|
|
70
|
+
// class, in order to set height: 100% on the portalled popover div wrappers
|
|
71
|
+
el;
|
|
72
|
+
},
|
|
55
73
|
"data-datagrid-cellcontent": true,
|
|
56
|
-
className:
|
|
57
|
-
style: isDefinedHeight ? rowHeightUtils === null || rowHeightUtils === void 0 ? void 0 : rowHeightUtils.getStylesForCell(rowHeightsOptions, rowIndex) : {}
|
|
74
|
+
className: classes
|
|
58
75
|
}, ___EmotionJSX(CellElement, _extends({
|
|
59
76
|
isDetails: false,
|
|
60
77
|
"data-test-subj": "cell-content",
|
|
61
78
|
rowIndex: rowIndex,
|
|
62
79
|
colIndex: colIndex,
|
|
63
80
|
schema: (column === null || column === void 0 ? void 0 : column.schema) || rest.columnType
|
|
64
|
-
}, rest)))
|
|
81
|
+
}, rest)));
|
|
82
|
+
if (cellHeightType === 'lineCount' && !isControlColumn) {
|
|
83
|
+
var lines = rowHeightUtils.getLineCount(rowHeight);
|
|
84
|
+
cellContent = ___EmotionJSX(EuiTextBlockTruncate, {
|
|
85
|
+
lines: lines,
|
|
86
|
+
cloneElement: true
|
|
87
|
+
}, cellContent);
|
|
88
|
+
}
|
|
89
|
+
var screenReaderText = ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("p", {
|
|
65
90
|
hidden: !isFocused
|
|
66
91
|
}, '- ', ___EmotionJSX(EuiI18n, {
|
|
67
92
|
token: "euiDataGridCell.position",
|
|
@@ -71,7 +96,10 @@ var EuiDataGridCellContent = /*#__PURE__*/memo(function (_ref) {
|
|
|
71
96
|
col: colIndex + 1,
|
|
72
97
|
row: ariaRowIndex
|
|
73
98
|
}
|
|
74
|
-
})))
|
|
99
|
+
})));
|
|
100
|
+
return ___EmotionJSX("div", {
|
|
101
|
+
className: wrapperClasses
|
|
102
|
+
}, cellContent, screenReaderText, cellActions);
|
|
75
103
|
});
|
|
76
104
|
export var EuiDataGridCell = /*#__PURE__*/function (_Component) {
|
|
77
105
|
_inherits(EuiDataGridCell, _Component);
|
|
@@ -521,24 +549,43 @@ export var EuiDataGridCell = /*#__PURE__*/function (_Component) {
|
|
|
521
549
|
}
|
|
522
550
|
}
|
|
523
551
|
};
|
|
524
|
-
var
|
|
552
|
+
var rowHeight = rowHeightUtils === null || rowHeightUtils === void 0 ? void 0 : rowHeightUtils.getRowHeightOption(rowIndex, rowHeightsOptions);
|
|
553
|
+
var cellHeightType = (rowHeightUtils === null || rowHeightUtils === void 0 ? void 0 : rowHeightUtils.getHeightType(rowHeight)) || 'default';
|
|
525
554
|
var cellContentProps = _objectSpread(_objectSpread({}, rest), {}, {
|
|
526
555
|
setCellProps: this.setCellProps,
|
|
527
556
|
column: column,
|
|
528
557
|
columnType: columnType,
|
|
558
|
+
cellHeightType: cellHeightType,
|
|
529
559
|
isExpandable: isExpandable,
|
|
530
560
|
isExpanded: popoverIsOpen,
|
|
531
561
|
isDetails: false,
|
|
532
562
|
isFocused: this.state.isFocused,
|
|
533
563
|
setCellContentsRef: this.setCellContentsRef,
|
|
534
|
-
|
|
564
|
+
setPopoverAnchorRef: this.popoverAnchorRef,
|
|
565
|
+
rowHeight: rowHeight,
|
|
535
566
|
rowHeightUtils: rowHeightUtils,
|
|
536
|
-
|
|
567
|
+
isControlColumn: cellClasses.includes('euiDataGridRowCell--controlColumn'),
|
|
537
568
|
ariaRowIndex: ariaRowIndex
|
|
538
569
|
});
|
|
539
|
-
var
|
|
540
|
-
|
|
541
|
-
|
|
570
|
+
var cellActions = showCellActions && ___EmotionJSX(EuiDataGridCellActions, {
|
|
571
|
+
rowIndex: rowIndex,
|
|
572
|
+
colIndex: colIndex,
|
|
573
|
+
column: column,
|
|
574
|
+
cellHeightType: cellHeightType,
|
|
575
|
+
onExpandClick: function onExpandClick() {
|
|
576
|
+
if (popoverIsOpen) {
|
|
577
|
+
closeCellPopover();
|
|
578
|
+
} else {
|
|
579
|
+
openCellPopover({
|
|
580
|
+
rowIndex: visibleRowIndex,
|
|
581
|
+
colIndex: colIndex
|
|
582
|
+
});
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
});
|
|
586
|
+
var cellContent = isExpandable ? ___EmotionJSX(EuiDataGridCellContent, _extends({}, cellContentProps, {
|
|
587
|
+
cellActions: cellActions
|
|
588
|
+
})) : ___EmotionJSX(EuiFocusTrap, {
|
|
542
589
|
disabled: !this.state.isEntered,
|
|
543
590
|
autoFocus: true,
|
|
544
591
|
onDeactivation: function onDeactivation() {
|
|
@@ -547,35 +594,8 @@ export var EuiDataGridCell = /*#__PURE__*/function (_Component) {
|
|
|
547
594
|
}, _this2.preventTabbing);
|
|
548
595
|
},
|
|
549
596
|
clickOutsideDisables: true
|
|
550
|
-
}, ___EmotionJSX(
|
|
551
|
-
|
|
552
|
-
ref: this.popoverAnchorRef
|
|
553
|
-
}, ___EmotionJSX("div", {
|
|
554
|
-
className: expandClass
|
|
555
|
-
}, ___EmotionJSX(EuiDataGridCellContent, cellContentProps))));
|
|
556
|
-
if (isExpandable) {
|
|
557
|
-
innerContent = ___EmotionJSX("div", {
|
|
558
|
-
className: anchorClass,
|
|
559
|
-
ref: this.popoverAnchorRef
|
|
560
|
-
}, ___EmotionJSX("div", {
|
|
561
|
-
className: expandClass
|
|
562
|
-
}, ___EmotionJSX(EuiDataGridCellContent, cellContentProps)), showCellActions && ___EmotionJSX(EuiDataGridCellActions, {
|
|
563
|
-
rowIndex: rowIndex,
|
|
564
|
-
colIndex: colIndex,
|
|
565
|
-
column: column,
|
|
566
|
-
onExpandClick: function onExpandClick() {
|
|
567
|
-
if (popoverIsOpen) {
|
|
568
|
-
closeCellPopover();
|
|
569
|
-
} else {
|
|
570
|
-
openCellPopover({
|
|
571
|
-
rowIndex: visibleRowIndex,
|
|
572
|
-
colIndex: colIndex
|
|
573
|
-
});
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
|
-
}));
|
|
577
|
-
}
|
|
578
|
-
var content = ___EmotionJSX("div", _extends({
|
|
597
|
+
}, ___EmotionJSX(EuiDataGridCellContent, cellContentProps));
|
|
598
|
+
var cell = ___EmotionJSX("div", _extends({
|
|
579
599
|
role: "gridcell",
|
|
580
600
|
"aria-rowindex": ariaRowIndex,
|
|
581
601
|
tabIndex: this.state.isFocused && !this.state.disableCellTabIndex ? 0 : -1,
|
|
@@ -605,14 +625,14 @@ export var EuiDataGridCell = /*#__PURE__*/function (_Component) {
|
|
|
605
625
|
});
|
|
606
626
|
},
|
|
607
627
|
onBlur: this.onBlur
|
|
608
|
-
}),
|
|
609
|
-
return rowManager && !IS_JEST_ENVIRONMENT ? /*#__PURE__*/createPortal(
|
|
628
|
+
}), cellContent);
|
|
629
|
+
return rowManager && !IS_JEST_ENVIRONMENT ? /*#__PURE__*/createPortal(cell, rowManager.getRow({
|
|
610
630
|
rowIndex: rowIndex,
|
|
611
631
|
visibleRowIndex: visibleRowIndex,
|
|
612
632
|
top: style.top,
|
|
613
633
|
// comes in as a `{float}px` string from react-window
|
|
614
634
|
height: style.height // comes in as an integer from react-window
|
|
615
|
-
})) :
|
|
635
|
+
})) : cell;
|
|
616
636
|
}
|
|
617
637
|
}]);
|
|
618
638
|
return EuiDataGridCell;
|
|
@@ -15,12 +15,14 @@ import { EuiButtonIcon } from '../../button/button_icon';
|
|
|
15
15
|
import { EuiButtonEmpty } from '../../button/button_empty';
|
|
16
16
|
import { EuiFlexGroup, EuiFlexItem } from '../../flex';
|
|
17
17
|
import { EuiPopoverFooter } from '../../popover';
|
|
18
|
+
import classNames from 'classnames';
|
|
18
19
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
19
20
|
export var EuiDataGridCellActions = function EuiDataGridCellActions(_ref) {
|
|
20
21
|
var onExpandClick = _ref.onExpandClick,
|
|
21
22
|
column = _ref.column,
|
|
22
23
|
rowIndex = _ref.rowIndex,
|
|
23
|
-
colIndex = _ref.colIndex
|
|
24
|
+
colIndex = _ref.colIndex,
|
|
25
|
+
cellHeightType = _ref.cellHeightType;
|
|
24
26
|
// Note: The cell expand button/expansion popover is *always* rendered if
|
|
25
27
|
// column.cellActions is present (regardless of column.isExpandable).
|
|
26
28
|
// This is because cell actions are not otherwise accessible to keyboard
|
|
@@ -67,8 +69,11 @@ export var EuiDataGridCellActions = function EuiDataGridCellActions(_ref) {
|
|
|
67
69
|
});
|
|
68
70
|
});
|
|
69
71
|
}, [column, colIndex, rowIndex]);
|
|
72
|
+
var classes = classNames('euiDataGridRowCell__actions', {
|
|
73
|
+
'euiDataGridRowCell__actions--overlay': cellHeightType !== 'default'
|
|
74
|
+
});
|
|
70
75
|
return ___EmotionJSX("div", {
|
|
71
|
-
className:
|
|
76
|
+
className: classes
|
|
72
77
|
}, [].concat(_toConsumableArray(additionalButtons), [expandButton]));
|
|
73
78
|
};
|
|
74
79
|
export var EuiDataGridCellPopoverActions = function EuiDataGridCellPopoverActions(_ref2) {
|
|
@@ -41,25 +41,20 @@ export var RowHeightUtils = /*#__PURE__*/function () {
|
|
|
41
41
|
paddingTop: 0,
|
|
42
42
|
paddingBottom: 0
|
|
43
43
|
});
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
/**
|
|
45
|
+
* Height types
|
|
46
|
+
*/
|
|
47
|
+
_defineProperty(this, "getHeightType", function (option) {
|
|
48
|
+
if (option == null) {
|
|
49
|
+
return 'default';
|
|
48
50
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
return {
|
|
52
|
-
WebkitLineClamp: lineCount,
|
|
53
|
-
display: '-webkit-box',
|
|
54
|
-
WebkitBoxOrient: 'vertical',
|
|
55
|
-
height: '100%',
|
|
56
|
-
overflow: 'hidden'
|
|
57
|
-
};
|
|
51
|
+
if (option === AUTO_HEIGHT) {
|
|
52
|
+
return 'auto';
|
|
58
53
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
54
|
+
if (_this.getLineCount(option) != null) {
|
|
55
|
+
return 'lineCount';
|
|
56
|
+
}
|
|
57
|
+
return 'numerical';
|
|
63
58
|
});
|
|
64
59
|
/**
|
|
65
60
|
* Heights cache utils
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["title", "titleId"];
|
|
4
|
+
/*
|
|
5
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
6
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
7
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
8
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
9
|
+
* Side Public License, v 1.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
// THIS IS A GENERATED FILE. DO NOT MODIFY MANUALLY. @see scripts/compile-icons.js
|
|
13
|
+
|
|
14
|
+
import * as React from 'react';
|
|
15
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
16
|
+
var EuiIconTokenVectorDense = function EuiIconTokenVectorDense(_ref) {
|
|
17
|
+
var title = _ref.title,
|
|
18
|
+
titleId = _ref.titleId,
|
|
19
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
20
|
+
return ___EmotionJSX("svg", _extends({
|
|
21
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
22
|
+
width: 16,
|
|
23
|
+
height: 16,
|
|
24
|
+
viewBox: "0 0 16 16",
|
|
25
|
+
"aria-labelledby": titleId
|
|
26
|
+
}, props), title ? ___EmotionJSX("title", {
|
|
27
|
+
id: titleId
|
|
28
|
+
}, title) : null, ___EmotionJSX("path", {
|
|
29
|
+
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"
|
|
30
|
+
}), ___EmotionJSX("path", {
|
|
31
|
+
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"
|
|
32
|
+
}), ___EmotionJSX("path", {
|
|
33
|
+
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"
|
|
34
|
+
}));
|
|
35
|
+
};
|
|
36
|
+
export var icon = EuiIconTokenVectorDense;
|
|
@@ -13,7 +13,7 @@ var _excluded = ["title", "titleId"];
|
|
|
13
13
|
|
|
14
14
|
import * as React from 'react';
|
|
15
15
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
16
|
-
var
|
|
16
|
+
var EuiIconTokenVectorSparse = function EuiIconTokenVectorSparse(_ref) {
|
|
17
17
|
var title = _ref.title,
|
|
18
18
|
titleId = _ref.titleId,
|
|
19
19
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -26,7 +26,11 @@ var EuiIconTokenDenseVector = function EuiIconTokenDenseVector(_ref) {
|
|
|
26
26
|
}, props), title ? ___EmotionJSX("title", {
|
|
27
27
|
id: titleId
|
|
28
28
|
}, title) : null, ___EmotionJSX("path", {
|
|
29
|
-
d: "
|
|
29
|
+
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"
|
|
30
|
+
}), ___EmotionJSX("path", {
|
|
31
|
+
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"
|
|
32
|
+
}), ___EmotionJSX("path", {
|
|
33
|
+
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"
|
|
30
34
|
}));
|
|
31
35
|
};
|
|
32
|
-
export var icon =
|
|
36
|
+
export var icon = EuiIconTokenVectorSparse;
|
|
@@ -446,7 +446,6 @@ export var typeToPathMap = {
|
|
|
446
446
|
tokenCompletionSuggester: 'tokenCompletionSuggester',
|
|
447
447
|
tokenConstant: 'tokenConstant',
|
|
448
448
|
tokenDate: 'tokenDate',
|
|
449
|
-
tokenDenseVector: 'tokenDenseVector',
|
|
450
449
|
tokenElement: 'tokenElement',
|
|
451
450
|
tokenEnum: 'tokenEnum',
|
|
452
451
|
tokenEnumMember: 'tokenEnumMember',
|
|
@@ -489,5 +488,9 @@ export var typeToPathMap = {
|
|
|
489
488
|
tokenTag: 'tokenTag',
|
|
490
489
|
tokenText: 'tokenText',
|
|
491
490
|
tokenTokenCount: 'tokenTokenCount',
|
|
492
|
-
tokenVariable: 'tokenVariable'
|
|
491
|
+
tokenVariable: 'tokenVariable',
|
|
492
|
+
tokenVectorDense: 'tokenVectorDense',
|
|
493
|
+
tokenDenseVector: 'tokenVectorDense',
|
|
494
|
+
// NOTE: This is an undocumented alias for `tokenVectorDense`, added for legacy compatability
|
|
495
|
+
tokenVectorSparse: 'tokenVectorSparse'
|
|
493
496
|
};
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import React from 'react';
|
|
10
|
-
import { cache as fallbackCache } from '@emotion/css';
|
|
11
|
-
import { EuiGlobalStyles } from '../../global_styling/reset/global_styles';
|
|
12
|
-
import { EuiUtilityClasses } from '../../global_styling/utility/utility';
|
|
13
10
|
import { EuiThemeProvider, CurrentEuiBreakpointProvider } from '../../services';
|
|
14
11
|
import { emitEuiProviderWarning } from '../../services/theme/warning';
|
|
12
|
+
import { cache as fallbackCache } from '../../services/emotion/css';
|
|
13
|
+
import { EuiGlobalStyles } from '../../global_styling/reset/global_styles';
|
|
14
|
+
import { EuiUtilityClasses } from '../../global_styling/utility/utility';
|
|
15
15
|
import { EuiThemeAmsterdam } from '../../themes';
|
|
16
16
|
import { EuiCacheProvider } from './cache';
|
|
17
17
|
import { EuiProviderNestedCheck, useIsNestedEuiProvider } from './nested';
|
|
@@ -49,10 +49,6 @@ export var TOKEN_MAP = {
|
|
|
49
49
|
shape: 'square',
|
|
50
50
|
color: 'euiColorVis6'
|
|
51
51
|
},
|
|
52
|
-
tokenDenseVector: {
|
|
53
|
-
shape: 'square',
|
|
54
|
-
color: 'euiColorVis2'
|
|
55
|
-
},
|
|
56
52
|
tokenElement: {
|
|
57
53
|
shape: 'square',
|
|
58
54
|
color: 'euiColorVis3'
|
|
@@ -224,5 +220,17 @@ export var TOKEN_MAP = {
|
|
|
224
220
|
tokenVariable: {
|
|
225
221
|
shape: 'circle',
|
|
226
222
|
color: 'euiColorVis7'
|
|
223
|
+
},
|
|
224
|
+
tokenVectorDense: {
|
|
225
|
+
shape: 'square',
|
|
226
|
+
color: 'euiColorVis5'
|
|
227
|
+
},
|
|
228
|
+
tokenDenseVector: {
|
|
229
|
+
shape: 'square',
|
|
230
|
+
color: 'euiColorVis5'
|
|
231
|
+
},
|
|
232
|
+
tokenVectorSparse: {
|
|
233
|
+
shape: 'square',
|
|
234
|
+
color: 'euiColorVis1'
|
|
227
235
|
}
|
|
228
236
|
};
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
|
|
9
|
+
import createEmotion from '@emotion/css/create-instance';
|
|
10
|
+
import { euiStylisPrefixer } from './prefixer';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* This custom instance is needed for internal EUI components to call
|
|
14
|
+
* `@emotion/css` with EUI's custom prefixer plugin
|
|
15
|
+
* @see https://emotion.sh/docs/@emotion/css#custom-instances
|
|
16
|
+
*
|
|
17
|
+
* NOTE: Usage is currently being beta tested internally,
|
|
18
|
+
* and is not yet intended to be a public export
|
|
19
|
+
*/
|
|
20
|
+
var _createEmotion = createEmotion({
|
|
21
|
+
key: 'css',
|
|
22
|
+
stylisPlugins: [euiStylisPrefixer],
|
|
23
|
+
speedy: false
|
|
24
|
+
}),
|
|
25
|
+
css = _createEmotion.css,
|
|
26
|
+
cx = _createEmotion.cx,
|
|
27
|
+
cache = _createEmotion.cache;
|
|
28
|
+
export { css, cx, cache };
|
|
@@ -0,0 +1,93 @@
|
|
|
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
|
+
|
|
9
|
+
import { charat, DECLARATION, hash, indexof, MOZ, replace, strlen, WEBKIT } from 'stylis';
|
|
10
|
+
|
|
11
|
+
// This is a heavily modified version of Emotion's default `prefixer` plugin
|
|
12
|
+
// (mostly removing unnecessary prefixes), which is in turn a modified version
|
|
13
|
+
// of stylis's default prefixer.
|
|
14
|
+
// @see https://github.com/emotion-js/emotion/blob/main/packages/cache/src/prefixer.js
|
|
15
|
+
/* eslint-disable prefer-template */
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* This is a stylis plugin which handles auto-prefixing CSS output by Emotion.
|
|
19
|
+
*
|
|
20
|
+
* *Please note*: EUI/Elastic targets latest evergreen browsers for support only.
|
|
21
|
+
* @see https://www.elastic.co/support/matrix#matrix_browsers
|
|
22
|
+
*/
|
|
23
|
+
export var euiStylisPrefixer = function euiStylisPrefixer(element) {
|
|
24
|
+
if (element.length > -1) if (!element.return) switch (element.type) {
|
|
25
|
+
case DECLARATION:
|
|
26
|
+
element.return = prefix(element.value, element.length);
|
|
27
|
+
break;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
var prefix = function prefix(value, length) {
|
|
31
|
+
switch (hash(value, length)) {
|
|
32
|
+
/**
|
|
33
|
+
* `-webkit` prefixes
|
|
34
|
+
*/
|
|
35
|
+
// user-select - https://caniuse.com/mdn-css_properties_user-select - needed by Safari
|
|
36
|
+
case 4246:
|
|
37
|
+
// text-decoration - https://caniuse.com/text-decoration - iOS Safari is the main one that needs this
|
|
38
|
+
case 5572:
|
|
39
|
+
// text-size-adjust - https://caniuse.com/text-size-adjust - iOS Safari
|
|
40
|
+
case 2756:
|
|
41
|
+
// box-decoration-break - https://caniuse.com/css-boxdecorationbreak - Chrome & Safari
|
|
42
|
+
case 3005:
|
|
43
|
+
// mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite - Chrome
|
|
44
|
+
case 6391:
|
|
45
|
+
case 5879:
|
|
46
|
+
case 5623:
|
|
47
|
+
case 6135:
|
|
48
|
+
case 4599:
|
|
49
|
+
case 4855:
|
|
50
|
+
// print-color-adjust - https://caniuse.com/css-color-adjust - Chrome
|
|
51
|
+
case 2282:
|
|
52
|
+
return WEBKIT + value + value;
|
|
53
|
+
|
|
54
|
+
// background-clip - https://caniuse.com/background-clip-text - Chrome, only for `text` value
|
|
55
|
+
case 4215:
|
|
56
|
+
if (~indexof(value, 'text')) {
|
|
57
|
+
return WEBKIT + value + value;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Intrinsic/extrinsic sizing value prefixes
|
|
62
|
+
* `stretch` alternatives needed by Chrome & Firefox - https://caniuse.com/intrinsic-width
|
|
63
|
+
*/
|
|
64
|
+
// (min|max)?(width|height|inline-size|block-size)
|
|
65
|
+
case 8116:
|
|
66
|
+
case 7059:
|
|
67
|
+
case 5753:
|
|
68
|
+
case 5535:
|
|
69
|
+
case 5445:
|
|
70
|
+
case 5701:
|
|
71
|
+
case 4933:
|
|
72
|
+
case 4677:
|
|
73
|
+
case 5533:
|
|
74
|
+
case 5789:
|
|
75
|
+
case 5021:
|
|
76
|
+
case 4765:
|
|
77
|
+
// stretch, max-content, min-content, fill-available
|
|
78
|
+
if (strlen(value) - 1 - length > 6) switch (charat(value, length + 1)) {
|
|
79
|
+
// (f)ill-available
|
|
80
|
+
case 102:
|
|
81
|
+
if (~indexof(value, 'fill-available')) {
|
|
82
|
+
return replace(value, /(.+:)(.+)-([^]+)/, '$1' + WEBKIT + '$2-$3' + '$1' + MOZ + (charat(value, length + 3) === 108 ? '$3' : '$2-$3'));
|
|
83
|
+
}
|
|
84
|
+
// (s)tretch
|
|
85
|
+
case 115:
|
|
86
|
+
if (~indexof(value, 'stretch')) {
|
|
87
|
+
return prefix(replace(value, 'stretch', 'fill-available'), length) + value;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
return value;
|
|
93
|
+
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
4
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
5
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
5
6
|
import { css as _css } from "@emotion/react";
|
|
6
7
|
var _excluded = ["cloneElement", "className"];
|
|
8
|
+
var _templateObject;
|
|
7
9
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8
10
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9
11
|
/*
|
|
@@ -15,11 +17,10 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
15
17
|
*/
|
|
16
18
|
|
|
17
19
|
import React, { useContext, useEffect, useRef, useMemo, useState, useCallback } from 'react';
|
|
18
|
-
import classNames from 'classnames';
|
|
19
|
-
import { css } from '@emotion/css';
|
|
20
20
|
import { Global } from '@emotion/react';
|
|
21
21
|
import isEqual from 'lodash/isEqual';
|
|
22
22
|
import { cloneElementWithCss } from '../emotion';
|
|
23
|
+
import { css, cx } from '../emotion/css';
|
|
23
24
|
import { EuiSystemContext, EuiThemeContext, EuiNestedThemeContext, EuiModificationsContext, EuiColorModeContext } from './context';
|
|
24
25
|
import { EuiEmotionThemeProvider } from './emotion';
|
|
25
26
|
import { buildTheme, getColorMode, getComputed, mergeDeep } from './utils';
|
|
@@ -104,13 +105,13 @@ export var EuiThemeProvider = function EuiThemeProvider(_ref) {
|
|
|
104
105
|
// The theme that determines the global body styles
|
|
105
106
|
bodyColor: isGlobalTheme ? theme.colors.text : bodyColor,
|
|
106
107
|
hasDifferentColorFromGlobalTheme: isGlobalTheme ? false : bodyColor !== theme.colors.text,
|
|
107
|
-
colorClassName:
|
|
108
|
+
colorClassName: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n label: euiColorMode-", ";\n color: ", ";\n "])), _colorMode || colorMode, theme.colors.text),
|
|
108
109
|
setGlobalCSSVariables: isGlobalTheme ? setThemeCSSVariables : setGlobalCSSVariables,
|
|
109
110
|
globalCSSVariables: isGlobalTheme ? themeCSSVariables : globalCSSVariables,
|
|
110
111
|
setNearestThemeCSSVariables: setThemeCSSVariables,
|
|
111
112
|
themeCSSVariables: themeCSSVariables
|
|
112
113
|
};
|
|
113
|
-
}, [theme, isGlobalTheme, bodyColor, _colorMode, setGlobalCSSVariables, globalCSSVariables, setThemeCSSVariables, themeCSSVariables]);
|
|
114
|
+
}, [theme, isGlobalTheme, bodyColor, _colorMode, colorMode, setGlobalCSSVariables, globalCSSVariables, setThemeCSSVariables, themeCSSVariables]);
|
|
114
115
|
var renderedChildren = useMemo(function () {
|
|
115
116
|
if (isGlobalTheme) {
|
|
116
117
|
return children; // No wrapper
|
|
@@ -121,7 +122,7 @@ export var EuiThemeProvider = function EuiThemeProvider(_ref) {
|
|
|
121
122
|
className = _ref2.className,
|
|
122
123
|
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
123
124
|
var props = _objectSpread(_objectSpread({}, rest), {}, {
|
|
124
|
-
className:
|
|
125
|
+
className: cx(className, nestedThemeContext.colorClassName)
|
|
125
126
|
});
|
|
126
127
|
// Condition avoids rendering an empty Emotion selector if no
|
|
127
128
|
// theme-specific CSS variables have been set by child components
|
|
@@ -132,11 +133,11 @@ export var EuiThemeProvider = function EuiThemeProvider(_ref) {
|
|
|
132
133
|
}
|
|
133
134
|
if (cloneElement) {
|
|
134
135
|
return cloneElementWithCss(children, _objectSpread(_objectSpread({}, props), {}, {
|
|
135
|
-
className:
|
|
136
|
+
className: cx(children.props.className, props.className)
|
|
136
137
|
}));
|
|
137
138
|
} else {
|
|
138
139
|
return ___EmotionJSX("span", _extends({}, props, {
|
|
139
|
-
className:
|
|
140
|
+
className: cx('euiThemeProvider', props.className)
|
|
140
141
|
}), children);
|
|
141
142
|
}
|
|
142
143
|
}, [isGlobalTheme, themeCSSVariables, nestedThemeContext, wrapperProps, children]);
|
|
@@ -35,7 +35,7 @@ export var isInverseColorMode = function isInverseColorMode(colorMode) {
|
|
|
35
35
|
/**
|
|
36
36
|
* Returns the color mode configured in the current EuiThemeProvider.
|
|
37
37
|
* Returns the parent color mode if none is explicity set.
|
|
38
|
-
* @param {string}
|
|
38
|
+
* @param {string} colorMode - `light`, `dark`, or `inverse`
|
|
39
39
|
* @param {string} parentColorMode - `LIGHT` or `DARK`; used as the fallback
|
|
40
40
|
*/
|
|
41
41
|
export var getColorMode = function getColorMode(colorMode, parentColorMode) {
|