@elastic/eui 73.0.0 → 74.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.
- package/dist/eui_theme_dark.css +0 -55
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +0 -55
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/basic_table/basic_table.js +56 -101
- package/es/components/basic_table/basic_table.styles.js +45 -0
- package/es/components/modal/confirm_modal.js +5 -3
- package/es/components/modal/modal.a11y.js +1 -1
- package/es/components/modal/modal_header_title.js +12 -3
- package/es/components/resizable_container/resizable_panel.js +5 -0
- package/es/services/security/get_secure_rel_for_target.js +2 -8
- package/es/services/theme/hooks.js +18 -0
- package/es/services/theme/index.js +1 -1
- package/eui.d.ts +46 -19
- package/i18ntokens.json +18 -18
- package/lib/components/basic_table/basic_table.js +56 -100
- package/lib/components/basic_table/basic_table.styles.js +54 -0
- package/lib/components/modal/confirm_modal.js +5 -3
- package/lib/components/modal/modal.a11y.js +1 -1
- package/lib/components/modal/modal_header_title.js +12 -3
- package/lib/components/resizable_container/resizable_panel.js +5 -0
- package/lib/services/security/get_secure_rel_for_target.js +2 -9
- package/lib/services/theme/hooks.js +22 -2
- package/lib/services/theme/index.js +6 -0
- package/optimize/es/components/basic_table/basic_table.js +56 -101
- package/optimize/es/components/basic_table/basic_table.styles.js +45 -0
- package/optimize/es/components/modal/confirm_modal.js +4 -3
- package/optimize/es/components/modal/modal.a11y.js +1 -1
- package/optimize/es/components/modal/modal_header_title.js +4 -2
- package/optimize/es/services/security/get_secure_rel_for_target.js +2 -8
- package/optimize/es/services/theme/hooks.js +18 -0
- package/optimize/es/services/theme/index.js +1 -1
- package/optimize/lib/components/basic_table/basic_table.js +56 -95
- package/optimize/lib/components/basic_table/basic_table.styles.js +56 -0
- package/optimize/lib/components/modal/confirm_modal.js +4 -3
- package/optimize/lib/components/modal/modal.a11y.js +1 -1
- package/optimize/lib/components/modal/modal_header_title.js +4 -2
- package/optimize/lib/services/security/get_secure_rel_for_target.js +2 -9
- package/optimize/lib/services/theme/hooks.js +22 -2
- package/optimize/lib/services/theme/index.js +6 -0
- package/package.json +1 -1
- package/src/components/index.scss +0 -1
- package/test-env/components/basic_table/basic_table.js +56 -95
- package/test-env/components/basic_table/basic_table.styles.js +56 -0
- package/test-env/components/modal/confirm_modal.js +5 -3
- package/test-env/components/modal/modal.a11y.js +1 -1
- package/test-env/components/modal/modal_header_title.js +12 -3
- package/test-env/components/resizable_container/resizable_panel.js +5 -0
- package/test-env/services/security/get_secure_rel_for_target.js +2 -9
- package/test-env/services/theme/hooks.js +22 -2
- package/test-env/services/theme/index.js +6 -0
- package/CHANGELOG.md +0 -6185
- package/es/services/url.js +0 -23
- package/lib/services/url.js +0 -32
- package/optimize/es/services/url.js +0 -23
- package/optimize/lib/services/url.js +0 -32
- package/src/components/basic_table/_basic_table.scss +0 -41
- package/src/components/basic_table/_index.scss +0 -1
- package/src/components/date_picker/react-datepicker/LICENSE +0 -21
- package/src/components/date_picker/react-datepicker/README.md +0 -168
- package/src/services/theme/README.md +0 -153
- package/src/test/README.md +0 -59
- package/test-env/services/url.js +0 -32
|
@@ -64,6 +64,8 @@ var _delay_render = require("../delay_render");
|
|
|
64
64
|
|
|
65
65
|
var _accessibility2 = require("../../services/accessibility");
|
|
66
66
|
|
|
67
|
+
var _basic_table = require("./basic_table.styles");
|
|
68
|
+
|
|
67
69
|
var _react2 = require("@emotion/react");
|
|
68
70
|
|
|
69
71
|
var _excluded = ["className", "loading", "items", "itemId", "columns", "pagination", "sorting", "selection", "onChange", "error", "noItemsMessage", "compressed", "itemIdToExpandedRowMap", "responsive", "isSelectable", "isExpandable", "hasActions", "rowProps", "cellProps", "tableCaption", "rowHeader", "tableLayout"],
|
|
@@ -184,40 +186,6 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
184
186
|
|
|
185
187
|
(0, _classCallCheck2.default)(this, EuiBasicTable);
|
|
186
188
|
_this = _super.call(this, props);
|
|
187
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "cleanups", []);
|
|
188
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "tbody", null);
|
|
189
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "setTbody", function (tbody) {
|
|
190
|
-
// remove listeners from an existing element
|
|
191
|
-
_this.removeLoadingListeners(); // update the ref
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
_this.tbody = tbody; // if loading, add listeners
|
|
195
|
-
|
|
196
|
-
if (_this.props.loading === true && tbody) {
|
|
197
|
-
_this.addLoadingListeners(tbody);
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "addLoadingListeners", function (tbody) {
|
|
201
|
-
var listener = function listener(event) {
|
|
202
|
-
event.stopPropagation();
|
|
203
|
-
event.preventDefault();
|
|
204
|
-
};
|
|
205
|
-
|
|
206
|
-
['mousedown', 'mouseup', 'mouseover', 'mouseout', 'mouseenter', 'mouseleave', 'click', 'dblclick', 'keydown', 'keyup', 'keypress'].forEach(function (event) {
|
|
207
|
-
tbody.addEventListener(event, listener, true);
|
|
208
|
-
|
|
209
|
-
_this.cleanups.push(function () {
|
|
210
|
-
tbody.removeEventListener(event, listener, true);
|
|
211
|
-
});
|
|
212
|
-
});
|
|
213
|
-
});
|
|
214
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "removeLoadingListeners", function () {
|
|
215
|
-
_this.cleanups.forEach(function (cleanup) {
|
|
216
|
-
return cleanup();
|
|
217
|
-
});
|
|
218
|
-
|
|
219
|
-
_this.cleanups.length = 0;
|
|
220
|
-
});
|
|
221
189
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "tableId", (0, _accessibility2.htmlIdGenerator)('__table')());
|
|
222
190
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "selectAllIdGenerator", (0, _accessibility2.htmlIdGenerator)('_selection_column-checkbox'));
|
|
223
191
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderSelectAll", function (isMobile) {
|
|
@@ -304,27 +272,13 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
304
272
|
(0, _createClass2.default)(EuiBasicTable, [{
|
|
305
273
|
key: "componentDidMount",
|
|
306
274
|
value: function componentDidMount() {
|
|
307
|
-
if (this.props.loading && this.tbody) this.addLoadingListeners(this.tbody);
|
|
308
275
|
this.getInitialSelection();
|
|
309
276
|
}
|
|
310
277
|
}, {
|
|
311
278
|
key: "componentDidUpdate",
|
|
312
|
-
value: function componentDidUpdate(
|
|
313
|
-
if (prevProps.loading !== this.props.loading) {
|
|
314
|
-
if (this.props.loading && this.tbody) {
|
|
315
|
-
this.addLoadingListeners(this.tbody);
|
|
316
|
-
} else {
|
|
317
|
-
this.removeLoadingListeners();
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
|
|
279
|
+
value: function componentDidUpdate() {
|
|
321
280
|
this.getInitialSelection();
|
|
322
281
|
}
|
|
323
|
-
}, {
|
|
324
|
-
key: "componentWillUnmount",
|
|
325
|
-
value: function componentWillUnmount() {
|
|
326
|
-
this.removeLoadingListeners();
|
|
327
|
-
}
|
|
328
282
|
}, {
|
|
329
283
|
key: "getInitialSelection",
|
|
330
284
|
value: function getInitialSelection() {
|
|
@@ -484,7 +438,8 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
484
438
|
var _this$props3 = this.props,
|
|
485
439
|
compressed = _this$props3.compressed,
|
|
486
440
|
responsive = _this$props3.responsive,
|
|
487
|
-
tableLayout = _this$props3.tableLayout
|
|
441
|
+
tableLayout = _this$props3.tableLayout,
|
|
442
|
+
loading = _this$props3.loading;
|
|
488
443
|
var mobileHeader = responsive ? (0, _react2.jsx)(_table.EuiTableHeaderMobile, null, (0, _react2.jsx)(_flex.EuiFlexGroup, {
|
|
489
444
|
responsive: false,
|
|
490
445
|
justifyContent: "spaceBetween",
|
|
@@ -502,7 +457,8 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
502
457
|
id: this.tableId,
|
|
503
458
|
tableLayout: tableLayout,
|
|
504
459
|
responsive: responsive,
|
|
505
|
-
compressed: compressed
|
|
460
|
+
compressed: compressed,
|
|
461
|
+
css: loading && _basic_table.safariLoadingWorkaround
|
|
506
462
|
}, caption, head, body, footer));
|
|
507
463
|
}
|
|
508
464
|
}, {
|
|
@@ -765,30 +721,35 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
765
721
|
value: function renderTableBody() {
|
|
766
722
|
var _this4 = this;
|
|
767
723
|
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
var
|
|
773
|
-
|
|
774
|
-
if (
|
|
775
|
-
|
|
724
|
+
var _this$props8 = this.props,
|
|
725
|
+
error = _this$props8.error,
|
|
726
|
+
loading = _this$props8.loading,
|
|
727
|
+
items = _this$props8.items;
|
|
728
|
+
var content;
|
|
729
|
+
|
|
730
|
+
if (error) {
|
|
731
|
+
content = this.renderErrorMessage(error);
|
|
732
|
+
} else if (items.length === 0) {
|
|
733
|
+
content = this.renderEmptyMessage();
|
|
734
|
+
} else {
|
|
735
|
+
content = items.map(function (item, index) {
|
|
736
|
+
// if there's pagination the item's index must be adjusted to the where it is in the whole dataset
|
|
737
|
+
var tableItemIndex = hasPagination(_this4.props) && _this4.props.pagination.pageSize > 0 ? _this4.props.pagination.pageIndex * _this4.props.pagination.pageSize + index : index;
|
|
738
|
+
return _this4.renderItemRow(item, tableItemIndex);
|
|
739
|
+
});
|
|
776
740
|
}
|
|
777
741
|
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
742
|
+
return (0, _react2.jsx)(_services.RenderWithEuiTheme, null, function (theme) {
|
|
743
|
+
return (0, _react2.jsx)(_table.EuiTableBody, {
|
|
744
|
+
css: loading && (0, _basic_table.euiBasicTableBodyLoading)(theme)
|
|
745
|
+
}, content);
|
|
782
746
|
});
|
|
783
|
-
return (0, _react2.jsx)(_table.EuiTableBody, {
|
|
784
|
-
bodyRef: this.setTbody
|
|
785
|
-
}, rows);
|
|
786
747
|
}
|
|
787
748
|
}, {
|
|
788
|
-
key: "
|
|
789
|
-
value: function
|
|
749
|
+
key: "renderErrorMessage",
|
|
750
|
+
value: function renderErrorMessage(error) {
|
|
790
751
|
var colSpan = this.props.columns.length + (this.props.selection ? 1 : 0);
|
|
791
|
-
return (0, _react2.jsx)(_table.
|
|
752
|
+
return (0, _react2.jsx)(_table.EuiTableRow, null, (0, _react2.jsx)(_table.EuiTableRowCell, {
|
|
792
753
|
align: "center",
|
|
793
754
|
colSpan: colSpan,
|
|
794
755
|
mobileOptions: {
|
|
@@ -797,38 +758,38 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
797
758
|
}, (0, _react2.jsx)(_icon.EuiIcon, {
|
|
798
759
|
type: "minusInCircle",
|
|
799
760
|
color: "danger"
|
|
800
|
-
}), " ", error))
|
|
761
|
+
}), " ", error));
|
|
801
762
|
}
|
|
802
763
|
}, {
|
|
803
|
-
key: "
|
|
804
|
-
value: function
|
|
805
|
-
var _this$
|
|
806
|
-
columns = _this$
|
|
807
|
-
selection = _this$
|
|
808
|
-
noItemsMessage = _this$
|
|
764
|
+
key: "renderEmptyMessage",
|
|
765
|
+
value: function renderEmptyMessage() {
|
|
766
|
+
var _this$props9 = this.props,
|
|
767
|
+
columns = _this$props9.columns,
|
|
768
|
+
selection = _this$props9.selection,
|
|
769
|
+
noItemsMessage = _this$props9.noItemsMessage;
|
|
809
770
|
var colSpan = columns.length + (selection ? 1 : 0);
|
|
810
|
-
return (0, _react2.jsx)(_table.
|
|
771
|
+
return (0, _react2.jsx)(_table.EuiTableRow, null, (0, _react2.jsx)(_table.EuiTableRowCell, {
|
|
811
772
|
align: "center",
|
|
812
773
|
colSpan: colSpan,
|
|
813
774
|
mobileOptions: {
|
|
814
775
|
width: '100%'
|
|
815
776
|
}
|
|
816
|
-
}, noItemsMessage))
|
|
777
|
+
}, noItemsMessage));
|
|
817
778
|
}
|
|
818
779
|
}, {
|
|
819
780
|
key: "renderItemRow",
|
|
820
781
|
value: function renderItemRow(item, rowIndex) {
|
|
821
782
|
var _this5 = this;
|
|
822
783
|
|
|
823
|
-
var _this$
|
|
824
|
-
columns = _this$
|
|
825
|
-
selection = _this$
|
|
826
|
-
isSelectable = _this$
|
|
827
|
-
hasActions = _this$
|
|
828
|
-
rowHeader = _this$
|
|
829
|
-
_this$
|
|
830
|
-
itemIdToExpandedRowMap = _this$
|
|
831
|
-
isExpandable = _this$
|
|
784
|
+
var _this$props10 = this.props,
|
|
785
|
+
columns = _this$props10.columns,
|
|
786
|
+
selection = _this$props10.selection,
|
|
787
|
+
isSelectable = _this$props10.isSelectable,
|
|
788
|
+
hasActions = _this$props10.hasActions,
|
|
789
|
+
rowHeader = _this$props10.rowHeader,
|
|
790
|
+
_this$props10$itemIdT = _this$props10.itemIdToExpandedRowMap,
|
|
791
|
+
itemIdToExpandedRowMap = _this$props10$itemIdT === void 0 ? {} : _this$props10$itemIdT,
|
|
792
|
+
isExpandable = _this$props10.isExpandable;
|
|
832
793
|
var cells = [];
|
|
833
794
|
var itemIdCallback = this.props.itemId;
|
|
834
795
|
var itemId = getItemId(item, itemIdCallback) != null ? getItemId(item, itemIdCallback) : rowIndex;
|
|
@@ -980,7 +941,8 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
980
941
|
key: key,
|
|
981
942
|
align: "right",
|
|
982
943
|
textOnly: false,
|
|
983
|
-
hasActions: true
|
|
944
|
+
hasActions: true,
|
|
945
|
+
css: _basic_table.euiBasicTableActionsWrapper
|
|
984
946
|
}, tools);
|
|
985
947
|
}
|
|
986
948
|
}, {
|
|
@@ -1064,11 +1026,11 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
1064
1026
|
value: function renderPaginationBar() {
|
|
1065
1027
|
var _this8 = this;
|
|
1066
1028
|
|
|
1067
|
-
var _this$
|
|
1068
|
-
error = _this$
|
|
1069
|
-
pagination = _this$
|
|
1070
|
-
tableCaption = _this$
|
|
1071
|
-
onChange = _this$
|
|
1029
|
+
var _this$props11 = this.props,
|
|
1030
|
+
error = _this$props11.error,
|
|
1031
|
+
pagination = _this$props11.pagination,
|
|
1032
|
+
tableCaption = _this$props11.tableCaption,
|
|
1033
|
+
onChange = _this$props11.onChange;
|
|
1072
1034
|
|
|
1073
1035
|
if (!error && pagination && pagination.totalItemCount > 0) {
|
|
1074
1036
|
if (!onChange) {
|
|
@@ -1120,8 +1082,7 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
1120
1082
|
}
|
|
1121
1083
|
|
|
1122
1084
|
return null;
|
|
1123
|
-
}
|
|
1124
|
-
|
|
1085
|
+
}
|
|
1125
1086
|
}]);
|
|
1126
1087
|
return EuiBasicTable;
|
|
1127
1088
|
}(_react.Component);
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.safariLoadingWorkaround = exports.euiBasicTableBodyLoading = exports.euiBasicTableActionsWrapper = void 0;
|
|
9
|
+
|
|
10
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
|
+
|
|
12
|
+
var _react = require("@emotion/react");
|
|
13
|
+
|
|
14
|
+
var _global_styling = require("../../global_styling");
|
|
15
|
+
|
|
16
|
+
var _templateObject;
|
|
17
|
+
|
|
18
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
19
|
+
|
|
20
|
+
var tableLoadingLine = (0, _react.keyframes)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n from {\n ", "\n ", "\n }\n\n 20% {\n ", "\n ", "\n }\n\n 80% {\n ", "\n ", "\n }\n\n 100% {\n ", "\n ", "\n }\n"])), (0, _global_styling.logicalCSS)('left', 0), (0, _global_styling.logicalCSS)('width', 0), (0, _global_styling.logicalCSS)('left', 0), (0, _global_styling.logicalCSS)('width', '40%'), (0, _global_styling.logicalCSS)('left', '60%'), (0, _global_styling.logicalCSS)('width', '40%'), (0, _global_styling.logicalCSS)('left', '100%'), (0, _global_styling.logicalCSS)('width', 0));
|
|
21
|
+
|
|
22
|
+
var euiBasicTableBodyLoading = function euiBasicTableBodyLoading(_ref2) {
|
|
23
|
+
var euiTheme = _ref2.euiTheme;
|
|
24
|
+
return /*#__PURE__*/(0, _react.css)("position:relative;overflow:hidden;&::before{position:absolute;content:'';", (0, _global_styling.logicalCSS)('width', '100%'), " ", (0, _global_styling.logicalCSS)('height', euiTheme.border.width.thick), " background-color:", euiTheme.colors.primary, ";animation:", tableLoadingLine, " 1s linear infinite;", _global_styling.euiCantAnimate, "{animation-duration:2s;}};label:euiBasicTableBodyLoading;");
|
|
25
|
+
}; // Fix to make the loading indicator position correctly in Safari
|
|
26
|
+
// For whatever annoying reason, Safari doesn't respect `position: relative;`
|
|
27
|
+
// on `tbody` without `position: relative` on the parent `table`
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
exports.euiBasicTableBodyLoading = euiBasicTableBodyLoading;
|
|
31
|
+
|
|
32
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
33
|
+
name: "6xbnw4-safariLoadingWorkaround",
|
|
34
|
+
styles: "position:relative;label:safariLoadingWorkaround;"
|
|
35
|
+
} : {
|
|
36
|
+
name: "6xbnw4-safariLoadingWorkaround",
|
|
37
|
+
styles: "position:relative;label:safariLoadingWorkaround;",
|
|
38
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
var safariLoadingWorkaround = function safariLoadingWorkaround() {
|
|
42
|
+
return _ref;
|
|
43
|
+
}; // Unsets the extra height caused by tooltip/popover wrappers around table action buttons
|
|
44
|
+
// Without this, the row height jumps whenever actions are disabled
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
exports.safariLoadingWorkaround = safariLoadingWorkaround;
|
|
48
|
+
var euiBasicTableActionsWrapper = process.env.NODE_ENV === "production" ? {
|
|
49
|
+
name: "1mshepa-euiBasicTableActionsWrapper",
|
|
50
|
+
styles: "line-height:1;label:euiBasicTableActionsWrapper;"
|
|
51
|
+
} : {
|
|
52
|
+
name: "1mshepa-euiBasicTableActionsWrapper",
|
|
53
|
+
styles: "line-height:1;label:euiBasicTableActionsWrapper;",
|
|
54
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
55
|
+
};
|
|
56
|
+
exports.euiBasicTableActionsWrapper = euiBasicTableActionsWrapper;
|
|
@@ -41,7 +41,7 @@ var _text = require("../text");
|
|
|
41
41
|
|
|
42
42
|
var _react2 = require("@emotion/react");
|
|
43
43
|
|
|
44
|
-
var _excluded = ["children", "title", "onCancel", "onConfirm", "cancelButtonText", "confirmButtonText", "confirmButtonDisabled", "className", "buttonColor", "defaultFocusedButton", "isLoading"];
|
|
44
|
+
var _excluded = ["children", "title", "titleProps", "onCancel", "onConfirm", "cancelButtonText", "confirmButtonText", "confirmButtonDisabled", "className", "buttonColor", "defaultFocusedButton", "isLoading"];
|
|
45
45
|
|
|
46
46
|
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); }
|
|
47
47
|
|
|
@@ -55,6 +55,7 @@ exports.CANCEL_BUTTON = CANCEL_BUTTON;
|
|
|
55
55
|
var EuiConfirmModal = function EuiConfirmModal(_ref) {
|
|
56
56
|
var children = _ref.children,
|
|
57
57
|
title = _ref.title,
|
|
58
|
+
titleProps = _ref.titleProps,
|
|
58
59
|
onCancel = _ref.onCancel,
|
|
59
60
|
onConfirm = _ref.onConfirm,
|
|
60
61
|
cancelButtonText = _ref.cancelButtonText,
|
|
@@ -106,9 +107,9 @@ var EuiConfirmModal = function EuiConfirmModal(_ref) {
|
|
|
106
107
|
var modalTitle;
|
|
107
108
|
|
|
108
109
|
if (title) {
|
|
109
|
-
modalTitle = (0, _react2.jsx)(_modal_header.EuiModalHeader, null, (0, _react2.jsx)(_modal_header_title.EuiModalHeaderTitle, {
|
|
110
|
+
modalTitle = (0, _react2.jsx)(_modal_header.EuiModalHeader, null, (0, _react2.jsx)(_modal_header_title.EuiModalHeaderTitle, (0, _extends2.default)({
|
|
110
111
|
"data-test-subj": "confirmModalTitleText"
|
|
111
|
-
}, title));
|
|
112
|
+
}, titleProps), title));
|
|
112
113
|
}
|
|
113
114
|
|
|
114
115
|
var message;
|
|
@@ -147,6 +148,7 @@ EuiConfirmModal.propTypes = {
|
|
|
147
148
|
*/
|
|
148
149
|
children: _propTypes.default.node,
|
|
149
150
|
title: _propTypes.default.node,
|
|
151
|
+
titleProps: _propTypes.default.any,
|
|
150
152
|
cancelButtonText: _propTypes.default.node,
|
|
151
153
|
confirmButtonText: _propTypes.default.node,
|
|
152
154
|
onCancel: _propTypes.default.func.isRequired,
|
|
@@ -47,7 +47,7 @@ var Modal = function Modal() {
|
|
|
47
47
|
};
|
|
48
48
|
return (0, _react2.jsx)("div", null, (0, _react2.jsx)(_button.EuiButton, {
|
|
49
49
|
onClick: showModal
|
|
50
|
-
}, "Show confirm modal"), isModalVisible && (0, _react2.jsx)(_index.EuiModal, modalProps, (0, _react2.jsx)(_index.EuiModalHeader, null, (0, _react2.jsx)(_index.EuiModalHeaderTitle, null,
|
|
50
|
+
}, "Show confirm modal"), isModalVisible && (0, _react2.jsx)(_index.EuiModal, modalProps, (0, _react2.jsx)(_index.EuiModalHeader, null, (0, _react2.jsx)(_index.EuiModalHeaderTitle, null, "Title of modal")), (0, _react2.jsx)(_index.EuiModalBody, null, (0, _react2.jsx)("p", null, "This is a simple modal body")), (0, _react2.jsx)(_index.EuiModalFooter, null, (0, _react2.jsx)(_button.EuiButton, {
|
|
51
51
|
onClick: closeModal,
|
|
52
52
|
fill: true
|
|
53
53
|
}, "Close"))));
|
|
@@ -21,17 +21,19 @@ var _title = require("../title");
|
|
|
21
21
|
|
|
22
22
|
var _react2 = require("@emotion/react");
|
|
23
23
|
|
|
24
|
-
var _excluded = ["className", "children"];
|
|
24
|
+
var _excluded = ["className", "children", "component"];
|
|
25
25
|
|
|
26
26
|
var EuiModalHeaderTitle = function EuiModalHeaderTitle(_ref) {
|
|
27
27
|
var className = _ref.className,
|
|
28
28
|
children = _ref.children,
|
|
29
|
+
_ref$component = _ref.component,
|
|
30
|
+
Component = _ref$component === void 0 ? 'h1' : _ref$component,
|
|
29
31
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
30
32
|
var classes = (0, _classnames.default)('euiModalHeader__title', className);
|
|
31
33
|
return (0, _react2.jsx)(_title.EuiTitle, (0, _extends2.default)({
|
|
32
34
|
size: "m",
|
|
33
35
|
className: classes
|
|
34
|
-
}, rest),
|
|
36
|
+
}, rest), (0, _react2.jsx)(Component, null, children));
|
|
35
37
|
};
|
|
36
38
|
|
|
37
39
|
exports.EuiModalHeaderTitle = EuiModalHeaderTitle;
|
|
@@ -39,5 +41,12 @@ EuiModalHeaderTitle.propTypes = {
|
|
|
39
41
|
className: _propTypes.default.string,
|
|
40
42
|
"aria-label": _propTypes.default.string,
|
|
41
43
|
"data-test-subj": _propTypes.default.string,
|
|
42
|
-
css: _propTypes.default.any
|
|
44
|
+
css: _propTypes.default.any,
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* The tag to render. Can be changed to a lower heading
|
|
48
|
+
* level like `h2` or a container `div`.
|
|
49
|
+
* @default h1
|
|
50
|
+
*/
|
|
51
|
+
component: _propTypes.default.any
|
|
43
52
|
};
|
|
@@ -329,6 +329,11 @@ EuiResizablePanel.propTypes = {
|
|
|
329
329
|
*/
|
|
330
330
|
style: _propTypes.default.any,
|
|
331
331
|
|
|
332
|
+
/**
|
|
333
|
+
* tabIndex={0} provides full keyboard access when content overflows `<EuiResizablePanel />`
|
|
334
|
+
*/
|
|
335
|
+
tabIndex: _propTypes.default.number,
|
|
336
|
+
|
|
332
337
|
/**
|
|
333
338
|
* Props to add to the wrapping `.euiResizablePanel` div
|
|
334
339
|
*/
|
|
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getSecureRelForTarget = void 0;
|
|
7
7
|
|
|
8
|
-
var _url = require("../url");
|
|
9
|
-
|
|
10
8
|
/*
|
|
11
9
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
12
10
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -20,18 +18,13 @@ var _url = require("../url");
|
|
|
20
18
|
* https://www.jitbit.com/alexblog/256-targetblank---the-most-underestimated-vulnerability-ever/
|
|
21
19
|
*/
|
|
22
20
|
var getSecureRelForTarget = function getSecureRelForTarget(_ref) {
|
|
23
|
-
var
|
|
24
|
-
_ref$target = _ref.target,
|
|
21
|
+
var _ref$target = _ref.target,
|
|
25
22
|
target = _ref$target === void 0 ? '' : _ref$target,
|
|
26
23
|
rel = _ref.rel;
|
|
27
|
-
var isElasticHref = !!href && (0, _url.isDomainSecure)(href);
|
|
28
24
|
var relParts = !!rel ? rel.split(' ').filter(function (part) {
|
|
29
25
|
return !!part.length && part !== 'noreferrer';
|
|
30
26
|
}) : [];
|
|
31
|
-
|
|
32
|
-
if (!isElasticHref) {
|
|
33
|
-
relParts.push('noreferrer');
|
|
34
|
-
}
|
|
27
|
+
relParts.push('noreferrer');
|
|
35
28
|
|
|
36
29
|
if (target.includes('_blank') && relParts.indexOf('noopener') === -1) {
|
|
37
30
|
relParts.push('noopener');
|
|
@@ -7,7 +7,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports.withEuiTheme = exports.useEuiTheme = void 0;
|
|
10
|
+
exports.withEuiTheme = exports.useEuiTheme = exports.RenderWithEuiTheme = void 0;
|
|
11
11
|
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
13
|
|
|
@@ -31,6 +31,9 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
31
31
|
* Side Public License, v 1.
|
|
32
32
|
*/
|
|
33
33
|
var providerMessage = "`EuiProvider` is missing which can result in negative effects.\nWrap your component in `EuiProvider`: https://ela.st/euiprovider.";
|
|
34
|
+
/**
|
|
35
|
+
* Hook for function components
|
|
36
|
+
*/
|
|
34
37
|
|
|
35
38
|
var useEuiTheme = function useEuiTheme() {
|
|
36
39
|
var theme = (0, _react.useContext)(_context.EuiThemeContext);
|
|
@@ -66,6 +69,10 @@ var useEuiTheme = function useEuiTheme() {
|
|
|
66
69
|
}, [theme, colorMode, modifications]);
|
|
67
70
|
return assembledTheme;
|
|
68
71
|
};
|
|
72
|
+
/**
|
|
73
|
+
* HOC for class components
|
|
74
|
+
*/
|
|
75
|
+
|
|
69
76
|
|
|
70
77
|
exports.useEuiTheme = useEuiTheme;
|
|
71
78
|
|
|
@@ -86,5 +93,18 @@ var withEuiTheme = function withEuiTheme(Component) {
|
|
|
86
93
|
WithEuiTheme.displayName = componentName;
|
|
87
94
|
return WithEuiTheme;
|
|
88
95
|
};
|
|
96
|
+
/**
|
|
97
|
+
* Render prop alternative for complex class components
|
|
98
|
+
* Most useful for scenarios where a HOC may interfere with typing
|
|
99
|
+
*/
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
exports.withEuiTheme = withEuiTheme;
|
|
103
|
+
|
|
104
|
+
var RenderWithEuiTheme = function RenderWithEuiTheme(_ref) {
|
|
105
|
+
var children = _ref.children;
|
|
106
|
+
var theme = useEuiTheme();
|
|
107
|
+
return children(theme);
|
|
108
|
+
};
|
|
89
109
|
|
|
90
|
-
exports.
|
|
110
|
+
exports.RenderWithEuiTheme = RenderWithEuiTheme;
|
|
@@ -45,6 +45,12 @@ Object.defineProperty(exports, "EuiThemeProvider", {
|
|
|
45
45
|
return _provider.EuiThemeProvider;
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
|
+
Object.defineProperty(exports, "RenderWithEuiTheme", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function get() {
|
|
51
|
+
return _hooks.RenderWithEuiTheme;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
48
54
|
Object.defineProperty(exports, "buildTheme", {
|
|
49
55
|
enumerable: true,
|
|
50
56
|
get: function get() {
|