@elastic/eui 74.0.1 → 74.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/card/card.js +1 -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 +3 -0
- package/lib/components/card/card.js +1 -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/card/card.js +1 -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/card/card.js +1 -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 +1 -1
- package/test-env/components/card/card.js +1 -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
|
@@ -276,16 +276,16 @@ export var FieldValueSelectionFilter = /*#__PURE__*/function (_Component) {
|
|
|
276
276
|
if (!multiSelect && autoClose) {
|
|
277
277
|
this.closePopover();
|
|
278
278
|
|
|
279
|
-
var _query = checked ? this.props.query.removeSimpleFieldClauses(field)
|
|
279
|
+
var _query = checked ? this.props.query.removeSimpleFieldClauses(field).addSimpleFieldValue(field, value, true, operator) : this.props.query.removeSimpleFieldClauses(field);
|
|
280
280
|
|
|
281
281
|
this.props.onChange(_query);
|
|
282
282
|
} else {
|
|
283
283
|
if (multiSelect === 'or') {
|
|
284
|
-
var _query2 = checked ? this.props.query.
|
|
284
|
+
var _query2 = checked ? this.props.query.addOrFieldValue(field, value, true, operator) : this.props.query.removeOrFieldValue(field, value);
|
|
285
285
|
|
|
286
286
|
this.props.onChange(_query2);
|
|
287
287
|
} else {
|
|
288
|
-
var _query3 = checked ? this.props.query.
|
|
288
|
+
var _query3 = checked ? this.props.query.addSimpleFieldValue(field, value, true, operator) : this.props.query.removeSimpleFieldValue(field, value);
|
|
289
289
|
|
|
290
290
|
this.props.onChange(_query3);
|
|
291
291
|
}
|
|
@@ -395,13 +395,9 @@ export var FieldValueSelectionFilter = /*#__PURE__*/function (_Component) {
|
|
|
395
395
|
listProps: {
|
|
396
396
|
isVirtualized: isOverSearchThreshold || false
|
|
397
397
|
},
|
|
398
|
-
onChange: function onChange(options) {
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
});
|
|
402
|
-
|
|
403
|
-
if (diff) {
|
|
404
|
-
_this5.onOptionClick(diff.data.optionField, diff.data.value, diff.checked);
|
|
398
|
+
onChange: function onChange(options, event, changedOption) {
|
|
399
|
+
if (changedOption.data) {
|
|
400
|
+
_this5.onOptionClick(changedOption.data.optionField, changedOption.data.value, changedOption.checked);
|
|
405
401
|
}
|
|
406
402
|
}
|
|
407
403
|
}, searchProps), function (list, search) {
|
|
@@ -117,6 +117,22 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
117
117
|
}
|
|
118
118
|
});
|
|
119
119
|
|
|
120
|
+
_defineProperty(_assertThisInitialized(_this), "ariaSetSize", 0);
|
|
121
|
+
|
|
122
|
+
_defineProperty(_assertThisInitialized(_this), "ariaPosInSetMap", {});
|
|
123
|
+
|
|
124
|
+
_defineProperty(_assertThisInitialized(_this), "calculateAriaSetAttrs", function (optionArray) {
|
|
125
|
+
_this.ariaPosInSetMap = {};
|
|
126
|
+
var latestAriaPosIndex = 0;
|
|
127
|
+
optionArray.forEach(function (option, index) {
|
|
128
|
+
if (!option.isGroupLabel) {
|
|
129
|
+
latestAriaPosIndex++;
|
|
130
|
+
_this.ariaPosInSetMap[index] = latestAriaPosIndex;
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
_this.ariaSetSize = latestAriaPosIndex;
|
|
134
|
+
});
|
|
135
|
+
|
|
120
136
|
_defineProperty(_assertThisInitialized(_this), "ListRow", /*#__PURE__*/memo(function (_ref) {
|
|
121
137
|
var data = _ref.data,
|
|
122
138
|
index = _ref.index,
|
|
@@ -160,9 +176,6 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
160
176
|
}, optionRest), prepend, label, append);
|
|
161
177
|
}
|
|
162
178
|
|
|
163
|
-
var labelCount = data.filter(function (option) {
|
|
164
|
-
return option.isGroupLabel;
|
|
165
|
-
}).length;
|
|
166
179
|
var id = makeOptionId(index);
|
|
167
180
|
return ___EmotionJSX(EuiSelectableListItem, _extends({
|
|
168
181
|
key: id,
|
|
@@ -183,8 +196,8 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
183
196
|
disabled: disabled,
|
|
184
197
|
prepend: prepend,
|
|
185
198
|
append: append,
|
|
186
|
-
"aria-posinset": index
|
|
187
|
-
"aria-setsize":
|
|
199
|
+
"aria-posinset": _this.ariaPosInSetMap[index],
|
|
200
|
+
"aria-setsize": _this.ariaSetSize,
|
|
188
201
|
onFocusBadge: onFocusBadge,
|
|
189
202
|
allowExclusions: allowExclusions,
|
|
190
203
|
showIcons: showIcons,
|
|
@@ -341,6 +354,7 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
341
354
|
rest = _objectWithoutProperties(_this$props7, _excluded3);
|
|
342
355
|
|
|
343
356
|
var optionArray = visibleOptions || options;
|
|
357
|
+
this.calculateAriaSetAttrs(optionArray);
|
|
344
358
|
var heightIsFull = forcedHeight === 'full';
|
|
345
359
|
var calculatedHeight = heightIsFull ? false : forcedHeight; // If calculatedHeight is still undefined, then calculate it
|
|
346
360
|
|
package/eui.d.ts
CHANGED
|
@@ -18081,6 +18081,9 @@ declare module '@elastic/eui/src/components/selectable/selectable_list/selectabl
|
|
|
18081
18081
|
setListBoxRef: (ref: HTMLUListElement | null) => void;
|
|
18082
18082
|
componentDidUpdate(): void;
|
|
18083
18083
|
constructor(props: EuiSelectableListProps<T>);
|
|
18084
|
+
ariaSetSize: number;
|
|
18085
|
+
ariaPosInSetMap: Record<number, number>;
|
|
18086
|
+
calculateAriaSetAttrs: (optionArray: Array<EuiSelectableOption<T>>) => void;
|
|
18084
18087
|
ListRow: React.MemoExoticComponent<({ data, index, style }: ListChildComponentProps<T>) => JSX.Element>;
|
|
18085
18088
|
render(): JSX.Element;
|
|
18086
18089
|
onAddOrRemoveOption: (option: EuiSelectableOption<T>, event: EuiSelectableOnChangeEvent) => void;
|
|
@@ -292,16 +292,16 @@ var FieldValueSelectionFilter = /*#__PURE__*/function (_Component) {
|
|
|
292
292
|
if (!multiSelect && autoClose) {
|
|
293
293
|
this.closePopover();
|
|
294
294
|
|
|
295
|
-
var _query = checked ? this.props.query.removeSimpleFieldClauses(field)
|
|
295
|
+
var _query = checked ? this.props.query.removeSimpleFieldClauses(field).addSimpleFieldValue(field, value, true, operator) : this.props.query.removeSimpleFieldClauses(field);
|
|
296
296
|
|
|
297
297
|
this.props.onChange(_query);
|
|
298
298
|
} else {
|
|
299
299
|
if (multiSelect === 'or') {
|
|
300
|
-
var _query2 = checked ? this.props.query.
|
|
300
|
+
var _query2 = checked ? this.props.query.addOrFieldValue(field, value, true, operator) : this.props.query.removeOrFieldValue(field, value);
|
|
301
301
|
|
|
302
302
|
this.props.onChange(_query2);
|
|
303
303
|
} else {
|
|
304
|
-
var _query3 = checked ? this.props.query.
|
|
304
|
+
var _query3 = checked ? this.props.query.addSimpleFieldValue(field, value, true, operator) : this.props.query.removeSimpleFieldValue(field, value);
|
|
305
305
|
|
|
306
306
|
this.props.onChange(_query3);
|
|
307
307
|
}
|
|
@@ -409,13 +409,9 @@ var FieldValueSelectionFilter = /*#__PURE__*/function (_Component) {
|
|
|
409
409
|
listProps: {
|
|
410
410
|
isVirtualized: isOverSearchThreshold || false
|
|
411
411
|
},
|
|
412
|
-
onChange: function onChange(options) {
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
});
|
|
416
|
-
|
|
417
|
-
if (diff) {
|
|
418
|
-
_this5.onOptionClick(diff.data.optionField, diff.data.value, diff.checked);
|
|
412
|
+
onChange: function onChange(options, event, changedOption) {
|
|
413
|
+
if (changedOption.data) {
|
|
414
|
+
_this5.onOptionClick(changedOption.data.optionField, changedOption.data.value, changedOption.checked);
|
|
419
415
|
}
|
|
420
416
|
}
|
|
421
417
|
}, searchProps), function (list, search) {
|
|
@@ -131,6 +131,22 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
131
131
|
}
|
|
132
132
|
});
|
|
133
133
|
|
|
134
|
+
_defineProperty(_assertThisInitialized(_this), "ariaSetSize", 0);
|
|
135
|
+
|
|
136
|
+
_defineProperty(_assertThisInitialized(_this), "ariaPosInSetMap", {});
|
|
137
|
+
|
|
138
|
+
_defineProperty(_assertThisInitialized(_this), "calculateAriaSetAttrs", function (optionArray) {
|
|
139
|
+
_this.ariaPosInSetMap = {};
|
|
140
|
+
var latestAriaPosIndex = 0;
|
|
141
|
+
optionArray.forEach(function (option, index) {
|
|
142
|
+
if (!option.isGroupLabel) {
|
|
143
|
+
latestAriaPosIndex++;
|
|
144
|
+
_this.ariaPosInSetMap[index] = latestAriaPosIndex;
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
_this.ariaSetSize = latestAriaPosIndex;
|
|
148
|
+
});
|
|
149
|
+
|
|
134
150
|
_defineProperty(_assertThisInitialized(_this), "ListRow", /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
135
151
|
var data = _ref.data,
|
|
136
152
|
index = _ref.index,
|
|
@@ -174,9 +190,6 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
174
190
|
}, optionRest), prepend, label, append);
|
|
175
191
|
}
|
|
176
192
|
|
|
177
|
-
var labelCount = data.filter(function (option) {
|
|
178
|
-
return option.isGroupLabel;
|
|
179
|
-
}).length;
|
|
180
193
|
var id = makeOptionId(index);
|
|
181
194
|
return (0, _react2.jsx)(_selectable_list_item.EuiSelectableListItem, _extends({
|
|
182
195
|
key: id,
|
|
@@ -197,8 +210,8 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
197
210
|
disabled: disabled,
|
|
198
211
|
prepend: prepend,
|
|
199
212
|
append: append,
|
|
200
|
-
"aria-posinset": index
|
|
201
|
-
"aria-setsize":
|
|
213
|
+
"aria-posinset": _this.ariaPosInSetMap[index],
|
|
214
|
+
"aria-setsize": _this.ariaSetSize,
|
|
202
215
|
onFocusBadge: onFocusBadge,
|
|
203
216
|
allowExclusions: allowExclusions,
|
|
204
217
|
showIcons: showIcons,
|
|
@@ -355,6 +368,7 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
355
368
|
rest = _objectWithoutProperties(_this$props7, _excluded3);
|
|
356
369
|
|
|
357
370
|
var optionArray = visibleOptions || options;
|
|
371
|
+
this.calculateAriaSetAttrs(optionArray);
|
|
358
372
|
var heightIsFull = forcedHeight === 'full';
|
|
359
373
|
var calculatedHeight = heightIsFull ? false : forcedHeight; // If calculatedHeight is still undefined, then calculate it
|
|
360
374
|
|
|
@@ -251,16 +251,16 @@ export var FieldValueSelectionFilter = /*#__PURE__*/function (_Component) {
|
|
|
251
251
|
if (!multiSelect && autoClose) {
|
|
252
252
|
this.closePopover();
|
|
253
253
|
|
|
254
|
-
var _query = checked ? this.props.query.removeSimpleFieldClauses(field)
|
|
254
|
+
var _query = checked ? this.props.query.removeSimpleFieldClauses(field).addSimpleFieldValue(field, value, true, operator) : this.props.query.removeSimpleFieldClauses(field);
|
|
255
255
|
|
|
256
256
|
this.props.onChange(_query);
|
|
257
257
|
} else {
|
|
258
258
|
if (multiSelect === 'or') {
|
|
259
|
-
var _query2 = checked ? this.props.query.
|
|
259
|
+
var _query2 = checked ? this.props.query.addOrFieldValue(field, value, true, operator) : this.props.query.removeOrFieldValue(field, value);
|
|
260
260
|
|
|
261
261
|
this.props.onChange(_query2);
|
|
262
262
|
} else {
|
|
263
|
-
var _query3 = checked ? this.props.query.
|
|
263
|
+
var _query3 = checked ? this.props.query.addSimpleFieldValue(field, value, true, operator) : this.props.query.removeSimpleFieldValue(field, value);
|
|
264
264
|
|
|
265
265
|
this.props.onChange(_query3);
|
|
266
266
|
}
|
|
@@ -370,13 +370,9 @@ export var FieldValueSelectionFilter = /*#__PURE__*/function (_Component) {
|
|
|
370
370
|
listProps: {
|
|
371
371
|
isVirtualized: isOverSearchThreshold || false
|
|
372
372
|
},
|
|
373
|
-
onChange: function onChange(options) {
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
});
|
|
377
|
-
|
|
378
|
-
if (diff) {
|
|
379
|
-
_this5.onOptionClick(diff.data.optionField, diff.data.value, diff.checked);
|
|
373
|
+
onChange: function onChange(options, event, changedOption) {
|
|
374
|
+
if (changedOption.data) {
|
|
375
|
+
_this5.onOptionClick(changedOption.data.optionField, changedOption.data.value, changedOption.checked);
|
|
380
376
|
}
|
|
381
377
|
}
|
|
382
378
|
}, searchProps), function (list, search) {
|
|
@@ -99,6 +99,22 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
99
99
|
}
|
|
100
100
|
});
|
|
101
101
|
|
|
102
|
+
_defineProperty(_assertThisInitialized(_this), "ariaSetSize", 0);
|
|
103
|
+
|
|
104
|
+
_defineProperty(_assertThisInitialized(_this), "ariaPosInSetMap", {});
|
|
105
|
+
|
|
106
|
+
_defineProperty(_assertThisInitialized(_this), "calculateAriaSetAttrs", function (optionArray) {
|
|
107
|
+
_this.ariaPosInSetMap = {};
|
|
108
|
+
var latestAriaPosIndex = 0;
|
|
109
|
+
optionArray.forEach(function (option, index) {
|
|
110
|
+
if (!option.isGroupLabel) {
|
|
111
|
+
latestAriaPosIndex++;
|
|
112
|
+
_this.ariaPosInSetMap[index] = latestAriaPosIndex;
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
_this.ariaSetSize = latestAriaPosIndex;
|
|
116
|
+
});
|
|
117
|
+
|
|
102
118
|
_defineProperty(_assertThisInitialized(_this), "ListRow", /*#__PURE__*/memo(function (_ref) {
|
|
103
119
|
var data = _ref.data,
|
|
104
120
|
index = _ref.index,
|
|
@@ -142,9 +158,6 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
142
158
|
}, optionRest), prepend, label, append);
|
|
143
159
|
}
|
|
144
160
|
|
|
145
|
-
var labelCount = data.filter(function (option) {
|
|
146
|
-
return option.isGroupLabel;
|
|
147
|
-
}).length;
|
|
148
161
|
var id = makeOptionId(index);
|
|
149
162
|
return ___EmotionJSX(EuiSelectableListItem, _extends({
|
|
150
163
|
key: id,
|
|
@@ -165,8 +178,8 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
165
178
|
disabled: disabled,
|
|
166
179
|
prepend: prepend,
|
|
167
180
|
append: append,
|
|
168
|
-
"aria-posinset": index
|
|
169
|
-
"aria-setsize":
|
|
181
|
+
"aria-posinset": _this.ariaPosInSetMap[index],
|
|
182
|
+
"aria-setsize": _this.ariaSetSize,
|
|
170
183
|
onFocusBadge: onFocusBadge,
|
|
171
184
|
allowExclusions: allowExclusions,
|
|
172
185
|
showIcons: showIcons,
|
|
@@ -323,6 +336,7 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
323
336
|
rest = _objectWithoutProperties(_this$props7, _excluded3);
|
|
324
337
|
|
|
325
338
|
var optionArray = visibleOptions || options;
|
|
339
|
+
this.calculateAriaSetAttrs(optionArray);
|
|
326
340
|
var heightIsFull = forcedHeight === 'full';
|
|
327
341
|
var calculatedHeight = heightIsFull ? false : forcedHeight; // If calculatedHeight is still undefined, then calculate it
|
|
328
342
|
|
|
@@ -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
|
@@ -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
|
|