@elastic/eui
Version:
Elastic UI Component Library
362 lines (356 loc) • 27 kB
JavaScript
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.EuiTableHeaderCell = void 0;
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _react = _interopRequireWildcard(require("react"));
var _classnames = _interopRequireDefault(require("classnames"));
var _services = require("../../services");
var _i18n = require("../i18n");
var _accessibility = require("../accessibility");
var _icon = require("../icon");
var _inner_text = require("../inner_text");
var _tool_tip = require("../tool_tip");
var _utils = require("./utils");
var _responsive_context = require("./mobile/responsive_context");
var _table_cell_content = require("./_table_cell_content");
var _table_cells_shared = require("./table_cells_shared.styles");
var _provider = require("./store/provider");
var _sticky_header = require("./sticky_header");
var _use_unique_column_id = require("./store/use_unique_column_id");
var _react2 = require("@emotion/react");
var _excluded = ["children", "align", "onSort", "isSorted", "isSortAscending", "className", "scope", "mobileOptions", "width", "minWidth", "maxWidth", "style", "readOnly", "tooltipProps", "description", "append", "sticky"];
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
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; }
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) { (0, _defineProperty2.default)(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; } /*
* 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.
*/
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 ? (0, _react2.jsx)(_icon.EuiIcon, (0, _extends2.default)({
className: "euiTableSortIcon",
type: tooltipProps.icon || 'question',
size: "m",
color: "subdued"
}, tooltipProps.iconProps)) : (0, _react2.jsx)(_tool_tip.EuiIconTip, (0, _extends2.default)({
content: tooltipProps.content,
type: tooltipProps.icon || 'question',
size: "m",
color: "subdued",
position: "top",
iconProps: _objectSpread({
role: 'button'
}, tooltipProps.iconProps)
}, tooltipProps.tooltipProps)) : null;
return (0, _react2.jsx)(_table_cell_content.EuiTableCellContent, {
className: className,
align: align,
textOnly: false,
truncateText: null
}, (0, _react2.jsx)(_inner_text.EuiInnerText, null, function (ref, innerText) {
return (0, _react2.jsx)(_i18n.EuiI18n, {
token: "euiTableHeaderCell.titleTextWithDesc",
default: "{innerText}; {description}",
values: {
innerText: innerText,
description: description
}
}, function (titleTextWithDesc) {
return (0, _react2.jsx)("span", {
title: description ? titleTextWithDesc : innerText,
ref: ref,
className: "eui-textTruncate"
}, children);
});
}), description && (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("span", null, description)), tooltipIcon, isSorted ? (0, _react2.jsx)(_icon.EuiIcon, {
className: "euiTableSortIcon",
type: isSortAscending ? 'sortUp' : 'sortDown',
size: "m"
}) : canSort ? (0, _react2.jsx)(_icon.EuiIcon, {
className: "euiTableSortIcon euiTableSortIcon--sortable",
type: "sortable",
size: "m",
color: "subdued" // Tinted a bit further via CSS
}) : null);
};
var EuiTableHeaderCell = exports.EuiTableHeaderCell = function EuiTableHeaderCell(_ref2) {
var children = _ref2.children,
_ref2$align = _ref2.align,
align = _ref2$align === void 0 ? _services.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 = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
var selfRef = (0, _react.useRef)(null);
var storeCellId = (0, _use_unique_column_id.useEuiTableStoreUniqueColumnId)();
var store = (0, _provider.useEuiTableColumnDataStore)();
var isWithinStickyHeader = (0, _sticky_header.useEuiTableWithinStickyHeader)();
var styles = (0, _services.useEuiMemoizedStyles)(_table_cells_shared.euiTableHeaderFooterCellStyles);
var stickyStyles = (0, _table_cells_shared._useEuiTableStickyCellStyles)(sticky);
var isResponsive = (0, _responsive_context.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 = (0, _react.useRef)();
renderHeaderCellRef.current = function (extraProps) {
if (hideForDesktop || hideForMobile) return null;
var classes = (0, _classnames.default)('euiTableHeaderCell', className);
var cssStyles = [styles.euiTableHeaderCell, !isResponsive && stickyStyles];
var inlineWidthStyles = (0, _utils.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 (0, _react2.jsx)(CellComponent, (0, _extends2.default)({
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 ? (0, _react2.jsx)(_tool_tip.EuiToolTip, (0, _extends2.default)({
content: tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.content
}, tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.tooltipProps, {
display: "block"
}), (0, _react2.jsx)("button", {
type: "button",
css: styles.euiTableHeaderCell__button,
className: (0, _classnames.default)('euiTableHeaderButton', {
'euiTableHeaderButton-isSorted': isSorted
}),
onClick: onSort,
"data-test-subj": "tableHeaderSortButton"
}, (0, _react2.jsx)(CellContents, cellContentsProps))) : (0, _react2.jsx)(CellContents, cellContentsProps), append);
};
var handleResize = (0, _react.useCallback)(function (entries) {
var entry = entries[0];
if (!entry) {
return;
}
store.updateColumnWidth(storeCellId, entry.contentRect.width);
}, [store, storeCellId]);
(0, _react.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.
(0, _react.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.default.string,
"aria-label": _propTypes.default.string,
"data-test-subj": _propTypes.default.string,
css: _propTypes.default.any,
width: _propTypes.default.oneOfType([_propTypes.default.string.isRequired, _propTypes.default.number.isRequired]),
minWidth: _propTypes.default.oneOfType([_propTypes.default.string.isRequired, _propTypes.default.number.isRequired]),
maxWidth: _propTypes.default.oneOfType([_propTypes.default.string.isRequired, _propTypes.default.number.isRequired]),
align: _propTypes.default.any,
isSortAscending: _propTypes.default.bool,
isSorted: _propTypes.default.bool,
mobileOptions: _propTypes.default.any,
onSort: _propTypes.default.func,
scope: _propTypes.default.any,
/** Allows adding an icon with a tooltip displayed next to the name */tooltipProps: _propTypes.default.shape({
/** The main content of the tooltip */content: _propTypes.default.node.isRequired,
/**
* The icon type to display
* @default 'question'
*/
icon: _propTypes.default.oneOfType([_propTypes.default.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.default.string.isRequired, _propTypes.default.elementType.isRequired]),
/** Additional props for EuiIcon */iconProps: _propTypes.default.any,
/** Additional props for the EuiToolTip */tooltipProps: _propTypes.default.shape({
/**
* Passes onto the span wrapping the trigger.
*/
anchorClassName: _propTypes.default.string,
/**
* Passes onto the span wrapping the trigger.
*/
anchorProps: _propTypes.default.shape({
className: _propTypes.default.string,
"aria-label": _propTypes.default.string,
"data-test-subj": _propTypes.default.string,
css: _propTypes.default.any
}),
/**
* Passes onto the tooltip itself, not the trigger.
*/
className: _propTypes.default.string,
/**
* The main content of your tooltip.
*/
content: _propTypes.default.node,
/**
* Common display alternatives for the anchor wrapper
*/
display: _propTypes.default.any,
/**
* An optional title for your tooltip.
*/
title: _propTypes.default.node,
/**
* Unless you provide one, this will be randomly generated.
*/
id: _propTypes.default.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.default.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.default.bool,
/**
* If supplied, called when mouse movement causes the tool tip to be
* hidden.
*/
onMouseOut: _propTypes.default.func,
/**
* If supplied, called when the trigger loses focus.
*/
onBlur: _propTypes.default.func,
/**
* Offset in pixels from the anchor. Defaults to 16.
*/
offset: _propTypes.default.number,
"aria-label": _propTypes.default.string,
"data-test-subj": _propTypes.default.string,
css: _propTypes.default.any,
position: _propTypes.default.any
})
}),
description: _propTypes.default.string,
/**
* Shows the sort indicator but removes the button
*/
readOnly: _propTypes.default.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.default.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.default.shape({
/**
* The side the cell should stick to.
* In horizontal writing-mode, `start` equals the left side and `end`
* the right side.
*/
side: _propTypes.default.oneOf(["start", "end"]).isRequired
})
};