@elastic/eui 88.5.0 → 88.5.2
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_theme_dark.css +8 -21
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +8 -21
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/collapsible_nav_beta/collapsible_nav_beta.js +20 -6
- package/es/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +4 -14
- package/es/components/collapsible_nav_beta/collapsible_nav_body_footer.js +57 -0
- package/es/components/collapsible_nav_beta/collapsible_nav_body_footer.styles.js +25 -0
- package/es/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +156 -0
- package/es/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.styles.js +19 -0
- package/es/components/collapsible_nav_beta/collapsible_nav_group/index.js +9 -0
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +3 -7
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +3 -7
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +4 -8
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +16 -63
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.styles.js +2 -10
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +122 -41
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.styles.js +13 -3
- package/es/components/combo_box/combo_box.js +12 -25
- package/es/components/combo_box/combo_box_input/combo_box_input.js +61 -54
- package/es/components/text_truncate/index.js +1 -1
- package/es/components/text_truncate/utils.js +88 -138
- package/es/services/canvas/canvas_text_utils.js +64 -0
- package/es/services/canvas/index.js +9 -0
- package/es/services/index.js +1 -0
- package/eui.d.ts +186 -105
- package/i18ntokens.json +8 -8
- package/lib/components/collapsible_nav_beta/collapsible_nav_beta.js +20 -6
- package/lib/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +11 -19
- package/lib/components/collapsible_nav_beta/collapsible_nav_body_footer.js +67 -0
- package/lib/components/collapsible_nav_beta/collapsible_nav_body_footer.styles.js +33 -0
- package/lib/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +166 -0
- package/lib/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.styles.js +26 -0
- package/lib/components/collapsible_nav_beta/collapsible_nav_group/index.js +12 -0
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +3 -7
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +3 -7
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +4 -8
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +14 -61
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.styles.js +1 -9
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +122 -39
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.styles.js +13 -4
- package/lib/components/combo_box/combo_box.js +12 -25
- package/lib/components/combo_box/combo_box_input/combo_box_input.js +60 -53
- package/lib/components/text_truncate/index.js +0 -6
- package/lib/components/text_truncate/utils.js +97 -148
- package/lib/services/canvas/canvas_text_utils.js +70 -0
- package/lib/services/canvas/index.js +12 -0
- package/lib/services/index.js +8 -0
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_beta.js +17 -3
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +4 -14
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_body_footer.js +56 -0
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_body_footer.styles.js +25 -0
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +48 -0
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.styles.js +19 -0
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_group/index.js +9 -0
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +7 -33
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.styles.js +2 -10
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +54 -21
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.styles.js +13 -3
- package/optimize/es/components/combo_box/combo_box.js +12 -25
- package/optimize/es/components/combo_box/combo_box_input/combo_box_input.js +61 -53
- package/optimize/es/components/text_truncate/index.js +1 -1
- package/optimize/es/components/text_truncate/utils.js +87 -137
- package/optimize/es/services/canvas/canvas_text_utils.js +60 -0
- package/optimize/es/services/canvas/index.js +9 -0
- package/optimize/es/services/index.js +1 -0
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_beta.js +15 -1
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +11 -19
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_body_footer.js +66 -0
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_body_footer.styles.js +33 -0
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +58 -0
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.styles.js +26 -0
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_group/index.js +12 -0
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +5 -31
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.styles.js +1 -9
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +54 -20
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.styles.js +13 -4
- package/optimize/lib/components/combo_box/combo_box.js +12 -25
- package/optimize/lib/components/combo_box/combo_box_input/combo_box_input.js +60 -52
- package/optimize/lib/components/text_truncate/index.js +0 -6
- package/optimize/lib/components/text_truncate/utils.js +96 -147
- package/optimize/lib/services/canvas/canvas_text_utils.js +67 -0
- package/optimize/lib/services/canvas/index.js +12 -0
- package/optimize/lib/services/index.js +8 -0
- package/package.json +2 -5
- package/src/components/combo_box/_combo_box.scss +12 -19
- package/test-env/components/collapsible_nav_beta/collapsible_nav_beta.js +20 -6
- package/test-env/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +11 -19
- package/test-env/components/collapsible_nav_beta/collapsible_nav_body_footer.js +66 -0
- package/test-env/components/collapsible_nav_beta/collapsible_nav_body_footer.styles.js +33 -0
- package/test-env/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +165 -0
- package/test-env/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.styles.js +26 -0
- package/test-env/components/collapsible_nav_beta/collapsible_nav_group/index.js +12 -0
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +3 -7
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +3 -7
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +4 -8
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +14 -61
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.styles.js +1 -9
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +122 -39
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.styles.js +13 -4
- package/test-env/components/combo_box/combo_box.js +12 -25
- package/test-env/components/combo_box/combo_box_input/combo_box_input.js +60 -53
- package/test-env/components/text_truncate/index.js +0 -6
- package/test-env/components/text_truncate/utils.js +96 -147
- package/test-env/services/canvas/canvas_text_utils.js +30 -0
- package/test-env/services/canvas/index.js +12 -0
- package/test-env/services/index.js +8 -0
package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js
CHANGED
|
@@ -16,12 +16,12 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
16
16
|
* Side Public License, v 1.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import React, { useCallback
|
|
19
|
+
import React, { useCallback } from 'react';
|
|
20
20
|
import PropTypes from "prop-types";
|
|
21
21
|
import classNames from 'classnames';
|
|
22
22
|
import { useEuiTheme, useGeneratedHtmlId } from '../../../services';
|
|
23
23
|
import { EuiAccordion } from '../../accordion';
|
|
24
|
-
import {
|
|
24
|
+
import { EuiCollapsibleNavSubItems } from './collapsible_nav_item';
|
|
25
25
|
import { EuiCollapsibleNavLink } from './collapsible_nav_link';
|
|
26
26
|
import { euiCollapsibleNavAccordionStyles } from './collapsible_nav_accordion.styles';
|
|
27
27
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
@@ -52,10 +52,6 @@ export var EuiCollapsibleNavAccordion = function EuiCollapsibleNavAccordion(_ref
|
|
|
52
52
|
var euiTheme = useEuiTheme();
|
|
53
53
|
var styles = euiCollapsibleNavAccordionStyles(euiTheme);
|
|
54
54
|
var cssStyles = [styles.euiCollapsibleNavAccordion, isSubItem ? styles.isSubItem : styles.isTopItem, isSelected && styles.isSelected, accordionProps === null || accordionProps === void 0 ? void 0 : accordionProps.css];
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Title / accordion trigger
|
|
58
|
-
*/
|
|
59
55
|
var isTitleInteractive = !!(href || linkProps !== null && linkProps !== void 0 && linkProps.onClick);
|
|
60
56
|
|
|
61
57
|
// Stop propagation on the title so that the accordion toggle doesn't occur on click
|
|
@@ -67,32 +63,6 @@ export var EuiCollapsibleNavAccordion = function EuiCollapsibleNavAccordion(_ref
|
|
|
67
63
|
}, [linkProps === null || linkProps === void 0 ? void 0 : linkProps.onClick] // eslint-disable-line react-hooks/exhaustive-deps
|
|
68
64
|
);
|
|
69
65
|
|
|
70
|
-
/**
|
|
71
|
-
* Child items
|
|
72
|
-
*/
|
|
73
|
-
// If any of the sub items have an icon, default to an
|
|
74
|
-
// icon of `empty` so that all text lines up vertically
|
|
75
|
-
var itemsHaveIcons = useMemo(function () {
|
|
76
|
-
return items.some(function (item) {
|
|
77
|
-
return !!item.icon;
|
|
78
|
-
});
|
|
79
|
-
}, [items]);
|
|
80
|
-
var icon = itemsHaveIcons ? 'empty' : undefined;
|
|
81
|
-
var childrenCssStyles = [styles.children.euiCollapsibleNavAccordion__children, isSubItem ? styles.children.isSubItem : styles.children.isTopItem];
|
|
82
|
-
var children = ___EmotionJSX("div", {
|
|
83
|
-
css: childrenCssStyles,
|
|
84
|
-
className: "euiCollapsibleNavAccordion__children"
|
|
85
|
-
}, items.map(function (item, index) {
|
|
86
|
-
return (
|
|
87
|
-
// This is an intentional circular dependency between the accordion & parent item display.
|
|
88
|
-
// EuiSideNavItem is purposely recursive to support any amount of nested sub items,
|
|
89
|
-
// and split up into separate files/components for better dev readability
|
|
90
|
-
___EmotionJSX(EuiCollapsibleNavSubItem, _extends({
|
|
91
|
-
key: index,
|
|
92
|
-
icon: icon
|
|
93
|
-
}, item))
|
|
94
|
-
);
|
|
95
|
-
}));
|
|
96
66
|
return ___EmotionJSX(EuiAccordion, _extends({
|
|
97
67
|
id: groupID,
|
|
98
68
|
className: classes,
|
|
@@ -114,7 +84,11 @@ export var EuiCollapsibleNavAccordion = function EuiCollapsibleNavAccordion(_ref
|
|
|
114
84
|
}, accordionProps === null || accordionProps === void 0 ? void 0 : accordionProps.arrowProps), {}, {
|
|
115
85
|
css: [styles.euiCollapsibleNavAccordion__arrow, accordionProps === null || accordionProps === void 0 ? void 0 : (_accordionProps$arrow = accordionProps.arrowProps) === null || _accordionProps$arrow === void 0 ? void 0 : _accordionProps$arrow.css]
|
|
116
86
|
})
|
|
117
|
-
}),
|
|
87
|
+
}), ___EmotionJSX(EuiCollapsibleNavSubItems, {
|
|
88
|
+
items: items,
|
|
89
|
+
isSubItem: isSubItem,
|
|
90
|
+
className: "euiCollapsibleNavAccordion__children"
|
|
91
|
+
}));
|
|
118
92
|
};
|
|
119
93
|
EuiCollapsibleNavAccordion.propTypes = {
|
|
120
94
|
/**
|
|
@@ -123,20 +97,20 @@ EuiCollapsibleNavAccordion.propTypes = {
|
|
|
123
97
|
*/
|
|
124
98
|
isSubItem: PropTypes.bool,
|
|
125
99
|
buttonContent: PropTypes.node.isRequired,
|
|
126
|
-
// On the main `EuiCollapsibleNavItem` component, this uses `EuiCollapsibleNavSubItemProps`
|
|
127
|
-
// to allow for section headings, but by the time `items` reaches this component, we
|
|
128
|
-
// know for sure it's an actual accordion item and not a section heading
|
|
129
100
|
items: PropTypes.arrayOf(PropTypes.shape({
|
|
130
101
|
/**
|
|
131
102
|
* Required text to render as the nav item title
|
|
132
103
|
*/
|
|
133
|
-
title: PropTypes.string
|
|
104
|
+
title: PropTypes.string,
|
|
134
105
|
/**
|
|
135
106
|
* Allows customizing the title element.
|
|
136
107
|
* Consider using a heading element for better accessibility.
|
|
137
108
|
* Defaults to an unsemantic `span` or `div`, depending on context.
|
|
138
109
|
*/
|
|
139
110
|
titleElement: PropTypes.oneOf(["h2", "h3", "h4", "h5", "h6", "span", "div"]),
|
|
111
|
+
/**
|
|
112
|
+
* Optional icon to render to the left of title content
|
|
113
|
+
*/
|
|
140
114
|
icon: PropTypes.oneOfType([PropTypes.oneOf(["accessibility", "addDataApp", "advancedSettingsApp", "agentApp", "aggregate", "analyzeEvent", "annotation", "apmApp", "apmTrace", "appSearchApp", "apps", "arrowDown", "arrowLeft", "arrowRight", "arrowUp", "arrowStart", "arrowEnd", "article", "asterisk", "at", "auditbeatApp", "beaker", "bell", "bellSlash", "beta", "bolt", "boxesHorizontal", "boxesVertical", "branch", "branchUser", "broom", "brush", "bug", "bullseye", "calendar", "canvasApp", "casesApp", "check", "checkInCircleFilled", "cheer", "classificationJob", "clock", "cloudDrizzle", "cloudStormy", "cloudSunny", "cluster", "codeApp", "color", "compute", "console", "consoleApp", "container", "continuityAbove", "continuityAboveBelow", "continuityBelow", "continuityWithin", "controlsHorizontal", "controlsVertical", "copy", "copyClipboard", "createAdvancedJob", "createMultiMetricJob", "createPopulationJob", "createSingleMetricJob", "cross", "crossClusterReplicationApp", "crosshairs", "currency", "cut", "dashboardApp", "dataVisualizer", "database", "desktop", "devToolsApp", "discoverApp", "discuss", "document", "documentEdit", "documentation", "documents", "dot", "dotInCircle", "doubleArrowLeft", "doubleArrowRight", "download", "editorAlignCenter", "editorAlignLeft", "editorAlignRight", "editorBold", "editorChecklist", "editorCodeBlock", "editorComment", "editorDistributeHorizontal", "editorDistributeVertical", "editorHeading", "editorItalic", "editorItemAlignBottom", "editorItemAlignCenter", "editorItemAlignLeft", "editorItemAlignMiddle", "editorItemAlignRight", "editorItemAlignTop", "editorLink", "editorOrderedList", "editorPositionBottomLeft", "editorPositionBottomRight", "editorPositionTopLeft", "editorPositionTopRight", "editorRedo", "editorStrike", "editorTable", "editorUnderline", "editorUndo", "editorUnorderedList", "email", "empty", "emsApp", "eql", "eraser", "error", "exit", "expand", "expandMini", "exportAction", "eye", "eyeClosed", "faceHappy", "faceNeutral", "faceSad", "filebeatApp", "filter", "filterExclude", "filterIgnore", "filterInclude", "filterInCircle", "flag", "fleetApp", "fold", "folderCheck", "folderClosed", "folderExclamation", "folderOpen", "frameNext", "framePrevious", "fullScreen", "fullScreenExit", "function", "gear", "gisApp", "glasses", "globe", "grab", "grabHorizontal", "grabOmnidirectional", "gradient", "graphApp", "grid", "grokApp", "heart", "heartbeatApp", "heatmap", "help", "home", "iInCircle", "image", "importAction", "indexClose", "indexEdit", "indexFlush", "indexManagementApp", "indexMapping", "indexOpen", "indexPatternApp", "indexRollupApp", "indexRuntime", "indexSettings", "indexTemporary", "infinity", "inputOutput", "inspect", "invert", "ip", "key", "keyboard", "kqlField", "kqlFunction", "kqlOperand", "kqlSelector", "kqlValue", "kubernetesNode", "kubernetesPod", "launch", "layers", "lensApp", "lettering", "lineDashed", "lineDotted", "lineSolid", "link", "list", "listAdd", "lock", "lockOpen", "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", "logoVulnerabilityManagement", "logoWebhook", "logoWindows", "logoWorkplaceSearch", "logsApp", "logstashFilter", "logstashIf", "logstashInput", "logstashOutput", "logstashQueue", "machineLearningApp", "magnet", "magnifyWithExclamation", "magnifyWithMinus", "magnifyWithPlus", "managementApp", "mapMarker", "memory", "menu", "menuDown", "menuLeft", "menuRight", "menuUp", "merge", "metricbeatApp", "metricsApp", "minimize", "minus", "minusInCircle", "minusInCircleFilled", "mobile", "monitoringApp", "moon", "namespace", "nested", "node", "notebookApp", "number", "offline", "online", "outlierDetectionJob", "package", "packetbeatApp", "pageSelect", "pagesSelect", "palette", "paperClip", "partial", "pause", "payment", "pencil", "percent", "pin", "pinFilled", "pipelineApp", "pivot", "play", "playFilled", "plus", "plusInCircle", "plusInCircleFilled", "popout", "push", "questionInCircle", "quote", "recentlyViewedApp", "refresh", "regressionJob", "reporter", "reportingApp", "returnKey", "save", "savedObjectsApp", "scale", "search", "searchProfilerApp", "securityAnalyticsApp", "securityApp", "securitySignal", "securitySignalDetected", "securitySignalResolved", "sessionViewer", "shard", "share", "snowflake", "sortAscending", "sortDescending", "sortDown", "sortLeft", "sortRight", "sortUp", "sortable", "spaces", "spacesApp", "sparkles", "sqlApp", "starEmpty", "starEmptySpace", "starFilled", "starFilledSpace", "starMinusEmpty", "starMinusFilled", "starPlusEmpty", "starPlusFilled", "stats", "stop", "stopFilled", "stopSlash", "storage", "string", "submodule", "sun", "swatchInput", "symlink", "tableDensityCompact", "tableDensityExpanded", "tableDensityNormal", "tableOfContents", "tag", "tear", "temperature", "timeline", "timelineWithArrow", "timelionApp", "timeRefresh", "timeslider", "training", "transitionLeftIn", "transitionLeftOut", "transitionTopIn", "transitionTopOut", "trash", "unfold", "unlink", "upgradeAssistantApp", "uptimeApp", "user", "userAvatar", "users", "usersRolesApp", "vector", "videoPlayer", "visArea", "visAreaStacked", "visBarHorizontal", "visBarHorizontalStacked", "visBarVertical", "visBarVerticalStacked", "visGauge", "visGoal", "visLine", "visMapCoordinate", "visMapRegion", "visMetric", "visPie", "visTable", "visTagCloud", "visText", "visTimelion", "visVega", "visVisualBuilder", "visualizeApp", "vulnerabilityManagementApp", "warning", "alert", "watchesApp", "wordWrap", "wordWrapDisabled", "workplaceSearchApp", "wrench", "tokenAlias", "tokenAnnotation", "tokenArray", "tokenBinary", "tokenBoolean", "tokenClass", "tokenCompletionSuggester", "tokenConstant", "tokenDate", "tokenDenseVector", "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", "tokenShape", "tokenString", "tokenStruct", "tokenSymbol", "tokenTag", "tokenText", "tokenTokenCount", "tokenVariable"]).isRequired, PropTypes.string.isRequired, PropTypes.elementType.isRequired]),
|
|
141
115
|
/**
|
|
142
116
|
* Optional props to pass to the title icon
|
|
@@ -155,33 +129,11 @@ EuiCollapsibleNavAccordion.propTypes = {
|
|
|
155
129
|
/**
|
|
156
130
|
* When passed, an `EuiAccordion` with nested child item links will be rendered.
|
|
157
131
|
*
|
|
158
|
-
* Accepts any #
|
|
159
|
-
*
|
|
132
|
+
* Accepts any #EuiCollapsibleNavItemProps. Or, to render completely custom
|
|
133
|
+
* subitem content, pass an object with a `renderItem` callback.
|
|
160
134
|
*/
|
|
161
135
|
items: PropTypes.arrayOf(PropTypes.shape({
|
|
162
|
-
|
|
163
|
-
* Required text to render as the nav item title
|
|
164
|
-
*/
|
|
165
|
-
title: PropTypes.string,
|
|
166
|
-
/**
|
|
167
|
-
* Allows customizing the title element.
|
|
168
|
-
* Consider using a heading element for better accessibility.
|
|
169
|
-
* Defaults to an unsemantic `span` or `div`, depending on context.
|
|
170
|
-
*/
|
|
171
|
-
titleElement: PropTypes.oneOf(["h2", "h3", "h4", "h5", "h6", "span", "div"]),
|
|
172
|
-
/**
|
|
173
|
-
* Optional icon to render to the left of title content
|
|
174
|
-
*/
|
|
175
|
-
icon: PropTypes.oneOfType([PropTypes.oneOf(["accessibility", "addDataApp", "advancedSettingsApp", "agentApp", "aggregate", "analyzeEvent", "annotation", "apmApp", "apmTrace", "appSearchApp", "apps", "arrowDown", "arrowLeft", "arrowRight", "arrowUp", "arrowStart", "arrowEnd", "article", "asterisk", "at", "auditbeatApp", "beaker", "bell", "bellSlash", "beta", "bolt", "boxesHorizontal", "boxesVertical", "branch", "branchUser", "broom", "brush", "bug", "bullseye", "calendar", "canvasApp", "casesApp", "check", "checkInCircleFilled", "cheer", "classificationJob", "clock", "cloudDrizzle", "cloudStormy", "cloudSunny", "cluster", "codeApp", "color", "compute", "console", "consoleApp", "container", "continuityAbove", "continuityAboveBelow", "continuityBelow", "continuityWithin", "controlsHorizontal", "controlsVertical", "copy", "copyClipboard", "createAdvancedJob", "createMultiMetricJob", "createPopulationJob", "createSingleMetricJob", "cross", "crossClusterReplicationApp", "crosshairs", "currency", "cut", "dashboardApp", "dataVisualizer", "database", "desktop", "devToolsApp", "discoverApp", "discuss", "document", "documentEdit", "documentation", "documents", "dot", "dotInCircle", "doubleArrowLeft", "doubleArrowRight", "download", "editorAlignCenter", "editorAlignLeft", "editorAlignRight", "editorBold", "editorChecklist", "editorCodeBlock", "editorComment", "editorDistributeHorizontal", "editorDistributeVertical", "editorHeading", "editorItalic", "editorItemAlignBottom", "editorItemAlignCenter", "editorItemAlignLeft", "editorItemAlignMiddle", "editorItemAlignRight", "editorItemAlignTop", "editorLink", "editorOrderedList", "editorPositionBottomLeft", "editorPositionBottomRight", "editorPositionTopLeft", "editorPositionTopRight", "editorRedo", "editorStrike", "editorTable", "editorUnderline", "editorUndo", "editorUnorderedList", "email", "empty", "emsApp", "eql", "eraser", "error", "exit", "expand", "expandMini", "exportAction", "eye", "eyeClosed", "faceHappy", "faceNeutral", "faceSad", "filebeatApp", "filter", "filterExclude", "filterIgnore", "filterInclude", "filterInCircle", "flag", "fleetApp", "fold", "folderCheck", "folderClosed", "folderExclamation", "folderOpen", "frameNext", "framePrevious", "fullScreen", "fullScreenExit", "function", "gear", "gisApp", "glasses", "globe", "grab", "grabHorizontal", "grabOmnidirectional", "gradient", "graphApp", "grid", "grokApp", "heart", "heartbeatApp", "heatmap", "help", "home", "iInCircle", "image", "importAction", "indexClose", "indexEdit", "indexFlush", "indexManagementApp", "indexMapping", "indexOpen", "indexPatternApp", "indexRollupApp", "indexRuntime", "indexSettings", "indexTemporary", "infinity", "inputOutput", "inspect", "invert", "ip", "key", "keyboard", "kqlField", "kqlFunction", "kqlOperand", "kqlSelector", "kqlValue", "kubernetesNode", "kubernetesPod", "launch", "layers", "lensApp", "lettering", "lineDashed", "lineDotted", "lineSolid", "link", "list", "listAdd", "lock", "lockOpen", "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", "logoVulnerabilityManagement", "logoWebhook", "logoWindows", "logoWorkplaceSearch", "logsApp", "logstashFilter", "logstashIf", "logstashInput", "logstashOutput", "logstashQueue", "machineLearningApp", "magnet", "magnifyWithExclamation", "magnifyWithMinus", "magnifyWithPlus", "managementApp", "mapMarker", "memory", "menu", "menuDown", "menuLeft", "menuRight", "menuUp", "merge", "metricbeatApp", "metricsApp", "minimize", "minus", "minusInCircle", "minusInCircleFilled", "mobile", "monitoringApp", "moon", "namespace", "nested", "node", "notebookApp", "number", "offline", "online", "outlierDetectionJob", "package", "packetbeatApp", "pageSelect", "pagesSelect", "palette", "paperClip", "partial", "pause", "payment", "pencil", "percent", "pin", "pinFilled", "pipelineApp", "pivot", "play", "playFilled", "plus", "plusInCircle", "plusInCircleFilled", "popout", "push", "questionInCircle", "quote", "recentlyViewedApp", "refresh", "regressionJob", "reporter", "reportingApp", "returnKey", "save", "savedObjectsApp", "scale", "search", "searchProfilerApp", "securityAnalyticsApp", "securityApp", "securitySignal", "securitySignalDetected", "securitySignalResolved", "sessionViewer", "shard", "share", "snowflake", "sortAscending", "sortDescending", "sortDown", "sortLeft", "sortRight", "sortUp", "sortable", "spaces", "spacesApp", "sparkles", "sqlApp", "starEmpty", "starEmptySpace", "starFilled", "starFilledSpace", "starMinusEmpty", "starMinusFilled", "starPlusEmpty", "starPlusFilled", "stats", "stop", "stopFilled", "stopSlash", "storage", "string", "submodule", "sun", "swatchInput", "symlink", "tableDensityCompact", "tableDensityExpanded", "tableDensityNormal", "tableOfContents", "tag", "tear", "temperature", "timeline", "timelineWithArrow", "timelionApp", "timeRefresh", "timeslider", "training", "transitionLeftIn", "transitionLeftOut", "transitionTopIn", "transitionTopOut", "trash", "unfold", "unlink", "upgradeAssistantApp", "uptimeApp", "user", "userAvatar", "users", "usersRolesApp", "vector", "videoPlayer", "visArea", "visAreaStacked", "visBarHorizontal", "visBarHorizontalStacked", "visBarVertical", "visBarVerticalStacked", "visGauge", "visGoal", "visLine", "visMapCoordinate", "visMapRegion", "visMetric", "visPie", "visTable", "visTagCloud", "visText", "visTimelion", "visVega", "visVisualBuilder", "visualizeApp", "vulnerabilityManagementApp", "warning", "alert", "watchesApp", "wordWrap", "wordWrapDisabled", "workplaceSearchApp", "wrench", "tokenAlias", "tokenAnnotation", "tokenArray", "tokenBinary", "tokenBoolean", "tokenClass", "tokenCompletionSuggester", "tokenConstant", "tokenDate", "tokenDenseVector", "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", "tokenShape", "tokenString", "tokenStruct", "tokenSymbol", "tokenTag", "tokenText", "tokenTokenCount", "tokenVariable"]).isRequired, PropTypes.string.isRequired, PropTypes.elementType.isRequired]),
|
|
176
|
-
/**
|
|
177
|
-
* Optional props to pass to the title icon
|
|
178
|
-
*/
|
|
179
|
-
iconProps: PropTypes.any,
|
|
180
|
-
/**
|
|
181
|
-
* Pass this flag to seperate links by group title headings.
|
|
182
|
-
* Strongly consider using the `titleElement` prop for accessibility.
|
|
183
|
-
*/
|
|
184
|
-
isGroupTitle: PropTypes.bool
|
|
136
|
+
renderItem: PropTypes.func
|
|
185
137
|
}).isRequired),
|
|
186
138
|
/**
|
|
187
139
|
* If `items` is specified, use this prop to pass any prop that `EuiAccordion`
|
|
@@ -197,6 +149,7 @@ EuiCollapsibleNavAccordion.propTypes = {
|
|
|
197
149
|
* Highlights whether an item is currently selected, e.g.
|
|
198
150
|
* if the user is on the same page as the nav link
|
|
199
151
|
*/
|
|
200
|
-
isSelected: PropTypes.bool
|
|
152
|
+
isSelected: PropTypes.bool,
|
|
153
|
+
renderItem: PropTypes.func
|
|
201
154
|
}).isRequired).isRequired
|
|
202
155
|
};
|
package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.styles.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { css } from '@emotion/react';
|
|
10
|
-
import { logicalCSS,
|
|
10
|
+
import { logicalCSS, euiCanAnimate } from '../../../global_styling';
|
|
11
11
|
import { euiCollapsibleNavItemVariables } from './collapsible_nav_item.styles';
|
|
12
12
|
export var euiCollapsibleNavAccordionStyles = function euiCollapsibleNavAccordionStyles(euiThemeContext) {
|
|
13
13
|
var euiTheme = euiThemeContext.euiTheme;
|
|
@@ -20,14 +20,6 @@ export var euiCollapsibleNavAccordionStyles = function euiCollapsibleNavAccordio
|
|
|
20
20
|
isSelected: /*#__PURE__*/css("&>.euiAccordion__triggerWrapper{background-color:", sharedStyles.backgroundSelectedColor, ";&:hover{background-color:", sharedStyles.backgroundSelectedColor, ";}};label:isSelected;"),
|
|
21
21
|
isSubItem: /*#__PURE__*/css("&.euiAccordion-isOpen{", logicalCSS('margin-bottom', euiTheme.size.m), ";};label:isSubItem;"),
|
|
22
22
|
// Arrow element
|
|
23
|
-
euiCollapsibleNavAccordion__arrow: /*#__PURE__*/css(logicalCSS('margin-right', euiTheme.size.xs), euiCanAnimate, "{transition:background-color ", sharedStyles.animation, ";}&:hover,&:focus-visible{background-color:", euiTheme.colors.lightShade, ";&>.euiIcon{color:", sharedStyles.color, ";}}transform:none!important;&>.euiIcon{color:", sharedStyles.rightIconColor, ";transform:rotate(90deg);", euiCanAnimate, "{transition:transform ", sharedStyles.animation, ",color ", sharedStyles.animation, ";}}&.euiAccordion__arrow[aria-expanded='true']>.euiIcon{color:", sharedStyles.color, ";transform:rotate(-90deg);};label:euiCollapsibleNavAccordion__arrow;")
|
|
24
|
-
// Children wrapper
|
|
25
|
-
children: {
|
|
26
|
-
euiCollapsibleNavAccordion__children: /*#__PURE__*/css(";label:euiCollapsibleNavAccordion__children;"),
|
|
27
|
-
isTopItem: /*#__PURE__*/css(logicalCSS('padding-top', euiTheme.size.xs), " ", logicalCSS('padding-left', euiTheme.size.xl), ";;label:isTopItem;"),
|
|
28
|
-
isSubItem: /*#__PURE__*/css(logicalCSS('border-left', euiTheme.border.thin), " ", logicalCSS('margin-left', euiTheme.size.s), " ", logicalCSS('padding-left', mathWithUnits([euiTheme.size.s, euiTheme.border.width.thin], function (x, y) {
|
|
29
|
-
return x - y;
|
|
30
|
-
})), ";;label:isSubItem;")
|
|
31
|
-
}
|
|
23
|
+
euiCollapsibleNavAccordion__arrow: /*#__PURE__*/css(logicalCSS('margin-right', euiTheme.size.xs), euiCanAnimate, "{transition:background-color ", sharedStyles.animation, ";}&:hover,&:focus-visible{background-color:", euiTheme.colors.lightShade, ";&>.euiIcon{color:", sharedStyles.color, ";}}transform:none!important;&>.euiIcon{color:", sharedStyles.rightIconColor, ";transform:rotate(90deg);", euiCanAnimate, "{transition:transform ", sharedStyles.animation, ",color ", sharedStyles.animation, ";}}&.euiAccordion__arrow[aria-expanded='true']>.euiIcon{color:", sharedStyles.color, ";transform:rotate(-90deg);};label:euiCollapsibleNavAccordion__arrow;")
|
|
32
24
|
};
|
|
33
25
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
var _excluded = ["isSubItem", "title", "titleElement", "icon", "iconProps", "items", "children"],
|
|
2
|
-
_excluded2 = ["
|
|
3
|
-
_excluded3 = ["className"]
|
|
2
|
+
_excluded2 = ["renderItem", "className"],
|
|
3
|
+
_excluded3 = ["items", "isSubItem", "isGroup", "className"],
|
|
4
|
+
_excluded4 = ["className"];
|
|
4
5
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
6
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
6
7
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
@@ -12,17 +13,16 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
12
13
|
* Side Public License, v 1.
|
|
13
14
|
*/
|
|
14
15
|
|
|
15
|
-
import React, { useContext } from 'react';
|
|
16
|
+
import React, { useContext, useMemo } from 'react';
|
|
16
17
|
import PropTypes from "prop-types";
|
|
17
18
|
import classNames from 'classnames';
|
|
18
19
|
import { useEuiTheme } from '../../../services';
|
|
19
20
|
import { EuiIcon } from '../../icon';
|
|
20
|
-
import { EuiTitle } from '../../title';
|
|
21
21
|
import { EuiCollapsibleNavContext } from '../context';
|
|
22
22
|
import { EuiCollapsedNavItem } from './collapsed';
|
|
23
23
|
import { EuiCollapsibleNavAccordion } from './collapsible_nav_accordion';
|
|
24
24
|
import { EuiCollapsibleNavLink } from './collapsible_nav_link';
|
|
25
|
-
import { euiCollapsibleNavItemTitleStyles,
|
|
25
|
+
import { euiCollapsibleNavItemTitleStyles, euiCollapsibleNavSubItemsStyles } from './collapsible_nav_item.styles';
|
|
26
26
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
27
27
|
/**
|
|
28
28
|
* Internal DRY subcomponent shared between top level items and sub items
|
|
@@ -97,15 +97,11 @@ EuiCollapsibleNavItemDisplay.propTypes = {
|
|
|
97
97
|
/**
|
|
98
98
|
* When passed, an `EuiAccordion` with nested child item links will be rendered.
|
|
99
99
|
*
|
|
100
|
-
* Accepts any #
|
|
101
|
-
*
|
|
100
|
+
* Accepts any #EuiCollapsibleNavItemProps. Or, to render completely custom
|
|
101
|
+
* subitem content, pass an object with a `renderItem` callback.
|
|
102
102
|
*/
|
|
103
103
|
items: PropTypes.arrayOf(PropTypes.shape({
|
|
104
|
-
|
|
105
|
-
* Pass this flag to seperate links by group title headings.
|
|
106
|
-
* Strongly consider using the `titleElement` prop for accessibility.
|
|
107
|
-
*/
|
|
108
|
-
isGroupTitle: PropTypes.bool
|
|
104
|
+
renderItem: PropTypes.func
|
|
109
105
|
}).isRequired),
|
|
110
106
|
/**
|
|
111
107
|
* If `items` is specified, use this prop to pass any prop that `EuiAccordion`
|
|
@@ -128,7 +124,7 @@ EuiCollapsibleNavItemDisplay.propTypes = {
|
|
|
128
124
|
*/
|
|
129
125
|
isSubItem: PropTypes.bool
|
|
130
126
|
};
|
|
131
|
-
var EuiCollapsibleNavItemTitle = function EuiCollapsibleNavItemTitle(_ref2) {
|
|
127
|
+
export var EuiCollapsibleNavItemTitle = function EuiCollapsibleNavItemTitle(_ref2) {
|
|
132
128
|
var title = _ref2.title,
|
|
133
129
|
_ref2$titleElement = _ref2.titleElement,
|
|
134
130
|
titleElement = _ref2$titleElement === void 0 ? 'span' : _ref2$titleElement,
|
|
@@ -145,23 +141,16 @@ var EuiCollapsibleNavItemTitle = function EuiCollapsibleNavItemTitle(_ref2) {
|
|
|
145
141
|
};
|
|
146
142
|
|
|
147
143
|
/**
|
|
148
|
-
* Sub-items can either be a
|
|
149
|
-
*
|
|
144
|
+
* Sub-items can either be a totally custom rendered item,
|
|
145
|
+
* or they can simply be more links or accordions
|
|
150
146
|
*/
|
|
151
147
|
export var EuiCollapsibleNavSubItem = function EuiCollapsibleNavSubItem(_ref3) {
|
|
152
|
-
var
|
|
148
|
+
var renderItem = _ref3.renderItem,
|
|
153
149
|
className = _ref3.className,
|
|
154
150
|
props = _objectWithoutProperties(_ref3, _excluded2);
|
|
155
|
-
var euiTheme = useEuiTheme();
|
|
156
|
-
var styles = euiCollapsibleNavSubItemGroupTitleStyles(euiTheme);
|
|
157
151
|
var classes = classNames('euiCollapsibleNavSubItem', className);
|
|
158
|
-
if (
|
|
159
|
-
|
|
160
|
-
return ___EmotionJSX(EuiTitle, {
|
|
161
|
-
size: "xxxs",
|
|
162
|
-
css: styles.euiCollapsibleNavItem__groupTitle,
|
|
163
|
-
className: "euiCollapsibleNavItem__groupTitle eui-textTruncate"
|
|
164
|
-
}, ___EmotionJSX(TitleElement, null, props.title));
|
|
152
|
+
if (renderItem) {
|
|
153
|
+
return ___EmotionJSX(React.Fragment, null, renderItem());
|
|
165
154
|
}
|
|
166
155
|
return ___EmotionJSX(EuiCollapsibleNavItemDisplay, _extends({
|
|
167
156
|
className: classes
|
|
@@ -171,7 +160,8 @@ export var EuiCollapsibleNavSubItem = function EuiCollapsibleNavSubItem(_ref3) {
|
|
|
171
160
|
};
|
|
172
161
|
|
|
173
162
|
/**
|
|
174
|
-
*
|
|
163
|
+
* Reuseable component for rendering a group of sub items
|
|
164
|
+
* Used by both `EuiCollapsibleNavGroup` and `EuiCollapsibleNavAccordion`
|
|
175
165
|
*/
|
|
176
166
|
EuiCollapsibleNavSubItem.propTypes = {
|
|
177
167
|
/**
|
|
@@ -205,8 +195,8 @@ EuiCollapsibleNavSubItem.propTypes = {
|
|
|
205
195
|
/**
|
|
206
196
|
* When passed, an `EuiAccordion` with nested child item links will be rendered.
|
|
207
197
|
*
|
|
208
|
-
* Accepts any #
|
|
209
|
-
*
|
|
198
|
+
* Accepts any #EuiCollapsibleNavItemProps. Or, to render completely custom
|
|
199
|
+
* subitem content, pass an object with a `renderItem` callback.
|
|
210
200
|
*/
|
|
211
201
|
items: PropTypes.arrayOf(PropTypes.any.isRequired),
|
|
212
202
|
/**
|
|
@@ -224,15 +214,110 @@ EuiCollapsibleNavSubItem.propTypes = {
|
|
|
224
214
|
* if the user is on the same page as the nav link
|
|
225
215
|
*/
|
|
226
216
|
isSelected: PropTypes.bool,
|
|
217
|
+
renderItem: PropTypes.func
|
|
218
|
+
};
|
|
219
|
+
export var EuiCollapsibleNavSubItems = function EuiCollapsibleNavSubItems(_ref4) {
|
|
220
|
+
var items = _ref4.items,
|
|
221
|
+
isSubItem = _ref4.isSubItem,
|
|
222
|
+
isGroup = _ref4.isGroup,
|
|
223
|
+
className = _ref4.className,
|
|
224
|
+
rest = _objectWithoutProperties(_ref4, _excluded3);
|
|
225
|
+
var classes = classNames('euiCollapsibleNavItem__items', className);
|
|
226
|
+
var euiTheme = useEuiTheme();
|
|
227
|
+
var styles = euiCollapsibleNavSubItemsStyles(euiTheme);
|
|
228
|
+
var cssStyles = [styles.euiCollapsibleNavItem__items, isGroup ? styles.isGroup : isSubItem ? styles.isSubItem : styles.isTopItem];
|
|
229
|
+
var itemsHaveIcons = useMemo(function () {
|
|
230
|
+
return items.some(function (item) {
|
|
231
|
+
return !!item.icon;
|
|
232
|
+
});
|
|
233
|
+
}, [items]);
|
|
234
|
+
return ___EmotionJSX("div", _extends({
|
|
235
|
+
className: classes,
|
|
236
|
+
css: cssStyles
|
|
237
|
+
}, rest), items.map(function (item, index) {
|
|
238
|
+
// If any of the sub items have an icon, default to an
|
|
239
|
+
// icon of `empty` so that all text lines up vertically
|
|
240
|
+
if (!item.renderItem && itemsHaveIcons && !item.icon) {
|
|
241
|
+
item.icon = 'empty';
|
|
242
|
+
}
|
|
243
|
+
return (
|
|
244
|
+
// This is an intentional circular dependency between the accordion & parent item display.
|
|
245
|
+
// EuiSideNavItem is purposely recursive to support any amount of nested sub items,
|
|
246
|
+
// and split up into separate files/components for better dev readability
|
|
247
|
+
___EmotionJSX(EuiCollapsibleNavSubItem, _extends({
|
|
248
|
+
key: index
|
|
249
|
+
}, item))
|
|
250
|
+
);
|
|
251
|
+
}));
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* The actual exported component
|
|
256
|
+
*/
|
|
257
|
+
EuiCollapsibleNavSubItems.propTypes = {
|
|
227
258
|
/**
|
|
228
|
-
*
|
|
229
|
-
*
|
|
259
|
+
* Determines whether the item should render as a top-level nav item
|
|
260
|
+
* or a nested nav subitem. Set internally by EUI
|
|
230
261
|
*/
|
|
231
|
-
|
|
262
|
+
isSubItem: PropTypes.bool,
|
|
263
|
+
items: PropTypes.arrayOf(PropTypes.shape({
|
|
264
|
+
/**
|
|
265
|
+
* Required text to render as the nav item title
|
|
266
|
+
*/
|
|
267
|
+
title: PropTypes.string,
|
|
268
|
+
/**
|
|
269
|
+
* Allows customizing the title element.
|
|
270
|
+
* Consider using a heading element for better accessibility.
|
|
271
|
+
* Defaults to an unsemantic `span` or `div`, depending on context.
|
|
272
|
+
*/
|
|
273
|
+
titleElement: PropTypes.oneOf(["h2", "h3", "h4", "h5", "h6", "span", "div"]),
|
|
274
|
+
/**
|
|
275
|
+
* Optional icon to render to the left of title content
|
|
276
|
+
*/
|
|
277
|
+
icon: PropTypes.oneOfType([PropTypes.oneOf(["accessibility", "addDataApp", "advancedSettingsApp", "agentApp", "aggregate", "analyzeEvent", "annotation", "apmApp", "apmTrace", "appSearchApp", "apps", "arrowDown", "arrowLeft", "arrowRight", "arrowUp", "arrowStart", "arrowEnd", "article", "asterisk", "at", "auditbeatApp", "beaker", "bell", "bellSlash", "beta", "bolt", "boxesHorizontal", "boxesVertical", "branch", "branchUser", "broom", "brush", "bug", "bullseye", "calendar", "canvasApp", "casesApp", "check", "checkInCircleFilled", "cheer", "classificationJob", "clock", "cloudDrizzle", "cloudStormy", "cloudSunny", "cluster", "codeApp", "color", "compute", "console", "consoleApp", "container", "continuityAbove", "continuityAboveBelow", "continuityBelow", "continuityWithin", "controlsHorizontal", "controlsVertical", "copy", "copyClipboard", "createAdvancedJob", "createMultiMetricJob", "createPopulationJob", "createSingleMetricJob", "cross", "crossClusterReplicationApp", "crosshairs", "currency", "cut", "dashboardApp", "dataVisualizer", "database", "desktop", "devToolsApp", "discoverApp", "discuss", "document", "documentEdit", "documentation", "documents", "dot", "dotInCircle", "doubleArrowLeft", "doubleArrowRight", "download", "editorAlignCenter", "editorAlignLeft", "editorAlignRight", "editorBold", "editorChecklist", "editorCodeBlock", "editorComment", "editorDistributeHorizontal", "editorDistributeVertical", "editorHeading", "editorItalic", "editorItemAlignBottom", "editorItemAlignCenter", "editorItemAlignLeft", "editorItemAlignMiddle", "editorItemAlignRight", "editorItemAlignTop", "editorLink", "editorOrderedList", "editorPositionBottomLeft", "editorPositionBottomRight", "editorPositionTopLeft", "editorPositionTopRight", "editorRedo", "editorStrike", "editorTable", "editorUnderline", "editorUndo", "editorUnorderedList", "email", "empty", "emsApp", "eql", "eraser", "error", "exit", "expand", "expandMini", "exportAction", "eye", "eyeClosed", "faceHappy", "faceNeutral", "faceSad", "filebeatApp", "filter", "filterExclude", "filterIgnore", "filterInclude", "filterInCircle", "flag", "fleetApp", "fold", "folderCheck", "folderClosed", "folderExclamation", "folderOpen", "frameNext", "framePrevious", "fullScreen", "fullScreenExit", "function", "gear", "gisApp", "glasses", "globe", "grab", "grabHorizontal", "grabOmnidirectional", "gradient", "graphApp", "grid", "grokApp", "heart", "heartbeatApp", "heatmap", "help", "home", "iInCircle", "image", "importAction", "indexClose", "indexEdit", "indexFlush", "indexManagementApp", "indexMapping", "indexOpen", "indexPatternApp", "indexRollupApp", "indexRuntime", "indexSettings", "indexTemporary", "infinity", "inputOutput", "inspect", "invert", "ip", "key", "keyboard", "kqlField", "kqlFunction", "kqlOperand", "kqlSelector", "kqlValue", "kubernetesNode", "kubernetesPod", "launch", "layers", "lensApp", "lettering", "lineDashed", "lineDotted", "lineSolid", "link", "list", "listAdd", "lock", "lockOpen", "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", "logoVulnerabilityManagement", "logoWebhook", "logoWindows", "logoWorkplaceSearch", "logsApp", "logstashFilter", "logstashIf", "logstashInput", "logstashOutput", "logstashQueue", "machineLearningApp", "magnet", "magnifyWithExclamation", "magnifyWithMinus", "magnifyWithPlus", "managementApp", "mapMarker", "memory", "menu", "menuDown", "menuLeft", "menuRight", "menuUp", "merge", "metricbeatApp", "metricsApp", "minimize", "minus", "minusInCircle", "minusInCircleFilled", "mobile", "monitoringApp", "moon", "namespace", "nested", "node", "notebookApp", "number", "offline", "online", "outlierDetectionJob", "package", "packetbeatApp", "pageSelect", "pagesSelect", "palette", "paperClip", "partial", "pause", "payment", "pencil", "percent", "pin", "pinFilled", "pipelineApp", "pivot", "play", "playFilled", "plus", "plusInCircle", "plusInCircleFilled", "popout", "push", "questionInCircle", "quote", "recentlyViewedApp", "refresh", "regressionJob", "reporter", "reportingApp", "returnKey", "save", "savedObjectsApp", "scale", "search", "searchProfilerApp", "securityAnalyticsApp", "securityApp", "securitySignal", "securitySignalDetected", "securitySignalResolved", "sessionViewer", "shard", "share", "snowflake", "sortAscending", "sortDescending", "sortDown", "sortLeft", "sortRight", "sortUp", "sortable", "spaces", "spacesApp", "sparkles", "sqlApp", "starEmpty", "starEmptySpace", "starFilled", "starFilledSpace", "starMinusEmpty", "starMinusFilled", "starPlusEmpty", "starPlusFilled", "stats", "stop", "stopFilled", "stopSlash", "storage", "string", "submodule", "sun", "swatchInput", "symlink", "tableDensityCompact", "tableDensityExpanded", "tableDensityNormal", "tableOfContents", "tag", "tear", "temperature", "timeline", "timelineWithArrow", "timelionApp", "timeRefresh", "timeslider", "training", "transitionLeftIn", "transitionLeftOut", "transitionTopIn", "transitionTopOut", "trash", "unfold", "unlink", "upgradeAssistantApp", "uptimeApp", "user", "userAvatar", "users", "usersRolesApp", "vector", "videoPlayer", "visArea", "visAreaStacked", "visBarHorizontal", "visBarHorizontalStacked", "visBarVertical", "visBarVerticalStacked", "visGauge", "visGoal", "visLine", "visMapCoordinate", "visMapRegion", "visMetric", "visPie", "visTable", "visTagCloud", "visText", "visTimelion", "visVega", "visVisualBuilder", "visualizeApp", "vulnerabilityManagementApp", "warning", "alert", "watchesApp", "wordWrap", "wordWrapDisabled", "workplaceSearchApp", "wrench", "tokenAlias", "tokenAnnotation", "tokenArray", "tokenBinary", "tokenBoolean", "tokenClass", "tokenCompletionSuggester", "tokenConstant", "tokenDate", "tokenDenseVector", "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", "tokenShape", "tokenString", "tokenStruct", "tokenSymbol", "tokenTag", "tokenText", "tokenTokenCount", "tokenVariable"]).isRequired, PropTypes.string.isRequired, PropTypes.elementType.isRequired]),
|
|
278
|
+
/**
|
|
279
|
+
* Optional props to pass to the title icon
|
|
280
|
+
*/
|
|
281
|
+
iconProps: PropTypes.any,
|
|
282
|
+
className: PropTypes.string,
|
|
283
|
+
"aria-label": PropTypes.string,
|
|
284
|
+
"data-test-subj": PropTypes.string,
|
|
285
|
+
css: PropTypes.any,
|
|
286
|
+
/**
|
|
287
|
+
* The nav item link.
|
|
288
|
+
* If not included, and no `onClick` is specified, the nav item
|
|
289
|
+
* will render as an non-interactive `<span>`.
|
|
290
|
+
*/
|
|
291
|
+
href: PropTypes.string,
|
|
292
|
+
/**
|
|
293
|
+
* When passed, an `EuiAccordion` with nested child item links will be rendered.
|
|
294
|
+
*
|
|
295
|
+
* Accepts any #EuiCollapsibleNavItemProps. Or, to render completely custom
|
|
296
|
+
* subitem content, pass an object with a `renderItem` callback.
|
|
297
|
+
*/
|
|
298
|
+
items: PropTypes.arrayOf(PropTypes.any.isRequired),
|
|
299
|
+
/**
|
|
300
|
+
* If `items` is specified, use this prop to pass any prop that `EuiAccordion`
|
|
301
|
+
* accepts, including props that control the toggled state of the accordion
|
|
302
|
+
* (e.g. `initialIsOpen`, `forceState`)
|
|
303
|
+
*/
|
|
304
|
+
accordionProps: PropTypes.any,
|
|
305
|
+
/**
|
|
306
|
+
* If a `href` is specified, use this prop to pass any prop that `EuiLink` accepts
|
|
307
|
+
*/
|
|
308
|
+
linkProps: PropTypes.any,
|
|
309
|
+
/**
|
|
310
|
+
* Highlights whether an item is currently selected, e.g.
|
|
311
|
+
* if the user is on the same page as the nav link
|
|
312
|
+
*/
|
|
313
|
+
isSelected: PropTypes.bool,
|
|
314
|
+
renderItem: PropTypes.func
|
|
315
|
+
}).isRequired).isRequired,
|
|
316
|
+
isGroup: PropTypes.bool
|
|
232
317
|
};
|
|
233
|
-
export var EuiCollapsibleNavItem = function EuiCollapsibleNavItem(
|
|
234
|
-
var className =
|
|
235
|
-
props = _objectWithoutProperties(
|
|
318
|
+
export var EuiCollapsibleNavItem = function EuiCollapsibleNavItem(_ref5) {
|
|
319
|
+
var className = _ref5.className,
|
|
320
|
+
props = _objectWithoutProperties(_ref5, _excluded4);
|
|
236
321
|
var classes = classNames('euiCollapsibleNavItem', className);
|
|
237
322
|
var _useContext = useContext(EuiCollapsibleNavContext),
|
|
238
323
|
isCollapsed = _useContext.isCollapsed,
|
|
@@ -277,15 +362,11 @@ EuiCollapsibleNavItem.propTypes = {
|
|
|
277
362
|
/**
|
|
278
363
|
* When passed, an `EuiAccordion` with nested child item links will be rendered.
|
|
279
364
|
*
|
|
280
|
-
* Accepts any #
|
|
281
|
-
*
|
|
365
|
+
* Accepts any #EuiCollapsibleNavItemProps. Or, to render completely custom
|
|
366
|
+
* subitem content, pass an object with a `renderItem` callback.
|
|
282
367
|
*/
|
|
283
368
|
items: PropTypes.arrayOf(PropTypes.shape({
|
|
284
|
-
|
|
285
|
-
* Pass this flag to seperate links by group title headings.
|
|
286
|
-
* Strongly consider using the `titleElement` prop for accessibility.
|
|
287
|
-
*/
|
|
288
|
-
isGroupTitle: PropTypes.bool
|
|
369
|
+
renderItem: PropTypes.func
|
|
289
370
|
}).isRequired),
|
|
290
371
|
/**
|
|
291
372
|
* If `items` is specified, use this prop to pass any prop that `EuiAccordion`
|
package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.styles.js
CHANGED
|
@@ -14,7 +14,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
import { css } from '@emotion/react';
|
|
17
|
-
import { logicalCSS,
|
|
17
|
+
import { logicalCSS, mathWithUnits, euiFontSize } from '../../../global_styling';
|
|
18
18
|
import { euiButtonColor } from '../../../themes/amsterdam/global_styling/mixins/button';
|
|
19
19
|
|
|
20
20
|
/**
|
|
@@ -50,9 +50,19 @@ export var euiCollapsibleNavItemTitleStyles = {
|
|
|
50
50
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
|
-
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Sub item groups
|
|
56
|
+
*/
|
|
57
|
+
|
|
58
|
+
export var euiCollapsibleNavSubItemsStyles = function euiCollapsibleNavSubItemsStyles(_ref) {
|
|
54
59
|
var euiTheme = _ref.euiTheme;
|
|
55
60
|
return {
|
|
56
|
-
|
|
61
|
+
euiCollapsibleNavItem__items: /*#__PURE__*/css(";label:euiCollapsibleNavItem__items;"),
|
|
62
|
+
isGroup: /*#__PURE__*/css(logicalCSS('padding-top', euiTheme.size.xs), " ", logicalCSS('padding-left', euiTheme.size.s), ";;label:isGroup;"),
|
|
63
|
+
isTopItem: /*#__PURE__*/css(logicalCSS('padding-top', euiTheme.size.xs), " ", logicalCSS('padding-left', euiTheme.size.xl), ";;label:isTopItem;"),
|
|
64
|
+
isSubItem: /*#__PURE__*/css(logicalCSS('border-left', euiTheme.border.thin), " ", logicalCSS('margin-left', euiTheme.size.s), " ", logicalCSS('padding-left', mathWithUnits([euiTheme.size.s, euiTheme.border.width.thin], function (x, y) {
|
|
65
|
+
return x - y;
|
|
66
|
+
})), ";;label:isSubItem;")
|
|
57
67
|
};
|
|
58
68
|
};
|
|
@@ -93,10 +93,6 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
95
|
});
|
|
96
|
-
_defineProperty(_assertThisInitialized(_this), "autoSizeInputRefInstance", null);
|
|
97
|
-
_defineProperty(_assertThisInitialized(_this), "autoSizeInputRefCallback", function (ref) {
|
|
98
|
-
_this.autoSizeInputRefInstance = ref;
|
|
99
|
-
});
|
|
100
96
|
_defineProperty(_assertThisInitialized(_this), "searchInputRefInstance", null);
|
|
101
97
|
_defineProperty(_assertThisInitialized(_this), "searchInputRefCallback", function (ref) {
|
|
102
98
|
_this.searchInputRefInstance = ref;
|
|
@@ -569,15 +565,7 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
569
565
|
_createClass(EuiComboBox, [{
|
|
570
566
|
key: "componentDidMount",
|
|
571
567
|
value: function componentDidMount() {
|
|
572
|
-
var _this2 = this;
|
|
573
568
|
this._isMounted = true;
|
|
574
|
-
|
|
575
|
-
// TODO: This will need to be called once the actual stylesheet loads.
|
|
576
|
-
setTimeout(function () {
|
|
577
|
-
if (_this2.autoSizeInputRefInstance) {
|
|
578
|
-
_this2.autoSizeInputRefInstance.copyInputStyles();
|
|
579
|
-
}
|
|
580
|
-
}, 100);
|
|
581
569
|
}
|
|
582
570
|
}, {
|
|
583
571
|
key: "componentDidUpdate",
|
|
@@ -610,7 +598,7 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
610
598
|
}, {
|
|
611
599
|
key: "render",
|
|
612
600
|
value: function render() {
|
|
613
|
-
var
|
|
601
|
+
var _this2 = this;
|
|
614
602
|
var _this$props8 = this.props,
|
|
615
603
|
dataTestSubj = _this$props8['data-test-subj'],
|
|
616
604
|
async = _this$props8.async,
|
|
@@ -681,32 +669,32 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
681
669
|
default: "Choose from the following options"
|
|
682
670
|
}, function (listboxAriaLabel) {
|
|
683
671
|
return ___EmotionJSX(EuiComboBoxOptionsList, {
|
|
684
|
-
zIndex:
|
|
685
|
-
activeOptionIndex:
|
|
686
|
-
areAllOptionsSelected:
|
|
672
|
+
zIndex: _this2.state.listZIndex,
|
|
673
|
+
activeOptionIndex: _this2.state.activeOptionIndex,
|
|
674
|
+
areAllOptionsSelected: _this2.areAllOptionsSelected(),
|
|
687
675
|
customOptionText: customOptionText,
|
|
688
676
|
"data-test-subj": optionsListDataTestSubj,
|
|
689
677
|
fullWidth: fullWidth,
|
|
690
678
|
isCaseSensitive: isCaseSensitive,
|
|
691
679
|
isLoading: isLoading,
|
|
692
|
-
listRef:
|
|
680
|
+
listRef: _this2.listRefCallback,
|
|
693
681
|
matchingOptions: matchingOptions,
|
|
694
|
-
onCloseList:
|
|
682
|
+
onCloseList: _this2.closeList,
|
|
695
683
|
onCreateOption: onCreateOption,
|
|
696
|
-
onOptionClick:
|
|
697
|
-
onOptionEnterKey:
|
|
698
|
-
onScroll:
|
|
699
|
-
optionRef:
|
|
684
|
+
onOptionClick: _this2.onOptionClick,
|
|
685
|
+
onOptionEnterKey: _this2.onOptionEnterKey,
|
|
686
|
+
onScroll: _this2.onOptionListScroll,
|
|
687
|
+
optionRef: _this2.optionRefCallback,
|
|
700
688
|
options: options,
|
|
701
689
|
position: listPosition,
|
|
702
690
|
singleSelection: singleSelection,
|
|
703
691
|
renderOption: renderOption,
|
|
704
|
-
rootId:
|
|
692
|
+
rootId: _this2.rootId,
|
|
705
693
|
rowHeight: rowHeight,
|
|
706
694
|
scrollToIndex: activeOptionIndex,
|
|
707
695
|
searchValue: searchValue,
|
|
708
696
|
selectedOptions: selectedOptions,
|
|
709
|
-
updatePosition:
|
|
697
|
+
updatePosition: _this2.updatePosition,
|
|
710
698
|
width: width,
|
|
711
699
|
delimiter: delimiter,
|
|
712
700
|
getSelectedOptionForSearchValue: getSelectedOptionForSearchValue,
|
|
@@ -730,7 +718,6 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
730
718
|
onBlur: this.onContainerBlur,
|
|
731
719
|
ref: this.comboBoxRefCallback
|
|
732
720
|
}), ___EmotionJSX(EuiComboBoxInput, {
|
|
733
|
-
autoSizeInputRef: this.autoSizeInputRefCallback,
|
|
734
721
|
compressed: compressed,
|
|
735
722
|
focusedOptionId: this.hasActiveOption() ? this.rootId("_option-".concat(this.state.activeOptionIndex)) : undefined,
|
|
736
723
|
fullWidth: fullWidth,
|