@elastic/eui 12.3.1 → 12.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -1
- package/dist/eui.js +1168 -210
- package/dist/eui.js.map +1 -1
- package/dist/eui.min.js +5 -5
- package/es/components/accordion/accordion.js +79 -56
- package/es/components/accordion/accordion.test.js +88 -0
- package/es/components/badge/badge.js +22 -1
- package/es/components/badge/beta_badge/beta_badge.js +22 -1
- package/es/components/combo_box/combo_box.js +2 -1
- package/es/components/combo_box/combo_box_options_list/combo_box_options_list.js +47 -5
- package/es/components/delay_hide/delay_hide.test.js +5 -1
- package/es/components/filter_group/filter_button.js +17 -2
- package/es/components/form/form_control_layout/form_control_layout_custom_icon.js +22 -1
- package/es/components/form/form_control_layout/form_control_layout_icons.js +44 -2
- package/es/components/form/range/dual_range.js +1 -1
- package/es/components/form/range/range.js +1 -1
- package/es/components/form/range/range_highlight.js +1 -1
- package/es/components/form/range/range_label.js +27 -8
- package/es/components/form/range/range_levels.js +13 -8
- package/es/components/form/range/range_levels.test.js +55 -0
- package/es/components/form/range/range_slider.js +12 -8
- package/es/components/form/range/range_thumb.js +35 -3
- package/es/components/form/range/range_ticks.js +43 -22
- package/es/components/form/range/range_tooltip.js +20 -4
- package/es/components/form/range/range_track.js +33 -14
- package/es/components/form/range/range_track.test.js +100 -0
- package/es/components/form/range/range_wrapper.js +9 -2
- package/es/components/header/header_logo.js +22 -1
- package/es/components/icon/assets/cloudDrizzle.js +21 -0
- package/es/components/icon/assets/cloudStormy.js +21 -0
- package/es/components/icon/assets/cloudSunny.js +21 -0
- package/es/components/icon/assets/documentEdit.js +21 -0
- package/es/components/icon/assets/documents.js +21 -0
- package/es/components/icon/assets/popout.js +1 -1
- package/es/components/icon/assets/training.js +21 -0
- package/es/components/icon/assets/videoPlayer.js +21 -0
- package/es/components/icon/icon.js +29 -1
- package/es/components/index.js +1 -0
- package/es/components/inner_text/index.js +1 -0
- package/es/components/inner_text/inner_text.js +66 -0
- package/es/components/inner_text/inner_text.test.js +240 -0
- package/es/components/list_group/list_group_item.js +21 -2
- package/es/components/popover/popover.js +7 -3
- package/es/components/search_bar/query/ast_to_es_query_dsl.js +2 -2
- package/es/components/toast/global_toast_list.js +22 -1
- package/es/components/toast/toast.js +22 -1
- package/es/components/token/token.js +22 -1
- package/es/components/tool_tip/icon_tip.js +22 -1
- package/eui.d.ts +435 -187
- package/lib/components/accordion/accordion.js +79 -55
- package/lib/components/accordion/accordion.test.js +96 -0
- package/lib/components/badge/badge.js +22 -1
- package/lib/components/badge/beta_badge/beta_badge.js +22 -1
- package/lib/components/combo_box/combo_box.js +2 -1
- package/lib/components/combo_box/combo_box_options_list/combo_box_options_list.js +47 -5
- package/lib/components/delay_hide/delay_hide.test.js +5 -1
- package/lib/components/filter_group/filter_button.js +18 -2
- package/lib/components/form/form_control_layout/form_control_layout_custom_icon.js +22 -1
- package/lib/components/form/form_control_layout/form_control_layout_icons.js +44 -2
- package/lib/components/form/range/dual_range.js +1 -1
- package/lib/components/form/range/range.js +1 -1
- package/lib/components/form/range/range_label.js +26 -7
- package/lib/components/form/range/range_levels.js +12 -7
- package/lib/components/form/range/range_levels.test.js +63 -0
- package/lib/components/form/range/range_slider.js +13 -8
- package/lib/components/form/range/range_thumb.js +34 -2
- package/lib/components/form/range/range_ticks.js +43 -21
- package/lib/components/form/range/range_tooltip.js +19 -3
- package/lib/components/form/range/range_track.js +32 -13
- package/lib/components/form/range/range_track.test.js +108 -0
- package/lib/components/form/range/range_wrapper.js +9 -4
- package/lib/components/header/header_logo.js +22 -1
- package/lib/components/icon/assets/cloudDrizzle.js +31 -0
- package/lib/components/icon/assets/cloudDrizzle.svg +3 -0
- package/lib/components/icon/assets/cloudStormy.js +31 -0
- package/lib/components/icon/assets/cloudStormy.svg +3 -0
- package/lib/components/icon/assets/cloudSunny.js +31 -0
- package/lib/components/icon/assets/cloudSunny.svg +3 -0
- package/lib/components/icon/assets/documentEdit.js +31 -0
- package/lib/components/icon/assets/documentEdit.svg +3 -0
- package/lib/components/icon/assets/documents.js +31 -0
- package/lib/components/icon/assets/documents.svg +3 -0
- package/lib/components/icon/assets/popout.js +1 -1
- package/lib/components/icon/assets/popout.svg +1 -1
- package/lib/components/icon/assets/training.js +31 -0
- package/lib/components/icon/assets/training.svg +3 -0
- package/lib/components/icon/assets/videoPlayer.js +31 -0
- package/lib/components/icon/assets/videoPlayer.svg +3 -0
- package/lib/components/icon/icon.js +29 -1
- package/lib/components/index.js +14 -0
- package/lib/components/inner_text/index.js +19 -0
- package/lib/components/inner_text/inner_text.js +80 -0
- package/lib/components/inner_text/inner_text.test.js +250 -0
- package/lib/components/list_group/list_group_item.js +22 -3
- package/lib/components/popover/popover.js +7 -3
- package/lib/components/search_bar/query/ast_to_es_query_dsl.js +2 -2
- package/lib/components/toast/global_toast_list.js +22 -1
- package/lib/components/toast/toast.js +22 -1
- package/lib/components/token/token.js +22 -1
- package/lib/components/tool_tip/icon_tip.js +22 -1
- package/package.json +7 -4
- package/postcss.config.js +6 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
var EuiIconDocuments = function EuiIconDocuments(props) {
|
|
6
|
+
return React.createElement("svg", _extends({
|
|
7
|
+
width: 16,
|
|
8
|
+
height: 16,
|
|
9
|
+
viewBox: "0 0 16 16",
|
|
10
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
11
|
+
}, props), React.createElement("path", {
|
|
12
|
+
d: "M8.8 0c.274 0 .537.113.726.312l3.2 3.428c.176.186.274.433.274.689V13a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V1a1 1 0 0 1 1-1h6.8zM12 5H8.5a.5.5 0 0 1-.5-.5V1H2v12h10V5zm-7.5 6a.5.5 0 1 1 0-1h5a.5.5 0 1 1 0 1h-5zm0-3a.5.5 0 0 1 0-1h5a.5.5 0 1 1 0 1h-5zm1 8a.5.5 0 1 1 0-1H14V6.5a.5.5 0 1 1 1 0V15a1 1 0 0 1-1 1H5.5z"
|
|
13
|
+
}));
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export var icon = EuiIconDocuments;
|
|
17
|
+
EuiIconDocuments.__docgenInfo = {
|
|
18
|
+
"description": "",
|
|
19
|
+
"methods": [],
|
|
20
|
+
"displayName": "EuiIconDocuments"
|
|
21
|
+
};
|
|
@@ -9,7 +9,7 @@ var EuiIconPopout = function EuiIconPopout(props) {
|
|
|
9
9
|
viewBox: "0 0 16 16",
|
|
10
10
|
xmlns: "http://www.w3.org/2000/svg"
|
|
11
11
|
}, props), React.createElement("path", {
|
|
12
|
-
d: "
|
|
12
|
+
d: "M13 8.5a.5.5 0 1 1 1 0V12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h3.5a.5.5 0 0 1 0 1H4a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V8.5zm-5.12.339a.5.5 0 1 1-.706-.707L13.305 2H10.5a.5.5 0 1 1 0-1H14a1 1 0 0 1 1 1v3.5a.5.5 0 1 1-1 0V2.72L7.88 8.838z"
|
|
13
13
|
}));
|
|
14
14
|
};
|
|
15
15
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
var EuiIconTraining = function EuiIconTraining(props) {
|
|
6
|
+
return React.createElement("svg", _extends({
|
|
7
|
+
width: 16,
|
|
8
|
+
height: 16,
|
|
9
|
+
viewBox: "0 0 16 16",
|
|
10
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
11
|
+
}, props), React.createElement("path", {
|
|
12
|
+
d: "M10.386 9.836a2.5 2.5 0 1 1 3.611.667C15.212 11.173 16 12.46 16 14v1.5a.5.5 0 1 1-1 0V14c0-1.724-1.276-3-3-3-.91 0-1.298-.02-1.805-.122-1.25-.254-2.333-1-3.585-2.566a.5.5 0 1 1 .78-.624c.9 1.124 1.653 1.74 2.434 2.043.155.052.345.083.562.105zm1.785.128c.083.01.167.021.251.034L12.5 10a1.5 1.5 0 1 0-.33-.036zM9.78 11.97a.5.5 0 0 1 .5.5c0 .076-.047.226-.05.231-.179.38-.23.774-.23 1.302v1.5a.5.5 0 1 1-1 0v-1.5c0-.657.072-1.186.307-1.696a.5.5 0 0 1 .473-.337zM5.958 5.772a.5.5 0 0 1-.78.625L3.11 3.812a.5.5 0 1 1 .78-.624l2.068 2.584zM1 11h5.5a.5.5 0 1 1 0 1h-6a.5.5 0 0 1-.5-.5V.5A.5.5 0 0 1 .5 0h12a.5.5 0 0 1 .5.5v3a.5.5 0 1 1-1 0V1H1v10z"
|
|
13
|
+
}));
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export var icon = EuiIconTraining;
|
|
17
|
+
EuiIconTraining.__docgenInfo = {
|
|
18
|
+
"description": "",
|
|
19
|
+
"methods": [],
|
|
20
|
+
"displayName": "EuiIconTraining"
|
|
21
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
var EuiIconVideoPlayer = function EuiIconVideoPlayer(props) {
|
|
6
|
+
return React.createElement("svg", _extends({
|
|
7
|
+
width: 16,
|
|
8
|
+
height: 16,
|
|
9
|
+
viewBox: "0 0 16 16",
|
|
10
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
11
|
+
}, props), React.createElement("path", {
|
|
12
|
+
d: "M0 1.994C0 .893.895 0 1.994 0h12.012C15.107 0 16 .895 16 1.994v12.012A1.995 1.995 0 0 1 14.006 16H1.994A1.995 1.995 0 0 1 0 14.006V1.994zm1 0v12.012c0 .548.446.994.994.994h12.012a.995.995 0 0 0 .994-.994V1.994A.995.995 0 0 0 14.006 1H1.994A.995.995 0 0 0 1 1.994zM1 4h14v1H1V4zm1.5-1a.5.5 0 0 1 0-1h1a.5.5 0 0 1 0 1h-1zm3 0a.5.5 0 0 1 0-1h1a.5.5 0 0 1 0 1h-1zm4.947 6.106a1 1 0 0 1 0 1.788l-3 2A1 1 0 0 1 6 12V8a1 1 0 0 1 1.447-.894l3 2zM10 10L7 8v4l3-2z"
|
|
13
|
+
}));
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export var icon = EuiIconVideoPlayer;
|
|
17
|
+
EuiIconVideoPlayer.__docgenInfo = {
|
|
18
|
+
"description": "",
|
|
19
|
+
"methods": [],
|
|
20
|
+
"displayName": "EuiIconVideoPlayer"
|
|
21
|
+
};
|
|
@@ -63,6 +63,9 @@ var typeToPathMap = {
|
|
|
63
63
|
check: 'check',
|
|
64
64
|
checkInCircleFilled: 'checkInCircleFilled',
|
|
65
65
|
clock: 'clock',
|
|
66
|
+
cloudDrizzle: 'cloudDrizzle',
|
|
67
|
+
cloudStormy: 'cloudStormy',
|
|
68
|
+
cloudSunny: 'cloudSunny',
|
|
66
69
|
compute: 'compute',
|
|
67
70
|
console: 'console',
|
|
68
71
|
consoleApp: 'app_console',
|
|
@@ -85,6 +88,8 @@ var typeToPathMap = {
|
|
|
85
88
|
devToolsApp: 'app_devtools',
|
|
86
89
|
discoverApp: 'app_discover',
|
|
87
90
|
document: 'document',
|
|
91
|
+
documentEdit: 'documentEdit',
|
|
92
|
+
documents: 'documents',
|
|
88
93
|
dot: 'dot',
|
|
89
94
|
editorAlignCenter: 'editor_align_center',
|
|
90
95
|
editorAlignLeft: 'editor_align_left',
|
|
@@ -303,12 +308,14 @@ var typeToPathMap = {
|
|
|
303
308
|
tear: 'tear',
|
|
304
309
|
temperature: 'temperature',
|
|
305
310
|
timelionApp: 'app_timelion',
|
|
311
|
+
training: 'training',
|
|
306
312
|
trash: 'trash',
|
|
307
313
|
upgradeAssistantApp: 'app_upgrade_assistant',
|
|
308
314
|
uptimeApp: 'app_uptime',
|
|
309
315
|
user: 'user',
|
|
310
316
|
usersRolesApp: 'app_users_roles',
|
|
311
317
|
vector: 'vector',
|
|
318
|
+
videoPlayer: 'videoPlayer',
|
|
312
319
|
visArea: 'vis_area',
|
|
313
320
|
visBarHorizontal: 'vis_bar_horizontal',
|
|
314
321
|
visBarVertical: 'vis_bar_vertical',
|
|
@@ -556,7 +563,7 @@ EuiIcon.propTypes = {
|
|
|
556
563
|
/**
|
|
557
564
|
* `Enum` is any of the named icons listed in the docs, `Element` is any React SVG element, and `string` is usually a URL to an SVG file
|
|
558
565
|
*/
|
|
559
|
-
type: PropTypes.oneOfType([PropTypes.oneOf(["addDataApp", "advancedSettingsApp", "alert", "apmApp", "apmTrace", "apps", "arrowDown", "arrowLeft", "arrowRight", "arrowUp", "asterisk", "auditbeatApp", "beaker", "bell", "bolt", "boxesHorizontal", "boxesVertical", "branch", "broom", "brush", "bug", "bullseye", "calendar", "canvasApp", "codeApp", "check", "checkInCircleFilled", "clock", "compute", "console", "consoleApp", "controlsHorizontal", "controlsVertical", "copy", "copyClipboard", "createAdvancedJob", "createMultiMetricJob", "createPopulationJob", "createSingleMetricJob", "cross", "crossClusterReplicationApp", "crosshairs", "crossInACircleFilled", "cut", "dashboardApp", "database", "dataVisualizer", "devToolsApp", "discoverApp", "document", "dot", "editorAlignCenter", "editorAlignLeft", "editorAlignRight", "editorBold", "editorCodeBlock", "editorComment", "editorDistributeHorizontal", "editorDistributeVertical", "editorHeading", "editorItalic", "editorItemAlignLeft", "editorItemAlignBottom", "editorItemAlignCenter", "editorItemAlignMiddle", "editorItemAlignRight", "editorItemAlignTop", "editorLink", "editorOrderedList", "editorPositionBottomLeft", "editorPositionBottomRight", "editorPositionTopLeft", "editorPositionTopRight", "editorRedo", "editorStrike", "editorTable", "editorUnderline", "editorUndo", "editorUnorderedList", "email", "empty", "emsApp", "exit", "expand", "exportAction", "eye", "eyeClosed", "faceHappy", "faceNeutral", "faceSad", "filebeatApp", "filter", "flag", "folderClosed", "folderOpen", "fullScreen", "gear", "gisApp", "glasses", "globe", "grab", "grabHorizontal", "graphApp", "grid", "grokApp", "heart", "heartbeatApp", "heatmap", "help", "iInCircle", "importAction", "indexClose", "indexEdit", "indexFlush", "indexManagementApp", "indexMapping", "indexOpen", "indexPatternApp", "indexRollupApp", "indexSettings", "infraApp", "inputOutput", "inspect", "invert", "kqlField", "kqlFunction", "kqlOperand", "kqlSelector", "kqlValue", "link", "list", "listAdd", "lock", "lockOpen", "loggingApp", "logoAerospike", "logoApache", "logoAPM", "logoAppSearch", "logoAWS", "logoAWSMono", "logoAzure", "logoAzureMono", "logoBeats", "logoBusinessAnalytics", "logoCeph", "logoCloud", "logoCloudEnterprise", "logoCode", "logoCodesandbox", "logoCouchbase", "logoDocker", "logoDropwizard", "logoElastic", "logoElasticsearch", "logoElasticStack", "logoEnterpriseSearch", "logoEtcd", "logoGCP", "logoGCPMono", "logoGithub", "logoGmail", "logoGolang", "logoHAproxy", "logoIBM", "logoIBMMono", "logoKafka", "logoKibana", "logoKubernetes", "logoLogging", "logoLogstash", "logoMaps", "logoMemcached", "logoMetrics", "logoMongodb", "logoMySQL", "logoNginx", "logoOsquery", "logoPhp", "logoPostgres", "logoPrometheus", "logoRabbitmq", "logoRedis", "logoSecurity", "logoSiteSearch", "logoSketch", "logoSlack", "logoUptime", "logoWebhook", "logoWindows", "logstashFilter", "logstashIf", "logstashInput", "logstashOutput", "logstashQueue", "machineLearningApp", "magnet", "magnifyWithMinus", "magnifyWithPlus", "managementApp", "mapMarker", "memory", "menuLeft", "menuRight", "merge", "metricbeatApp", "minusInCircle", "minusInCircleFilled", "monitoringApp", "moon", "node", "notebookApp", "number", "offline", "online", "packetbeatApp", "pause", "pencil", "pin", "pinFilled", "pipelineApp", "play", "plusInCircle", "plusInCircleFilled", "popout", "questionInCircle", "refresh", "reportingApp", "save", "savedObjectsApp", "scale", "search", "searchProfilerApp", "securityAnalyticsApp", "securityApp", "shard", "share", "snowflake", "sortable", "sortDown", "sortLeft", "sortRight", "sortUp", "spacesApp", "sqlApp", "starEmpty", "starEmptySpace", "starFilled", "starFilledSpace", "starMinusEmpty", "starMinusFilled", "starPlusEmpty", "starPlusFilled", "stats", "stop", "stopFilled", "stopSlash", "storage", "string", "submodule", "swatchInput", "symlink", "tableOfContents", "tag", "tear", "temperature", "timelionApp", "trash", "upgradeAssistantApp", "uptimeApp", "user", "usersRolesApp", "vector", "visArea", "visBarHorizontal", "visBarVertical", "visControls", "visGauge", "visGoal", "visHeatmap", "visLine", "visMapCoordinate", "visMapRegion", "visMetric", "visPie", "visTable", "visTagCloud", "visText", "visTimelion", "visualizeApp", "visVega", "visVisualBuilder", "watchesApp", "wrench", "tokenClass", "tokenProperty", "tokenEnum", "tokenVariable", "tokenMethod", "tokenAnnotation", "tokenException", "tokenInterface", "tokenParameter", "tokenField", "tokenElement", "tokenFunction", "tokenBoolean", "tokenString", "tokenArray", "tokenNumber", "tokenConstant", "tokenObject", "tokenEvent", "tokenKey", "tokenNull", "tokenStruct", "tokenPackage", "tokenOperator", "tokenEnumMember", "tokenRepo", "tokenSymbol", "tokenFile", "tokenModule", "tokenNamespace"]).isRequired, PropTypes.string.isRequired, PropTypes.element.isRequired]).isRequired,
|
|
566
|
+
type: PropTypes.oneOfType([PropTypes.oneOf(["addDataApp", "advancedSettingsApp", "alert", "apmApp", "apmTrace", "apps", "arrowDown", "arrowLeft", "arrowRight", "arrowUp", "asterisk", "auditbeatApp", "beaker", "bell", "bolt", "boxesHorizontal", "boxesVertical", "branch", "broom", "brush", "bug", "bullseye", "calendar", "canvasApp", "codeApp", "check", "checkInCircleFilled", "clock", "cloudDrizzle", "cloudStormy", "cloudSunny", "compute", "console", "consoleApp", "controlsHorizontal", "controlsVertical", "copy", "copyClipboard", "createAdvancedJob", "createMultiMetricJob", "createPopulationJob", "createSingleMetricJob", "cross", "crossClusterReplicationApp", "crosshairs", "crossInACircleFilled", "cut", "dashboardApp", "database", "dataVisualizer", "devToolsApp", "discoverApp", "document", "documentEdit", "documents", "dot", "editorAlignCenter", "editorAlignLeft", "editorAlignRight", "editorBold", "editorCodeBlock", "editorComment", "editorDistributeHorizontal", "editorDistributeVertical", "editorHeading", "editorItalic", "editorItemAlignLeft", "editorItemAlignBottom", "editorItemAlignCenter", "editorItemAlignMiddle", "editorItemAlignRight", "editorItemAlignTop", "editorLink", "editorOrderedList", "editorPositionBottomLeft", "editorPositionBottomRight", "editorPositionTopLeft", "editorPositionTopRight", "editorRedo", "editorStrike", "editorTable", "editorUnderline", "editorUndo", "editorUnorderedList", "email", "empty", "emsApp", "exit", "expand", "exportAction", "eye", "eyeClosed", "faceHappy", "faceNeutral", "faceSad", "filebeatApp", "filter", "flag", "folderClosed", "folderOpen", "fullScreen", "gear", "gisApp", "glasses", "globe", "grab", "grabHorizontal", "graphApp", "grid", "grokApp", "heart", "heartbeatApp", "heatmap", "help", "iInCircle", "importAction", "indexClose", "indexEdit", "indexFlush", "indexManagementApp", "indexMapping", "indexOpen", "indexPatternApp", "indexRollupApp", "indexSettings", "infraApp", "inputOutput", "inspect", "invert", "kqlField", "kqlFunction", "kqlOperand", "kqlSelector", "kqlValue", "link", "list", "listAdd", "lock", "lockOpen", "loggingApp", "logoAerospike", "logoApache", "logoAPM", "logoAppSearch", "logoAWS", "logoAWSMono", "logoAzure", "logoAzureMono", "logoBeats", "logoBusinessAnalytics", "logoCeph", "logoCloud", "logoCloudEnterprise", "logoCode", "logoCodesandbox", "logoCouchbase", "logoDocker", "logoDropwizard", "logoElastic", "logoElasticsearch", "logoElasticStack", "logoEnterpriseSearch", "logoEtcd", "logoGCP", "logoGCPMono", "logoGithub", "logoGmail", "logoGolang", "logoHAproxy", "logoIBM", "logoIBMMono", "logoKafka", "logoKibana", "logoKubernetes", "logoLogging", "logoLogstash", "logoMaps", "logoMemcached", "logoMetrics", "logoMongodb", "logoMySQL", "logoNginx", "logoOsquery", "logoPhp", "logoPostgres", "logoPrometheus", "logoRabbitmq", "logoRedis", "logoSecurity", "logoSiteSearch", "logoSketch", "logoSlack", "logoUptime", "logoWebhook", "logoWindows", "logstashFilter", "logstashIf", "logstashInput", "logstashOutput", "logstashQueue", "machineLearningApp", "magnet", "magnifyWithMinus", "magnifyWithPlus", "managementApp", "mapMarker", "memory", "menuLeft", "menuRight", "merge", "metricbeatApp", "minusInCircle", "minusInCircleFilled", "monitoringApp", "moon", "node", "notebookApp", "number", "offline", "online", "packetbeatApp", "pause", "pencil", "pin", "pinFilled", "pipelineApp", "play", "plusInCircle", "plusInCircleFilled", "popout", "questionInCircle", "refresh", "reportingApp", "save", "savedObjectsApp", "scale", "search", "searchProfilerApp", "securityAnalyticsApp", "securityApp", "shard", "share", "snowflake", "sortable", "sortDown", "sortLeft", "sortRight", "sortUp", "spacesApp", "sqlApp", "starEmpty", "starEmptySpace", "starFilled", "starFilledSpace", "starMinusEmpty", "starMinusFilled", "starPlusEmpty", "starPlusFilled", "stats", "stop", "stopFilled", "stopSlash", "storage", "string", "submodule", "swatchInput", "symlink", "tableOfContents", "tag", "tear", "temperature", "timelionApp", "training", "trash", "upgradeAssistantApp", "uptimeApp", "user", "usersRolesApp", "vector", "videoPlayer", "visArea", "visBarHorizontal", "visBarVertical", "visControls", "visGauge", "visGoal", "visHeatmap", "visLine", "visMapCoordinate", "visMapRegion", "visMetric", "visPie", "visTable", "visTagCloud", "visText", "visTimelion", "visualizeApp", "visVega", "visVisualBuilder", "watchesApp", "wrench", "tokenClass", "tokenProperty", "tokenEnum", "tokenVariable", "tokenMethod", "tokenAnnotation", "tokenException", "tokenInterface", "tokenParameter", "tokenField", "tokenElement", "tokenFunction", "tokenBoolean", "tokenString", "tokenArray", "tokenNumber", "tokenConstant", "tokenObject", "tokenEvent", "tokenKey", "tokenNull", "tokenStruct", "tokenPackage", "tokenOperator", "tokenEnumMember", "tokenRepo", "tokenSymbol", "tokenFile", "tokenModule", "tokenNamespace"]).isRequired, PropTypes.string.isRequired, PropTypes.element.isRequired]).isRequired,
|
|
560
567
|
|
|
561
568
|
/**
|
|
562
569
|
* One of EUI's color palette or a valid CSS color value https://developer.mozilla.org/en-US/docs/Web/CSS/color_value.
|
|
@@ -693,6 +700,15 @@ EuiIcon.__docgenInfo = {
|
|
|
693
700
|
}, {
|
|
694
701
|
"value": "\"clock\"",
|
|
695
702
|
"computed": false
|
|
703
|
+
}, {
|
|
704
|
+
"value": "\"cloudDrizzle\"",
|
|
705
|
+
"computed": false
|
|
706
|
+
}, {
|
|
707
|
+
"value": "\"cloudStormy\"",
|
|
708
|
+
"computed": false
|
|
709
|
+
}, {
|
|
710
|
+
"value": "\"cloudSunny\"",
|
|
711
|
+
"computed": false
|
|
696
712
|
}, {
|
|
697
713
|
"value": "\"compute\"",
|
|
698
714
|
"computed": false
|
|
@@ -759,6 +775,12 @@ EuiIcon.__docgenInfo = {
|
|
|
759
775
|
}, {
|
|
760
776
|
"value": "\"document\"",
|
|
761
777
|
"computed": false
|
|
778
|
+
}, {
|
|
779
|
+
"value": "\"documentEdit\"",
|
|
780
|
+
"computed": false
|
|
781
|
+
}, {
|
|
782
|
+
"value": "\"documents\"",
|
|
783
|
+
"computed": false
|
|
762
784
|
}, {
|
|
763
785
|
"value": "\"dot\"",
|
|
764
786
|
"computed": false
|
|
@@ -1410,6 +1432,9 @@ EuiIcon.__docgenInfo = {
|
|
|
1410
1432
|
}, {
|
|
1411
1433
|
"value": "\"timelionApp\"",
|
|
1412
1434
|
"computed": false
|
|
1435
|
+
}, {
|
|
1436
|
+
"value": "\"training\"",
|
|
1437
|
+
"computed": false
|
|
1413
1438
|
}, {
|
|
1414
1439
|
"value": "\"trash\"",
|
|
1415
1440
|
"computed": false
|
|
@@ -1428,6 +1453,9 @@ EuiIcon.__docgenInfo = {
|
|
|
1428
1453
|
}, {
|
|
1429
1454
|
"value": "\"vector\"",
|
|
1430
1455
|
"computed": false
|
|
1456
|
+
}, {
|
|
1457
|
+
"value": "\"videoPlayer\"",
|
|
1458
|
+
"computed": false
|
|
1431
1459
|
}, {
|
|
1432
1460
|
"value": "\"visArea\"",
|
|
1433
1461
|
"computed": false
|
package/es/components/index.js
CHANGED
|
@@ -34,6 +34,7 @@ export { EuiHighlight } from './highlight';
|
|
|
34
34
|
export { EuiHorizontalRule } from './horizontal_rule';
|
|
35
35
|
export { ICON_TYPES, EuiIcon } from './icon';
|
|
36
36
|
export { EuiImage } from './image';
|
|
37
|
+
export { useInnerText, EuiInnerText } from './inner_text';
|
|
37
38
|
export { EuiI18n, EuiI18nNumber } from './i18n';
|
|
38
39
|
export { EuiLoadingKibana, EuiLoadingChart, EuiLoadingContent, EuiLoadingSpinner } from './loading';
|
|
39
40
|
export { EuiKeyPadMenu, EuiKeyPadMenuItem, EuiKeyPadMenuItemButton } from './key_pad_menu';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useInnerText, EuiInnerText } from './inner_text';
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
2
|
+
|
|
3
|
+
import PropTypes from "prop-types";
|
|
4
|
+
|
|
5
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
6
|
+
|
|
7
|
+
function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
8
|
+
|
|
9
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
10
|
+
|
|
11
|
+
import { useEffect, useState } from 'react';
|
|
12
|
+
export function useInnerText(innerTextFallback) {
|
|
13
|
+
var _useState = useState(null),
|
|
14
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
15
|
+
ref = _useState2[0],
|
|
16
|
+
setRef = _useState2[1];
|
|
17
|
+
|
|
18
|
+
var _useState3 = useState(innerTextFallback),
|
|
19
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
20
|
+
innerText = _useState4[0],
|
|
21
|
+
setInnerText = _useState4[1];
|
|
22
|
+
|
|
23
|
+
var updateInnerText = function updateInnerText(node) {
|
|
24
|
+
if (!node) return;
|
|
25
|
+
setInnerText( // Check for `innerText` implementation rather than a simple OR check
|
|
26
|
+
// because in real cases the result of `innerText` could correctly be `null`
|
|
27
|
+
// while the result of `textContent` could correctly be non-`null` due to
|
|
28
|
+
// differing reliance on browser layout calculations.
|
|
29
|
+
// We prefer the result of `innerText`, if available.
|
|
30
|
+
'innerText' in node ? node.innerText : node.textContent || undefined);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
var observer = new MutationObserver(function (mutationsList) {
|
|
34
|
+
if (mutationsList.length) updateInnerText(ref);
|
|
35
|
+
});
|
|
36
|
+
useEffect(function () {
|
|
37
|
+
if (ref) {
|
|
38
|
+
observer.disconnect();
|
|
39
|
+
updateInnerText(ref);
|
|
40
|
+
observer.observe(ref, {
|
|
41
|
+
characterData: true,
|
|
42
|
+
subtree: true
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return function () {
|
|
47
|
+
observer.disconnect();
|
|
48
|
+
};
|
|
49
|
+
}, [ref]);
|
|
50
|
+
return [setRef, innerText];
|
|
51
|
+
}
|
|
52
|
+
export var EuiInnerText = function EuiInnerText(_ref) {
|
|
53
|
+
var children = _ref.children,
|
|
54
|
+
fallback = _ref.fallback;
|
|
55
|
+
|
|
56
|
+
var _useInnerText = useInnerText(fallback),
|
|
57
|
+
_useInnerText2 = _slicedToArray(_useInnerText, 2),
|
|
58
|
+
ref = _useInnerText2[0],
|
|
59
|
+
innerText = _useInnerText2[1];
|
|
60
|
+
|
|
61
|
+
return children(ref, innerText);
|
|
62
|
+
};
|
|
63
|
+
EuiInnerText.propTypes = {
|
|
64
|
+
children: PropTypes.func.isRequired,
|
|
65
|
+
fallback: PropTypes.string
|
|
66
|
+
};
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure undefined"); }
|
|
4
|
+
|
|
5
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
6
|
+
|
|
7
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
8
|
+
|
|
9
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
10
|
+
|
|
11
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
12
|
+
|
|
13
|
+
function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
14
|
+
|
|
15
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
|
+
|
|
17
|
+
import React, { useState, useEffect } from 'react';
|
|
18
|
+
import { act } from 'react-dom/test-utils';
|
|
19
|
+
import { render, mount } from 'enzyme';
|
|
20
|
+
import { findTestSubject, requiredProps, sleep } from '../../test';
|
|
21
|
+
import { useInnerText, EuiInnerText } from './inner_text';
|
|
22
|
+
import { EuiBadge } from '../badge';
|
|
23
|
+
describe('useInnerText', function () {
|
|
24
|
+
test('provides a callback `ref`', function () {
|
|
25
|
+
var ref;
|
|
26
|
+
|
|
27
|
+
var App = function App() {
|
|
28
|
+
var _useInnerText = useInnerText();
|
|
29
|
+
|
|
30
|
+
var _useInnerText2 = _slicedToArray(_useInnerText, 1);
|
|
31
|
+
|
|
32
|
+
ref = _useInnerText2[0];
|
|
33
|
+
return React.createElement("span", null);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
mount(React.createElement(App, null));
|
|
37
|
+
expect(ref).toBeInstanceOf(Function);
|
|
38
|
+
});
|
|
39
|
+
test('provides the result of `innerText`', function () {
|
|
40
|
+
var text = 'Test';
|
|
41
|
+
var ref;
|
|
42
|
+
var innerText;
|
|
43
|
+
|
|
44
|
+
var App = function App() {
|
|
45
|
+
var _useInnerText3 = useInnerText();
|
|
46
|
+
|
|
47
|
+
var _useInnerText4 = _slicedToArray(_useInnerText3, 2);
|
|
48
|
+
|
|
49
|
+
ref = _useInnerText4[0];
|
|
50
|
+
innerText = _useInnerText4[1];
|
|
51
|
+
return React.createElement("span", {
|
|
52
|
+
ref: ref
|
|
53
|
+
}, text);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
mount(React.createElement(App, null));
|
|
57
|
+
expect(innerText).toEqual(text);
|
|
58
|
+
});
|
|
59
|
+
test('accepts a fallback value', function () {
|
|
60
|
+
var text = 'Test';
|
|
61
|
+
var fallback = 'Fallback';
|
|
62
|
+
var innerText;
|
|
63
|
+
|
|
64
|
+
var App = function App() {
|
|
65
|
+
var _useInnerText5 = useInnerText(fallback);
|
|
66
|
+
|
|
67
|
+
var _useInnerText6 = _slicedToArray(_useInnerText5, 2);
|
|
68
|
+
|
|
69
|
+
innerText = _useInnerText6[1];
|
|
70
|
+
return React.createElement("span", null, text);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
mount(React.createElement(App, null));
|
|
74
|
+
expect(innerText).toEqual(fallback);
|
|
75
|
+
});
|
|
76
|
+
test('handles updated elements',
|
|
77
|
+
/*#__PURE__*/
|
|
78
|
+
_asyncToGenerator(
|
|
79
|
+
/*#__PURE__*/
|
|
80
|
+
regeneratorRuntime.mark(function _callee() {
|
|
81
|
+
var timeout, first, second, innerText, ref, App;
|
|
82
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
83
|
+
while (1) {
|
|
84
|
+
switch (_context.prev = _context.next) {
|
|
85
|
+
case 0:
|
|
86
|
+
timeout = 500;
|
|
87
|
+
first = 'First';
|
|
88
|
+
second = 'Second';
|
|
89
|
+
|
|
90
|
+
App = function App() {
|
|
91
|
+
var _useState = useState([first, 'span']),
|
|
92
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
93
|
+
_useState2$ = _slicedToArray(_useState2[0], 2),
|
|
94
|
+
thing = _useState2$[0],
|
|
95
|
+
type = _useState2$[1],
|
|
96
|
+
setThing = _useState2[1];
|
|
97
|
+
|
|
98
|
+
useEffect(function () {
|
|
99
|
+
setTimeout(function () {
|
|
100
|
+
act(function () {
|
|
101
|
+
return setThing([second, 'div']);
|
|
102
|
+
});
|
|
103
|
+
}, timeout);
|
|
104
|
+
}, [setThing]);
|
|
105
|
+
|
|
106
|
+
var _useInnerText7 = useInnerText();
|
|
107
|
+
|
|
108
|
+
var _useInnerText8 = _slicedToArray(_useInnerText7, 2);
|
|
109
|
+
|
|
110
|
+
ref = _useInnerText8[0];
|
|
111
|
+
innerText = _useInnerText8[1];
|
|
112
|
+
return React.createElement("div", null, React.createElement(type, {
|
|
113
|
+
ref: ref,
|
|
114
|
+
title: innerText
|
|
115
|
+
}, thing));
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
mount(React.createElement(App, null));
|
|
119
|
+
expect(innerText).toEqual(first);
|
|
120
|
+
_context.next = 8;
|
|
121
|
+
return sleep(timeout + 10);
|
|
122
|
+
|
|
123
|
+
case 8:
|
|
124
|
+
expect(innerText).toEqual(second);
|
|
125
|
+
|
|
126
|
+
case 9:
|
|
127
|
+
case "end":
|
|
128
|
+
return _context.stop();
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}, _callee, this);
|
|
132
|
+
})));
|
|
133
|
+
test('handles updated content',
|
|
134
|
+
/*#__PURE__*/
|
|
135
|
+
_asyncToGenerator(
|
|
136
|
+
/*#__PURE__*/
|
|
137
|
+
regeneratorRuntime.mark(function _callee2() {
|
|
138
|
+
var timeout, first, second, innerText, ref, App, mutationObserverPolyfillPeriod;
|
|
139
|
+
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
140
|
+
while (1) {
|
|
141
|
+
switch (_context2.prev = _context2.next) {
|
|
142
|
+
case 0:
|
|
143
|
+
timeout = 500;
|
|
144
|
+
first = 'First';
|
|
145
|
+
second = 'Second';
|
|
146
|
+
|
|
147
|
+
App = function App() {
|
|
148
|
+
var _useState3 = useState(first),
|
|
149
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
150
|
+
thing = _useState4[0],
|
|
151
|
+
setThing = _useState4[1];
|
|
152
|
+
|
|
153
|
+
useEffect(function () {
|
|
154
|
+
setTimeout(function () {
|
|
155
|
+
act(function () {
|
|
156
|
+
return setThing(second);
|
|
157
|
+
});
|
|
158
|
+
}, timeout);
|
|
159
|
+
}, [setThing]);
|
|
160
|
+
|
|
161
|
+
var _useInnerText9 = useInnerText();
|
|
162
|
+
|
|
163
|
+
var _useInnerText10 = _slicedToArray(_useInnerText9, 2);
|
|
164
|
+
|
|
165
|
+
ref = _useInnerText10[0];
|
|
166
|
+
innerText = _useInnerText10[1];
|
|
167
|
+
return React.createElement("div", null, React.createElement("span", {
|
|
168
|
+
ref: ref,
|
|
169
|
+
title: innerText
|
|
170
|
+
}, thing));
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
mount(React.createElement(App, null));
|
|
174
|
+
expect(innerText).toEqual(first); // MutationObserver polyfill institues a 30ms mutation timeout period
|
|
175
|
+
|
|
176
|
+
mutationObserverPolyfillPeriod = 30;
|
|
177
|
+
_context2.next = 9;
|
|
178
|
+
return sleep(timeout + mutationObserverPolyfillPeriod + 10);
|
|
179
|
+
|
|
180
|
+
case 9:
|
|
181
|
+
expect(innerText).toEqual(second);
|
|
182
|
+
|
|
183
|
+
case 10:
|
|
184
|
+
case "end":
|
|
185
|
+
return _context2.stop();
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}, _callee2, this);
|
|
189
|
+
})));
|
|
190
|
+
});
|
|
191
|
+
describe('EuiInnerText', function () {
|
|
192
|
+
test('is rendered', function () {
|
|
193
|
+
var component = render(React.createElement(EuiInnerText, requiredProps, function (ref, innerText) {
|
|
194
|
+
return React.createElement("span", {
|
|
195
|
+
ref: ref,
|
|
196
|
+
title: innerText
|
|
197
|
+
}, "Test");
|
|
198
|
+
}));
|
|
199
|
+
expect(component).toMatchSnapshot();
|
|
200
|
+
});
|
|
201
|
+
test('uses innerText', function () {
|
|
202
|
+
var text = 'Test';
|
|
203
|
+
var component = mount(React.createElement(EuiInnerText, requiredProps, function (ref, innerText) {
|
|
204
|
+
return React.createElement("span", {
|
|
205
|
+
ref: ref,
|
|
206
|
+
title: innerText,
|
|
207
|
+
"data-test-subj": "span"
|
|
208
|
+
}, text);
|
|
209
|
+
}));
|
|
210
|
+
var span = findTestSubject(component, 'span');
|
|
211
|
+
expect(span.props().title).toBe(text);
|
|
212
|
+
});
|
|
213
|
+
test('accepts fallback prop', function () {
|
|
214
|
+
var text = 'Test';
|
|
215
|
+
var fallback = 'Fallback';
|
|
216
|
+
var component = mount(React.createElement(EuiInnerText, _extends({}, requiredProps, {
|
|
217
|
+
fallback: fallback
|
|
218
|
+
}), function (_ref3, innerText) {
|
|
219
|
+
_objectDestructuringEmpty(_ref3);
|
|
220
|
+
|
|
221
|
+
return React.createElement("span", {
|
|
222
|
+
title: innerText,
|
|
223
|
+
"data-test-subj": "span"
|
|
224
|
+
}, text);
|
|
225
|
+
}));
|
|
226
|
+
var span = findTestSubject(component, 'span');
|
|
227
|
+
expect(span.props().title).toBe(fallback);
|
|
228
|
+
});
|
|
229
|
+
test('works with wrapper and interspersed DOM elements', function () {
|
|
230
|
+
var component = mount(React.createElement(EuiInnerText, requiredProps, function (ref, innerText) {
|
|
231
|
+
return React.createElement("span", {
|
|
232
|
+
ref: ref,
|
|
233
|
+
title: innerText,
|
|
234
|
+
"data-test-subj": "span"
|
|
235
|
+
}, React.createElement("div", null, "I", ' ', React.createElement("span", null, "can", ' ', React.createElement("em", null, "still ", React.createElement("strong", null, "read "), React.createElement(EuiBadge, null, "this")))));
|
|
236
|
+
}));
|
|
237
|
+
var span = findTestSubject(component, 'span');
|
|
238
|
+
expect(span.props().title).toBe('I can still read this');
|
|
239
|
+
});
|
|
240
|
+
});
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
2
|
+
|
|
3
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
4
|
+
|
|
5
|
+
function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
6
|
+
|
|
7
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8
|
+
|
|
1
9
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
10
|
|
|
3
11
|
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; }
|
|
@@ -10,6 +18,7 @@ import classNames from 'classnames';
|
|
|
10
18
|
import { EuiButtonIcon } from '../button';
|
|
11
19
|
import { IconPropType, EuiIcon } from '../icon';
|
|
12
20
|
import { EuiToolTip } from '../tool_tip';
|
|
21
|
+
import { useInnerText } from '../inner_text';
|
|
13
22
|
var sizeToClassNameMap = {
|
|
14
23
|
xs: 'euiListGroupItem--xSmall',
|
|
15
24
|
s: 'euiListGroupItem--small',
|
|
@@ -73,11 +82,21 @@ export var EuiListGroupItem = function EuiListGroupItem(_ref) {
|
|
|
73
82
|
disabled: isDisabled
|
|
74
83
|
}));
|
|
75
84
|
} // Only add the label as the title attribute if it's possibly truncated
|
|
85
|
+
// Also ensure the value of the title attribute is a string
|
|
86
|
+
|
|
76
87
|
|
|
88
|
+
var _useInnerText = useInnerText(),
|
|
89
|
+
_useInnerText2 = _slicedToArray(_useInnerText, 2),
|
|
90
|
+
ref = _useInnerText2[0],
|
|
91
|
+
innerText = _useInnerText2[1];
|
|
77
92
|
|
|
78
|
-
var
|
|
93
|
+
var shouldRenderTitle = !wrapText && !showToolTip;
|
|
94
|
+
var labelContent = shouldRenderTitle ? React.createElement("span", {
|
|
95
|
+
ref: ref,
|
|
79
96
|
className: "euiListGroupItem__label",
|
|
80
|
-
title:
|
|
97
|
+
title: typeof label === 'string' ? label : innerText
|
|
98
|
+
}, label) : React.createElement("span", {
|
|
99
|
+
className: "euiListGroupItem__label"
|
|
81
100
|
}, label); // Handle the variety of interaction behavior
|
|
82
101
|
|
|
83
102
|
var itemContent;
|
|
@@ -406,7 +406,11 @@ function (_Component) {
|
|
|
406
406
|
setTimeout(function () {
|
|
407
407
|
_this3.setState({
|
|
408
408
|
isOpenStable: true
|
|
409
|
-
},
|
|
409
|
+
}, function () {
|
|
410
|
+
_this3.positionPopoverFixed();
|
|
411
|
+
|
|
412
|
+
_this3.updateFocus();
|
|
413
|
+
});
|
|
410
414
|
}, durationMatch + delayMatch);
|
|
411
415
|
} // update scroll listener
|
|
412
416
|
|
|
@@ -429,8 +433,6 @@ function (_Component) {
|
|
|
429
433
|
});
|
|
430
434
|
}, 250);
|
|
431
435
|
}
|
|
432
|
-
|
|
433
|
-
this.updateFocus();
|
|
434
436
|
}
|
|
435
437
|
}, {
|
|
436
438
|
key: "componentWillUnmount",
|
|
@@ -512,6 +514,8 @@ function (_Component) {
|
|
|
512
514
|
panel = React.createElement(EuiPortal, {
|
|
513
515
|
insert: insert
|
|
514
516
|
}, React.createElement(EuiFocusTrap, {
|
|
517
|
+
returnFocus: !this.state.isOpening // Ignore temporary state of indecisive focus
|
|
518
|
+
,
|
|
515
519
|
clickOutsideDisables: true,
|
|
516
520
|
initialFocus: _initialFocus,
|
|
517
521
|
disabled: !ownFocus
|
|
@@ -344,11 +344,11 @@ export var astToEsQueryDsl = function astToEsQueryDsl(ast, options) {
|
|
|
344
344
|
}, []);
|
|
345
345
|
must.push({
|
|
346
346
|
bool: {
|
|
347
|
-
should:
|
|
347
|
+
should: clauses.map(function (clause) {
|
|
348
348
|
return {
|
|
349
349
|
bool: clause
|
|
350
350
|
};
|
|
351
|
-
})
|
|
351
|
+
})
|
|
352
352
|
}
|
|
353
353
|
});
|
|
354
354
|
return must;
|