@elastic/eui 87.0.0 → 87.1.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/accordion/accordion.js +82 -35
- package/es/components/auto_sizer/index.js +1 -1
- package/es/components/breadcrumbs/breadcrumb.js +2 -3
- package/es/components/breadcrumbs/breadcrumbs.js +2 -3
- package/es/components/code/code_block_virtualized.js +25 -17
- package/es/components/collapsible_nav_beta/collapsible_nav_beta.js +14 -1
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +8 -7
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +6 -6
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +7 -7
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +6 -6
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +9 -9
- package/es/components/color_picker/color_palette_picker/color_palette_picker.js +1 -1
- package/es/components/control_bar/control_bar.js +2 -3
- package/es/components/date_picker/date_picker_range.js +5 -2
- package/es/components/date_picker/super_date_picker/super_date_picker.js +2 -2
- package/es/components/date_picker/super_date_picker/super_update_button.js +1 -1
- package/es/components/empty_prompt/empty_prompt.js +0 -1
- package/es/components/flyout/flyout.js +9 -7
- package/es/components/flyout/flyout_body.js +15 -3
- package/es/components/form/range/dual_range.js +33 -6
- package/es/components/form/range/range.js +31 -6
- package/es/components/form/super_select/super_select.js +1 -1
- package/es/components/header/header_breadcrumbs/header_breadcrumbs.js +2 -3
- package/es/components/header/header_links/header_links.js +2 -3
- package/es/components/page/page_header/page_header_content.js +2 -3
- package/es/components/page/page_sidebar/page_sidebar.js +2 -2
- package/es/components/page_template/page_template.js +12 -4
- package/es/components/popover/input_popover.js +24 -9
- package/es/components/popover/popover.js +4 -6
- package/es/components/selectable/selectable_list/selectable_list.js +97 -79
- package/es/components/tool_tip/icon_tip.js +1 -1
- package/es/components/tool_tip/tool_tip.js +4 -14
- package/es/components/tool_tip/tool_tip_anchor.js +5 -14
- package/es/components/tour/tour_step.js +2 -3
- package/eui.d.ts +85 -37
- package/i18ntokens.json +54 -36
- package/lib/components/accordion/accordion.js +82 -35
- package/lib/components/auto_sizer/index.js +11 -7
- package/lib/components/breadcrumbs/breadcrumb.js +2 -3
- package/lib/components/code/code_block_virtualized.js +25 -17
- package/lib/components/collapsible_nav_beta/collapsible_nav_beta.js +14 -1
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +8 -7
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +6 -6
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +7 -7
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +6 -6
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +9 -9
- package/lib/components/color_picker/color_palette_picker/color_palette_picker.js +1 -1
- package/lib/components/date_picker/date_picker_range.js +5 -2
- package/lib/components/date_picker/super_date_picker/super_date_picker.js +2 -2
- package/lib/components/date_picker/super_date_picker/super_update_button.js +1 -1
- package/lib/components/empty_prompt/empty_prompt.js +0 -1
- package/lib/components/flyout/flyout.js +9 -7
- package/lib/components/flyout/flyout_body.js +15 -3
- package/lib/components/form/range/dual_range.js +33 -6
- package/lib/components/form/range/range.js +14 -6
- package/lib/components/form/super_select/super_select.js +1 -1
- package/lib/components/page/page_sidebar/page_sidebar.js +1 -1
- package/lib/components/page_template/page_template.js +12 -4
- package/lib/components/popover/input_popover.js +23 -8
- package/lib/components/popover/popover.js +4 -6
- package/lib/components/selectable/selectable_list/selectable_list.js +97 -79
- package/lib/components/tool_tip/icon_tip.js +1 -1
- package/lib/components/tool_tip/tool_tip.js +4 -14
- package/lib/components/tool_tip/tool_tip_anchor.js +5 -13
- package/optimize/es/components/accordion/accordion.js +82 -35
- package/optimize/es/components/auto_sizer/index.js +1 -1
- package/optimize/es/components/code/code_block_virtualized.js +25 -17
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_beta.js +5 -1
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +2 -1
- package/optimize/es/components/date_picker/date_picker_range.js +5 -2
- package/optimize/es/components/flyout/flyout.js +9 -7
- package/optimize/es/components/flyout/flyout_body.js +4 -2
- package/optimize/es/components/form/range/dual_range.js +7 -4
- package/optimize/es/components/form/range/range.js +5 -4
- package/optimize/es/components/page/page_sidebar/page_sidebar.js +2 -2
- package/optimize/es/components/page_template/page_template.js +12 -4
- package/optimize/es/components/popover/input_popover.js +13 -8
- package/optimize/es/components/popover/popover.js +2 -3
- package/optimize/es/components/selectable/selectable_list/selectable_list.js +97 -79
- package/optimize/es/components/tool_tip/tool_tip.js +3 -13
- package/optimize/es/components/tool_tip/tool_tip_anchor.js +4 -8
- package/optimize/lib/components/accordion/accordion.js +82 -35
- package/optimize/lib/components/auto_sizer/index.js +11 -7
- package/optimize/lib/components/code/code_block_virtualized.js +25 -17
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_beta.js +5 -1
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +2 -1
- package/optimize/lib/components/date_picker/date_picker_range.js +5 -2
- package/optimize/lib/components/flyout/flyout.js +9 -7
- package/optimize/lib/components/flyout/flyout_body.js +4 -2
- package/optimize/lib/components/form/range/dual_range.js +7 -4
- package/optimize/lib/components/form/range/range.js +5 -4
- package/optimize/lib/components/page/page_sidebar/page_sidebar.js +1 -1
- package/optimize/lib/components/page_template/page_template.js +12 -4
- package/optimize/lib/components/popover/input_popover.js +12 -7
- package/optimize/lib/components/popover/popover.js +2 -3
- package/optimize/lib/components/selectable/selectable_list/selectable_list.js +97 -79
- package/optimize/lib/components/tool_tip/tool_tip.js +3 -13
- package/optimize/lib/components/tool_tip/tool_tip_anchor.js +4 -8
- package/package.json +7 -9
- package/test-env/components/accordion/accordion.js +82 -35
- package/test-env/components/auto_sizer/index.js +11 -7
- package/test-env/components/breadcrumbs/breadcrumb.js +2 -3
- package/test-env/components/code/code_block_virtualized.js +25 -17
- package/test-env/components/collapsible_nav_beta/collapsible_nav_beta.js +14 -1
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +8 -7
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +6 -6
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +7 -7
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +6 -6
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +9 -9
- package/test-env/components/color_picker/color_palette_picker/color_palette_picker.js +1 -1
- package/test-env/components/date_picker/date_picker_range.js +5 -2
- package/test-env/components/date_picker/super_date_picker/super_date_picker.js +2 -2
- package/test-env/components/date_picker/super_date_picker/super_update_button.js +1 -1
- package/test-env/components/empty_prompt/empty_prompt.js +0 -1
- package/test-env/components/flyout/flyout_body.js +15 -3
- package/test-env/components/form/range/dual_range.js +33 -6
- package/test-env/components/form/range/range.js +14 -6
- package/test-env/components/form/super_select/super_select.js +1 -1
- package/test-env/components/page/page_sidebar/page_sidebar.js +1 -1
- package/test-env/components/page_template/page_template.js +12 -4
- package/test-env/components/popover/input_popover.js +23 -8
- package/test-env/components/popover/popover.js +4 -6
- package/test-env/components/selectable/selectable_list/selectable_list.js +97 -79
- package/test-env/components/tool_tip/icon_tip.js +1 -1
- package/test-env/components/tool_tip/tool_tip.js +4 -14
- package/test-env/components/tool_tip/tool_tip_anchor.js +5 -11
|
@@ -171,17 +171,67 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
171
171
|
search: searchValue
|
|
172
172
|
}, label));
|
|
173
173
|
}, areEqual));
|
|
174
|
+
_defineProperty(_assertThisInitialized(_this), "renderVirtualizedList", function (heightIsFull, optionArray) {
|
|
175
|
+
if (!_this.props.isVirtualized) return null;
|
|
176
|
+
var _this$props3 = _this.props,
|
|
177
|
+
windowProps = _this$props3.windowProps,
|
|
178
|
+
forcedHeight = _this$props3.height,
|
|
179
|
+
rowHeight = _this$props3.rowHeight;
|
|
180
|
+
var virtualizationProps = _objectSpread({
|
|
181
|
+
className: 'euiSelectableList__list',
|
|
182
|
+
ref: _this.setListRef,
|
|
183
|
+
outerRef: _this.removeScrollableTabStop,
|
|
184
|
+
innerRef: _this.setListBoxRef,
|
|
185
|
+
innerElementType: 'ul',
|
|
186
|
+
itemCount: optionArray.length,
|
|
187
|
+
itemData: optionArray,
|
|
188
|
+
itemSize: rowHeight,
|
|
189
|
+
'data-skip-axe': 'scrollable-region-focusable'
|
|
190
|
+
}, windowProps);
|
|
191
|
+
|
|
192
|
+
// Calculated height is only used if height is not full
|
|
193
|
+
var calculatedHeight = !heightIsFull ? forcedHeight || 0 : 0;
|
|
194
|
+
|
|
195
|
+
// If calculatedHeight is still falsy, then calculate it
|
|
196
|
+
if (!heightIsFull && !calculatedHeight) {
|
|
197
|
+
var maxVisibleOptions = 7;
|
|
198
|
+
var numVisibleOptions = optionArray.length;
|
|
199
|
+
var numVisibleMoreThanMax = optionArray.length > maxVisibleOptions;
|
|
200
|
+
if (numVisibleMoreThanMax) {
|
|
201
|
+
// Show only half of the last one to indicate there's more to scroll to
|
|
202
|
+
calculatedHeight = (maxVisibleOptions - 0.5) * rowHeight;
|
|
203
|
+
} else {
|
|
204
|
+
calculatedHeight = numVisibleOptions * rowHeight;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
return heightIsFull ? ___EmotionJSX(EuiAutoSizer, null, function (_ref2) {
|
|
208
|
+
var width = _ref2.width,
|
|
209
|
+
height = _ref2.height;
|
|
210
|
+
return ___EmotionJSX(FixedSizeList, _extends({
|
|
211
|
+
width: width,
|
|
212
|
+
height: height
|
|
213
|
+
}, virtualizationProps), _this.ListRow);
|
|
214
|
+
}) : ___EmotionJSX(EuiAutoSizer, {
|
|
215
|
+
disableHeight: true
|
|
216
|
+
}, function (_ref3) {
|
|
217
|
+
var width = _ref3.width;
|
|
218
|
+
return ___EmotionJSX(FixedSizeList, _extends({
|
|
219
|
+
width: width,
|
|
220
|
+
height: calculatedHeight
|
|
221
|
+
}, virtualizationProps), _this.ListRow);
|
|
222
|
+
});
|
|
223
|
+
});
|
|
174
224
|
_defineProperty(_assertThisInitialized(_this), "onAddOrRemoveOption", function (option, event) {
|
|
175
225
|
if (option.disabled) {
|
|
176
226
|
return;
|
|
177
227
|
}
|
|
178
|
-
var _this$
|
|
179
|
-
allowExclusions = _this$
|
|
180
|
-
options = _this$
|
|
181
|
-
_this$
|
|
182
|
-
visibleOptions = _this$
|
|
183
|
-
_this.props.setActiveOptionIndex(visibleOptions.findIndex(function (
|
|
184
|
-
var label =
|
|
228
|
+
var _this$props4 = _this.props,
|
|
229
|
+
allowExclusions = _this$props4.allowExclusions,
|
|
230
|
+
options = _this$props4.options,
|
|
231
|
+
_this$props4$visibleO = _this$props4.visibleOptions,
|
|
232
|
+
visibleOptions = _this$props4$visibleO === void 0 ? options : _this$props4$visibleO;
|
|
233
|
+
_this.props.setActiveOptionIndex(visibleOptions.findIndex(function (_ref4) {
|
|
234
|
+
var label = _ref4.label;
|
|
185
235
|
return label === option.label;
|
|
186
236
|
}), function () {
|
|
187
237
|
if (option.checked === 'on' && allowExclusions) {
|
|
@@ -194,10 +244,10 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
194
244
|
});
|
|
195
245
|
});
|
|
196
246
|
_defineProperty(_assertThisInitialized(_this), "onAddOption", function (addedOption, event) {
|
|
197
|
-
var _this$
|
|
198
|
-
onOptionClick = _this$
|
|
199
|
-
options = _this$
|
|
200
|
-
singleSelection = _this$
|
|
247
|
+
var _this$props5 = _this.props,
|
|
248
|
+
onOptionClick = _this$props5.onOptionClick,
|
|
249
|
+
options = _this$props5.options,
|
|
250
|
+
singleSelection = _this$props5.singleSelection;
|
|
201
251
|
var changedOption = _objectSpread({}, addedOption);
|
|
202
252
|
var updatedOptions = options.map(function (option) {
|
|
203
253
|
// if singleSelection is enabled, uncheck any selected option(s)
|
|
@@ -216,10 +266,10 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
216
266
|
onOptionClick(updatedOptions, event, changedOption);
|
|
217
267
|
});
|
|
218
268
|
_defineProperty(_assertThisInitialized(_this), "onRemoveOption", function (removedOption, event) {
|
|
219
|
-
var _this$
|
|
220
|
-
onOptionClick = _this$
|
|
221
|
-
singleSelection = _this$
|
|
222
|
-
options = _this$
|
|
269
|
+
var _this$props6 = _this.props,
|
|
270
|
+
onOptionClick = _this$props6.onOptionClick,
|
|
271
|
+
singleSelection = _this$props6.singleSelection,
|
|
272
|
+
options = _this$props6.options;
|
|
223
273
|
var changedOption = _objectSpread({}, removedOption);
|
|
224
274
|
var updatedOptions = options.map(function (option) {
|
|
225
275
|
var updatedOption = _objectSpread({}, option);
|
|
@@ -232,9 +282,9 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
232
282
|
onOptionClick(updatedOptions, event, changedOption);
|
|
233
283
|
});
|
|
234
284
|
_defineProperty(_assertThisInitialized(_this), "onExcludeOption", function (excludedOption, event) {
|
|
235
|
-
var _this$
|
|
236
|
-
onOptionClick = _this$
|
|
237
|
-
options = _this$
|
|
285
|
+
var _this$props7 = _this.props,
|
|
286
|
+
onOptionClick = _this$props7.onOptionClick,
|
|
287
|
+
options = _this$props7.options;
|
|
238
288
|
var changedOption = _objectSpread({}, excludedOption);
|
|
239
289
|
var updatedOptions = options.map(function (option) {
|
|
240
290
|
var updatedOption = _objectSpread({}, option);
|
|
@@ -263,76 +313,44 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
263
313
|
key: "render",
|
|
264
314
|
value: function render() {
|
|
265
315
|
var _this2 = this;
|
|
266
|
-
var _this$
|
|
267
|
-
className = _this$
|
|
268
|
-
options = _this$
|
|
269
|
-
searchValue = _this$
|
|
270
|
-
onOptionClick = _this$
|
|
271
|
-
renderOption = _this$
|
|
272
|
-
forcedHeight = _this$
|
|
273
|
-
windowProps = _this$
|
|
274
|
-
rowHeight = _this$
|
|
275
|
-
activeOptionIndex = _this$
|
|
276
|
-
makeOptionId = _this$
|
|
277
|
-
showIcons = _this$
|
|
278
|
-
singleSelection = _this$
|
|
279
|
-
visibleOptions = _this$
|
|
280
|
-
allowExclusions = _this$
|
|
281
|
-
bordered = _this$
|
|
282
|
-
paddingSize = _this$
|
|
283
|
-
searchable = _this$
|
|
284
|
-
onFocusBadge = _this$
|
|
285
|
-
listId = _this$
|
|
286
|
-
setActiveOptionIndex = _this$
|
|
287
|
-
ariaLabel = _this$
|
|
288
|
-
ariaLabelledby = _this$
|
|
289
|
-
ariaDescribedby = _this$
|
|
290
|
-
role = _this$
|
|
291
|
-
isVirtualized = _this$
|
|
292
|
-
textWrap = _this$
|
|
293
|
-
rest = _objectWithoutProperties(_this$
|
|
316
|
+
var _this$props8 = this.props,
|
|
317
|
+
className = _this$props8.className,
|
|
318
|
+
options = _this$props8.options,
|
|
319
|
+
searchValue = _this$props8.searchValue,
|
|
320
|
+
onOptionClick = _this$props8.onOptionClick,
|
|
321
|
+
renderOption = _this$props8.renderOption,
|
|
322
|
+
forcedHeight = _this$props8.height,
|
|
323
|
+
windowProps = _this$props8.windowProps,
|
|
324
|
+
rowHeight = _this$props8.rowHeight,
|
|
325
|
+
activeOptionIndex = _this$props8.activeOptionIndex,
|
|
326
|
+
makeOptionId = _this$props8.makeOptionId,
|
|
327
|
+
showIcons = _this$props8.showIcons,
|
|
328
|
+
singleSelection = _this$props8.singleSelection,
|
|
329
|
+
visibleOptions = _this$props8.visibleOptions,
|
|
330
|
+
allowExclusions = _this$props8.allowExclusions,
|
|
331
|
+
bordered = _this$props8.bordered,
|
|
332
|
+
paddingSize = _this$props8.paddingSize,
|
|
333
|
+
searchable = _this$props8.searchable,
|
|
334
|
+
onFocusBadge = _this$props8.onFocusBadge,
|
|
335
|
+
listId = _this$props8.listId,
|
|
336
|
+
setActiveOptionIndex = _this$props8.setActiveOptionIndex,
|
|
337
|
+
ariaLabel = _this$props8['aria-label'],
|
|
338
|
+
ariaLabelledby = _this$props8['aria-labelledby'],
|
|
339
|
+
ariaDescribedby = _this$props8['aria-describedby'],
|
|
340
|
+
role = _this$props8.role,
|
|
341
|
+
isVirtualized = _this$props8.isVirtualized,
|
|
342
|
+
textWrap = _this$props8.textWrap,
|
|
343
|
+
rest = _objectWithoutProperties(_this$props8, _excluded3);
|
|
294
344
|
var optionArray = visibleOptions || options;
|
|
295
345
|
this.calculateAriaSetAttrs(optionArray);
|
|
296
346
|
var heightIsFull = forcedHeight === 'full';
|
|
297
|
-
var calculatedHeight = heightIsFull ? false : forcedHeight;
|
|
298
|
-
|
|
299
|
-
// If calculatedHeight is still undefined, then calculate it
|
|
300
|
-
if (calculatedHeight === undefined) {
|
|
301
|
-
var maxVisibleOptions = 7;
|
|
302
|
-
var numVisibleOptions = optionArray.length;
|
|
303
|
-
var numVisibleMoreThanMax = optionArray.length > maxVisibleOptions;
|
|
304
|
-
if (numVisibleMoreThanMax) {
|
|
305
|
-
// Show only half of the last one to indicate there's more to scroll to
|
|
306
|
-
calculatedHeight = (maxVisibleOptions - 0.5) * rowHeight;
|
|
307
|
-
} else {
|
|
308
|
-
calculatedHeight = numVisibleOptions * rowHeight;
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
347
|
var classes = classNames('euiSelectableList', {
|
|
312
348
|
'euiSelectableList-fullHeight': heightIsFull,
|
|
313
349
|
'euiSelectableList-bordered': bordered
|
|
314
350
|
}, className);
|
|
315
351
|
return ___EmotionJSX("div", _extends({
|
|
316
352
|
className: classes
|
|
317
|
-
}, rest), isVirtualized ? ___EmotionJSX(
|
|
318
|
-
disableHeight: !heightIsFull
|
|
319
|
-
}, function (_ref3) {
|
|
320
|
-
var width = _ref3.width,
|
|
321
|
-
height = _ref3.height;
|
|
322
|
-
return ___EmotionJSX(FixedSizeList, _extends({
|
|
323
|
-
ref: _this2.setListRef,
|
|
324
|
-
outerRef: _this2.removeScrollableTabStop,
|
|
325
|
-
className: "euiSelectableList__list",
|
|
326
|
-
"data-skip-axe": "scrollable-region-focusable",
|
|
327
|
-
width: width,
|
|
328
|
-
height: calculatedHeight || height,
|
|
329
|
-
itemCount: optionArray.length,
|
|
330
|
-
itemData: optionArray,
|
|
331
|
-
itemSize: rowHeight,
|
|
332
|
-
innerElementType: "ul",
|
|
333
|
-
innerRef: _this2.setListBoxRef
|
|
334
|
-
}, windowProps), _this2.ListRow);
|
|
335
|
-
}) : ___EmotionJSX("div", {
|
|
353
|
+
}, rest), isVirtualized ? this.renderVirtualizedList(heightIsFull, optionArray) : ___EmotionJSX("div", {
|
|
336
354
|
className: "euiSelectableList__list",
|
|
337
355
|
ref: this.removeScrollableTabStop
|
|
338
356
|
}, ___EmotionJSX("ul", {
|
|
@@ -27,7 +27,6 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
27
27
|
import React, { Component } from 'react';
|
|
28
28
|
import PropTypes from "prop-types";
|
|
29
29
|
import classNames from 'classnames';
|
|
30
|
-
import { keysOf } from '../common';
|
|
31
30
|
import { findPopoverPosition, htmlIdGenerator } from '../../services';
|
|
32
31
|
import { enqueueStateChange } from '../../services/react';
|
|
33
32
|
import { EuiResizeObserver } from '../observer/resize_observer';
|
|
@@ -37,21 +36,12 @@ import { EuiToolTipAnchor } from './tool_tip_anchor';
|
|
|
37
36
|
import { EuiToolTipArrow } from './tool_tip_arrow';
|
|
38
37
|
import { toolTipManager } from './tool_tip_manager';
|
|
39
38
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
right: 'euiToolTip--right',
|
|
43
|
-
bottom: 'euiToolTip--bottom',
|
|
44
|
-
left: 'euiToolTip--left'
|
|
45
|
-
};
|
|
46
|
-
export var POSITIONS = keysOf(positionsToClassNameMap);
|
|
39
|
+
export var POSITIONS = ['top', 'right', 'bottom', 'left'];
|
|
40
|
+
var DISPLAYS = ['inlineBlock', 'block'];
|
|
47
41
|
var delayToMsMap = {
|
|
48
42
|
regular: 250,
|
|
49
43
|
long: 250 * 5
|
|
50
44
|
};
|
|
51
|
-
var displayToClassNameMap = {
|
|
52
|
-
inlineBlock: undefined,
|
|
53
|
-
block: 'euiToolTipAnchor--displayBlock'
|
|
54
|
-
};
|
|
55
45
|
var DEFAULT_TOOLTIP_STYLES = {
|
|
56
46
|
// position the tooltip content near the top-left
|
|
57
47
|
// corner of the window so it can't create scrollbars
|
|
@@ -262,7 +252,7 @@ export var EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
262
252
|
onFocus: this.onFocus,
|
|
263
253
|
onMouseOver: this.showToolTip,
|
|
264
254
|
onMouseOut: this.onMouseOut,
|
|
265
|
-
id:
|
|
255
|
+
id: id,
|
|
266
256
|
className: anchorClasses,
|
|
267
257
|
display: display,
|
|
268
258
|
isVisible: visible
|
|
@@ -324,7 +314,7 @@ EuiToolTip.propTypes = {
|
|
|
324
314
|
/**
|
|
325
315
|
* Common display alternatives for the anchor wrapper
|
|
326
316
|
*/
|
|
327
|
-
display: PropTypes.
|
|
317
|
+
display: PropTypes.any,
|
|
328
318
|
/**
|
|
329
319
|
* Delay before showing tooltip. Good for repeatable items.
|
|
330
320
|
*/
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
1
|
var _excluded = ["onBlur", "onFocus", "onMouseOver", "onMouseOut", "id", "className", "children", "display", "isVisible"];
|
|
3
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
-
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; }
|
|
5
|
-
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) { _defineProperty(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; }
|
|
6
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
7
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
8
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
9
3
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
10
4
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
11
5
|
/*
|
|
@@ -44,7 +38,7 @@ export var EuiToolTipAnchor = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
44
38
|
className: classes,
|
|
45
39
|
onMouseOver: onMouseOver,
|
|
46
40
|
onMouseOut: onMouseOut
|
|
47
|
-
}), /*#__PURE__*/cloneElement(children,
|
|
41
|
+
}), /*#__PURE__*/cloneElement(children, {
|
|
48
42
|
onFocus: function onFocus(e) {
|
|
49
43
|
_onFocus();
|
|
50
44
|
children.props.onFocus && children.props.onFocus(e);
|
|
@@ -52,17 +46,14 @@ export var EuiToolTipAnchor = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
52
46
|
onBlur: function onBlur(e) {
|
|
53
47
|
_onBlur();
|
|
54
48
|
children.props.onBlur && children.props.onBlur(e);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
})))
|
|
49
|
+
},
|
|
50
|
+
'aria-describedby': isVisible ? classNames(id, children.props['aria-describedby']) : children.props['aria-describedby']
|
|
51
|
+
}))
|
|
59
52
|
);
|
|
60
53
|
});
|
|
61
54
|
EuiToolTipAnchor.propTypes = {
|
|
62
55
|
onBlur: PropTypes.func.isRequired,
|
|
63
56
|
onFocus: PropTypes.func.isRequired,
|
|
64
|
-
|
|
65
|
-
isVisible: PropTypes.bool.isRequired,
|
|
66
|
-
display: PropTypes.oneOf(["block", "inlineBlock"]).isRequired
|
|
57
|
+
isVisible: PropTypes.bool.isRequired
|
|
67
58
|
};
|
|
68
59
|
EuiToolTipAnchor.displayName = 'EuiToolTipAnchor';
|
|
@@ -229,9 +229,8 @@ EuiTourStep.propTypes = {
|
|
|
229
229
|
*/
|
|
230
230
|
anchorPosition: PropTypes.any,
|
|
231
231
|
/**
|
|
232
|
-
* Style and position alteration for arrow-less
|
|
233
|
-
*
|
|
234
|
-
* EuiInputPopover
|
|
232
|
+
* Style and position alteration for arrow-less attachment.
|
|
233
|
+
* Intended for use with inputs as anchors, e.g. EuiInputPopover
|
|
235
234
|
*/
|
|
236
235
|
attachToAnchor: PropTypes.bool,
|
|
237
236
|
buttonRef: PropTypes.any,
|