@elastic/eui 81.1.0 → 81.3.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/README.md +2 -0
- package/dist/eui_theme_dark.css +42 -38
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +42 -38
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/avatar/avatar.js +1 -1
- package/es/components/badge/badge.js +1 -1
- package/es/components/badge/beta_badge/beta_badge.js +1 -1
- package/es/components/basic_table/basic_table.js +1 -1
- package/es/components/basic_table/collapsed_item_actions.js +1 -1
- package/es/components/basic_table/in_memory_table.js +1 -1
- package/es/components/button/_button_content_deprecated.js +1 -1
- package/es/components/button/button_display/_button_display.js +1 -1
- package/es/components/button/button_display/_button_display_content.js +1 -1
- package/es/components/button/button_empty/button_empty.js +1 -1
- package/es/components/button/button_group/button_group.js +1 -1
- package/es/components/button/button_group/button_group_button.js +1 -1
- package/es/components/button/button_icon/button_icon.js +1 -1
- package/es/components/call_out/call_out.js +1 -1
- package/es/components/card/card.js +1 -1
- package/es/components/code/code_block_annotations.js +13 -4
- package/es/components/code/code_block_copy.js +14 -2
- package/es/components/code/code_block_line.styles.js +1 -1
- package/es/components/code/utils.js +29 -17
- package/es/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
- package/es/components/comment_list/comment.js +2 -2
- package/es/components/comment_list/comment_event.js +1 -1
- package/es/components/comment_list/comment_list.js +2 -2
- package/es/components/comment_list/comment_timeline.js +1 -1
- package/es/components/datagrid/body/data_grid_body.js +13 -13
- package/es/components/datagrid/body/data_grid_body_custom.js +13 -13
- package/es/components/datagrid/body/data_grid_body_virtualized.js +13 -13
- package/es/components/datagrid/body/data_grid_cell.js +24 -24
- package/es/components/datagrid/body/header/data_grid_header_cell.js +12 -12
- package/es/components/datagrid/body/header/data_grid_header_row.js +13 -13
- package/es/components/datagrid/controls/column_sorting_draggable.js +1 -1
- package/es/components/datagrid/data_grid.js +13 -13
- package/es/components/datagrid/utils/in_memory.js +12 -12
- package/es/components/date_picker/date_picker.js +2 -2
- package/es/components/date_picker/date_picker_range.js +1 -1
- package/es/components/date_picker/super_date_picker/super_date_picker.js +49 -39
- package/es/components/empty_prompt/empty_prompt.js +1 -1
- package/es/components/facet/facet_button.js +1 -1
- package/es/components/form/field_number/field_number.js +1 -1
- package/es/components/form/field_text/field_text.js +2 -2
- package/es/components/form/form_control_layout/form_control_layout.js +2 -2
- package/es/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
- package/es/components/form/form_control_layout/form_control_layout_icons.js +2 -2
- package/es/components/header/header_links/header_link.js +1 -1
- package/es/components/header/header_links/header_links.js +1 -1
- package/es/components/header/header_logo.js +1 -1
- package/es/components/icon/assets/timelineWithArrow.js +34 -0
- package/es/components/icon/icon.js +1 -1
- package/es/components/icon/icon_glyphs.a11y.js +1 -1
- package/es/components/icon/icon_map.js +1 -0
- package/es/components/key_pad_menu/key_pad_menu_item.js +1 -1
- package/es/components/list_group/list_group.js +2 -2
- package/es/components/list_group/list_group_item.js +2 -2
- package/es/components/list_group/list_group_item_extra_action.js +1 -1
- package/es/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
- package/es/components/loading/loading_logo.js +1 -1
- package/es/components/markdown_editor/markdown_editor.js +1 -1
- package/es/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
- package/es/components/markdown_editor/markdown_editor_footer.js +1 -1
- package/es/components/markdown_editor/markdown_editor_toolbar.js +1 -1
- package/es/components/notification/notification_event.js +2 -2
- package/es/components/notification/notification_event_meta.js +1 -1
- package/es/components/page/page_header/page_header_content.js +1 -1
- package/es/components/pagination/pagination_button.js +1 -1
- package/es/components/selectable/selectable_list/selectable_list.js +1 -1
- package/es/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
- package/es/components/suggest/suggest.js +1 -1
- package/es/components/suggest/suggest_item.js +1 -1
- package/es/components/table/table_header_button.js +1 -1
- package/es/components/timeline/timeline_item_icon.js +1 -1
- package/es/components/toast/global_toast_list.js +1 -1
- package/es/components/toast/toast.js +1 -1
- package/es/components/tool_tip/icon_tip.js +1 -1
- package/eui.d.ts +41 -7
- package/i18ntokens.json +8 -8
- package/lib/components/avatar/avatar.js +1 -1
- package/lib/components/badge/badge.js +1 -1
- package/lib/components/badge/beta_badge/beta_badge.js +1 -1
- package/lib/components/basic_table/basic_table.js +1 -1
- package/lib/components/basic_table/collapsed_item_actions.js +1 -1
- package/lib/components/basic_table/in_memory_table.js +1 -1
- package/lib/components/button/_button_content_deprecated.js +1 -1
- package/lib/components/button/button_display/_button_display.js +1 -1
- package/lib/components/button/button_display/_button_display_content.js +1 -1
- package/lib/components/button/button_empty/button_empty.js +1 -1
- package/lib/components/button/button_group/button_group.js +1 -1
- package/lib/components/button/button_group/button_group_button.js +1 -1
- package/lib/components/button/button_icon/button_icon.js +1 -1
- package/lib/components/call_out/call_out.js +1 -1
- package/lib/components/card/card.js +1 -1
- package/lib/components/code/code_block_annotations.js +21 -11
- package/lib/components/code/code_block_copy.js +14 -2
- package/lib/components/code/code_block_line.styles.js +1 -1
- package/lib/components/code/utils.js +32 -18
- package/lib/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
- package/lib/components/comment_list/comment.js +2 -2
- package/lib/components/comment_list/comment_event.js +1 -1
- package/lib/components/comment_list/comment_list.js +2 -2
- package/lib/components/comment_list/comment_timeline.js +1 -1
- package/lib/components/datagrid/body/data_grid_body.js +13 -13
- package/lib/components/datagrid/body/data_grid_body_custom.js +13 -13
- package/lib/components/datagrid/body/data_grid_body_virtualized.js +13 -13
- package/lib/components/datagrid/body/data_grid_cell.js +24 -24
- package/lib/components/datagrid/body/header/data_grid_header_cell.js +12 -12
- package/lib/components/datagrid/body/header/data_grid_header_row.js +13 -13
- package/lib/components/datagrid/controls/column_sorting_draggable.js +1 -1
- package/lib/components/datagrid/data_grid.js +13 -13
- package/lib/components/datagrid/utils/in_memory.js +12 -12
- package/lib/components/date_picker/date_picker.js +2 -2
- package/lib/components/date_picker/date_picker_range.js +1 -1
- package/lib/components/date_picker/super_date_picker/super_date_picker.js +49 -39
- package/lib/components/empty_prompt/empty_prompt.js +1 -1
- package/lib/components/facet/facet_button.js +1 -1
- package/lib/components/form/field_number/field_number.js +1 -1
- package/lib/components/form/field_text/field_text.js +2 -2
- package/lib/components/form/form_control_layout/form_control_layout.js +2 -2
- package/lib/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
- package/lib/components/form/form_control_layout/form_control_layout_icons.js +2 -2
- package/lib/components/header/header_links/header_link.js +1 -1
- package/lib/components/header/header_links/header_links.js +1 -1
- package/lib/components/header/header_logo.js +1 -1
- package/lib/components/icon/assets/timelineWithArrow.js +42 -0
- package/lib/components/icon/icon.js +1 -1
- package/lib/components/icon/icon_glyphs.a11y.js +1 -1
- package/lib/components/icon/icon_map.js +1 -0
- package/lib/components/icon/svgs/timelineWithArrow.svg +6 -0
- package/lib/components/key_pad_menu/key_pad_menu_item.js +1 -1
- package/lib/components/list_group/list_group.js +2 -2
- package/lib/components/list_group/list_group_item.js +2 -2
- package/lib/components/list_group/list_group_item_extra_action.js +1 -1
- package/lib/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
- package/lib/components/loading/loading_logo.js +1 -1
- package/lib/components/markdown_editor/markdown_editor.js +1 -1
- package/lib/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
- package/lib/components/markdown_editor/markdown_editor_footer.js +1 -1
- package/lib/components/markdown_editor/markdown_editor_toolbar.js +1 -1
- package/lib/components/notification/notification_event.js +2 -2
- package/lib/components/notification/notification_event_meta.js +1 -1
- package/lib/components/page/page_header/page_header_content.js +1 -1
- package/lib/components/selectable/selectable_list/selectable_list.js +1 -1
- package/lib/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
- package/lib/components/suggest/suggest.js +1 -1
- package/lib/components/suggest/suggest_item.js +1 -1
- package/lib/components/table/table_header_button.js +1 -1
- package/lib/components/timeline/timeline_item_icon.js +1 -1
- package/lib/components/toast/global_toast_list.js +1 -1
- package/lib/components/toast/toast.js +1 -1
- package/lib/components/tool_tip/icon_tip.js +1 -1
- package/optimize/es/components/code/code_block_annotations.js +8 -4
- package/optimize/es/components/code/code_block_copy.js +14 -2
- package/optimize/es/components/code/code_block_line.styles.js +1 -1
- package/optimize/es/components/code/utils.js +29 -17
- package/optimize/es/components/date_picker/super_date_picker/super_date_picker.js +31 -37
- package/optimize/es/components/icon/assets/timelineWithArrow.js +33 -0
- package/optimize/es/components/icon/icon_glyphs.a11y.js +1 -1
- package/optimize/es/components/icon/icon_map.js +1 -0
- package/optimize/lib/components/code/code_block_annotations.js +10 -7
- package/optimize/lib/components/code/code_block_copy.js +14 -2
- package/optimize/lib/components/code/code_block_line.styles.js +1 -1
- package/optimize/lib/components/code/utils.js +32 -18
- package/optimize/lib/components/date_picker/super_date_picker/super_date_picker.js +31 -37
- package/optimize/lib/components/icon/assets/timelineWithArrow.js +42 -0
- package/optimize/lib/components/icon/icon_glyphs.a11y.js +1 -1
- package/optimize/lib/components/icon/icon_map.js +1 -0
- package/optimize/lib/components/icon/svgs/timelineWithArrow.svg +6 -0
- package/package.json +1 -1
- package/src/components/date_picker/super_date_picker/_super_date_picker.scss +34 -28
- package/src/components/table/_table.scss +7 -9
- package/test-env/components/avatar/avatar.js +1 -1
- package/test-env/components/badge/badge.js +1 -1
- package/test-env/components/badge/beta_badge/beta_badge.js +1 -1
- package/test-env/components/basic_table/basic_table.js +1 -1
- package/test-env/components/basic_table/collapsed_item_actions.js +1 -1
- package/test-env/components/basic_table/in_memory_table.js +1 -1
- package/test-env/components/button/_button_content_deprecated.js +1 -1
- package/test-env/components/button/button_display/_button_display.js +1 -1
- package/test-env/components/button/button_display/_button_display_content.js +1 -1
- package/test-env/components/button/button_empty/button_empty.js +1 -1
- package/test-env/components/button/button_group/button_group.js +1 -1
- package/test-env/components/button/button_group/button_group_button.js +1 -1
- package/test-env/components/button/button_icon/button_icon.js +1 -1
- package/test-env/components/call_out/call_out.js +1 -1
- package/test-env/components/card/card.js +1 -1
- package/test-env/components/code/code_block_annotations.js +14 -7
- package/test-env/components/code/code_block_copy.js +14 -2
- package/test-env/components/code/code_block_line.styles.js +1 -1
- package/test-env/components/code/utils.js +32 -18
- package/test-env/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
- package/test-env/components/comment_list/comment.js +2 -2
- package/test-env/components/comment_list/comment_event.js +1 -1
- package/test-env/components/comment_list/comment_list.js +2 -2
- package/test-env/components/comment_list/comment_timeline.js +1 -1
- package/test-env/components/datagrid/body/data_grid_body.js +13 -13
- package/test-env/components/datagrid/body/data_grid_body_custom.js +13 -13
- package/test-env/components/datagrid/body/data_grid_body_virtualized.js +13 -13
- package/test-env/components/datagrid/body/data_grid_cell.js +24 -24
- package/test-env/components/datagrid/body/header/data_grid_header_cell.js +12 -12
- package/test-env/components/datagrid/body/header/data_grid_header_row.js +13 -13
- package/test-env/components/datagrid/controls/column_sorting_draggable.js +1 -1
- package/test-env/components/datagrid/data_grid.js +13 -13
- package/test-env/components/datagrid/utils/in_memory.js +12 -12
- package/test-env/components/date_picker/date_picker.js +2 -2
- package/test-env/components/date_picker/date_picker_range.js +1 -1
- package/test-env/components/date_picker/super_date_picker/super_date_picker.js +49 -39
- package/test-env/components/empty_prompt/empty_prompt.js +1 -1
- package/test-env/components/facet/facet_button.js +1 -1
- package/test-env/components/form/field_number/field_number.js +1 -1
- package/test-env/components/form/field_text/field_text.js +2 -2
- package/test-env/components/form/form_control_layout/form_control_layout.js +2 -2
- package/test-env/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
- package/test-env/components/form/form_control_layout/form_control_layout_icons.js +2 -2
- package/test-env/components/header/header_links/header_link.js +1 -1
- package/test-env/components/header/header_links/header_links.js +1 -1
- package/test-env/components/header/header_logo.js +1 -1
- package/test-env/components/icon/assets/timelineWithArrow.js +42 -0
- package/test-env/components/icon/icon_glyphs.a11y.js +1 -1
- package/test-env/components/icon/icon_map.js +1 -0
- package/test-env/components/key_pad_menu/key_pad_menu_item.js +1 -1
- package/test-env/components/list_group/list_group.js +2 -2
- package/test-env/components/list_group/list_group_item.js +2 -2
- package/test-env/components/list_group/list_group_item_extra_action.js +1 -1
- package/test-env/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
- package/test-env/components/loading/loading_logo.js +1 -1
- package/test-env/components/markdown_editor/markdown_editor.js +1 -1
- package/test-env/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
- package/test-env/components/markdown_editor/markdown_editor_footer.js +1 -1
- package/test-env/components/markdown_editor/markdown_editor_toolbar.js +1 -1
- package/test-env/components/notification/notification_event.js +2 -2
- package/test-env/components/notification/notification_event_meta.js +1 -1
- package/test-env/components/page/page_header/page_header_content.js +1 -1
- package/test-env/components/selectable/selectable_list/selectable_list.js +1 -1
- package/test-env/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
- package/test-env/components/suggest/suggest.js +1 -1
- package/test-env/components/suggest/suggest_item.js +1 -1
- package/test-env/components/table/table_header_button.js +1 -1
- package/test-env/components/timeline/timeline_item_icon.js +1 -1
- package/test-env/components/toast/global_toast_list.js +1 -1
- package/test-env/components/toast/toast.js +1 -1
- package/test-env/components/tool_tip/icon_tip.js +1 -1
|
@@ -20,10 +20,10 @@ import React, { Component } from 'react';
|
|
|
20
20
|
import classNames from 'classnames';
|
|
21
21
|
import moment from 'moment'; // eslint-disable-line import/named
|
|
22
22
|
import dateMath from '@elastic/datemath';
|
|
23
|
+
import { isObject } from '../../../services/predicate';
|
|
23
24
|
import { EuiI18nConsumer } from '../../context';
|
|
24
25
|
import { EuiDatePickerRange } from '../date_picker_range';
|
|
25
26
|
import { EuiFormControlLayout } from '../../form';
|
|
26
|
-
import { EuiFlexGroup, EuiFlexItem } from '../../flex';
|
|
27
27
|
import { RenderI18nTimeOptions } from './time_options';
|
|
28
28
|
import { PrettyDuration, showPrettyDuration } from './pretty_duration';
|
|
29
29
|
import { AsyncInterval } from './async_interval';
|
|
@@ -220,7 +220,7 @@ export var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
|
|
|
220
220
|
customQuickSelectRender: customQuickSelectRender,
|
|
221
221
|
dateFormat: dateFormat,
|
|
222
222
|
end: end,
|
|
223
|
-
isDisabled: isDisabled,
|
|
223
|
+
isDisabled: !!isDisabled,
|
|
224
224
|
isPaused: isPaused,
|
|
225
225
|
recentlyUsedRanges: recentlyUsedRanges,
|
|
226
226
|
refreshInterval: refreshInterval,
|
|
@@ -251,41 +251,38 @@ export var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
|
|
|
251
251
|
timeFormat = _this$props3.timeFormat,
|
|
252
252
|
utcOffset = _this$props3.utcOffset,
|
|
253
253
|
compressed = _this$props3.compressed,
|
|
254
|
-
onFocus = _this$props3.onFocus
|
|
255
|
-
className = _this$props3.className,
|
|
256
|
-
dataTestSubj = _this$props3['data-test-subj'];
|
|
254
|
+
onFocus = _this$props3.onFocus;
|
|
257
255
|
var autoRefreshAppend = !isPaused ? ___EmotionJSX(EuiAutoRefreshButton, {
|
|
258
256
|
refreshInterval: refreshInterval,
|
|
259
|
-
isDisabled: isDisabled,
|
|
257
|
+
isDisabled: !!isDisabled,
|
|
260
258
|
isPaused: isPaused,
|
|
261
259
|
onRefreshChange: _this.onRefreshChange,
|
|
262
260
|
shortHand: true
|
|
263
261
|
}) : undefined;
|
|
264
262
|
var formControlLayoutProps = {
|
|
265
|
-
className: classNames('euiSuperDatePicker', className),
|
|
266
263
|
compressed: compressed,
|
|
267
264
|
isInvalid: isInvalid,
|
|
268
265
|
isLoading: isLoading && !showUpdateButton,
|
|
269
|
-
disabled: isDisabled,
|
|
266
|
+
disabled: !!isDisabled,
|
|
270
267
|
prepend: _this.renderQuickSelect(),
|
|
271
|
-
append: autoRefreshAppend
|
|
272
|
-
'data-test-subj': dataTestSubj
|
|
268
|
+
append: autoRefreshAppend
|
|
273
269
|
};
|
|
274
270
|
if (isQuickSelectOnly) {
|
|
275
271
|
return ___EmotionJSX(EuiFormControlLayout, _extends({
|
|
276
272
|
iconsPosition: "static"
|
|
277
273
|
}, formControlLayoutProps));
|
|
278
274
|
}
|
|
279
|
-
|
|
275
|
+
var isDisabledDisplay = isObject(isDisabled) && (isDisabled === null || isDisabled === void 0 ? void 0 : isDisabled.display);
|
|
276
|
+
if (isDisabledDisplay || showPrettyDuration && !isStartDatePopoverOpen && !isEndDatePopoverOpen) {
|
|
280
277
|
return ___EmotionJSX(EuiFormControlLayout, formControlLayoutProps, ___EmotionJSX("button", {
|
|
281
278
|
className: classNames('euiSuperDatePicker__prettyFormat', {
|
|
282
279
|
'euiSuperDatePicker__prettyFormat--disabled': isDisabled
|
|
283
280
|
}),
|
|
284
281
|
"data-test-subj": "superDatePickerShowDatesButton",
|
|
285
|
-
disabled: isDisabled,
|
|
282
|
+
disabled: !!isDisabled,
|
|
286
283
|
onClick: _this.hidePrettyDuration,
|
|
287
284
|
onFocus: onFocus
|
|
288
|
-
}, ___EmotionJSX(PrettyDuration, {
|
|
285
|
+
}, isDisabledDisplay ? isDisabled.display : ___EmotionJSX(PrettyDuration, {
|
|
289
286
|
timeFrom: start,
|
|
290
287
|
timeTo: end,
|
|
291
288
|
quickRanges: commonlyUsedRanges,
|
|
@@ -295,9 +292,6 @@ export var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
|
|
|
295
292
|
return ___EmotionJSX(EuiI18nConsumer, null, function (_ref4) {
|
|
296
293
|
var contextLocale = _ref4.locale;
|
|
297
294
|
return ___EmotionJSX(EuiDatePickerRange, _extends({}, formControlLayoutProps, {
|
|
298
|
-
className: classNames(formControlLayoutProps.className, {
|
|
299
|
-
'euiSuperDatePicker--needsUpdating': hasChanged && !isDisabled && !isInvalid
|
|
300
|
-
}),
|
|
301
295
|
isCustom: true,
|
|
302
296
|
iconType: false,
|
|
303
297
|
startDateControl: ___EmotionJSX(EuiDatePopoverButton, {
|
|
@@ -306,7 +300,7 @@ export var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
|
|
|
306
300
|
position: "start",
|
|
307
301
|
needsUpdating: hasChanged,
|
|
308
302
|
isInvalid: isInvalid,
|
|
309
|
-
isDisabled: isDisabled,
|
|
303
|
+
isDisabled: !!isDisabled,
|
|
310
304
|
onChange: _this.setStart,
|
|
311
305
|
value: start,
|
|
312
306
|
dateFormat: dateFormat,
|
|
@@ -326,7 +320,7 @@ export var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
|
|
|
326
320
|
compressed: compressed,
|
|
327
321
|
needsUpdating: hasChanged,
|
|
328
322
|
isInvalid: isInvalid,
|
|
329
|
-
isDisabled: isDisabled,
|
|
323
|
+
isDisabled: !!isDisabled,
|
|
330
324
|
onChange: _this.setEnd,
|
|
331
325
|
value: end,
|
|
332
326
|
dateFormat: dateFormat,
|
|
@@ -368,18 +362,16 @@ export var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
|
|
|
368
362
|
showUpdateButton = _this$props5.showUpdateButton,
|
|
369
363
|
compressed = _this$props5.compressed;
|
|
370
364
|
if (!showUpdateButton) return null;
|
|
371
|
-
return ___EmotionJSX(
|
|
372
|
-
grow: false
|
|
373
|
-
}, ___EmotionJSX(EuiSuperUpdateButton, _extends({
|
|
365
|
+
return ___EmotionJSX(EuiSuperUpdateButton, _extends({
|
|
374
366
|
needsUpdate: _this.state.hasChanged,
|
|
375
367
|
showTooltip: !_this.state.isStartDatePopoverOpen && !_this.state.isEndDatePopoverOpen,
|
|
376
368
|
isLoading: isLoading,
|
|
377
|
-
isDisabled: isDisabled || _this.state.isInvalid,
|
|
369
|
+
isDisabled: !!isDisabled || _this.state.isInvalid,
|
|
378
370
|
onClick: _this.handleClickUpdateButton,
|
|
379
371
|
"data-test-subj": "superDatePickerApplyTimeButton",
|
|
380
372
|
size: compressed ? 's' : 'm',
|
|
381
373
|
iconOnly: showUpdateButton === 'iconOnly'
|
|
382
|
-
}, updateButtonProps))
|
|
374
|
+
}, updateButtonProps));
|
|
383
375
|
});
|
|
384
376
|
return _this;
|
|
385
377
|
}
|
|
@@ -398,30 +390,32 @@ export var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
|
|
|
398
390
|
isQuickSelectOnly = _this$props6.isQuickSelectOnly,
|
|
399
391
|
compressed = _this$props6.compressed,
|
|
400
392
|
className = _this$props6.className;
|
|
393
|
+
var _this$state2 = this.state,
|
|
394
|
+
hasChanged = _this$state2.hasChanged,
|
|
395
|
+
isInvalid = _this$state2.isInvalid;
|
|
401
396
|
|
|
402
397
|
// Force reduction in width if showing quick select only
|
|
403
398
|
var width = isQuickSelectOnly ? 'auto' : _width;
|
|
404
|
-
var
|
|
405
|
-
'
|
|
406
|
-
'
|
|
407
|
-
'
|
|
408
|
-
'
|
|
409
|
-
'
|
|
399
|
+
var classes = classNames('euiSuperDatePicker', className, {
|
|
400
|
+
'euiSuperDatePicker--needsUpdating': hasChanged && !isDisabled && !isInvalid,
|
|
401
|
+
'euiSuperDatePicker--noUpdateButton': !showUpdateButton,
|
|
402
|
+
'euiSuperDatePicker--isAutoRefreshOnly': isAutoRefreshOnly,
|
|
403
|
+
'euiSuperDatePicker--isQuickSelectOnly': isQuickSelectOnly,
|
|
404
|
+
'euiSuperDatePicker--fullWidth': width === 'full',
|
|
405
|
+
'euiSuperDatePicker--autoWidth': width === 'auto'
|
|
410
406
|
});
|
|
411
|
-
return ___EmotionJSX(
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
}, isAutoRefreshOnly && onRefreshChange ? ___EmotionJSX(EuiFlexItem, null, ___EmotionJSX(EuiAutoRefresh, {
|
|
407
|
+
return ___EmotionJSX("div", {
|
|
408
|
+
className: classes,
|
|
409
|
+
"data-test-subj": dataTestSubj
|
|
410
|
+
}, isAutoRefreshOnly && onRefreshChange ? ___EmotionJSX(EuiAutoRefresh, {
|
|
416
411
|
isPaused: isPaused,
|
|
417
412
|
refreshInterval: refreshInterval,
|
|
418
413
|
onRefreshChange: onRefreshChange,
|
|
419
414
|
fullWidth: width === 'full',
|
|
420
415
|
compressed: compressed,
|
|
421
|
-
isDisabled: isDisabled,
|
|
422
|
-
"data-test-subj": dataTestSubj,
|
|
416
|
+
isDisabled: !!isDisabled,
|
|
423
417
|
className: className
|
|
424
|
-
})
|
|
418
|
+
}) : ___EmotionJSX(React.Fragment, null, this.renderDatePickerRange(), this.renderUpdateButton()));
|
|
425
419
|
}
|
|
426
420
|
}], [{
|
|
427
421
|
key: "getDerivedStateFromProps",
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["title", "titleId"];
|
|
4
|
+
/*
|
|
5
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
6
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
7
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
8
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
9
|
+
* Side Public License, v 1.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
// THIS IS A GENERATED FILE. DO NOT MODIFY MANUALLY. @see scripts/compile-icons.js
|
|
13
|
+
|
|
14
|
+
import * as React from 'react';
|
|
15
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
16
|
+
var EuiIconTimelineWithArrow = function EuiIconTimelineWithArrow(_ref) {
|
|
17
|
+
var title = _ref.title,
|
|
18
|
+
titleId = _ref.titleId,
|
|
19
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
20
|
+
return ___EmotionJSX("svg", _extends({
|
|
21
|
+
width: 16,
|
|
22
|
+
height: 16,
|
|
23
|
+
viewBox: "0 0 16 16",
|
|
24
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
25
|
+
"aria-labelledby": titleId
|
|
26
|
+
}, props), title ? ___EmotionJSX("title", {
|
|
27
|
+
id: titleId
|
|
28
|
+
}, title) : null, ___EmotionJSX("path", {
|
|
29
|
+
fillRule: "evenodd",
|
|
30
|
+
d: "M7.854 4.854A.5.5 0 017 4.5V4H6a1 1 0 01-1-1V1a1 1 0 011-1h3a1 1 0 011 1v2a1 1 0 01-1 1H8v.5a.5.5 0 01-.146.354zM6 3V1h3v2H6zM2.146 9.146A.5.5 0 002 9.5v.5H1a1 1 0 00-1 1v2a1 1 0 001 1h3a1 1 0 001-1v-2a1 1 0 00-1-1H3v-.5a.5.5 0 00-.854-.354zM4 13v-2H1v2h3zM11.5 15a4.5 4.5 0 100-9 4.5 4.5 0 000 9zm.354-6.854l2 2a.5.5 0 010 .708l-2 2a.5.5 0 01-.707-.708L12.293 11H9.5a.5.5 0 010-1h2.793l-1.146-1.146a.5.5 0 11.707-.708zM8.337 6H3.915a1.5 1.5 0 00-2.83 0H.5a.5.5 0 000 1h.585a1.5 1.5 0 002.83 0h3.342c.314-.38.677-.716 1.08-1zM2 6.5a.5.5 0 111 0 .5.5 0 01-1 0z"
|
|
31
|
+
}));
|
|
32
|
+
};
|
|
33
|
+
export var icon = EuiIconTimelineWithArrow;
|
|
@@ -15,7 +15,7 @@ import { EuiIcon } from './icon';
|
|
|
15
15
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
16
16
|
describe('EuiIcons', function () {
|
|
17
17
|
describe('Automated accessibility check for glyph icons', function () {
|
|
18
|
-
var GlyphIcons = ['accessibility', 'aggregate', 'analyzeEvent', 'annotation', 'apmTrace', 'apps', 'arrowDown', 'arrowLeft', 'arrowRight', 'arrowUp', 'arrowStart', 'arrowEnd', 'article', 'asterisk', 'beaker', 'bell', 'bellSlash', 'beta', 'bolt', 'boxesHorizontal', 'boxesVertical', 'branch', 'branchUser', 'broom', 'brush', 'bug', 'bullseye', 'calendar', 'check', 'checkInCircleFilled', 'cheer', 'clock', 'cloudDrizzle', 'cloudStormy', 'cloudSunny', 'cluster', 'color', 'compute', 'console', 'container', 'continuityAbove', 'continuityAboveBelow', 'continuityBelow', 'continuityWithin', 'controlsHorizontal', 'controlsVertical', 'copy', 'copyClipboard', 'cross', 'crosshairs', 'currency', 'cut', 'database', 'desktop', 'discuss', 'document', 'documents', 'documentEdit', 'documentation', 'dot', 'dotInCircle', 'doubleArrowLeft', 'doubleArrowRight', 'download', 'email', 'empty', 'eql', 'eraser', 'exit', 'expand', 'expandMini', 'exportAction', 'eye', 'eyeClosed', 'faceHappy', 'faceNeutral', 'faceSad', 'filter', 'filterExclude', 'filterIgnore', 'filterInclude', 'filterInCircle', 'flag', 'fold', 'folderCheck', 'folderClosed', 'folderExclamation', 'folderOpen', 'frameNext', 'framePrevious', 'fullScreen', 'fullScreenExit', 'function', 'gear', 'glasses', 'globe', 'grab', 'grabHorizontal', 'grid', 'heart', 'heatmap', 'help', 'home', 'iInCircle', 'image', 'importAction', 'indexClose', 'indexEdit', 'indexFlush', 'indexMapping', 'indexOpen', 'indexRuntime', 'indexSettings', 'indexTemporary', 'infinity', 'inputOutput', 'inspect', 'invert', 'ip', 'keyboard', 'kqlField', 'kqlFunction', 'kqlOperand', 'kqlSelector', 'kqlValue', 'kubernetesNode', 'kubernetesPod', 'launch', 'layers', 'lettering', 'lineDashed', 'lineDotted', 'lineSolid', 'link', 'list', 'listAdd', 'lock', 'lockOpen', 'logstashFilter', 'logstashIf', 'logstashInput', 'logstashOutput', 'logstashQueue', 'magnifyWithExclamation', 'magnifyWithMinus', 'magnifyWithPlus', 'magnet', 'mapMarker', 'memory', 'merge', 'menu', 'menuDown', 'menuLeft', 'menuRight', 'menuUp', 'minimize', 'minus', 'minusInCircle', 'minusInCircleFilled', 'mobile', 'moon', 'namespace', 'nested', 'node', 'number', 'offline', 'online', 'package', 'pageSelect', 'pagesSelect', 'paperClip', 'partial', 'pause', 'payment', 'pencil', 'percent', 'pin', 'pinFilled', 'play', 'playFilled', 'plus', 'plusInCircle', 'plusInCircleFilled', 'popout', 'push', 'questionInCircle', 'quote', 'refresh', 'reporter', 'returnKey', 'save', 'scale', 'search', 'securitySignal', 'securitySignalDetected', 'securitySignalResolved', 'sessionViewer', 'shard', 'share', 'snowflake', 'sortable', 'sortAscending', 'sortDescending', 'sortDown', 'sortLeft', 'sortRight', 'sortUp', 'spaces', 'starEmpty', 'starEmptySpace', 'starFilled', 'starFilledSpace', 'starMinusEmpty', 'starMinusFilled', 'starPlusEmpty', 'starPlusFilled', 'stats', 'stop', 'stopFilled', 'stopSlash', 'storage', 'string', 'submodule', 'sun', 'symlink', 'tableOfContents', 'tableDensityExpanded', 'tableDensityCompact', 'tableDensityNormal', 'tag', 'tear', 'temperature', 'timeline', 'timeRefresh', 'timeslider', 'training', 'trash', 'unfold', 'unlink', 'user', 'userAvatar', 'users', 'vector', 'videoPlayer', 'visArea', 'visAreaStacked', 'visBarHorizontal', 'visBarHorizontalStacked', 'visBarVertical', 'visBarVerticalStacked', 'visGauge', 'visGoal', 'visLine', 'visMapCoordinate', 'visMapRegion', 'visMetric', 'visPie', 'visTable', 'visTagCloud', 'visText', 'visTimelion', 'visVega', 'visVisualBuilder', 'warning', 'wordWrap', 'wordWrapDisabled', 'wrench'];
|
|
18
|
+
var GlyphIcons = ['accessibility', 'aggregate', 'analyzeEvent', 'annotation', 'apmTrace', 'apps', 'arrowDown', 'arrowLeft', 'arrowRight', 'arrowUp', 'arrowStart', 'arrowEnd', 'article', 'asterisk', 'beaker', 'bell', 'bellSlash', 'beta', 'bolt', 'boxesHorizontal', 'boxesVertical', 'branch', 'branchUser', 'broom', 'brush', 'bug', 'bullseye', 'calendar', 'check', 'checkInCircleFilled', 'cheer', 'clock', 'cloudDrizzle', 'cloudStormy', 'cloudSunny', 'cluster', 'color', 'compute', 'console', 'container', 'continuityAbove', 'continuityAboveBelow', 'continuityBelow', 'continuityWithin', 'controlsHorizontal', 'controlsVertical', 'copy', 'copyClipboard', 'cross', 'crosshairs', 'currency', 'cut', 'database', 'desktop', 'discuss', 'document', 'documents', 'documentEdit', 'documentation', 'dot', 'dotInCircle', 'doubleArrowLeft', 'doubleArrowRight', 'download', 'email', 'empty', 'eql', 'eraser', 'exit', 'expand', 'expandMini', 'exportAction', 'eye', 'eyeClosed', 'faceHappy', 'faceNeutral', 'faceSad', 'filter', 'filterExclude', 'filterIgnore', 'filterInclude', 'filterInCircle', 'flag', 'fold', 'folderCheck', 'folderClosed', 'folderExclamation', 'folderOpen', 'frameNext', 'framePrevious', 'fullScreen', 'fullScreenExit', 'function', 'gear', 'glasses', 'globe', 'grab', 'grabHorizontal', 'grid', 'heart', 'heatmap', 'help', 'home', 'iInCircle', 'image', 'importAction', 'indexClose', 'indexEdit', 'indexFlush', 'indexMapping', 'indexOpen', 'indexRuntime', 'indexSettings', 'indexTemporary', 'infinity', 'inputOutput', 'inspect', 'invert', 'ip', 'keyboard', 'kqlField', 'kqlFunction', 'kqlOperand', 'kqlSelector', 'kqlValue', 'kubernetesNode', 'kubernetesPod', 'launch', 'layers', 'lettering', 'lineDashed', 'lineDotted', 'lineSolid', 'link', 'list', 'listAdd', 'lock', 'lockOpen', 'logstashFilter', 'logstashIf', 'logstashInput', 'logstashOutput', 'logstashQueue', 'magnifyWithExclamation', 'magnifyWithMinus', 'magnifyWithPlus', 'magnet', 'mapMarker', 'memory', 'merge', 'menu', 'menuDown', 'menuLeft', 'menuRight', 'menuUp', 'minimize', 'minus', 'minusInCircle', 'minusInCircleFilled', 'mobile', 'moon', 'namespace', 'nested', 'node', 'number', 'offline', 'online', 'package', 'pageSelect', 'pagesSelect', 'paperClip', 'partial', 'pause', 'payment', 'pencil', 'percent', 'pin', 'pinFilled', 'play', 'playFilled', 'plus', 'plusInCircle', 'plusInCircleFilled', 'popout', 'push', 'questionInCircle', 'quote', 'refresh', 'reporter', 'returnKey', 'save', 'scale', 'search', 'securitySignal', 'securitySignalDetected', 'securitySignalResolved', 'sessionViewer', 'shard', 'share', 'snowflake', 'sortable', 'sortAscending', 'sortDescending', 'sortDown', 'sortLeft', 'sortRight', 'sortUp', 'spaces', 'starEmpty', 'starEmptySpace', 'starFilled', 'starFilledSpace', 'starMinusEmpty', 'starMinusFilled', 'starPlusEmpty', 'starPlusFilled', 'stats', 'stop', 'stopFilled', 'stopSlash', 'storage', 'string', 'submodule', 'sun', 'symlink', 'tableOfContents', 'tableDensityExpanded', 'tableDensityCompact', 'tableDensityNormal', 'tag', 'tear', 'temperature', 'timeline', 'timelineWithArrow', 'timeRefresh', 'timeslider', 'training', 'trash', 'unfold', 'unlink', 'user', 'userAvatar', 'users', 'vector', 'videoPlayer', 'visArea', 'visAreaStacked', 'visBarHorizontal', 'visBarHorizontalStacked', 'visBarVertical', 'visBarVerticalStacked', 'visGauge', 'visGoal', 'visLine', 'visMapCoordinate', 'visMapRegion', 'visMetric', 'visPie', 'visTable', 'visTagCloud', 'visText', 'visTimelion', 'visVega', 'visVisualBuilder', 'warning', 'wordWrap', 'wordWrapDisabled', 'wrench'];
|
|
19
19
|
var GlyphGrid = function GlyphGrid() {
|
|
20
20
|
return ___EmotionJSX("div", null, GlyphIcons.map(function (glyph) {
|
|
21
21
|
return ___EmotionJSX(EuiIcon, {
|
|
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.EuiCodeBlockAnnotation = void 0;
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
13
|
var _services = require("../../services");
|
|
13
14
|
var _i18n = require("../i18n");
|
|
@@ -16,8 +17,7 @@ var _icon = require("../icon");
|
|
|
16
17
|
var _button = require("../../themes/amsterdam/global_styling/mixins/button");
|
|
17
18
|
var _code_block_annotations = require("./code_block_annotations.style");
|
|
18
19
|
var _react2 = require("@emotion/react");
|
|
19
|
-
|
|
20
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
20
|
+
var _excluded = ["lineNumber", "children"];
|
|
21
21
|
/*
|
|
22
22
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
23
23
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -25,10 +25,12 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
25
25
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
26
26
|
* Side Public License, v 1.
|
|
27
27
|
*/
|
|
28
|
-
|
|
28
|
+
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); }
|
|
29
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
30
|
var EuiCodeBlockAnnotation = function EuiCodeBlockAnnotation(_ref) {
|
|
30
31
|
var lineNumber = _ref.lineNumber,
|
|
31
|
-
children = _ref.children
|
|
32
|
+
children = _ref.children,
|
|
33
|
+
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
32
34
|
var _useState = (0, _react.useState)(false),
|
|
33
35
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
34
36
|
isOpen = _useState2[0],
|
|
@@ -43,7 +45,9 @@ var EuiCodeBlockAnnotation = function EuiCodeBlockAnnotation(_ref) {
|
|
|
43
45
|
var buttonIconFocusStyle = (0, _button.useEuiButtonFocusCSS)();
|
|
44
46
|
var cssButtonIconStyles = [styles.euiCodeBlockAnnotation__buttonIcon, buttonIconFocusStyle];
|
|
45
47
|
var isDarkMode = colorMode === 'DARK';
|
|
46
|
-
return (0, _react2.jsx)(_popover.EuiPopover, {
|
|
48
|
+
return (0, _react2.jsx)(_popover.EuiPopover, (0, _extends2.default)({
|
|
49
|
+
css: styles.euiCodeBlockAnnotation
|
|
50
|
+
}, rest, {
|
|
47
51
|
isOpen: isOpen,
|
|
48
52
|
closePopover: function closePopover() {
|
|
49
53
|
return setIsOpen(false);
|
|
@@ -60,14 +64,13 @@ var EuiCodeBlockAnnotation = function EuiCodeBlockAnnotation(_ref) {
|
|
|
60
64
|
size: "s",
|
|
61
65
|
color: isDarkMode ? euiTheme.colors.ink : 'ghost'
|
|
62
66
|
})),
|
|
63
|
-
css: styles.euiCodeBlockAnnotation,
|
|
64
67
|
zIndex: Number(euiTheme.levels.mask) + 1 // Ensure fullscreen annotation popovers sit above the mask
|
|
65
68
|
,
|
|
66
69
|
anchorPosition: "downLeft",
|
|
67
70
|
panelProps: {
|
|
68
71
|
'data-test-subj': 'euiCodeBlockAnnotationPopover'
|
|
69
72
|
}
|
|
70
|
-
}, children);
|
|
73
|
+
}), children);
|
|
71
74
|
};
|
|
72
75
|
exports.EuiCodeBlockAnnotation = EuiCodeBlockAnnotation;
|
|
73
76
|
var AnnotationInfoIcon = function AnnotationInfoIcon(props) {
|
|
@@ -12,6 +12,7 @@ var _inner_text = require("../inner_text");
|
|
|
12
12
|
var _copy = require("../copy");
|
|
13
13
|
var _i18n = require("../i18n");
|
|
14
14
|
var _button = require("../button");
|
|
15
|
+
var _utils = require("./utils");
|
|
15
16
|
var _react2 = require("@emotion/react");
|
|
16
17
|
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); }
|
|
17
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -35,7 +36,17 @@ var useCopy = function useCopy(_ref) {
|
|
|
35
36
|
innerTextRef = _useInnerText2[0],
|
|
36
37
|
_innerText = _useInnerText2[1];
|
|
37
38
|
var innerText = (0, _react.useMemo)(function () {
|
|
38
|
-
return (_innerText
|
|
39
|
+
return (_innerText
|
|
40
|
+
// Normalize line terminations to match native JS format
|
|
41
|
+
=== null || _innerText
|
|
42
|
+
// Normalize line terminations to match native JS format
|
|
43
|
+
=== void 0 ? void 0 : _innerText
|
|
44
|
+
// Normalize line terminations to match native JS format
|
|
45
|
+
.replace(_utils.NEW_LINE_REGEX_GLOBAL, '\n')
|
|
46
|
+
// Reduce two or more consecutive new line characters to a single one
|
|
47
|
+
// This is needed primarily because of how syntax highlighting
|
|
48
|
+
// generated DOM elements affect `innerText` output.
|
|
49
|
+
.replace(/\n{2,}/g, '\n')) || '';
|
|
39
50
|
}, [_innerText]);
|
|
40
51
|
var textToCopy = isVirtualized ? "".concat(children) : innerText; // Virtualized code blocks do not have inner text
|
|
41
52
|
|
|
@@ -51,7 +62,8 @@ var useCopy = function useCopy(_ref) {
|
|
|
51
62
|
onClick: copy,
|
|
52
63
|
iconType: "copyClipboard",
|
|
53
64
|
color: "text",
|
|
54
|
-
"aria-label": copyAriaLabel
|
|
65
|
+
"aria-label": copyAriaLabel,
|
|
66
|
+
"data-test-subj": "euiCodeBlockCopy"
|
|
55
67
|
});
|
|
56
68
|
})) : null;
|
|
57
69
|
}, [showCopyButton, textToCopy, copyAriaLabel]);
|
|
@@ -47,7 +47,7 @@ var euiCodeBlockLineStyles = function euiCodeBlockLineStyles(euiThemeContext) {
|
|
|
47
47
|
},
|
|
48
48
|
lineNumber: {
|
|
49
49
|
euiCodeBlock__lineNumberWrapper: /*#__PURE__*/(0, _css.css)("position:relative;flex-grow:0;flex-shrink:0;user-select:none;padding-inline-end:", euiTheme.size.m, ";box-sizing:content-box;;label:euiCodeBlock__lineNumberWrapper;"),
|
|
50
|
-
euiCodeBlock__lineNumber: /*#__PURE__*/(0, _css.css)("color:", euiTheme.colors.subduedText, ";text-align:end;display:block
|
|
50
|
+
euiCodeBlock__lineNumber: /*#__PURE__*/(0, _css.css)("color:", euiTheme.colors.subduedText, ";text-align:end;display:block;&::before{content:attr(data-line-number);};label:euiCodeBlock__lineNumber;")
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
53
|
};
|
|
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.parseLineRanges = exports.nodeToHtml = exports.isAstElement = exports.highlightByLine = exports.getHtmlContent = exports.checkSupportedLanguage = exports.SUPPORTED_LANGUAGES = exports.DEFAULT_LANGUAGE = void 0;
|
|
8
|
+
exports.parseLineRanges = exports.nodeToHtml = exports.isAstElement = exports.highlightByLine = exports.getHtmlContent = exports.checkSupportedLanguage = exports.SUPPORTED_LANGUAGES = exports.NEW_LINE_REGEX_GLOBAL = exports.NEW_LINE_REGEX = exports.DEFAULT_LANGUAGE = void 0;
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _refractor = require("refractor");
|
|
@@ -28,7 +28,25 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
28
28
|
var SUPPORTED_LANGUAGES = (0, _refractor.listLanguages)();
|
|
29
29
|
exports.SUPPORTED_LANGUAGES = SUPPORTED_LANGUAGES;
|
|
30
30
|
var DEFAULT_LANGUAGE = 'text';
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Platform-agnostic new line regex that safely matches all standard
|
|
34
|
+
* line termination conventions:
|
|
35
|
+
* - LF: Unix-based platforms and JS-native sources like text areas
|
|
36
|
+
* - CRLF: Windows
|
|
37
|
+
* - CR: Mac Classic; to support files saved a long time ago
|
|
38
|
+
*/
|
|
31
39
|
exports.DEFAULT_LANGUAGE = DEFAULT_LANGUAGE;
|
|
40
|
+
var NEW_LINE_REGEX = /\r\n|\r|\n/;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Platform-agnostic global new line regex that safely matches all standard
|
|
44
|
+
* line termination conventions.
|
|
45
|
+
* See [NEW_LINE_REGEX]{@link NEW_LINE_REGEX} for more details.
|
|
46
|
+
*/
|
|
47
|
+
exports.NEW_LINE_REGEX = NEW_LINE_REGEX;
|
|
48
|
+
var NEW_LINE_REGEX_GLOBAL = new RegExp(NEW_LINE_REGEX, 'g');
|
|
49
|
+
exports.NEW_LINE_REGEX_GLOBAL = NEW_LINE_REGEX_GLOBAL;
|
|
32
50
|
var checkSupportedLanguage = function checkSupportedLanguage(language) {
|
|
33
51
|
return SUPPORTED_LANGUAGES.includes(language) ? language : DEFAULT_LANGUAGE;
|
|
34
52
|
};
|
|
@@ -57,14 +75,12 @@ var nodeToHtml = function nodeToHtml(node, idx, nodes) {
|
|
|
57
75
|
}), children && children.map(function (el, i) {
|
|
58
76
|
return (
|
|
59
77
|
// @ts-ignore - using a custom type here to handle JSX annotations
|
|
60
|
-
el.type === 'annotation' ?
|
|
61
|
-
|
|
62
|
-
(0, _react2.jsx)(_code_block_annotations.EuiCodeBlockAnnotation, {
|
|
78
|
+
el.type === 'annotation' ? (0, _react2.jsx)(_code_block_annotations.EuiCodeBlockAnnotation, {
|
|
79
|
+
className: "euiCodeBlock__lineAnnotation",
|
|
63
80
|
lineNumber: el.lineNumber,
|
|
64
81
|
children: el.annotation,
|
|
65
82
|
key: i
|
|
66
|
-
})
|
|
67
|
-
: nodeToHtml(el, i, nodes, depth + 1)
|
|
83
|
+
}) : nodeToHtml(el, i, nodes, depth + 1)
|
|
68
84
|
);
|
|
69
85
|
}));
|
|
70
86
|
}
|
|
@@ -102,12 +118,12 @@ var addLineData = function addLineData(nodes, data) {
|
|
|
102
118
|
return nodes.reduce(function (result, node) {
|
|
103
119
|
var lineStart = data.lineNumber;
|
|
104
120
|
if (node.type === 'text') {
|
|
105
|
-
if (!node.value.match(
|
|
121
|
+
if (!node.value.match(NEW_LINE_REGEX)) {
|
|
106
122
|
node.lineStart = lineStart;
|
|
107
123
|
node.lineEnd = lineStart;
|
|
108
124
|
result.push(node);
|
|
109
125
|
} else {
|
|
110
|
-
var lines = node.value.split(
|
|
126
|
+
var lines = node.value.split(NEW_LINE_REGEX);
|
|
111
127
|
lines.forEach(function (line, i) {
|
|
112
128
|
var num = i === 0 ? data.lineNumber : ++data.lineNumber;
|
|
113
129
|
result.push({
|
|
@@ -181,11 +197,12 @@ function wrapLines(nodes, options, euiTheme) {
|
|
|
181
197
|
var lineNumberWrapperElement = {
|
|
182
198
|
type: 'element',
|
|
183
199
|
tagName: 'span',
|
|
184
|
-
properties:
|
|
200
|
+
properties: {
|
|
185
201
|
style: {
|
|
186
202
|
inlineSize: width
|
|
187
|
-
}
|
|
188
|
-
|
|
203
|
+
},
|
|
204
|
+
className: ['euiCodeBlock__lineNumberWrapper', lineNumberWrapperStyles]
|
|
205
|
+
},
|
|
189
206
|
children: []
|
|
190
207
|
};
|
|
191
208
|
|
|
@@ -194,13 +211,10 @@ function wrapLines(nodes, options, euiTheme) {
|
|
|
194
211
|
var lineNumberElement = {
|
|
195
212
|
type: 'element',
|
|
196
213
|
tagName: 'span',
|
|
197
|
-
properties: (
|
|
198
|
-
className: [lineNumberStyles]
|
|
199
|
-
}, 'aria-hidden', true),
|
|
200
|
-
children: [
|
|
201
|
-
type: 'text',
|
|
202
|
-
value: String(lineNumber)
|
|
203
|
-
}]
|
|
214
|
+
properties: (_properties = {
|
|
215
|
+
className: ['euiCodeBlock__lineNumber', lineNumberStyles]
|
|
216
|
+
}, (0, _defineProperty2.default)(_properties, 'data-line-number', lineNumber), (0, _defineProperty2.default)(_properties, 'aria-hidden', true), _properties),
|
|
217
|
+
children: []
|
|
204
218
|
};
|
|
205
219
|
lineNumberWrapperElement.children.push(lineNumberElement);
|
|
206
220
|
|
|
@@ -18,10 +18,10 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
18
18
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
19
19
|
var _moment = _interopRequireDefault(require("moment"));
|
|
20
20
|
var _datemath = _interopRequireDefault(require("@elastic/datemath"));
|
|
21
|
+
var _predicate = require("../../../services/predicate");
|
|
21
22
|
var _context = require("../../context");
|
|
22
23
|
var _date_picker_range = require("../date_picker_range");
|
|
23
24
|
var _form = require("../../form");
|
|
24
|
-
var _flex = require("../../flex");
|
|
25
25
|
var _time_options = require("./time_options");
|
|
26
26
|
var _pretty_duration = require("./pretty_duration");
|
|
27
27
|
var _async_interval = require("./async_interval");
|
|
@@ -228,7 +228,7 @@ var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
|
|
|
228
228
|
customQuickSelectRender: customQuickSelectRender,
|
|
229
229
|
dateFormat: dateFormat,
|
|
230
230
|
end: end,
|
|
231
|
-
isDisabled: isDisabled,
|
|
231
|
+
isDisabled: !!isDisabled,
|
|
232
232
|
isPaused: isPaused,
|
|
233
233
|
recentlyUsedRanges: recentlyUsedRanges,
|
|
234
234
|
refreshInterval: refreshInterval,
|
|
@@ -259,41 +259,38 @@ var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
|
|
|
259
259
|
timeFormat = _this$props3.timeFormat,
|
|
260
260
|
utcOffset = _this$props3.utcOffset,
|
|
261
261
|
compressed = _this$props3.compressed,
|
|
262
|
-
onFocus = _this$props3.onFocus
|
|
263
|
-
className = _this$props3.className,
|
|
264
|
-
dataTestSubj = _this$props3['data-test-subj'];
|
|
262
|
+
onFocus = _this$props3.onFocus;
|
|
265
263
|
var autoRefreshAppend = !isPaused ? (0, _react2.jsx)(_auto_refresh.EuiAutoRefreshButton, {
|
|
266
264
|
refreshInterval: refreshInterval,
|
|
267
|
-
isDisabled: isDisabled,
|
|
265
|
+
isDisabled: !!isDisabled,
|
|
268
266
|
isPaused: isPaused,
|
|
269
267
|
onRefreshChange: _this.onRefreshChange,
|
|
270
268
|
shortHand: true
|
|
271
269
|
}) : undefined;
|
|
272
270
|
var formControlLayoutProps = {
|
|
273
|
-
className: (0, _classnames.default)('euiSuperDatePicker', className),
|
|
274
271
|
compressed: compressed,
|
|
275
272
|
isInvalid: isInvalid,
|
|
276
273
|
isLoading: isLoading && !showUpdateButton,
|
|
277
|
-
disabled: isDisabled,
|
|
274
|
+
disabled: !!isDisabled,
|
|
278
275
|
prepend: _this.renderQuickSelect(),
|
|
279
|
-
append: autoRefreshAppend
|
|
280
|
-
'data-test-subj': dataTestSubj
|
|
276
|
+
append: autoRefreshAppend
|
|
281
277
|
};
|
|
282
278
|
if (isQuickSelectOnly) {
|
|
283
279
|
return (0, _react2.jsx)(_form.EuiFormControlLayout, (0, _extends2.default)({
|
|
284
280
|
iconsPosition: "static"
|
|
285
281
|
}, formControlLayoutProps));
|
|
286
282
|
}
|
|
287
|
-
|
|
283
|
+
var isDisabledDisplay = (0, _predicate.isObject)(isDisabled) && (isDisabled === null || isDisabled === void 0 ? void 0 : isDisabled.display);
|
|
284
|
+
if (isDisabledDisplay || showPrettyDuration && !isStartDatePopoverOpen && !isEndDatePopoverOpen) {
|
|
288
285
|
return (0, _react2.jsx)(_form.EuiFormControlLayout, formControlLayoutProps, (0, _react2.jsx)("button", {
|
|
289
286
|
className: (0, _classnames.default)('euiSuperDatePicker__prettyFormat', {
|
|
290
287
|
'euiSuperDatePicker__prettyFormat--disabled': isDisabled
|
|
291
288
|
}),
|
|
292
289
|
"data-test-subj": "superDatePickerShowDatesButton",
|
|
293
|
-
disabled: isDisabled,
|
|
290
|
+
disabled: !!isDisabled,
|
|
294
291
|
onClick: _this.hidePrettyDuration,
|
|
295
292
|
onFocus: onFocus
|
|
296
|
-
}, (0, _react2.jsx)(_pretty_duration.PrettyDuration, {
|
|
293
|
+
}, isDisabledDisplay ? isDisabled.display : (0, _react2.jsx)(_pretty_duration.PrettyDuration, {
|
|
297
294
|
timeFrom: start,
|
|
298
295
|
timeTo: end,
|
|
299
296
|
quickRanges: commonlyUsedRanges,
|
|
@@ -303,9 +300,6 @@ var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
|
|
|
303
300
|
return (0, _react2.jsx)(_context.EuiI18nConsumer, null, function (_ref4) {
|
|
304
301
|
var contextLocale = _ref4.locale;
|
|
305
302
|
return (0, _react2.jsx)(_date_picker_range.EuiDatePickerRange, (0, _extends2.default)({}, formControlLayoutProps, {
|
|
306
|
-
className: (0, _classnames.default)(formControlLayoutProps.className, {
|
|
307
|
-
'euiSuperDatePicker--needsUpdating': hasChanged && !isDisabled && !isInvalid
|
|
308
|
-
}),
|
|
309
303
|
isCustom: true,
|
|
310
304
|
iconType: false,
|
|
311
305
|
startDateControl: (0, _react2.jsx)(_date_popover_button.EuiDatePopoverButton, {
|
|
@@ -314,7 +308,7 @@ var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
|
|
|
314
308
|
position: "start",
|
|
315
309
|
needsUpdating: hasChanged,
|
|
316
310
|
isInvalid: isInvalid,
|
|
317
|
-
isDisabled: isDisabled,
|
|
311
|
+
isDisabled: !!isDisabled,
|
|
318
312
|
onChange: _this.setStart,
|
|
319
313
|
value: start,
|
|
320
314
|
dateFormat: dateFormat,
|
|
@@ -334,7 +328,7 @@ var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
|
|
|
334
328
|
compressed: compressed,
|
|
335
329
|
needsUpdating: hasChanged,
|
|
336
330
|
isInvalid: isInvalid,
|
|
337
|
-
isDisabled: isDisabled,
|
|
331
|
+
isDisabled: !!isDisabled,
|
|
338
332
|
onChange: _this.setEnd,
|
|
339
333
|
value: end,
|
|
340
334
|
dateFormat: dateFormat,
|
|
@@ -376,18 +370,16 @@ var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
|
|
|
376
370
|
showUpdateButton = _this$props5.showUpdateButton,
|
|
377
371
|
compressed = _this$props5.compressed;
|
|
378
372
|
if (!showUpdateButton) return null;
|
|
379
|
-
return (0, _react2.jsx)(
|
|
380
|
-
grow: false
|
|
381
|
-
}, (0, _react2.jsx)(_super_update_button.EuiSuperUpdateButton, (0, _extends2.default)({
|
|
373
|
+
return (0, _react2.jsx)(_super_update_button.EuiSuperUpdateButton, (0, _extends2.default)({
|
|
382
374
|
needsUpdate: _this.state.hasChanged,
|
|
383
375
|
showTooltip: !_this.state.isStartDatePopoverOpen && !_this.state.isEndDatePopoverOpen,
|
|
384
376
|
isLoading: isLoading,
|
|
385
|
-
isDisabled: isDisabled || _this.state.isInvalid,
|
|
377
|
+
isDisabled: !!isDisabled || _this.state.isInvalid,
|
|
386
378
|
onClick: _this.handleClickUpdateButton,
|
|
387
379
|
"data-test-subj": "superDatePickerApplyTimeButton",
|
|
388
380
|
size: compressed ? 's' : 'm',
|
|
389
381
|
iconOnly: showUpdateButton === 'iconOnly'
|
|
390
|
-
}, updateButtonProps))
|
|
382
|
+
}, updateButtonProps));
|
|
391
383
|
});
|
|
392
384
|
return _this;
|
|
393
385
|
}
|
|
@@ -406,30 +398,32 @@ var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
|
|
|
406
398
|
isQuickSelectOnly = _this$props6.isQuickSelectOnly,
|
|
407
399
|
compressed = _this$props6.compressed,
|
|
408
400
|
className = _this$props6.className;
|
|
401
|
+
var _this$state2 = this.state,
|
|
402
|
+
hasChanged = _this$state2.hasChanged,
|
|
403
|
+
isInvalid = _this$state2.isInvalid;
|
|
409
404
|
|
|
410
405
|
// Force reduction in width if showing quick select only
|
|
411
406
|
var width = isQuickSelectOnly ? 'auto' : _width;
|
|
412
|
-
var
|
|
413
|
-
'
|
|
414
|
-
'
|
|
415
|
-
'
|
|
416
|
-
'
|
|
417
|
-
'
|
|
407
|
+
var classes = (0, _classnames.default)('euiSuperDatePicker', className, {
|
|
408
|
+
'euiSuperDatePicker--needsUpdating': hasChanged && !isDisabled && !isInvalid,
|
|
409
|
+
'euiSuperDatePicker--noUpdateButton': !showUpdateButton,
|
|
410
|
+
'euiSuperDatePicker--isAutoRefreshOnly': isAutoRefreshOnly,
|
|
411
|
+
'euiSuperDatePicker--isQuickSelectOnly': isQuickSelectOnly,
|
|
412
|
+
'euiSuperDatePicker--fullWidth': width === 'full',
|
|
413
|
+
'euiSuperDatePicker--autoWidth': width === 'auto'
|
|
418
414
|
});
|
|
419
|
-
return (0, _react2.jsx)(
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
}, isAutoRefreshOnly && onRefreshChange ? (0, _react2.jsx)(_flex.EuiFlexItem, null, (0, _react2.jsx)(_auto_refresh.EuiAutoRefresh, {
|
|
415
|
+
return (0, _react2.jsx)("div", {
|
|
416
|
+
className: classes,
|
|
417
|
+
"data-test-subj": dataTestSubj
|
|
418
|
+
}, isAutoRefreshOnly && onRefreshChange ? (0, _react2.jsx)(_auto_refresh.EuiAutoRefresh, {
|
|
424
419
|
isPaused: isPaused,
|
|
425
420
|
refreshInterval: refreshInterval,
|
|
426
421
|
onRefreshChange: onRefreshChange,
|
|
427
422
|
fullWidth: width === 'full',
|
|
428
423
|
compressed: compressed,
|
|
429
|
-
isDisabled: isDisabled,
|
|
430
|
-
"data-test-subj": dataTestSubj,
|
|
424
|
+
isDisabled: !!isDisabled,
|
|
431
425
|
className: className
|
|
432
|
-
})
|
|
426
|
+
}) : (0, _react2.jsx)(_react.default.Fragment, null, this.renderDatePickerRange(), this.renderUpdateButton()));
|
|
433
427
|
}
|
|
434
428
|
}], [{
|
|
435
429
|
key: "getDerivedStateFromProps",
|