@elastic/eui 91.3.1 → 92.0.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.
Files changed (160) hide show
  1. package/dist/eui_charts_theme.js.map +1 -1
  2. package/dist/eui_theme_dark.css +0 -513
  3. package/dist/eui_theme_dark.min.css +1 -1
  4. package/dist/eui_theme_light.css +0 -513
  5. package/dist/eui_theme_light.min.css +1 -1
  6. package/es/components/basic_table/basic_table.js +5 -5
  7. package/es/components/drag_and_drop/drag_and_drop.a11y.js +1 -1
  8. package/es/components/filter_group/filter_button.js +20 -13
  9. package/es/components/filter_group/filter_button.styles.js +11 -20
  10. package/es/components/flyout/flyout.js +4 -4
  11. package/es/components/flyout/flyout_resizable.js +127 -0
  12. package/es/components/flyout/flyout_resizable.styles.js +27 -0
  13. package/es/components/flyout/index.js +2 -1
  14. package/es/components/form/range/dual_range.js +15 -66
  15. package/es/components/form/range/range.js +6 -5
  16. package/es/components/form/range/range_slider.js +28 -22
  17. package/es/components/form/text_area/text_area.js +39 -3
  18. package/es/components/index.js +0 -2
  19. package/es/components/markdown_editor/markdown_editor.js +12 -13
  20. package/es/components/page_template/bottom_bar/page_bottom_bar.js +1 -1
  21. package/es/components/selectable/selectable_list/selectable_list_item.js +1 -1
  22. package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +5 -0
  23. package/es/components/tree_view/tree_view.js +23 -25
  24. package/es/utils/prop_types/is.js +2 -2
  25. package/eui.d.ts +825 -1141
  26. package/i18ntokens.json +68 -338
  27. package/lib/components/basic_table/basic_table.js +5 -5
  28. package/lib/components/drag_and_drop/drag_and_drop.a11y.js +1 -1
  29. package/lib/components/filter_group/filter_button.js +20 -13
  30. package/lib/components/filter_group/filter_button.styles.js +11 -20
  31. package/lib/components/flyout/flyout.js +4 -4
  32. package/lib/components/flyout/flyout_resizable.js +136 -0
  33. package/lib/components/flyout/flyout_resizable.styles.js +32 -0
  34. package/lib/components/flyout/index.js +8 -1
  35. package/lib/components/form/range/dual_range.js +15 -66
  36. package/lib/components/form/range/range.js +6 -5
  37. package/lib/components/form/range/range_slider.js +27 -21
  38. package/lib/components/form/text_area/text_area.js +42 -3
  39. package/lib/components/index.js +0 -22
  40. package/lib/components/markdown_editor/markdown_editor.js +12 -13
  41. package/lib/components/page_template/bottom_bar/page_bottom_bar.js +1 -1
  42. package/lib/components/pagination/pagination_button.js +79 -2
  43. package/lib/components/selectable/selectable_list/selectable_list_item.js +1 -1
  44. package/lib/components/tree_view/tree_view.js +23 -25
  45. package/lib/utils/prop_types/is.js +2 -2
  46. package/optimize/es/components/basic_table/basic_table.js +5 -5
  47. package/optimize/es/components/drag_and_drop/drag_and_drop.a11y.js +1 -1
  48. package/optimize/es/components/filter_group/filter_button.js +20 -13
  49. package/optimize/es/components/filter_group/filter_button.styles.js +11 -20
  50. package/optimize/es/components/flyout/flyout.js +4 -4
  51. package/optimize/es/components/flyout/flyout_resizable.js +121 -0
  52. package/optimize/es/components/flyout/flyout_resizable.styles.js +27 -0
  53. package/optimize/es/components/flyout/index.js +2 -1
  54. package/optimize/es/components/form/range/dual_range.js +15 -66
  55. package/optimize/es/components/form/range/range.js +6 -5
  56. package/optimize/es/components/form/range/range_slider.js +26 -21
  57. package/optimize/es/components/form/text_area/text_area.js +29 -3
  58. package/optimize/es/components/index.js +0 -2
  59. package/optimize/es/components/markdown_editor/markdown_editor.js +12 -13
  60. package/optimize/es/components/page_template/bottom_bar/page_bottom_bar.js +1 -1
  61. package/optimize/es/components/selectable/selectable_list/selectable_list_item.js +1 -1
  62. package/optimize/es/components/tree_view/tree_view.js +23 -25
  63. package/optimize/es/utils/prop_types/is.js +2 -2
  64. package/optimize/lib/components/basic_table/basic_table.js +5 -5
  65. package/optimize/lib/components/drag_and_drop/drag_and_drop.a11y.js +1 -1
  66. package/optimize/lib/components/filter_group/filter_button.js +20 -13
  67. package/optimize/lib/components/filter_group/filter_button.styles.js +11 -20
  68. package/optimize/lib/components/flyout/flyout.js +4 -4
  69. package/optimize/lib/components/flyout/flyout_resizable.js +131 -0
  70. package/optimize/lib/components/flyout/flyout_resizable.styles.js +32 -0
  71. package/optimize/lib/components/flyout/index.js +8 -1
  72. package/optimize/lib/components/form/range/dual_range.js +15 -66
  73. package/optimize/lib/components/form/range/range.js +6 -5
  74. package/optimize/lib/components/form/range/range_slider.js +26 -21
  75. package/optimize/lib/components/form/text_area/text_area.js +32 -3
  76. package/optimize/lib/components/index.js +0 -22
  77. package/optimize/lib/components/markdown_editor/markdown_editor.js +12 -13
  78. package/optimize/lib/components/page_template/bottom_bar/page_bottom_bar.js +1 -1
  79. package/optimize/lib/components/selectable/selectable_list/selectable_list_item.js +1 -1
  80. package/optimize/lib/components/tree_view/tree_view.js +23 -25
  81. package/optimize/lib/utils/prop_types/is.js +2 -2
  82. package/package.json +2 -2
  83. package/src/components/index.scss +0 -2
  84. package/test-env/components/basic_table/basic_table.js +5 -5
  85. package/test-env/components/drag_and_drop/drag_and_drop.a11y.js +1 -1
  86. package/test-env/components/filter_group/filter_button.js +20 -13
  87. package/test-env/components/filter_group/filter_button.styles.js +11 -20
  88. package/test-env/components/flyout/flyout_resizable.js +131 -0
  89. package/test-env/components/flyout/flyout_resizable.styles.js +32 -0
  90. package/test-env/components/flyout/index.js +8 -1
  91. package/test-env/components/form/range/dual_range.js +15 -66
  92. package/test-env/components/form/range/range.js +6 -5
  93. package/test-env/components/form/range/range_slider.js +27 -21
  94. package/test-env/components/form/text_area/text_area.js +42 -3
  95. package/test-env/components/index.js +0 -22
  96. package/test-env/components/markdown_editor/markdown_editor.js +12 -13
  97. package/test-env/components/page_template/bottom_bar/page_bottom_bar.js +1 -1
  98. package/test-env/components/pagination/pagination_button.js +79 -2
  99. package/test-env/components/selectable/selectable_list/selectable_list_item.js +1 -1
  100. package/test-env/components/tree_view/tree_view.js +23 -25
  101. package/test-env/utils/prop_types/is.js +2 -2
  102. package/es/components/control_bar/control_bar.a11y.js +0 -133
  103. package/es/components/control_bar/control_bar.js +0 -609
  104. package/es/components/control_bar/index.js +0 -9
  105. package/es/components/notification/index.js +0 -9
  106. package/es/components/notification/notification_event.a11y.js +0 -104
  107. package/es/components/notification/notification_event.js +0 -288
  108. package/es/components/notification/notification_event_messages.js +0 -79
  109. package/es/components/notification/notification_event_meta.js +0 -148
  110. package/es/components/notification/notification_event_read_button.js +0 -86
  111. package/es/components/notification/notification_event_read_icon.js +0 -77
  112. package/lib/components/control_bar/control_bar.a11y.js +0 -134
  113. package/lib/components/control_bar/control_bar.js +0 -441
  114. package/lib/components/control_bar/index.js +0 -12
  115. package/lib/components/notification/index.js +0 -12
  116. package/lib/components/notification/notification_event.a11y.js +0 -105
  117. package/lib/components/notification/notification_event.js +0 -297
  118. package/lib/components/notification/notification_event_messages.js +0 -88
  119. package/lib/components/notification/notification_event_meta.js +0 -157
  120. package/lib/components/notification/notification_event_read_button.js +0 -93
  121. package/lib/components/notification/notification_event_read_icon.js +0 -64
  122. package/optimize/es/components/control_bar/control_bar.a11y.js +0 -128
  123. package/optimize/es/components/control_bar/control_bar.js +0 -308
  124. package/optimize/es/components/control_bar/index.js +0 -9
  125. package/optimize/es/components/notification/index.js +0 -9
  126. package/optimize/es/components/notification/notification_event.a11y.js +0 -99
  127. package/optimize/es/components/notification/notification_event.js +0 -114
  128. package/optimize/es/components/notification/notification_event_messages.js +0 -63
  129. package/optimize/es/components/notification/notification_event_meta.js +0 -106
  130. package/optimize/es/components/notification/notification_event_read_button.js +0 -44
  131. package/optimize/es/components/notification/notification_event_read_icon.js +0 -44
  132. package/optimize/lib/components/control_bar/control_bar.a11y.js +0 -134
  133. package/optimize/lib/components/control_bar/control_bar.js +0 -301
  134. package/optimize/lib/components/control_bar/index.js +0 -12
  135. package/optimize/lib/components/notification/index.js +0 -12
  136. package/optimize/lib/components/notification/notification_event.a11y.js +0 -105
  137. package/optimize/lib/components/notification/notification_event.js +0 -123
  138. package/optimize/lib/components/notification/notification_event_messages.js +0 -74
  139. package/optimize/lib/components/notification/notification_event_meta.js +0 -117
  140. package/optimize/lib/components/notification/notification_event_read_button.js +0 -51
  141. package/optimize/lib/components/notification/notification_event_read_icon.js +0 -51
  142. package/src/components/control_bar/_control_bar.scss +0 -232
  143. package/src/components/control_bar/_index.scss +0 -2
  144. package/src/components/control_bar/_variables.scss +0 -12
  145. package/src/components/notification/_index.scss +0 -5
  146. package/src/components/notification/_notification_event.scss +0 -40
  147. package/src/components/notification/_notification_event_messages.scss +0 -17
  148. package/src/components/notification/_notification_event_meta.scss +0 -44
  149. package/src/components/notification/_notification_event_read_button.scss +0 -5
  150. package/src/components/notification/_notification_event_read_icon.scss +0 -12
  151. package/test-env/components/control_bar/control_bar.a11y.js +0 -134
  152. package/test-env/components/control_bar/control_bar.js +0 -436
  153. package/test-env/components/control_bar/index.js +0 -12
  154. package/test-env/components/notification/index.js +0 -12
  155. package/test-env/components/notification/notification_event.a11y.js +0 -105
  156. package/test-env/components/notification/notification_event.js +0 -296
  157. package/test-env/components/notification/notification_event_messages.js +0 -85
  158. package/test-env/components/notification/notification_event_meta.js +0 -154
  159. package/test-env/components/notification/notification_event_read_button.js +0 -92
  160. package/test-env/components/notification/notification_event_read_icon.js +0 -63
@@ -1,134 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _typeof = require("@babel/runtime/helpers/typeof");
5
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
6
- var _react = _interopRequireWildcard(require("react"));
7
- var _button = require("../button");
8
- var _control_bar = require("./control_bar");
9
- var _panel = require("../panel");
10
- var _text = require("../text");
11
- var _react2 = require("@emotion/react");
12
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
14
- /*
15
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
16
- * or more contributor license agreements. Licensed under the Elastic License
17
- * 2.0 and the Server Side Public License, v 1; you may not use this file except
18
- * in compliance with, at your election, the Elastic License 2.0 or the Server
19
- * Side Public License, v 1.
20
- */
21
-
22
- /// <reference types="cypress" />
23
- /// <reference types="cypress-real-events" />
24
- /// <reference types="../../../cypress/support" />
25
-
26
- var ControlBar = function ControlBar() {
27
- var _useState = (0, _react.useState)(false),
28
- _useState2 = (0, _slicedToArray2.default)(_useState, 2),
29
- contentIsVisible = _useState2[0],
30
- setVisibility = _useState2[1];
31
- var _useState3 = (0, _react.useState)(false),
32
- _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
33
- isDisplaying = _useState4[0],
34
- setDisplay = _useState4[1];
35
- var toggleContent = function toggleContent() {
36
- setVisibility(!contentIsVisible);
37
- };
38
- var toggleDisplay = function toggleDisplay() {
39
- setDisplay(!isDisplaying);
40
- setVisibility(false);
41
- };
42
- var codeControls = [{
43
- controlType: 'icon',
44
- id: 'root_icon',
45
- iconType: 'submodule',
46
- 'aria-label': 'Project Root'
47
- }, {
48
- controlType: 'breadcrumbs',
49
- id: 'current_file_path',
50
- breadcrumbs: [{
51
- text: 'src'
52
- }, {
53
- text: 'components'
54
- }]
55
- }, {
56
- controlType: 'spacer'
57
- }, {
58
- controlType: 'icon',
59
- id: 'status_icon',
60
- iconType: 'warning',
61
- color: 'warning',
62
- 'aria-label': 'Repo Status'
63
- }, {
64
- controlType: 'divider'
65
- }, {
66
- controlType: 'icon',
67
- id: 'branch_icon',
68
- iconType: 'branch',
69
- 'aria-label': 'Branch Icon'
70
- }, {
71
- controlType: 'text',
72
- id: 'branch_name',
73
- text: 'some_long_branch'
74
- }, {
75
- controlType: 'divider'
76
- }, {
77
- controlType: 'icon',
78
- id: 'github_icon',
79
- iconType: 'logoGithub',
80
- onClick: function onClick() {},
81
- title: 'Open in Github',
82
- 'aria-label': 'Open in Github'
83
- }, {
84
- controlType: 'divider'
85
- }, {
86
- controlType: 'button',
87
- id: 'open_history_view',
88
- label: contentIsVisible ? 'Hide history' : 'Show history',
89
- color: 'primary',
90
- onClick: toggleContent
91
- }];
92
- var display;
93
- if (isDisplaying) {
94
- display = (0, _react2.jsx)(_control_bar.EuiControlBar, {
95
- controls: codeControls,
96
- showContent: contentIsVisible
97
- }, (0, _react2.jsx)("div", {
98
- style: {
99
- padding: '2rem',
100
- maxWidth: '60rem',
101
- margin: '0 auto'
102
- }
103
- }, (0, _react2.jsx)(_panel.EuiPanel, null, (0, _react2.jsx)(_text.EuiText, null, (0, _react2.jsx)("h1", null, "1984"), (0, _react2.jsx)("h3", null, "By: George Orwell"), (0, _react2.jsx)("p", null, "It was a bright cold day in April, and the clocks were striking thirteen. Winston Smith, his chin nuzzled into his breast in an effort to escape the vile wind, slipped quickly through the glass doors of Victory Mansions, though not quickly enough to prevent a swirl of gritty dust from entering along with him."), (0, _react2.jsx)("p", null, "The hallway smelt of boiled cabbage and old rag mats. At one end of it a coloured poster, too large for indoor display, had been tacked to the wall. It depicted simply an enormous face, more than a metre wide: the face of a man of about forty-five, with a heavy black moustache and ruggedly handsome features. Winston made for the stairs. It was no use trying the lift. Even at the best of times it was seldom working, and at present the electric current was cut off during daylight hours. It was part of the economy drive in preparation for Hate Week. The flat was seven flights up, and Winston, who was thirty-nine and had a varicose ulcer above his right ankle, went slowly, resting several times on the way. On each landing, opposite the lift-shaft, the poster with the enormous face gazed from the wall. It was one of those pictures which are so contrived that the eyes follow you about when you move. BIG BROTHER IS WATCHING YOU, the caption beneath it ran."), (0, _react2.jsx)("p", null, "Inside the flat a fruity voice was reading out a list of figures which had something to do with the production of pig-iron. The voice came from an oblong metal plaque like a dulled mirror which formed part of the surface of the right-hand wall. Winston turned a switch and the voice sank somewhat, though the words were still distinguishable. The instrument (the telescreen, it was called) could be dimmed, but there was no way of shutting it off completely. He moved over to the window: a smallish, frail figure, the meagreness of his body merely emphasized by the blue overalls which were the uniform of the party. His hair was very fair, his face naturally sanguine, his skin roughened by coarse soap and blunt razor blades and the cold of the winter that had just ended.")))));
104
- }
105
- return (0, _react2.jsx)("div", null, (0, _react2.jsx)(_button.EuiButton, {
106
- onClick: toggleDisplay
107
- }, "Toggle example"), display);
108
- };
109
- beforeEach(function () {
110
- cy.viewport(1024, 768);
111
- cy.mount((0, _react2.jsx)(ControlBar, null));
112
- cy.get('section[aria-label="Page level controls"]').should('not.exist');
113
- });
114
- describe('EuiControlBar', function () {
115
- describe('Automated accessibility check', function () {
116
- it('has zero violations on render', function () {
117
- cy.checkAxe();
118
- });
119
- it('has zero violations when control bar is shown', function () {
120
- cy.get('button.euiButton').contains('Toggle example').realClick();
121
- cy.get('section[aria-label="Page level controls"]').should('exist');
122
- cy.checkAxe({
123
- context: 'section[aria-label="Page level controls"]'
124
- });
125
- });
126
- it('has zero violations when control bar is hidden', function () {
127
- cy.get('button.euiButton').contains('Toggle example').realClick();
128
- cy.get('section[aria-label="Page level controls"]').should('exist');
129
- cy.get('button.euiButton').contains('Toggle example').realClick();
130
- cy.get('section[aria-label="Page level controls"]').should('not.exist');
131
- cy.checkAxe();
132
- });
133
- });
134
- });
@@ -1,436 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _typeof = require("@babel/runtime/helpers/typeof");
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.EuiControlBar = void 0;
9
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
12
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
14
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
15
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
16
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
17
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
18
- var _classnames = _interopRequireDefault(require("classnames"));
19
- var _propTypes = _interopRequireDefault(require("prop-types"));
20
- var _react = _interopRequireWildcard(require("react"));
21
- var _services = require("../../services");
22
- var _accessibility = require("../accessibility");
23
- var _breadcrumbs = require("../breadcrumbs");
24
- var _button = require("../button");
25
- var _i18n = require("../i18n");
26
- var _icon = require("../icon");
27
- var _portal = require("../portal");
28
- var _react2 = require("@emotion/react");
29
- var _excluded = ["children", "className", "showContent", "controls", "size", "leftOffset", "rightOffset", "maxHeight", "showOnMobile", "style", "position", "bodyClassName", "landmarkHeading"],
30
- _excluded2 = ["controlType", "id", "color", "label", "className"],
31
- _excluded3 = ["controlType", "id", "iconType", "className", "color", "onClick", "href"],
32
- _excluded4 = ["controlType", "id", "text", "className"],
33
- _excluded5 = ["controlType", "id", "label", "onClick", "className"],
34
- _excluded6 = ["controlType", "id"];
35
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
36
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
37
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
38
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
39
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
40
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /*
41
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
42
- * or more contributor license agreements. Licensed under the Elastic License
43
- * 2.0 and the Server Side Public License, v 1; you may not use this file except
44
- * in compliance with, at your election, the Elastic License 2.0 or the Server
45
- * Side Public License, v 1.
46
- */ /**
47
- * Extends EuiButton excluding `size`. Requires `label` as the `children`.
48
- */ /**
49
- * Creates a `button` visually styles as a tab.
50
- * Requires `label` as the `children`.
51
- * `onClick` must be provided to handle the content swapping.
52
- */ /**
53
- * Extends EuiBreadcrumbs
54
- */ /**
55
- * Simple div controlling color and size text output.
56
- * Requires `label` as the `children`.
57
- */ /**
58
- * Custom props specific to the icon control type
59
- */ /**
60
- * Icon can extend EuiIcon
61
- * Had to omit `onClick` as it's a valid prop of SVGElement
62
- * Also omits `type` and `id` as these are also specific to icon control
63
- */ /**
64
- * Icon can extend EuiButtonIcon
65
- * Also omits `iconType` and `id` as these are also specific to icon control
66
- */ /**
67
- * @deprecated
68
- */
69
- /**
70
- * @deprecated - EuiControlBar is scheduled for deprecation due to low internal usage and high
71
- * overlap with other existing EUI components. We recommend using EuiBottomBar instead,
72
- * or copying this component into your own application for usage if necessary.
73
- *
74
- * The component will be permanently removed in December 2023.
75
- */
76
- var EuiControlBar = /*#__PURE__*/function (_Component) {
77
- (0, _inherits2.default)(EuiControlBar, _Component);
78
- var _super = _createSuper(EuiControlBar);
79
- function EuiControlBar() {
80
- var _this;
81
- (0, _classCallCheck2.default)(this, EuiControlBar);
82
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
83
- args[_key] = arguments[_key];
84
- }
85
- _this = _super.call.apply(_super, [this].concat(args));
86
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "bar", null);
87
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
88
- selectedTab: ''
89
- });
90
- return _this;
91
- }
92
- (0, _createClass2.default)(EuiControlBar, [{
93
- key: "componentDidMount",
94
- value: function componentDidMount() {
95
- if (this.props.position === 'fixed') {
96
- var height = this.bar ? this.bar.clientHeight : -1;
97
- document.body.style.paddingBottom = "".concat(height, "px");
98
- if (this.props.bodyClassName) {
99
- document.body.classList.add(this.props.bodyClassName);
100
- }
101
- }
102
- }
103
- }, {
104
- key: "componentWillUnmount",
105
- value: function componentWillUnmount() {
106
- document.body.style.paddingBottom = '';
107
- if (this.props.bodyClassName) {
108
- document.body.classList.remove(this.props.bodyClassName);
109
- }
110
- }
111
- }, {
112
- key: "render",
113
- value: function render() {
114
- var _this2 = this;
115
- var _this$props = this.props,
116
- children = _this$props.children,
117
- className = _this$props.className,
118
- showContent = _this$props.showContent,
119
- controls = _this$props.controls,
120
- size = _this$props.size,
121
- leftOffset = _this$props.leftOffset,
122
- rightOffset = _this$props.rightOffset,
123
- maxHeight = _this$props.maxHeight,
124
- showOnMobile = _this$props.showOnMobile,
125
- style = _this$props.style,
126
- position = _this$props.position,
127
- bodyClassName = _this$props.bodyClassName,
128
- landmarkHeading = _this$props.landmarkHeading,
129
- rest = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
130
- var styles = _objectSpread(_objectSpread({}, style), {}, {
131
- left: leftOffset,
132
- right: rightOffset,
133
- maxHeight: maxHeight
134
- });
135
- var classes = (0, _classnames.default)('euiControlBar', className, {
136
- 'euiControlBar-isOpen': showContent,
137
- 'euiControlBar--large': size === 'l',
138
- 'euiControlBar--medium': size === 'm',
139
- 'euiControlBar--small': size === 's',
140
- 'euiControlBar--fixed': position === 'fixed',
141
- 'euiControlBar--absolute': position === 'absolute',
142
- 'euiControlBar--relative': position === 'relative',
143
- 'euiControlBar--showOnMobile': showOnMobile
144
- });
145
- var handleTabClick = function handleTabClick(control, e) {
146
- _this2.setState({
147
- selectedTab: control.id
148
- }, function () {
149
- control.onClick(e);
150
- });
151
- };
152
- var controlItem = function controlItem(control, index) {
153
- switch (control.controlType) {
154
- case 'button':
155
- {
156
- var controlType = control.controlType,
157
- id = control.id,
158
- color = control.color,
159
- label = control.label,
160
- _className = control.className,
161
- _rest = (0, _objectWithoutProperties2.default)(control, _excluded2);
162
- return (0, _react2.jsx)(_button.EuiButton, (0, _extends2.default)({
163
- key: id + index,
164
- className: (0, _classnames.default)('euiControlBar__button', _className),
165
- color: color
166
- }, _rest, {
167
- size: "s"
168
- }), label);
169
- }
170
- case 'icon':
171
- {
172
- var _controlType = control.controlType,
173
- _id = control.id,
174
- iconType = control.iconType,
175
- _className2 = control.className,
176
- _control$color = control.color,
177
- _color = _control$color === void 0 ? 'text' : _control$color,
178
- onClick = control.onClick,
179
- href = control.href,
180
- _rest2 = (0, _objectWithoutProperties2.default)(control, _excluded3);
181
- return onClick || href ? (0, _react2.jsx)(_button.EuiButtonIcon, (0, _extends2.default)({
182
- key: _id + index,
183
- className: (0, _classnames.default)('euiControlBar__buttonIcon', _className2),
184
- onClick: onClick,
185
- href: href,
186
- color: _color
187
- }, _rest2, {
188
- iconType: iconType
189
- })) : (0, _react2.jsx)(_icon.EuiIcon, (0, _extends2.default)({
190
- key: _id + index,
191
- className: (0, _classnames.default)('euiControlBar__icon', _className2),
192
- type: iconType,
193
- color: _color
194
- }, _rest2));
195
- }
196
- case 'divider':
197
- return (0, _react2.jsx)("div", {
198
- key: control.controlType + index,
199
- className: "euiControlBar__divider"
200
- });
201
- case 'spacer':
202
- return (0, _react2.jsx)("div", {
203
- key: control.controlType + index,
204
- className: "euiControlBar__spacer"
205
- });
206
- case 'text':
207
- {
208
- var _controlType2 = control.controlType,
209
- _id2 = control.id,
210
- text = control.text,
211
- _className3 = control.className,
212
- _rest3 = (0, _objectWithoutProperties2.default)(control, _excluded4);
213
- return (0, _react2.jsx)("div", (0, _extends2.default)({
214
- key: _id2,
215
- className: (0, _classnames.default)('euiControlBar__text', _className3)
216
- }, _rest3), text);
217
- }
218
- case 'tab':
219
- {
220
- var _controlType3 = control.controlType,
221
- _id3 = control.id,
222
- _label = control.label,
223
- _onClick = control.onClick,
224
- _className4 = control.className,
225
- _rest4 = (0, _objectWithoutProperties2.default)(control, _excluded5);
226
- var tabClasses = (0, _classnames.default)('euiControlBar__tab', {
227
- 'euiControlBar__tab--active': showContent && _id3 === _this2.state.selectedTab
228
- }, _className4);
229
- return (0, _react2.jsx)("button", (0, _extends2.default)({
230
- key: _id3 + index,
231
- className: tabClasses,
232
- onClick: function onClick(event) {
233
- return handleTabClick(control, event);
234
- }
235
- }, _rest4), _label);
236
- }
237
- case 'breadcrumbs':
238
- {
239
- var _controlType4 = control.controlType,
240
- _id4 = control.id,
241
- _rest5 = (0, _objectWithoutProperties2.default)(control, _excluded6);
242
- return (0, _react2.jsx)(_breadcrumbs.EuiBreadcrumbs, (0, _extends2.default)({
243
- className: "euiControlBar__breadcrumbs",
244
- key: control.id
245
- }, _rest5));
246
- }
247
- }
248
- };
249
- var controlBar = (0, _react2.jsx)(_i18n.EuiI18n, {
250
- token: "euiControlBar.screenReaderHeading",
251
- default: "Page level controls"
252
- }, function (screenReaderHeading) {
253
- return (0, _react2.jsx)(_services.EuiThemeProvider, {
254
- colorMode: "dark",
255
- wrapperProps: {
256
- cloneElement: true
257
- }
258
- }, (0, _react2.jsx)("section", (0, _extends2.default)({
259
- className: classes
260
- // Though it would be better to use aria-labelledby than aria-label
261
- // and not repeat the same string twice, a bug in voiceover won't list
262
- // some landmarks in the rotor without an aria-label
263
- ,
264
- "aria-label": landmarkHeading ? landmarkHeading : screenReaderHeading
265
- }, rest, {
266
- style: styles
267
- }), (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("h2", null, landmarkHeading ? landmarkHeading : screenReaderHeading)), (0, _react2.jsx)("div", {
268
- className: "euiControlBar__controls",
269
- ref: function ref(node) {
270
- _this2.bar = node;
271
- }
272
- }, controls.map(function (control, index) {
273
- return controlItem(control, index);
274
- })), _this2.props.showContent ? (0, _react2.jsx)("div", {
275
- className: "euiControlBar__content"
276
- }, children) : null));
277
- });
278
- return position === 'fixed' ? (0, _react2.jsx)(_portal.EuiPortal, null, controlBar, (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("p", {
279
- "aria-live": "assertive"
280
- }, landmarkHeading ? (0, _react2.jsx)(_i18n.EuiI18n, {
281
- token: "euiControlBar.customScreenReaderAnnouncement",
282
- default: "There is a new region landmark called {landmarkHeading} with page level controls at the end of the document.",
283
- values: {
284
- landmarkHeading: landmarkHeading
285
- }
286
- }) : (0, _react2.jsx)(_i18n.EuiI18n, {
287
- token: "euiControlBar.screenReaderAnnouncement",
288
- default: "There is a new region landmark with page level controls at the end of the document."
289
- })))) : controlBar;
290
- }
291
- }]);
292
- return EuiControlBar;
293
- }(_react.Component);
294
- exports.EuiControlBar = EuiControlBar;
295
- (0, _defineProperty2.default)(EuiControlBar, "defaultProps", {
296
- leftOffset: 0,
297
- rightOffset: 0,
298
- position: 'fixed',
299
- size: 'l',
300
- showContent: false,
301
- showOnMobile: false
302
- });
303
- EuiControlBar.propTypes = {
304
- className: _propTypes.default.string,
305
- "aria-label": _propTypes.default.string,
306
- "data-test-subj": _propTypes.default.string,
307
- css: _propTypes.default.any,
308
- /**
309
- * Show or hide the content area containing the `children`
310
- */
311
- showContent: _propTypes.default.bool,
312
- /**
313
- * An array of controls, actions, and layout spacers to display.
314
- * Accepts `'button' | 'tab' | 'breadcrumbs' | 'text' | 'icon' | 'spacer' | 'divider'`
315
- */
316
- controls: _propTypes.default.arrayOf(_propTypes.default.shape({
317
- href: _propTypes.default.string,
318
- onClick: _propTypes.default.func,
319
- id: _propTypes.default.string,
320
- label: _propTypes.default.oneOfType([_propTypes.default.node.isRequired, _propTypes.default.node]),
321
- buttonRef: _propTypes.default.any,
322
- controlType: _propTypes.default.oneOfType([_propTypes.default.oneOfType([_propTypes.default.oneOfType([_propTypes.default.oneOfType([_propTypes.default.oneOfType([_propTypes.default.oneOf(["button"]).isRequired, _propTypes.default.oneOfType([_propTypes.default.oneOf(["breadcrumbs"]).isRequired, _propTypes.default.oneOf(["tab"]).isRequired]).isRequired]).isRequired, _propTypes.default.oneOf(["text"]).isRequired]).isRequired, _propTypes.default.oneOf(["icon"]).isRequired]).isRequired, _propTypes.default.oneOf(["divider"]).isRequired]).isRequired, _propTypes.default.oneOf(["spacer"]).isRequired]).isRequired,
323
- className: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.string]),
324
- "aria-label": _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.string]),
325
- "data-test-subj": _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.string]),
326
- css: _propTypes.default.oneOfType([_propTypes.default.any, _propTypes.default.any]),
327
- /**
328
- * Hides extra (above the max) breadcrumbs under a collapsed item as the window gets smaller.
329
- * Pass a custom #EuiBreadcrumbResponsiveMaxCount object to change the number of breadcrumbs to show at the particular breakpoints.
330
- *
331
- * Pass `false` to turn this behavior off.
332
- *
333
- * Default: `{ xs: 1, s: 2, m: 4 }`
334
- */
335
- responsive: _propTypes.default.oneOfType([_propTypes.default.bool.isRequired, _propTypes.default.any.isRequired]),
336
- /**
337
- * Forces all breadcrumbs to single line and
338
- * truncates each breadcrumb to a particular width,
339
- * except for the last item
340
- */
341
- truncate: _propTypes.default.bool,
342
- /**
343
- * Collapses the inner items past the maximum set here
344
- * into a single ellipses item.
345
- * Omitting or passing a `0` value will show all breadcrumbs.
346
- */
347
- max: _propTypes.default.oneOfType([_propTypes.default.number.isRequired, _propTypes.default.oneOf([null])]),
348
- /**
349
- * The array of individual #EuiBreadcrumb items
350
- */
351
- breadcrumbs: _propTypes.default.arrayOf(_propTypes.default.shape({
352
- className: _propTypes.default.string,
353
- "aria-label": _propTypes.default.string,
354
- "data-test-subj": _propTypes.default.string,
355
- css: _propTypes.default.any,
356
- href: _propTypes.default.string,
357
- rel: _propTypes.default.string,
358
- onClick: _propTypes.default.func,
359
- /**
360
- * Visible label of the breadcrumb
361
- */
362
- text: _propTypes.default.node.isRequired,
363
- /**
364
- * Force a max-width on the breadcrumb text
365
- */
366
- truncate: _propTypes.default.bool,
367
- /**
368
- * Accepts any EuiLink `color` when rendered as one (has `href`, `onClick`, or `popoverContent`)
369
- */
370
- color: _propTypes.default.any,
371
- /**
372
- * Override the existing `aria-current` which defaults to `page` for the last breadcrumb
373
- */
374
- "aria-current": _propTypes.default.any,
375
- /**
376
- * Creates a breadcrumb that toggles a popover dialog
377
- *
378
- * If passed, both `href` and `onClick` will be ignored - the breadcrumb's
379
- * click behavior should only trigger a popover.
380
- */
381
- popoverContent: _propTypes.default.node,
382
- /**
383
- * Allows customizing the popover if necessary. Accepts any props that
384
- * [EuiPopover](/#/layout/popover) accepts, except for props that control state.
385
- */
386
- popoverProps: _propTypes.default.any
387
- }).isRequired),
388
- /**
389
- * Determines breadcrumbs appearance, with `page` being the default styling.
390
- * Application breadcrumbs should only be once per page, in (e.g.) EuiHeader
391
- */
392
- type: _propTypes.default.oneOf(["page", "application"]),
393
- /**
394
- * Whether the last breadcrumb should visually (and accessibly, to screen readers)
395
- * be highlighted as the current page. Defaults to true.
396
- */
397
- lastBreadcrumbIsCurrentPage: _propTypes.default.bool,
398
- text: _propTypes.default.node,
399
- iconType: _propTypes.default.string
400
- }).isRequired).isRequired,
401
- /**
402
- * The default height of the content area.
403
- */
404
- size: _propTypes.default.oneOf(["s", "m", "l"]),
405
- /**
406
- * Customize the max height.
407
- * Best when used with `size=l` as this will ensure the actual height equals the max height set.
408
- */
409
- maxHeight: _propTypes.default.oneOfType([_propTypes.default.number.isRequired, _propTypes.default.string.isRequired]),
410
- /**
411
- * Set the offset from the left side of the screen.
412
- */
413
- leftOffset: _propTypes.default.oneOfType([_propTypes.default.number.isRequired, _propTypes.default.string.isRequired]),
414
- /**
415
- * Set the offset from the left side of the screen.
416
- */
417
- rightOffset: _propTypes.default.oneOfType([_propTypes.default.number.isRequired, _propTypes.default.string.isRequired]),
418
- /**
419
- * The control bar is hidden on mobile by default. Use the `showOnMobile` prop to force it's display on mobile screens.
420
- * You'll need to ensure that the content you place into the bar renders as expected on mobile.
421
- */
422
- showOnMobile: _propTypes.default.bool,
423
- /**
424
- * By default EuiControlBar will live in a portal, fixed position to the browser window.
425
- * Change the position of the bar to live inside a container and be positioned against its parent.
426
- */
427
- position: _propTypes.default.oneOf(["fixed", "relative", "absolute"]),
428
- /**
429
- * Optional class applied to the body used when `position = fixed`
430
- */
431
- bodyClassName: _propTypes.default.string,
432
- /**
433
- * Customize the screen reader heading that helps users find this control. Default is "Page level controls".
434
- */
435
- landmarkHeading: _propTypes.default.string
436
- };
@@ -1,12 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "EuiControlBar", {
7
- enumerable: true,
8
- get: function get() {
9
- return _control_bar.EuiControlBar;
10
- }
11
- });
12
- var _control_bar = require("./control_bar");
@@ -1,12 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "EuiNotificationEvent", {
7
- enumerable: true,
8
- get: function get() {
9
- return _notification_event.EuiNotificationEvent;
10
- }
11
- });
12
- var _notification_event = require("./notification_event");