UNPKG

@elastic/eui

Version:

Elastic UI Component Library

358 lines (352 loc) 26.6 kB
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } var _excluded = ["children", "align", "onSort", "isSorted", "isSortAscending", "className", "scope", "mobileOptions", "width", "minWidth", "maxWidth", "style", "readOnly", "tooltipProps", "description", "append", "sticky"]; function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } import PropTypes from "prop-types"; function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License * 2.0 and the Server Side Public License, v 1; you may not use this file except * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ import React, { useEffect, useCallback, useRef } from 'react'; import classNames from 'classnames'; import { useEuiMemoizedStyles, LEFT_ALIGNMENT } from '../../services'; import { EuiI18n } from '../i18n'; import { EuiScreenReaderOnly } from '../accessibility'; import { EuiIcon } from '../icon'; import { EuiInnerText } from '../inner_text'; import { EuiIconTip, EuiToolTip } from '../tool_tip'; import { resolveWidthPropsAsStyle } from './utils'; import { useEuiTableIsResponsive } from './mobile/responsive_context'; import { EuiTableCellContent } from './_table_cell_content'; import { euiTableHeaderFooterCellStyles, _useEuiTableStickyCellStyles } from './table_cells_shared.styles'; import { useEuiTableColumnDataStore } from './store/provider'; import { useEuiTableWithinStickyHeader } from './sticky_header'; import { useEuiTableStoreUniqueColumnId } from './store/use_unique_column_id'; import { jsx as ___EmotionJSX } from "@emotion/react"; var CellContents = function CellContents(_ref) { var className = _ref.className, align = _ref.align, tooltipProps = _ref.tooltipProps, description = _ref.description, children = _ref.children, canSort = _ref.canSort, isSorted = _ref.isSorted, isSortAscending = _ref.isSortAscending; var tooltipIcon = tooltipProps ? canSort ? ___EmotionJSX(EuiIcon, _extends({ className: "euiTableSortIcon", type: tooltipProps.icon || 'question', size: "m", color: "subdued" }, tooltipProps.iconProps)) : ___EmotionJSX(EuiIconTip, _extends({ content: tooltipProps.content, type: tooltipProps.icon || 'question', size: "m", color: "subdued", position: "top", iconProps: _objectSpread({ role: 'button' }, tooltipProps.iconProps) }, tooltipProps.tooltipProps)) : null; return ___EmotionJSX(EuiTableCellContent, { className: className, align: align, textOnly: false, truncateText: null }, ___EmotionJSX(EuiInnerText, null, function (ref, innerText) { return ___EmotionJSX(EuiI18n, { token: "euiTableHeaderCell.titleTextWithDesc", default: "{innerText}; {description}", values: { innerText: innerText, description: description } }, function (titleTextWithDesc) { return ___EmotionJSX("span", { title: description ? titleTextWithDesc : innerText, ref: ref, className: "eui-textTruncate" }, children); }); }), description && ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("span", null, description)), tooltipIcon, isSorted ? ___EmotionJSX(EuiIcon, { className: "euiTableSortIcon", type: isSortAscending ? 'sortUp' : 'sortDown', size: "m" }) : canSort ? ___EmotionJSX(EuiIcon, { className: "euiTableSortIcon euiTableSortIcon--sortable", type: "sortable", size: "m", color: "subdued" // Tinted a bit further via CSS }) : null); }; export var EuiTableHeaderCell = function EuiTableHeaderCell(_ref2) { var children = _ref2.children, _ref2$align = _ref2.align, align = _ref2$align === void 0 ? LEFT_ALIGNMENT : _ref2$align, onSort = _ref2.onSort, isSorted = _ref2.isSorted, isSortAscending = _ref2.isSortAscending, className = _ref2.className, scope = _ref2.scope, mobileOptions = _ref2.mobileOptions, width = _ref2.width, minWidth = _ref2.minWidth, maxWidth = _ref2.maxWidth, _style = _ref2.style, readOnly = _ref2.readOnly, tooltipProps = _ref2.tooltipProps, description = _ref2.description, append = _ref2.append, sticky = _ref2.sticky, rest = _objectWithoutProperties(_ref2, _excluded); var selfRef = useRef(null); var storeCellId = useEuiTableStoreUniqueColumnId(); var store = useEuiTableColumnDataStore(); var isWithinStickyHeader = useEuiTableWithinStickyHeader(); var styles = useEuiMemoizedStyles(euiTableHeaderFooterCellStyles); var stickyStyles = _useEuiTableStickyCellStyles(sticky); var isResponsive = useEuiTableIsResponsive(); var hideForDesktop = !isResponsive && (mobileOptions === null || mobileOptions === void 0 ? void 0 : mobileOptions.only); var hideForMobile = isResponsive && (mobileOptions === null || mobileOptions === void 0 ? void 0 : mobileOptions.show) === false; var renderHeaderCellRef = useRef(); renderHeaderCellRef.current = function (extraProps) { if (hideForDesktop || hideForMobile) return null; var classes = classNames('euiTableHeaderCell', className); var cssStyles = [styles.euiTableHeaderCell, !isResponsive && stickyStyles]; var inlineWidthStyles = resolveWidthPropsAsStyle(_style, { width: width, minWidth: minWidth, maxWidth: maxWidth }); var CellComponent = children ? 'th' : 'td'; var cellScope = CellComponent === 'th' ? scope !== null && scope !== void 0 ? scope : 'col' : undefined; // `scope` is only valid on `th` elements var canSort = !!(onSort && !readOnly); var ariaSortValue; if (isSorted) { ariaSortValue = isSortAscending ? 'ascending' : 'descending'; } else if (canSort) { ariaSortValue = 'none'; } var cellContentsProps = { css: styles.euiTableHeaderCell__content, align: align, tooltipProps: tooltipProps, description: description, canSort: canSort, isSorted: isSorted, isSortAscending: isSortAscending, children: children }; return ___EmotionJSX(CellComponent, _extends({ css: cssStyles, className: classes, scope: cellScope, role: "columnheader", "aria-sort": ariaSortValue, "data-sticky": !isResponsive && (sticky === null || sticky === void 0 ? void 0 : sticky.side) || undefined, style: _objectSpread(_objectSpread({}, _style), inlineWidthStyles) }, rest, extraProps), canSort ? ___EmotionJSX(EuiToolTip, _extends({ content: tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.content }, tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.tooltipProps, { display: "block" }), ___EmotionJSX("button", { type: "button", css: styles.euiTableHeaderCell__button, className: classNames('euiTableHeaderButton', { 'euiTableHeaderButton-isSorted': isSorted }), onClick: onSort, "data-test-subj": "tableHeaderSortButton" }, ___EmotionJSX(CellContents, cellContentsProps))) : ___EmotionJSX(CellContents, cellContentsProps), append); }; var handleResize = useCallback(function (entries) { var entry = entries[0]; if (!entry) { return; } store.updateColumnWidth(storeCellId, entry.contentRect.width); }, [store, storeCellId]); useEffect(function () { // Don't register the column inside the sticky header as the original // column is already registered. This would cause an infinite loop. if (isWithinStickyHeader || !selfRef.current || !renderHeaderCellRef.current) { return; } var unregisterColumn = store.registerColumn(storeCellId, { renderHeaderCellRef: renderHeaderCellRef, // getBoundingClientRect is not the cheapest, but we call it only once currentWidth: selfRef.current.getBoundingClientRect().width }); // ResizeObserver is available in all supported browsers, // but jsdom and jest don't provide a polyfill for it. var resizeObserver; if (typeof window.ResizeObserver !== 'undefined') { resizeObserver = new ResizeObserver(handleResize); // Note: This _could_ be optimized by using a single ResizeObserver // for the whole EuiTable, but it would need to be changed back to this // if/when we implement resizable columns resizeObserver.observe(selfRef.current); } return function () { var _resizeObserver; unregisterColumn(); (_resizeObserver = resizeObserver) === null || _resizeObserver === void 0 || _resizeObserver.disconnect(); }; }, [store, isWithinStickyHeader, handleResize, storeCellId]); // Notify the store on every render so the sticky header stays in sync. // React's reconciliation will efficiently handle any duplicate renders. useEffect(function () { // Don't update the store if the component is rendered within EuiTableStickyHeader if (isWithinStickyHeader) { return; } // Don't update the store if the element doesn't exist. The render function // in `renderHeaderCellRef` sometimes renders null - e.g., in mobile layout if (!selfRef.current) { return; } store.updateColumn(storeCellId, { renderHeaderCellRef: renderHeaderCellRef }); }); return renderHeaderCellRef.current({ ref: selfRef }); }; EuiTableHeaderCell.propTypes = { className: PropTypes.string, "aria-label": PropTypes.string, "data-test-subj": PropTypes.string, css: PropTypes.any, width: PropTypes.oneOfType([PropTypes.string.isRequired, PropTypes.number.isRequired]), minWidth: PropTypes.oneOfType([PropTypes.string.isRequired, PropTypes.number.isRequired]), maxWidth: PropTypes.oneOfType([PropTypes.string.isRequired, PropTypes.number.isRequired]), align: PropTypes.any, isSortAscending: PropTypes.bool, isSorted: PropTypes.bool, mobileOptions: PropTypes.any, onSort: PropTypes.func, scope: PropTypes.any, /** Allows adding an icon with a tooltip displayed next to the name */tooltipProps: PropTypes.shape({ /** The main content of the tooltip */content: PropTypes.node.isRequired, /** * The icon type to display * @default 'question' */ icon: PropTypes.oneOfType([PropTypes.oneOf(["accessibility", "addDataApp", "addToDashboard", "advancedSettingsApp", "agentApp", "aggregate", "alignBottom", "alignBottomLeft", "alignBottomRight", "alignCenterHorizontal", "alignCenterVertical", "alignLeft", "alignRight", "alignTop", "alignTopLeft", "alignTopRight", "alert", "analyzeEvent", "annotation", "anomalyChart", "chartAnomaly", "anomalySwimLane", "apmApp", "apmTrace", "chartWaterfall", "appSearchApp", "apps", "arrowDown", "chevronSingleDown", "arrowLeft", "chevronSingleLeft", "arrowRight", "chevronSingleRight", "arrowUp", "chevronSingleUp", "arrowStart", "chevronLimitLeft", "arrowEnd", "chevronLimitRight", "article", "asterisk", "at", "archive", "axisX", "axisYLeft", "axisYRight", "auditbeatApp", "backgroundTask", "beaker", "bell", "bellSlash", "beta", "bolt", "boxesHorizontal", "boxesVertical", "branch", "briefcase", "branchUser", "broom", "brush", "bug", "bulb", "bullseye", "calendar", "canvasApp", "casesApp", "changePointDetection", "chartChangePoint", "chartArea", "chartAreaStack", "chartBarHorizontal", "chartBarHorizontalStack", "chartBarVertical", "chartBarVerticalStack", "chartGauge", "chartHeatmap", "chartLine", "chartPie", "chartTagCloud", "chartThreshold", "check", "checkCircle", "checkInCircleFilled", "checkCircleFill", "cheer", "popper", "classificationJob", "clickLeft", "clickRight", "clock", "clockCounter", "clockControl", "cloud", "cloudDrizzle", "cloudStormy", "cloudSunny", "cluster", "code", "codeApp", "color", "paintBucket", "commandLine", "comment", "compare", "compute", "processor", "console", "consoleApp", "container", "continuityAbove", "continuityAboveBelow", "continuityBelow", "continuityWithin", "contrast", "contrastHigh", "contrastFill", "controls", "controlsHorizontal", "controlsVertical", "copy", "copyClipboard", "crossProjectSearch", "createAdvancedJob", "createGenericJob", "createGeoJob", "createMultiMetricJob", "createPopulationJob", "createSingleMetricJob", "cross", "crossClusterReplicationApp", "crossInCircle", "crossCircle", "crosshair", "crosshairs", "currency", "money", "cut", "scissors", "dashboardApp", "dashedCircle", "dataVisualizer", "database", "desktop", "display", "devToolsApp", "diff", "discoverApp", "distributeHorizontal", "distributeVertical", "download", "drag", "dragHorizontal", "dragVertical", "discuss", "document", "documentEdit", "documentation", "documents", "dot", "dotInCircle", "doubleArrowLeft", "chevronDoubleLeft", "doubleArrowRight", "chevronDoubleRight", "ellipsis", "editorAlignCenter", "textAlignCenter", "editorAlignLeft", "textAlignLeft", "editorAlignRight", "textAlignRight", "editorBold", "textBold", "editorChecklist", "listCheck", "editorCodeBlock", "editorComment", "editorDistributeHorizontal", "editorDistributeVertical", "editorHeading", "textHeading", "editorItalic", "textItalic", "editorItemAlignBottom", "editorItemAlignCenter", "editorItemAlignLeft", "editorItemAlignMiddle", "editorItemAlignRight", "editorItemAlignTop", "editorLink", "editorOrderedList", "listNumber", "editorPositionBottomLeft", "editorPositionBottomRight", "editorPositionTopLeft", "editorPositionTopRight", "editorRedo", "redo", "editorStrike", "textStrike", "editorTable", "table", "editorUnderline", "textUnderline", "editorUndo", "undo", "editorUnorderedList", "listBullet", "email", "mail", "empty", "emsApp", "endpoint", "eql", "query", "eraser", "error", "errorFilled", "errorFill", "esqlVis", "exit", "logOut", "expand", "maximize", "expandMini", "export", "exportAction", "upload", "external", "eye", "eyeClosed", "eyeSlash", "faceHappy", "faceNeutral", "faceSad", "fieldStatistics", "tableInfo", "filebeatApp", "filter", "filterExclude", "filterIgnore", "filterInclude", "filterInCircle", "flask", "flag", "fleetApp", "fold", "folder", "folderClosed", "folderClose", "folderCheck", "folderExclamation", "folderOpen", "folderOpened", "frameNext", "framePrevious", "fullScreen", "fullScreenExit", "function", "gear", "gisApp", "glasses", "globe", "grab", "grabHorizontal", "grabOmnidirectional", "gradient", "graphApp", "grid", "grokApp", "heart", "heartbeatApp", "heatmap", "help", "home", "hourglass", "if", "info", "image", "importAction", "index", "indexClose", "indexEdit", "indexFlush", "indexManagementApp", "indexMapping", "mapping", "indexOpen", "indexPatternApp", "indexRollupApp", "indexRuntime", "indexSettings", "indexTemporary", "tableTime", "infinity", "inputOutput", "inspect", "invert", "ip", "key", "keyboard", "kqlField", "queryField", "kqlFunction", "kqlOperand", "queryOperand", "kqlSelector", "querySelector", "kqlValue", "queryValue", "kubernetesNode", "kubernetesPod", "launch", "rocket", "layers", "lensApp", "lettering", "text", "lineBreak", "lineBreakSlash", "lineDash", "lineDashed", "lineDot", "lineDotted", "lineSolid", "link", "linkSlash", "list", "listAdd", "lock", "lockOpen", "logPatternAnalysis", "pattern", "logRateAnalysis", "logoAWS", "logoAWSMono", "logoAerospike", "logoApache", "logoAppSearch", "logoAzure", "logoAzureMono", "logoBeats", "logoBusinessAnalytics", "logoCeph", "logoCloud", "logoCloudEnterprise", "logoCode", "logoCodesandbox", "logoCouchbase", "logoDocker", "logoDropwizard", "logoElastic", "logoElasticStack", "logoElasticsearch", "logoEnterpriseSearch", "logoEtcd", "logoGCP", "logoGCPMono", "logoGithub", "logoGmail", "logoGolang", "logoGoogleG", "logoHAproxy", "logoIBM", "logoIBMMono", "logoKafka", "logoKibana", "logoKubernetes", "logoLogging", "logoLogstash", "logoMaps", "logoMemcached", "logoMetrics", "logoMongodb", "logoMySQL", "logoNginx", "logoObservability", "logoOsquery", "logoPhp", "logoPostgres", "logoPrometheus", "logoRabbitmq", "logoRedis", "logoSecurity", "logoSiteSearch", "logoSketch", "logoSlack", "logoUptime", "logoVectorDB", "logoVulnerabilityManagement", "logoWebhook", "logoWindows", "logoWorkplaceSearch", "logsApp", "logstashFilter", "logstashIf", "logstashInput", "logstashOutput", "logstashQueue", "queue", "machineLearningApp", "magnet", "magnify", "magnifyExclamation", "magnifyMinus", "magnifyPlus", "magnifyWithExclamation", "magnifyWithMinus", "magnifyWithPlus", "managementApp", "map", "mapMarker", "waypoint", "megaphone", "memory", "menu", "menuDown", "menuLeft", "menuRight", "menuUp", "merge", "metricbeatApp", "metricsApp", "minimize", "minus", "minusCircle", "minusInCircle", "minusInCircleFilled", "minusInSquare", "minusSquare", "mobile", "monitoringApp", "moon", "move", "namespace", "nested", "newChat", "node", "vectorTriangle", "notebookApp", "number", "offline", "wifiSlash", "online", "wifi", "outlierDetectionJob", "package", "packetbeatApp", "pageSelect", "pagesSelect", "palette", "paperClip", "partial", "pause", "payment", "pencil", "percent", "pin", "pinFill", "pinFilled", "pipeBreaks", "pipelineApp", "pipeNoBreaks", "pivot", "play", "playFilled", "plugs", "plus", "plusCircle", "plusInCircle", "plusInCircleFilled", "plusInSquare", "plusSquare", "popout", "presentation", "productRobot", "productAgent", "productCloudInfra", "productDashboard", "productDiscover", "productML", "productStreamsClassic", "productStreamsWired", "push", "send", "question", "quote", "radar", "readOnly", "recentlyViewedApp", "refresh", "regressionJob", "reporter", "reportingApp", "return", "returnKey", "save", "savedObjectsApp", "scale", "search", "searchProfilerApp", "section", "securityAnalyticsApp", "securityApp", "securitySignal", "securitySignalDetected", "securitySignalResolved", "server", "sessionViewer", "shard", "share", "significantEvents", "singleMetricViewer", "snowflake", "sortAscending", "sortDescending", "sortDown", "sortLeft", "sortRight", "sortUp", "sortable", "spaces", "spacesApp", "sparkles", "sqlApp", "star", "starEmpty", "starEmptySpace", "starFill", "starFilled", "starFillSpace", "starFilledSpace", "starMinusEmpty", "starMinusFill", "starMinusFilled", "starPlusEmpty", "starPlusFill", "starPlusFilled", "stats", "stop", "stopFill", "stopFilled", "stopSlash", "storage", "streamsClassic", "streamsWired", "string", "submodule", "sun", "swatchInput", "symlink", "tableDensityCompact", "tableDensityHigh", "tableDensityExpanded", "tableDensityLow", "tableDensityNormal", "tableOfContents", "tag", "tear", "temperature", "thermometer", "thumbDown", "thumbUp", "timeline", "timelineWithArrow", "timelionApp", "timeRefresh", "refreshTime", "timeslider", "training", "transitionBottomIn", "transitionBottomOut", "transitionLeftIn", "transitionLeftOut", "transitionTopIn", "transitionTopOut", "trash", "unfold", "unlink", "upgradeAssistantApp", "uptimeApp", "user", "userAvatar", "users", "usersRolesApp", "unarchive", "vector", "vectorSquare", "videoPlayer", "visArea", "visAreaStacked", "visBarHorizontal", "visBarHorizontalStacked", "visBarVertical", "visBarVerticalStacked", "visGauge", "visGoal", "visLine", "visMapCoordinate", "visMapRegion", "visMetric", "chartMetric", "visPie", "visTable", "visTagCloud", "visText", "visTimelion", "visVega", "visVisualBuilder", "visualizeApp", "vulnerabilityManagementApp", "warning", "warningFilled", "warningFill", "watchesApp", "web", "wordWrap", "wordWrapDisabled", "workflowsApp", "workflow", "workplaceSearchApp", "wrench", "tokenAlias", "tokenAnnotation", "tokenArray", "tokenBinary", "tokenBoolean", "tokenClass", "tokenCompletionSuggester", "tokenConstant", "tokenDate", "tokenDimension", "tokenElement", "tokenEnum", "tokenEnumMember", "tokenEvent", "tokenException", "tokenField", "tokenFile", "tokenFlattened", "tokenFunction", "tokenGeo", "tokenHistogram", "tokenInterface", "tokenIP", "tokenJoin", "tokenKey", "tokenKeyword", "tokenMethod", "tokenMetricCounter", "tokenMetricGauge", "tokenModule", "tokenNamespace", "tokenNested", "tokenNull", "tokenNumber", "tokenObject", "tokenOperator", "tokenPackage", "tokenParameter", "tokenPercolator", "tokenProperty", "tokenRange", "tokenRankFeature", "tokenRankFeatures", "tokenRepo", "tokenSearchType", "tokenSemanticText", "tokenShape", "tokenString", "tokenStruct", "tokenSymbol", "tokenTag", "tokenText", "tokenTokenCount", "tokenVariable", "tokenVectorDense", "tokenDenseVector", "tokenVectorSparse"]).isRequired, PropTypes.string.isRequired, PropTypes.elementType.isRequired]), /** Additional props for EuiIcon */iconProps: PropTypes.any, /** Additional props for the EuiToolTip */tooltipProps: PropTypes.shape({ /** * Passes onto the span wrapping the trigger. */ anchorClassName: PropTypes.string, /** * Passes onto the span wrapping the trigger. */ anchorProps: PropTypes.shape({ className: PropTypes.string, "aria-label": PropTypes.string, "data-test-subj": PropTypes.string, css: PropTypes.any }), /** * Passes onto the tooltip itself, not the trigger. */ className: PropTypes.string, /** * The main content of your tooltip. */ content: PropTypes.node, /** * Common display alternatives for the anchor wrapper */ display: PropTypes.any, /** * An optional title for your tooltip. */ title: PropTypes.node, /** * Unless you provide one, this will be randomly generated. */ id: PropTypes.string, /** * When `true`, the tooltip's position is re-calculated when the user * scrolls. This supports having fixed-position tooltip anchors. * * When nesting an `EuiTooltip` in a scrollable container, `repositionOnScroll` should be `true` */ repositionOnScroll: PropTypes.bool, /** * Disables the tooltip content being read by screen readers when focusing the trigger element. * Do not use when the trigger `aria-label` and tooltip `content` can be rephrased to be standalone * information (action & additional information). * Enable this prop only when the trigger has a descriptive label that either duplicates or includes * the tooltip content and would result in repetitive output. * @default false */ disableScreenReaderOutput: PropTypes.bool, /** * If supplied, called when mouse movement causes the tool tip to be * hidden. */ onMouseOut: PropTypes.func, /** * If supplied, called when the trigger loses focus. */ onBlur: PropTypes.func, /** * Offset in pixels from the anchor. Defaults to 16. */ offset: PropTypes.number, "aria-label": PropTypes.string, "data-test-subj": PropTypes.string, css: PropTypes.any, position: PropTypes.any }) }), description: PropTypes.string, /** * Shows the sort indicator but removes the button */ readOnly: PropTypes.bool, /** * Content rendered outside the visible cell content wrapper. Useful for, e.g. screen reader text. * * Used by EuiBasicTable to render hidden copy markers */ append: PropTypes.node, /** * Whether the cell should stick to a side of the table. * * This option is not applied in the responsive cards layout - see * {@link EuiTableProps#responsiveBreakpoint|`responsiveBreakpoint`}. * * Currently, it can only be used when the cell is in the first or the last * column of a table. * * When set to `true` and `hasBackground: false` is set on the table, * `--euiTableCellStickyBackgroundColor` CSS variable should be set to match * the background color of the element containing the table. * Otherwise, the sticky cell will use the default `backgroundBasePlain` * background color. * @internal * @beta * @default false */ sticky: PropTypes.shape({ /** * The side the cell should stick to. * In horizontal writing-mode, `start` equals the left side and `end` * the right side. */ side: PropTypes.oneOf(["start", "end"]).isRequired }) };