@elastic/eui 74.1.0 → 75.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/es/components/collapsible_nav/collapsible_nav.js +10 -11
- package/es/components/flyout/flyout.js +88 -24
- package/es/components/header/header.js +3 -1
- package/es/components/search_bar/filters/field_value_selection_filter.js +6 -10
- package/es/components/selectable/selectable_list/selectable_list.js +19 -5
- package/eui.d.ts +15 -12
- package/i18ntokens.json +50 -2
- package/lib/components/collapsible_nav/collapsible_nav.js +10 -11
- package/lib/components/flyout/flyout.js +85 -22
- package/lib/components/header/header.js +3 -1
- package/lib/components/search_bar/filters/field_value_selection_filter.js +6 -10
- package/lib/components/selectable/selectable_list/selectable_list.js +19 -5
- package/optimize/es/components/collapsible_nav/collapsible_nav.js +1 -4
- package/optimize/es/components/flyout/flyout.js +81 -24
- package/optimize/es/components/header/header.js +3 -1
- package/optimize/es/components/search_bar/filters/field_value_selection_filter.js +6 -10
- package/optimize/es/components/selectable/selectable_list/selectable_list.js +19 -5
- package/optimize/lib/components/collapsible_nav/collapsible_nav.js +1 -4
- package/optimize/lib/components/flyout/flyout.js +80 -22
- package/optimize/lib/components/header/header.js +3 -1
- package/optimize/lib/components/search_bar/filters/field_value_selection_filter.js +6 -10
- package/optimize/lib/components/selectable/selectable_list/selectable_list.js +16 -5
- package/package.json +2 -2
- package/test-env/components/collapsible_nav/collapsible_nav.js +10 -11
- package/test-env/components/header/header.js +3 -1
- package/test-env/components/search_bar/filters/field_value_selection_filter.js +6 -10
- package/test-env/components/selectable/selectable_list/selectable_list.js +16 -5
|
@@ -9,6 +9,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
});
|
|
10
10
|
exports.TYPES = exports.SIZES = exports.SIDES = exports.PADDING_SIZES = exports.EuiFlyout = void 0;
|
|
11
11
|
|
|
12
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
13
|
+
|
|
12
14
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
15
|
|
|
14
16
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
@@ -37,11 +39,13 @@ var _resize_observer = require("../observer/resize_observer");
|
|
|
37
39
|
|
|
38
40
|
var _portal = require("../portal");
|
|
39
41
|
|
|
42
|
+
var _accessibility = require("../accessibility");
|
|
43
|
+
|
|
40
44
|
var _flyout = require("./flyout.styles");
|
|
41
45
|
|
|
42
46
|
var _react2 = require("@emotion/react");
|
|
43
47
|
|
|
44
|
-
var _excluded = ["className", "children", "as", "hideCloseButton", "closeButtonProps", "
|
|
48
|
+
var _excluded = ["className", "children", "as", "hideCloseButton", "closeButtonProps", "closeButtonPosition", "onClose", "ownFocus", "side", "size", "paddingSize", "maxWidth", "style", "maskProps", "type", "outsideClickCloses", "pushMinBreakpoint", "focusTrapProps", "includeFixedHeadersInFocusTrap"];
|
|
45
49
|
|
|
46
50
|
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
51
|
|
|
@@ -76,7 +80,6 @@ var EuiFlyout = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
76
80
|
_ref$hideCloseButton = _ref.hideCloseButton,
|
|
77
81
|
hideCloseButton = _ref$hideCloseButton === void 0 ? false : _ref$hideCloseButton,
|
|
78
82
|
closeButtonProps = _ref.closeButtonProps,
|
|
79
|
-
closeButtonAriaLabel = _ref.closeButtonAriaLabel,
|
|
80
83
|
_ref$closeButtonPosit = _ref.closeButtonPosition,
|
|
81
84
|
closeButtonPosition = _ref$closeButtonPosit === void 0 ? 'inside' : _ref$closeButtonPosit,
|
|
82
85
|
onClose = _ref.onClose,
|
|
@@ -95,12 +98,14 @@ var EuiFlyout = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
95
98
|
_ref$type = _ref.type,
|
|
96
99
|
type = _ref$type === void 0 ? 'overlay' : _ref$type,
|
|
97
100
|
outsideClickCloses = _ref.outsideClickCloses,
|
|
98
|
-
_ref$role = _ref.role,
|
|
99
|
-
role = _ref$role === void 0 ? 'dialog' : _ref$role,
|
|
100
101
|
_ref$pushMinBreakpoin = _ref.pushMinBreakpoint,
|
|
101
102
|
pushMinBreakpoint = _ref$pushMinBreakpoin === void 0 ? 'l' : _ref$pushMinBreakpoin,
|
|
102
|
-
focusTrapProps = _ref.focusTrapProps,
|
|
103
|
+
_ref$focusTrapProps = _ref.focusTrapProps,
|
|
104
|
+
_focusTrapProps = _ref$focusTrapProps === void 0 ? {} : _ref$focusTrapProps,
|
|
105
|
+
_ref$includeFixedHead = _ref.includeFixedHeadersInFocusTrap,
|
|
106
|
+
includeFixedHeadersInFocusTrap = _ref$includeFixedHead === void 0 ? true : _ref$includeFixedHead,
|
|
103
107
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
108
|
+
|
|
104
109
|
var Element = as || defaultElement;
|
|
105
110
|
var maskRef = (0, _react.useRef)(null);
|
|
106
111
|
var windowIsLargeEnoughToPush = (0, _services.useIsWithinMinBreakpoint)(pushMinBreakpoint);
|
|
@@ -191,7 +196,7 @@ var EuiFlyout = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
191
196
|
display: closeButtonPosition === 'outside' ? 'fill' : 'empty',
|
|
192
197
|
iconType: "cross",
|
|
193
198
|
color: "text",
|
|
194
|
-
"aria-label":
|
|
199
|
+
"aria-label": closeAriaLabel,
|
|
195
200
|
"data-test-subj": "euiFlyoutCloseButton"
|
|
196
201
|
}, closeButtonProps, {
|
|
197
202
|
className: closeButtonClasses,
|
|
@@ -204,24 +209,60 @@ var EuiFlyout = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
204
209
|
}));
|
|
205
210
|
});
|
|
206
211
|
}
|
|
212
|
+
/*
|
|
213
|
+
* If not disabled, automatically add fixed EuiHeaders as shards
|
|
214
|
+
* to EuiFlyout focus traps, to prevent focus fighting
|
|
215
|
+
*/
|
|
207
216
|
|
|
208
|
-
var hasOverlayMask = ownFocus && !isPushed;
|
|
209
217
|
|
|
210
|
-
var
|
|
211
|
-
// Do not close the flyout for any external click
|
|
212
|
-
if (outsideClickCloses === false) return undefined;
|
|
218
|
+
var flyoutToggle = (0, _react.useRef)(document.activeElement);
|
|
213
219
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
220
|
+
var _useState3 = (0, _react.useState)([]),
|
|
221
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
222
|
+
fixedHeaders = _useState4[0],
|
|
223
|
+
setFixedHeaders = _useState4[1];
|
|
224
|
+
|
|
225
|
+
(0, _react.useEffect)(function () {
|
|
226
|
+
if (includeFixedHeadersInFocusTrap) {
|
|
227
|
+
var fixedHeaderEls = document.querySelectorAll('.euiHeader[data-fixed-header]');
|
|
228
|
+
setFixedHeaders(Array.from(fixedHeaderEls)); // Flyouts that are toggled from fixed headers do not have working
|
|
229
|
+
// focus trap autoFocus, so we need to focus the flyout wrapper ourselves
|
|
230
|
+
|
|
231
|
+
fixedHeaderEls.forEach(function (header) {
|
|
232
|
+
if (header.contains(flyoutToggle.current)) {
|
|
233
|
+
resizeRef === null || resizeRef === void 0 ? void 0 : resizeRef.focus();
|
|
234
|
+
}
|
|
235
|
+
});
|
|
217
236
|
} else {
|
|
218
|
-
//
|
|
219
|
-
|
|
220
|
-
|
|
237
|
+
// Clear existing headers if necessary, e.g. switching to `false`
|
|
238
|
+
setFixedHeaders(function (headers) {
|
|
239
|
+
return headers.length ? [] : headers;
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
}, [includeFixedHeadersInFocusTrap, resizeRef]);
|
|
221
243
|
|
|
244
|
+
var focusTrapProps = _objectSpread(_objectSpread({}, _focusTrapProps), {}, {
|
|
245
|
+
shards: [].concat((0, _toConsumableArray2.default)(fixedHeaders), (0, _toConsumableArray2.default)(_focusTrapProps.shards || []))
|
|
246
|
+
});
|
|
247
|
+
/*
|
|
248
|
+
* Provide meaningful screen reader instructions/details
|
|
249
|
+
*/
|
|
222
250
|
|
|
223
|
-
|
|
224
|
-
|
|
251
|
+
|
|
252
|
+
var hasOverlayMask = ownFocus && !isPushed;
|
|
253
|
+
var descriptionId = (0, _services.useGeneratedHtmlId)();
|
|
254
|
+
var screenReaderDescription = (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("p", {
|
|
255
|
+
id: descriptionId
|
|
256
|
+
}, hasOverlayMask ? (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
257
|
+
token: "euiFlyout.screenReaderModalDialog",
|
|
258
|
+
default: "You are in a modal dialog. Press Escape or tap/click outside the dialog on the shadowed overlay to close."
|
|
259
|
+
}) : (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
260
|
+
token: "euiFlyout.screenReaderNonModalDialog",
|
|
261
|
+
default: "You are in a non-modal dialog. To close the dialog, press Escape."
|
|
262
|
+
}), ' ', fixedHeaders.length > 0 && (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
263
|
+
token: "euiFlyout.screenReaderFixedHeaders",
|
|
264
|
+
default: "You can still continue tabbing through the page headers in addition to the dialog."
|
|
265
|
+
})));
|
|
225
266
|
/*
|
|
226
267
|
* Trap focus even when `ownFocus={false}`, otherwise closing
|
|
227
268
|
* the flyout won't return focus to the originating button.
|
|
@@ -235,6 +276,21 @@ var EuiFlyout = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
235
276
|
* (both mousedown and mouseup) the overlay mask.
|
|
236
277
|
*/
|
|
237
278
|
|
|
279
|
+
var onClickOutside = function onClickOutside(event) {
|
|
280
|
+
// Do not close the flyout for any external click
|
|
281
|
+
if (outsideClickCloses === false) return undefined;
|
|
282
|
+
|
|
283
|
+
if (hasOverlayMask) {
|
|
284
|
+
// The overlay mask is present, so only clicks on the mask should close the flyout, regardless of outsideClickCloses
|
|
285
|
+
if (event.target === maskRef.current) return onClose(event);
|
|
286
|
+
} else {
|
|
287
|
+
// No overlay mask is present, so any outside clicks should close the flyout
|
|
288
|
+
if (outsideClickCloses === true) return onClose(event);
|
|
289
|
+
} // Otherwise if ownFocus is false and outsideClickCloses is undefined, outside clicks should not close the flyout
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
return undefined;
|
|
293
|
+
};
|
|
238
294
|
|
|
239
295
|
var flyout = (0, _react2.jsx)(_focus_trap.EuiFocusTrap, (0, _extends2.default)({
|
|
240
296
|
disabled: isPushed,
|
|
@@ -243,12 +299,14 @@ var EuiFlyout = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
243
299
|
}, focusTrapProps), (0, _react2.jsx)(Element, (0, _extends2.default)({
|
|
244
300
|
css: cssStyles
|
|
245
301
|
}, rest, {
|
|
246
|
-
role:
|
|
302
|
+
role: "dialog",
|
|
247
303
|
className: classes,
|
|
248
|
-
tabIndex:
|
|
304
|
+
tabIndex: 0,
|
|
305
|
+
"data-autofocus": true,
|
|
306
|
+
"aria-describedby": !isPushed ? descriptionId : undefined,
|
|
249
307
|
style: newStyle,
|
|
250
308
|
ref: setRef
|
|
251
|
-
}), closeButton, children)); // If ownFocus is set, wrap with an overlay and allow the user to click it to close it.
|
|
309
|
+
}), !isPushed && screenReaderDescription, closeButton, children)); // If ownFocus is set, wrap with an overlay and allow the user to click it to close it.
|
|
252
310
|
|
|
253
311
|
var mergedMaskProps = _objectSpread(_objectSpread({}, maskProps), {}, {
|
|
254
312
|
maskRef: (0, _services.useCombinedRefs)([maskProps === null || maskProps === void 0 ? void 0 : maskProps.maskRef, maskRef])
|
|
@@ -263,7 +321,7 @@ var EuiFlyout = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
263
321
|
flyout = (0, _react2.jsx)(_portal.EuiPortal, null, flyout);
|
|
264
322
|
}
|
|
265
323
|
|
|
266
|
-
return (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(_services.EuiWindowEvent, {
|
|
324
|
+
return (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_services.EuiWindowEvent, {
|
|
267
325
|
event: "keydown",
|
|
268
326
|
handler: onKeyDown
|
|
269
327
|
}), flyout);
|
|
@@ -101,7 +101,9 @@ var EuiHeader = function EuiHeader(_ref) {
|
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
return (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
104
|
-
className: classes
|
|
104
|
+
className: classes,
|
|
105
|
+
"data-fixed-header": position === 'fixed' || undefined // Used by EuiFlyouts as a query selector
|
|
106
|
+
|
|
105
107
|
}, rest), contents);
|
|
106
108
|
};
|
|
107
109
|
|
|
@@ -273,16 +273,16 @@ var FieldValueSelectionFilter = /*#__PURE__*/function (_Component) {
|
|
|
273
273
|
if (!multiSelect && autoClose) {
|
|
274
274
|
this.closePopover();
|
|
275
275
|
|
|
276
|
-
var _query = checked ? this.props.query.removeSimpleFieldClauses(field)
|
|
276
|
+
var _query = checked ? this.props.query.removeSimpleFieldClauses(field).addSimpleFieldValue(field, value, true, operator) : this.props.query.removeSimpleFieldClauses(field);
|
|
277
277
|
|
|
278
278
|
this.props.onChange(_query);
|
|
279
279
|
} else {
|
|
280
280
|
if (multiSelect === 'or') {
|
|
281
|
-
var _query2 = checked ? this.props.query.
|
|
281
|
+
var _query2 = checked ? this.props.query.addOrFieldValue(field, value, true, operator) : this.props.query.removeOrFieldValue(field, value);
|
|
282
282
|
|
|
283
283
|
this.props.onChange(_query2);
|
|
284
284
|
} else {
|
|
285
|
-
var _query3 = checked ? this.props.query.
|
|
285
|
+
var _query3 = checked ? this.props.query.addSimpleFieldValue(field, value, true, operator) : this.props.query.removeSimpleFieldValue(field, value);
|
|
286
286
|
|
|
287
287
|
this.props.onChange(_query3);
|
|
288
288
|
}
|
|
@@ -390,13 +390,9 @@ var FieldValueSelectionFilter = /*#__PURE__*/function (_Component) {
|
|
|
390
390
|
listProps: {
|
|
391
391
|
isVirtualized: isOverSearchThreshold || false
|
|
392
392
|
},
|
|
393
|
-
onChange: function onChange(options) {
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
});
|
|
397
|
-
|
|
398
|
-
if (diff) {
|
|
399
|
-
_this5.onOptionClick(diff.data.optionField, diff.data.value, diff.checked);
|
|
393
|
+
onChange: function onChange(options, event, changedOption) {
|
|
394
|
+
if (changedOption.data) {
|
|
395
|
+
_this5.onOptionClick(changedOption.data.optionField, changedOption.data.value, changedOption.checked);
|
|
400
396
|
}
|
|
401
397
|
}
|
|
402
398
|
}, searchProps), function (list, search) {
|
|
@@ -116,6 +116,19 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
});
|
|
119
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "ariaSetSize", 0);
|
|
120
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "ariaPosInSetMap", {});
|
|
121
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "calculateAriaSetAttrs", function (optionArray) {
|
|
122
|
+
_this.ariaPosInSetMap = {};
|
|
123
|
+
var latestAriaPosIndex = 0;
|
|
124
|
+
optionArray.forEach(function (option, index) {
|
|
125
|
+
if (!option.isGroupLabel) {
|
|
126
|
+
latestAriaPosIndex++;
|
|
127
|
+
_this.ariaPosInSetMap[index] = latestAriaPosIndex;
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
_this.ariaSetSize = latestAriaPosIndex;
|
|
131
|
+
});
|
|
119
132
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "ListRow", /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
120
133
|
var data = _ref.data,
|
|
121
134
|
index = _ref.index,
|
|
@@ -158,9 +171,6 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
158
171
|
}, optionRest), prepend, label, append);
|
|
159
172
|
}
|
|
160
173
|
|
|
161
|
-
var labelCount = data.filter(function (option) {
|
|
162
|
-
return option.isGroupLabel;
|
|
163
|
-
}).length;
|
|
164
174
|
var id = makeOptionId(index);
|
|
165
175
|
return (0, _react2.jsx)(_selectable_list_item.EuiSelectableListItem, (0, _extends2.default)({
|
|
166
176
|
key: id,
|
|
@@ -181,8 +191,8 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
181
191
|
disabled: disabled,
|
|
182
192
|
prepend: prepend,
|
|
183
193
|
append: append,
|
|
184
|
-
"aria-posinset": index
|
|
185
|
-
"aria-setsize":
|
|
194
|
+
"aria-posinset": _this.ariaPosInSetMap[index],
|
|
195
|
+
"aria-setsize": _this.ariaSetSize,
|
|
186
196
|
onFocusBadge: onFocusBadge,
|
|
187
197
|
allowExclusions: allowExclusions,
|
|
188
198
|
showIcons: showIcons,
|
|
@@ -333,6 +343,7 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
333
343
|
textWrap = _this$props7.textWrap,
|
|
334
344
|
rest = (0, _objectWithoutProperties2.default)(_this$props7, _excluded3);
|
|
335
345
|
var optionArray = visibleOptions || options;
|
|
346
|
+
this.calculateAriaSetAttrs(optionArray);
|
|
336
347
|
var heightIsFull = forcedHeight === 'full';
|
|
337
348
|
var calculatedHeight = heightIsFull ? false : forcedHeight; // If calculatedHeight is still undefined, then calculate it
|
|
338
349
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elastic/eui",
|
|
3
3
|
"description": "Elastic UI Component Library",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "75.0.0",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "lib",
|
|
7
7
|
"module": "es",
|
|
@@ -246,7 +246,7 @@
|
|
|
246
246
|
"webpack-dev-server": "^4.10.0",
|
|
247
247
|
"yargs": "^17.2.1",
|
|
248
248
|
"yeoman-generator": "^4.12.0",
|
|
249
|
-
"yo": "^3.1
|
|
249
|
+
"yo": "^4.3.1"
|
|
250
250
|
},
|
|
251
251
|
"peerDependencies": {
|
|
252
252
|
"@elastic/datemath": "^5.0.2",
|
|
@@ -29,7 +29,7 @@ var _flyout = require("../flyout");
|
|
|
29
29
|
|
|
30
30
|
var _react2 = require("@emotion/react");
|
|
31
31
|
|
|
32
|
-
var _excluded = ["id", "children", "className", "isDocked", "isOpen", "button", "showButtonIfDocked", "dockedBreakpoint", "as", "size", "side", "
|
|
32
|
+
var _excluded = ["id", "children", "className", "isDocked", "isOpen", "button", "showButtonIfDocked", "dockedBreakpoint", "as", "size", "side", "ownFocus", "outsideClickCloses", "closeButtonPosition", "paddingSize", "focusTrapProps"];
|
|
33
33
|
|
|
34
34
|
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); }
|
|
35
35
|
|
|
@@ -58,8 +58,6 @@ var EuiCollapsibleNav = function EuiCollapsibleNav(_ref) {
|
|
|
58
58
|
size = _ref$size === void 0 ? 320 : _ref$size,
|
|
59
59
|
_ref$side = _ref.side,
|
|
60
60
|
side = _ref$side === void 0 ? 'left' : _ref$side,
|
|
61
|
-
_ref$role = _ref.role,
|
|
62
|
-
role = _ref$role === void 0 ? null : _ref$role,
|
|
63
61
|
_ref$ownFocus = _ref.ownFocus,
|
|
64
62
|
ownFocus = _ref$ownFocus === void 0 ? true : _ref$ownFocus,
|
|
65
63
|
_ref$outsideClickClos = _ref.outsideClickCloses,
|
|
@@ -108,7 +106,6 @@ var EuiCollapsibleNav = function EuiCollapsibleNav(_ref) {
|
|
|
108
106
|
as: as,
|
|
109
107
|
size: size,
|
|
110
108
|
side: side,
|
|
111
|
-
role: role,
|
|
112
109
|
ownFocus: ownFocus,
|
|
113
110
|
outsideClickCloses: outsideClickCloses,
|
|
114
111
|
closeButtonPosition: closeButtonPosition,
|
|
@@ -217,13 +214,6 @@ EuiCollapsibleNav.propTypes = {
|
|
|
217
214
|
*/
|
|
218
215
|
side: _propTypes.default.any,
|
|
219
216
|
|
|
220
|
-
/**
|
|
221
|
-
* Defaults to `dialog` which is best for most cases of the flyout.
|
|
222
|
-
* Otherwise pass in your own, aria-role, or `null` to remove it and use the semantic `as` element instead
|
|
223
|
-
* @default dialog
|
|
224
|
-
*/
|
|
225
|
-
role: _propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.string.isRequired]),
|
|
226
|
-
|
|
227
217
|
/**
|
|
228
218
|
* Named breakpoint (`xs` through `xl`) for customizing the minimum window width to enable docking
|
|
229
219
|
*/
|
|
@@ -237,6 +227,15 @@ EuiCollapsibleNav.propTypes = {
|
|
|
237
227
|
*/
|
|
238
228
|
focusTrapProps: _propTypes.default.any,
|
|
239
229
|
|
|
230
|
+
/**
|
|
231
|
+
* By default, EuiFlyout will consider any fixed `EuiHeader`s that sit alongside or above the EuiFlyout
|
|
232
|
+
* as part of the flyout's focus trap. This prevents focus fighting with interactive elements
|
|
233
|
+
* within fixed headers.
|
|
234
|
+
*
|
|
235
|
+
* Set this to `false` if you need to disable this behavior for a specific reason.
|
|
236
|
+
*/
|
|
237
|
+
includeFixedHeadersInFocusTrap: _propTypes.default.bool,
|
|
238
|
+
|
|
240
239
|
/**
|
|
241
240
|
* ReactNode to render as this component's content
|
|
242
241
|
*/
|
|
@@ -103,7 +103,9 @@ var EuiHeader = function EuiHeader(_ref) {
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
return (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
106
|
-
className: classes
|
|
106
|
+
className: classes,
|
|
107
|
+
"data-fixed-header": position === 'fixed' || undefined // Used by EuiFlyouts as a query selector
|
|
108
|
+
|
|
107
109
|
}, rest), contents);
|
|
108
110
|
};
|
|
109
111
|
|
|
@@ -275,16 +275,16 @@ var FieldValueSelectionFilter = /*#__PURE__*/function (_Component) {
|
|
|
275
275
|
if (!multiSelect && autoClose) {
|
|
276
276
|
this.closePopover();
|
|
277
277
|
|
|
278
|
-
var _query = checked ? this.props.query.removeSimpleFieldClauses(field)
|
|
278
|
+
var _query = checked ? this.props.query.removeSimpleFieldClauses(field).addSimpleFieldValue(field, value, true, operator) : this.props.query.removeSimpleFieldClauses(field);
|
|
279
279
|
|
|
280
280
|
this.props.onChange(_query);
|
|
281
281
|
} else {
|
|
282
282
|
if (multiSelect === 'or') {
|
|
283
|
-
var _query2 = checked ? this.props.query.
|
|
283
|
+
var _query2 = checked ? this.props.query.addOrFieldValue(field, value, true, operator) : this.props.query.removeOrFieldValue(field, value);
|
|
284
284
|
|
|
285
285
|
this.props.onChange(_query2);
|
|
286
286
|
} else {
|
|
287
|
-
var _query3 = checked ? this.props.query.
|
|
287
|
+
var _query3 = checked ? this.props.query.addSimpleFieldValue(field, value, true, operator) : this.props.query.removeSimpleFieldValue(field, value);
|
|
288
288
|
|
|
289
289
|
this.props.onChange(_query3);
|
|
290
290
|
}
|
|
@@ -392,13 +392,9 @@ var FieldValueSelectionFilter = /*#__PURE__*/function (_Component) {
|
|
|
392
392
|
listProps: {
|
|
393
393
|
isVirtualized: isOverSearchThreshold || false
|
|
394
394
|
},
|
|
395
|
-
onChange: function onChange(options) {
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
});
|
|
399
|
-
|
|
400
|
-
if (diff) {
|
|
401
|
-
_this5.onOptionClick(diff.data.optionField, diff.data.value, diff.checked);
|
|
395
|
+
onChange: function onChange(options, event, changedOption) {
|
|
396
|
+
if (changedOption.data) {
|
|
397
|
+
_this5.onOptionClick(changedOption.data.optionField, changedOption.data.value, changedOption.checked);
|
|
402
398
|
}
|
|
403
399
|
}
|
|
404
400
|
}, searchProps), function (list, search) {
|
|
@@ -118,6 +118,19 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
});
|
|
121
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "ariaSetSize", 0);
|
|
122
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "ariaPosInSetMap", {});
|
|
123
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "calculateAriaSetAttrs", function (optionArray) {
|
|
124
|
+
_this.ariaPosInSetMap = {};
|
|
125
|
+
var latestAriaPosIndex = 0;
|
|
126
|
+
optionArray.forEach(function (option, index) {
|
|
127
|
+
if (!option.isGroupLabel) {
|
|
128
|
+
latestAriaPosIndex++;
|
|
129
|
+
_this.ariaPosInSetMap[index] = latestAriaPosIndex;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
_this.ariaSetSize = latestAriaPosIndex;
|
|
133
|
+
});
|
|
121
134
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "ListRow", /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
122
135
|
var data = _ref.data,
|
|
123
136
|
index = _ref.index,
|
|
@@ -160,9 +173,6 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
160
173
|
}, optionRest), prepend, label, append);
|
|
161
174
|
}
|
|
162
175
|
|
|
163
|
-
var labelCount = data.filter(function (option) {
|
|
164
|
-
return option.isGroupLabel;
|
|
165
|
-
}).length;
|
|
166
176
|
var id = makeOptionId(index);
|
|
167
177
|
return (0, _react2.jsx)(_selectable_list_item.EuiSelectableListItem, (0, _extends2.default)({
|
|
168
178
|
key: id,
|
|
@@ -183,8 +193,8 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
183
193
|
disabled: disabled,
|
|
184
194
|
prepend: prepend,
|
|
185
195
|
append: append,
|
|
186
|
-
"aria-posinset": index
|
|
187
|
-
"aria-setsize":
|
|
196
|
+
"aria-posinset": _this.ariaPosInSetMap[index],
|
|
197
|
+
"aria-setsize": _this.ariaSetSize,
|
|
188
198
|
onFocusBadge: onFocusBadge,
|
|
189
199
|
allowExclusions: allowExclusions,
|
|
190
200
|
showIcons: showIcons,
|
|
@@ -335,6 +345,7 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
335
345
|
textWrap = _this$props7.textWrap,
|
|
336
346
|
rest = (0, _objectWithoutProperties2.default)(_this$props7, _excluded3);
|
|
337
347
|
var optionArray = visibleOptions || options;
|
|
348
|
+
this.calculateAriaSetAttrs(optionArray);
|
|
338
349
|
var heightIsFull = forcedHeight === 'full';
|
|
339
350
|
var calculatedHeight = heightIsFull ? false : forcedHeight; // If calculatedHeight is still undefined, then calculate it
|
|
340
351
|
|