@elastic/eui 116.3.0 → 116.3.1-snapshot.1782148316870
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/avatar/avatar.js +4 -0
- package/es/components/avatar/avatar.styles.js +16 -16
- package/es/components/banner/banner.js +1 -2
- package/es/components/banner/banner.styles.js +1 -1
- package/es/components/basic_table/basic_table.js +35 -5
- package/es/components/basic_table/basic_table.styles.js +19 -1
- package/es/components/basic_table/in_memory_table.js +17 -0
- package/es/components/basic_table/index.js +2 -1
- package/es/components/basic_table/pagination_bar.js +19 -4
- package/es/components/basic_table/pagination_bar.styles.js +21 -0
- package/es/components/basic_table/panel.styles.js +14 -0
- package/es/components/basic_table/use_panel_props.js +28 -0
- package/es/components/date_picker/auto_refresh/refresh_interval.js +176 -229
- package/es/components/date_picker/date_picker.js +1 -1
- package/es/components/flyout/flyout.component.js +10 -6
- package/es/components/flyout/flyout_menu.js +122 -19
- package/es/components/flyout/flyout_menu.styles.js +2 -1
- package/es/components/flyout/manager/actions.js +20 -0
- package/es/components/flyout/manager/flyout_child.js +23 -1
- package/es/components/flyout/manager/flyout_managed.js +65 -19
- package/es/components/flyout/manager/hooks.js +1 -1
- package/es/components/flyout/manager/index.js +2 -2
- package/es/components/flyout/manager/reducer.js +32 -8
- package/es/components/flyout/manager/selectors.js +8 -2
- package/es/components/flyout/manager/store.js +35 -2
- package/es/components/flyout/use_flyout_menu.js +2 -2
- package/es/components/form/field_password/field_password.styles.js +1 -1
- package/es/components/form/field_search/field_search.styles.js +1 -1
- package/es/components/form/form.styles.js +1 -1
- package/es/components/form/form_control_layout/form_control_layout_icons.js +95 -143
- package/es/components/form/select/select.styles.js +1 -1
- package/es/components/form/text_area/text_area.styles.js +1 -1
- package/es/components/form/validatable_control/validatable_control.js +8 -55
- package/es/components/table/mobile/table_sort_mobile.js +64 -103
- package/es/components/table/store/use_unique_column_id.js +25 -0
- package/es/components/table/table_header_cell.js +7 -8
- package/es/components/table/table_header_cell_checkbox.js +5 -6
- package/es/components/tool_tip/tool_tip.js +61 -30
- package/es/components/tool_tip/tool_tip_anchor.js +5 -5
- package/es/components/tool_tip/tool_tip_manager.js +27 -2
- package/eui.d.ts +679 -530
- package/i18ntokens.json +810 -738
- package/lib/components/avatar/avatar.js +4 -0
- package/lib/components/avatar/avatar.styles.js +16 -16
- package/lib/components/banner/banner.js +1 -2
- package/lib/components/banner/banner.styles.js +1 -1
- package/lib/components/basic_table/basic_table.js +34 -4
- package/lib/components/basic_table/basic_table.styles.js +19 -1
- package/lib/components/basic_table/in_memory_table.js +17 -0
- package/lib/components/basic_table/index.js +8 -1
- package/lib/components/basic_table/pagination_bar.js +19 -4
- package/lib/components/basic_table/pagination_bar.styles.js +26 -0
- package/lib/components/basic_table/panel.styles.js +20 -0
- package/lib/components/basic_table/use_panel_props.js +33 -0
- package/lib/components/date_picker/auto_refresh/refresh_interval.js +175 -229
- package/lib/components/date_picker/date_picker.js +1 -1
- package/lib/components/flyout/flyout.component.js +10 -6
- package/lib/components/flyout/flyout_menu.js +120 -19
- package/lib/components/flyout/flyout_menu.styles.js +2 -1
- package/lib/components/flyout/manager/actions.js +21 -1
- package/lib/components/flyout/manager/flyout_child.js +23 -1
- package/lib/components/flyout/manager/flyout_managed.js +41 -17
- package/lib/components/flyout/manager/hooks.js +6 -0
- package/lib/components/flyout/manager/index.js +12 -0
- package/lib/components/flyout/manager/reducer.js +31 -7
- package/lib/components/flyout/manager/selectors.js +9 -3
- package/lib/components/flyout/manager/store.js +34 -1
- package/lib/components/flyout/use_flyout_menu.js +2 -2
- package/lib/components/form/field_password/field_password.styles.js +1 -1
- package/lib/components/form/field_search/field_search.styles.js +1 -1
- package/lib/components/form/form.styles.js +1 -1
- package/lib/components/form/form_control_layout/form_control_layout_icons.js +95 -145
- package/lib/components/form/select/select.styles.js +1 -1
- package/lib/components/form/text_area/text_area.styles.js +1 -1
- package/lib/components/form/validatable_control/validatable_control.js +7 -52
- package/lib/components/table/mobile/table_sort_mobile.js +71 -108
- package/lib/components/table/store/use_unique_column_id.js +34 -0
- package/lib/components/table/table_header_cell.js +7 -8
- package/lib/components/table/table_header_cell_checkbox.js +5 -6
- package/lib/components/tool_tip/tool_tip.js +59 -29
- package/lib/components/tool_tip/tool_tip_anchor.js +5 -5
- package/lib/components/tool_tip/tool_tip_manager.js +27 -2
- package/optimize/es/components/avatar/avatar.js +4 -0
- package/optimize/es/components/avatar/avatar.styles.js +16 -16
- package/optimize/es/components/banner/banner.js +1 -2
- package/optimize/es/components/banner/banner.styles.js +1 -1
- package/optimize/es/components/basic_table/basic_table.js +18 -5
- package/optimize/es/components/basic_table/basic_table.styles.js +19 -1
- package/optimize/es/components/basic_table/index.js +2 -1
- package/optimize/es/components/basic_table/pagination_bar.js +19 -4
- package/optimize/es/components/basic_table/pagination_bar.styles.js +21 -0
- package/optimize/es/components/basic_table/panel.styles.js +14 -0
- package/optimize/es/components/basic_table/use_panel_props.js +28 -0
- package/optimize/es/components/date_picker/auto_refresh/refresh_interval.js +172 -196
- package/optimize/es/components/date_picker/date_picker.js +1 -1
- package/optimize/es/components/flyout/flyout.component.js +10 -6
- package/optimize/es/components/flyout/flyout_menu.js +99 -18
- package/optimize/es/components/flyout/flyout_menu.styles.js +2 -1
- package/optimize/es/components/flyout/manager/actions.js +20 -0
- package/optimize/es/components/flyout/manager/flyout_managed.js +42 -18
- package/optimize/es/components/flyout/manager/hooks.js +1 -1
- package/optimize/es/components/flyout/manager/index.js +2 -2
- package/optimize/es/components/flyout/manager/reducer.js +32 -8
- package/optimize/es/components/flyout/manager/selectors.js +8 -2
- package/optimize/es/components/flyout/manager/store.js +35 -2
- package/optimize/es/components/flyout/use_flyout_menu.js +2 -2
- package/optimize/es/components/form/field_password/field_password.styles.js +1 -1
- package/optimize/es/components/form/field_search/field_search.styles.js +1 -1
- package/optimize/es/components/form/form.styles.js +1 -1
- package/optimize/es/components/form/form_control_layout/form_control_layout_icons.js +96 -115
- package/optimize/es/components/form/select/select.styles.js +1 -1
- package/optimize/es/components/form/text_area/text_area.styles.js +1 -1
- package/optimize/es/components/form/validatable_control/validatable_control.js +7 -48
- package/optimize/es/components/table/mobile/table_sort_mobile.js +59 -82
- package/optimize/es/components/table/store/use_unique_column_id.js +25 -0
- package/optimize/es/components/table/table_header_cell.js +7 -8
- package/optimize/es/components/table/table_header_cell_checkbox.js +5 -6
- package/optimize/es/components/tool_tip/tool_tip.js +58 -30
- package/optimize/es/components/tool_tip/tool_tip_anchor.js +5 -5
- package/optimize/es/components/tool_tip/tool_tip_manager.js +27 -2
- package/optimize/lib/components/avatar/avatar.js +4 -0
- package/optimize/lib/components/avatar/avatar.styles.js +16 -16
- package/optimize/lib/components/banner/banner.js +1 -2
- package/optimize/lib/components/banner/banner.styles.js +1 -1
- package/optimize/lib/components/basic_table/basic_table.js +17 -4
- package/optimize/lib/components/basic_table/basic_table.styles.js +19 -1
- package/optimize/lib/components/basic_table/index.js +8 -1
- package/optimize/lib/components/basic_table/pagination_bar.js +19 -4
- package/optimize/lib/components/basic_table/pagination_bar.styles.js +26 -0
- package/optimize/lib/components/basic_table/panel.styles.js +20 -0
- package/optimize/lib/components/basic_table/use_panel_props.js +33 -0
- package/optimize/lib/components/date_picker/auto_refresh/refresh_interval.js +170 -194
- package/optimize/lib/components/date_picker/date_picker.js +1 -1
- package/optimize/lib/components/flyout/flyout.component.js +10 -6
- package/optimize/lib/components/flyout/flyout_menu.js +98 -18
- package/optimize/lib/components/flyout/flyout_menu.styles.js +2 -1
- package/optimize/lib/components/flyout/manager/actions.js +21 -1
- package/optimize/lib/components/flyout/manager/flyout_managed.js +41 -17
- package/optimize/lib/components/flyout/manager/hooks.js +6 -0
- package/optimize/lib/components/flyout/manager/index.js +12 -0
- package/optimize/lib/components/flyout/manager/reducer.js +31 -7
- package/optimize/lib/components/flyout/manager/selectors.js +9 -3
- package/optimize/lib/components/flyout/manager/store.js +34 -1
- package/optimize/lib/components/flyout/use_flyout_menu.js +2 -2
- package/optimize/lib/components/form/field_password/field_password.styles.js +1 -1
- package/optimize/lib/components/form/field_search/field_search.styles.js +1 -1
- package/optimize/lib/components/form/form.styles.js +1 -1
- package/optimize/lib/components/form/form_control_layout/form_control_layout_icons.js +96 -117
- package/optimize/lib/components/form/select/select.styles.js +1 -1
- package/optimize/lib/components/form/text_area/text_area.styles.js +1 -1
- package/optimize/lib/components/form/validatable_control/validatable_control.js +6 -49
- package/optimize/lib/components/table/mobile/table_sort_mobile.js +61 -83
- package/optimize/lib/components/table/store/use_unique_column_id.js +34 -0
- package/optimize/lib/components/table/table_header_cell.js +7 -8
- package/optimize/lib/components/table/table_header_cell_checkbox.js +5 -6
- package/optimize/lib/components/tool_tip/tool_tip.js +57 -29
- package/optimize/lib/components/tool_tip/tool_tip_anchor.js +5 -5
- package/optimize/lib/components/tool_tip/tool_tip_manager.js +27 -2
- package/package.json +8 -5
- package/test-env/components/avatar/avatar.js +4 -0
- package/test-env/components/avatar/avatar.styles.js +16 -16
- package/test-env/components/banner/banner.js +1 -2
- package/test-env/components/banner/banner.styles.js +1 -1
- package/test-env/components/basic_table/basic_table.js +34 -4
- package/test-env/components/basic_table/basic_table.styles.js +19 -1
- package/test-env/components/basic_table/in_memory_table.js +17 -0
- package/test-env/components/basic_table/index.js +8 -1
- package/test-env/components/basic_table/pagination_bar.js +19 -4
- package/test-env/components/basic_table/pagination_bar.styles.js +26 -0
- package/test-env/components/basic_table/panel.styles.js +20 -0
- package/test-env/components/basic_table/use_panel_props.js +33 -0
- package/test-env/components/date_picker/auto_refresh/refresh_interval.js +170 -220
- package/test-env/components/date_picker/date_picker.js +1 -1
- package/test-env/components/flyout/flyout.component.js +10 -6
- package/test-env/components/flyout/flyout_menu.js +121 -19
- package/test-env/components/flyout/flyout_menu.styles.js +2 -1
- package/test-env/components/flyout/manager/actions.js +21 -1
- package/test-env/components/flyout/manager/flyout_child.js +23 -1
- package/test-env/components/flyout/manager/flyout_managed.js +41 -17
- package/test-env/components/flyout/manager/hooks.js +6 -0
- package/test-env/components/flyout/manager/index.js +12 -0
- package/test-env/components/flyout/manager/reducer.js +31 -7
- package/test-env/components/flyout/manager/selectors.js +9 -3
- package/test-env/components/flyout/manager/store.js +34 -1
- package/test-env/components/flyout/use_flyout_menu.js +2 -2
- package/test-env/components/form/field_password/field_password.styles.js +1 -1
- package/test-env/components/form/field_search/field_search.styles.js +1 -1
- package/test-env/components/form/form.styles.js +1 -1
- package/test-env/components/form/form_control_layout/form_control_layout_icons.js +95 -139
- package/test-env/components/form/select/select.styles.js +1 -1
- package/test-env/components/form/text_area/text_area.styles.js +1 -1
- package/test-env/components/form/validatable_control/validatable_control.js +6 -48
- package/test-env/components/table/mobile/table_sort_mobile.js +61 -98
- package/test-env/components/table/store/use_unique_column_id.js +34 -0
- package/test-env/components/table/table_header_cell.js +7 -8
- package/test-env/components/table/table_header_cell_checkbox.js +5 -6
- package/test-env/components/tool_tip/tool_tip.js +57 -29
- package/test-env/components/tool_tip/tool_tip_anchor.js +5 -5
- package/test-env/components/tool_tip/tool_tip_manager.js +27 -2
|
@@ -20,7 +20,7 @@ var _ref = process.env.NODE_ENV === "production" ? {
|
|
|
20
20
|
export var euiFieldPasswordStyles = function euiFieldPasswordStyles(euiThemeContext) {
|
|
21
21
|
var formStyles = euiFormControlStyles(euiThemeContext);
|
|
22
22
|
return {
|
|
23
|
-
euiFieldPassword: /*#__PURE__*/css(formStyles.shared, " &:invalid{", formStyles.invalid, ";}&:focus{", formStyles.focus, ";}&:disabled{", formStyles.disabled, ";}&[readOnly]{", formStyles.readOnly, ";}&:autofill{", formStyles.autoFill, ";};label:euiFieldPassword;"),
|
|
23
|
+
euiFieldPassword: /*#__PURE__*/css(formStyles.shared, " &:is(:invalid, [aria-invalid='true']){", formStyles.invalid, ";}&:focus{", formStyles.focus, ";}&:disabled{", formStyles.disabled, ";}&[readOnly]{", formStyles.readOnly, ";}&:autofill{", formStyles.autoFill, ";};label:euiFieldPassword;"),
|
|
24
24
|
// Only remove Edge's internal reveal button if we're providing a custom one
|
|
25
25
|
// This pseudo-element is still supported in Chromium-based Edge.
|
|
26
26
|
withToggle: _ref,
|
|
@@ -11,7 +11,7 @@ import { euiFormControlStyles } from '../form.styles';
|
|
|
11
11
|
export var euiFieldSearchStyles = function euiFieldSearchStyles(euiThemeContext) {
|
|
12
12
|
var formStyles = euiFormControlStyles(euiThemeContext);
|
|
13
13
|
return {
|
|
14
|
-
euiFieldSearch: /*#__PURE__*/css("-webkit-appearance:textfield;&::-webkit-search-decoration,&::-webkit-search-cancel-button{-webkit-appearance:none;}", formStyles.shared, " &:invalid{", formStyles.invalid, ";}&:focus{", formStyles.focus, ";}&:disabled{", formStyles.disabled, ";}&[readOnly]{", formStyles.readOnly, ";}&:autofill{", formStyles.autoFill, ";};label:euiFieldSearch;"),
|
|
14
|
+
euiFieldSearch: /*#__PURE__*/css("-webkit-appearance:textfield;&::-webkit-search-decoration,&::-webkit-search-cancel-button{-webkit-appearance:none;}", formStyles.shared, " &:is(:invalid, [aria-invalid='true']){", formStyles.invalid, ";}&:focus{", formStyles.focus, ";}&:disabled{", formStyles.disabled, ";}&[readOnly]{", formStyles.readOnly, ";}&:autofill{", formStyles.autoFill, ";};label:euiFieldSearch;"),
|
|
15
15
|
// Skip the css() on the default height to avoid generating a className
|
|
16
16
|
uncompressed: formStyles.uncompressed,
|
|
17
17
|
compressed: /*#__PURE__*/css(formStyles.compressed, ";label:compressed;"),
|
|
@@ -208,7 +208,7 @@ export var euiFormControlAutoFillStyles = function euiFormControlAutoFillStyles(
|
|
|
208
208
|
var borderShadow = "inset 0 0 0 var(--euiFormControlStateAutofillWidth) var(--euiFormControlStateAutofillColor), ".concat(backgroundShadow);
|
|
209
209
|
|
|
210
210
|
// These styles only apply/override Chrome/webkit browsers - Firefox does not set autofill styles
|
|
211
|
-
return "\n &:where(:-webkit-autofill) {\n --euiFormControlStateAutofillWidth: ".concat(euiTheme.border.width.thin, ";\n --euiFormControlStateAutofillColor: ").concat(borderColor, ";\n \n -webkit-text-fill-color: ").concat(textColor, ";\n -webkit-box-shadow: ").concat(borderShadow, ";\n \n\n &:hover {\n --euiFormControlStateAutofillColor: ").concat(borderHovered, ";\n }\n\n &:focus {\n --euiFormControlStateAutofillWidth: ").concat(euiTheme.border.width.thick, ";\n }\n\n &:invalid {\n --euiFormControlStateAutofillColor: ").concat(borderInvalid, ";\n\n &:hover {\n --euiFormControlStateAutofillColor: ").concat(borderInvalidHovered, ";\n }\n }\n }\n ");
|
|
211
|
+
return "\n &:where(:-webkit-autofill) {\n --euiFormControlStateAutofillWidth: ".concat(euiTheme.border.width.thin, ";\n --euiFormControlStateAutofillColor: ").concat(borderColor, ";\n \n -webkit-text-fill-color: ").concat(textColor, ";\n -webkit-box-shadow: ").concat(borderShadow, ";\n \n\n &:hover {\n --euiFormControlStateAutofillColor: ").concat(borderHovered, ";\n }\n\n &:focus {\n --euiFormControlStateAutofillWidth: ").concat(euiTheme.border.width.thick, ";\n }\n\n &:is(:invalid, [aria-invalid='true']) {\n --euiFormControlStateAutofillColor: ").concat(borderInvalid, ";\n\n &:hover {\n --euiFormControlStateAutofillColor: ").concat(borderInvalidHovered, ";\n }\n }\n }\n ");
|
|
212
212
|
};
|
|
213
213
|
export var euiFormControlAutofillUnsetStyles = "\n\n";
|
|
214
214
|
export var euiFormControlShowBackgroundLine = function euiFormControlShowBackgroundLine(euiThemeContext, color) {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
1
|
var _excluded = ["ref", "side"];
|
|
3
2
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
4
3
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
@@ -9,18 +8,6 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
|
|
|
9
8
|
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
10
9
|
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
11
10
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
12
|
-
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
13
|
-
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
14
|
-
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
15
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
16
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
17
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
18
|
-
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
19
|
-
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
20
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
21
|
-
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
22
|
-
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
23
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
24
11
|
/*
|
|
25
12
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
26
13
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -29,9 +16,8 @@ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf
|
|
|
29
16
|
* Side Public License, v 1.
|
|
30
17
|
*/
|
|
31
18
|
|
|
32
|
-
import React
|
|
33
|
-
import
|
|
34
|
-
import { RenderWithEuiStylesMemoizer } from '../../../services';
|
|
19
|
+
import React from 'react';
|
|
20
|
+
import { useEuiTheme } from '../../../services';
|
|
35
21
|
import { EuiIcon } from '../../icon';
|
|
36
22
|
import { EuiLoadingSpinner } from '../../loading';
|
|
37
23
|
import { EuiFormControlLayoutClearButton } from './form_control_layout_clear_button';
|
|
@@ -42,133 +28,99 @@ export var ICON_SIDES = ['left', 'right'];
|
|
|
42
28
|
export var isIconShape = function isIconShape(icon) {
|
|
43
29
|
return !!icon && icon.hasOwnProperty('type');
|
|
44
30
|
};
|
|
45
|
-
export var EuiFormControlLayoutIcons =
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
31
|
+
export var EuiFormControlLayoutIcons = function EuiFormControlLayoutIcons(_ref) {
|
|
32
|
+
var _ref$side = _ref.side,
|
|
33
|
+
side = _ref$side === void 0 ? 'left' : _ref$side,
|
|
34
|
+
_ref$iconsPosition = _ref.iconsPosition,
|
|
35
|
+
iconsPosition = _ref$iconsPosition === void 0 ? 'absolute' : _ref$iconsPosition,
|
|
36
|
+
compressed = _ref.compressed,
|
|
37
|
+
isDisabled = _ref.isDisabled,
|
|
38
|
+
icon = _ref.icon,
|
|
39
|
+
clear = _ref.clear,
|
|
40
|
+
isLoading = _ref.isLoading,
|
|
41
|
+
isInvalid = _ref.isInvalid,
|
|
42
|
+
isDropdown = _ref.isDropdown;
|
|
43
|
+
var euiThemeContext = useEuiTheme();
|
|
44
|
+
var styles = euiFormControlLayoutIconsStyles(euiThemeContext);
|
|
45
|
+
var cssStyles = [styles.euiFormControlLayoutIcons, compressed ? styles.compressed : styles.uncompressed].concat(_toConsumableArray(iconsPosition === 'absolute' ? [styles.position.absolute.absolute, compressed ? styles.position.absolute.compressed[side] : styles.position.absolute.uncompressed[side]] : [styles.position.static.static, compressed ? styles.position.static.compressed : styles.position.static.uncompressed]), [isDisabled && styles.disabled]);
|
|
46
|
+
return ___EmotionJSX("div", {
|
|
47
|
+
css: cssStyles,
|
|
48
|
+
className: "euiFormControlLayoutIcons"
|
|
49
|
+
}, ___EmotionJSX(ClearButton, {
|
|
50
|
+
clear: clear,
|
|
51
|
+
isDisabled: isDisabled
|
|
52
|
+
}), ___EmotionJSX(LoadingSpinner, {
|
|
53
|
+
isLoading: isLoading
|
|
54
|
+
}), ___EmotionJSX(InvalidIcon, {
|
|
55
|
+
isInvalid: isInvalid
|
|
56
|
+
}), ___EmotionJSX(CustomIcon, {
|
|
57
|
+
icon: icon,
|
|
58
|
+
isDisabled: isDisabled
|
|
59
|
+
}), ___EmotionJSX(DropdownIcon, {
|
|
60
|
+
isDropdown: isDropdown,
|
|
61
|
+
isDisabled: isDisabled
|
|
62
|
+
}));
|
|
63
|
+
};
|
|
64
|
+
var CustomIcon = function CustomIcon(_ref2) {
|
|
65
|
+
var icon = _ref2.icon,
|
|
66
|
+
isDisabled = _ref2.isDisabled;
|
|
67
|
+
if (!icon) {
|
|
68
|
+
return null;
|
|
49
69
|
}
|
|
50
|
-
_inherits(EuiFormControlLayoutIcons, _Component);
|
|
51
|
-
return _createClass(EuiFormControlLayoutIcons, [{
|
|
52
|
-
key: "render",
|
|
53
|
-
value: function render() {
|
|
54
|
-
var _this$props = this.props,
|
|
55
|
-
_this$props$side = _this$props.side,
|
|
56
|
-
side = _this$props$side === void 0 ? 'left' : _this$props$side,
|
|
57
|
-
_this$props$iconsPosi = _this$props.iconsPosition,
|
|
58
|
-
iconsPosition = _this$props$iconsPosi === void 0 ? 'absolute' : _this$props$iconsPosi,
|
|
59
|
-
compressed = _this$props.compressed,
|
|
60
|
-
isDisabled = _this$props.isDisabled;
|
|
61
|
-
var customIcon = this.renderCustomIcon();
|
|
62
|
-
var loadingSpinner = this.renderLoadingSpinner();
|
|
63
|
-
var clearButton = this.renderClearButton();
|
|
64
|
-
var invalidIcon = this.renderInvalidIcon();
|
|
65
|
-
var dropdownIcon = this.renderDropdownIcon();
|
|
66
|
-
return ___EmotionJSX(RenderWithEuiStylesMemoizer, null, function (stylesMemoizer) {
|
|
67
|
-
var styles = stylesMemoizer(euiFormControlLayoutIconsStyles);
|
|
68
|
-
var cssStyles = [styles.euiFormControlLayoutIcons, compressed ? styles.compressed : styles.uncompressed].concat(_toConsumableArray(iconsPosition === 'absolute' ? [styles.position.absolute.absolute, compressed ? styles.position.absolute.compressed[side] : styles.position.absolute.uncompressed[side]] : [styles.position.static.static, compressed ? styles.position.static.compressed : styles.position.static.uncompressed]), [isDisabled && styles.disabled]);
|
|
69
|
-
return ___EmotionJSX("div", {
|
|
70
|
-
css: cssStyles,
|
|
71
|
-
className: "euiFormControlLayoutIcons"
|
|
72
|
-
}, clearButton, loadingSpinner, invalidIcon, customIcon, dropdownIcon);
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
}, {
|
|
76
|
-
key: "renderCustomIcon",
|
|
77
|
-
value: function renderCustomIcon() {
|
|
78
|
-
var _this$props2 = this.props,
|
|
79
|
-
icon = _this$props2.icon,
|
|
80
|
-
isDisabled = _this$props2.isDisabled;
|
|
81
|
-
if (!icon) {
|
|
82
|
-
return null;
|
|
83
|
-
}
|
|
84
70
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
value: function renderInvalidIcon() {
|
|
141
|
-
var isInvalid = this.props.isInvalid;
|
|
142
|
-
if (!isInvalid) {
|
|
143
|
-
return null;
|
|
144
|
-
}
|
|
145
|
-
return ___EmotionJSX(EuiIcon, {
|
|
146
|
-
size: "m",
|
|
147
|
-
color: "danger",
|
|
148
|
-
type: "warning"
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
}]);
|
|
152
|
-
}(Component);
|
|
153
|
-
EuiFormControlLayoutIcons.propTypes = {
|
|
154
|
-
icon: PropTypes.oneOfType([PropTypes.oneOfType([PropTypes.oneOf(["accessibility", "addDataApp", "addToDashboard", "advancedSettingsApp", "agentApp", "aggregate", "alignBottom", "alignBottomLeft", "alignBottomRight", "alignCenterHorizontal", "alignCenterVertical", "alignLeft", "alignRight", "alignTop", "alignTopLeft", "alignTopRight", "alert", "analyzeEvent", "annotation", "anomalyChart", "chartAnomaly", "anomalySwimLane", "apmApp", "apmTrace", "chartWaterfall", "appSearchApp", "apps", "arrowDown", "chevronSingleDown", "arrowLeft", "chevronSingleLeft", "arrowRight", "chevronSingleRight", "arrowUp", "chevronSingleUp", "arrowStart", "chevronLimitLeft", "arrowEnd", "chevronLimitRight", "article", "asterisk", "at", "archive", "axisX", "axisYLeft", "axisYRight", "auditbeatApp", "backgroundTask", "beaker", "bell", "bellSlash", "beta", "bolt", "boxesHorizontal", "boxesVertical", "branch", "briefcase", "branchUser", "broom", "brush", "bug", "bulb", "bullseye", "calendar", "canvasApp", "casesApp", "changePointDetection", "chartChangePoint", "chartArea", "chartAreaStack", "chartBarHorizontal", "chartBarHorizontalStack", "chartBarVertical", "chartBarVerticalStack", "chartGauge", "chartHeatmap", "chartLine", "chartPie", "chartTagCloud", "chartThreshold", "check", "checkCircle", "checkInCircleFilled", "checkCircleFill", "cheer", "popper", "classificationJob", "clickLeft", "clickRight", "clock", "clockCounter", "clockControl", "cloud", "cloudDrizzle", "cloudStormy", "cloudSunny", "cluster", "code", "codeApp", "color", "paintBucket", "commandLine", "comment", "compare", "compute", "processor", "console", "consoleApp", "container", "continuityAbove", "continuityAboveBelow", "continuityBelow", "continuityWithin", "contrast", "contrastHigh", "contrastFill", "controls", "controlsHorizontal", "controlsVertical", "copy", "copyClipboard", "crossProjectSearch", "createAdvancedJob", "createGenericJob", "createGeoJob", "createMultiMetricJob", "createPopulationJob", "createSingleMetricJob", "cross", "crossClusterReplicationApp", "crossInCircle", "crossCircle", "crosshair", "crosshairs", "currency", "money", "cut", "scissors", "dashboardApp", "dashedCircle", "dataVisualizer", "database", "desktop", "display", "devToolsApp", "diff", "discoverApp", "distributeHorizontal", "distributeVertical", "download", "drag", "dragHorizontal", "dragVertical", "discuss", "document", "documentEdit", "documentation", "documents", "dot", "dotInCircle", "doubleArrowLeft", "chevronDoubleLeft", "doubleArrowRight", "chevronDoubleRight", "ellipsis", "editorAlignCenter", "textAlignCenter", "editorAlignLeft", "textAlignLeft", "editorAlignRight", "textAlignRight", "editorBold", "textBold", "editorChecklist", "listCheck", "editorCodeBlock", "editorComment", "editorDistributeHorizontal", "editorDistributeVertical", "editorHeading", "textHeading", "editorItalic", "textItalic", "editorItemAlignBottom", "editorItemAlignCenter", "editorItemAlignLeft", "editorItemAlignMiddle", "editorItemAlignRight", "editorItemAlignTop", "editorLink", "editorOrderedList", "listNumber", "editorPositionBottomLeft", "editorPositionBottomRight", "editorPositionTopLeft", "editorPositionTopRight", "editorRedo", "redo", "editorStrike", "textStrike", "editorTable", "table", "editorUnderline", "textUnderline", "editorUndo", "undo", "editorUnorderedList", "listBullet", "email", "mail", "empty", "emsApp", "endpoint", "eql", "query", "eraser", "error", "errorFilled", "errorFill", "esqlVis", "exit", "logOut", "expand", "maximize", "expandMini", "export", "exportAction", "upload", "external", "eye", "eyeClosed", "eyeSlash", "faceHappy", "faceNeutral", "faceSad", "fieldStatistics", "tableInfo", "filebeatApp", "filter", "filterExclude", "filterIgnore", "filterInclude", "filterInCircle", "flask", "flag", "fleetApp", "fold", "folder", "folderClosed", "folderClose", "folderCheck", "folderExclamation", "folderOpen", "folderOpened", "frameNext", "framePrevious", "fullScreen", "fullScreenExit", "function", "gear", "gisApp", "glasses", "globe", "grab", "grabHorizontal", "grabOmnidirectional", "gradient", "graphApp", "grid", "grokApp", "heart", "heartbeatApp", "heatmap", "help", "home", "hourglass", "if", "info", "image", "importAction", "index", "indexClose", "indexEdit", "indexFlush", "indexManagementApp", "indexMapping", "mapping", "indexOpen", "indexPatternApp", "indexRollupApp", "indexRuntime", "indexSettings", "indexTemporary", "tableTime", "infinity", "inputOutput", "inspect", "invert", "ip", "key", "keyboard", "kqlField", "queryField", "kqlFunction", "kqlOperand", "queryOperand", "kqlSelector", "querySelector", "kqlValue", "queryValue", "kubernetesNode", "kubernetesPod", "launch", "rocket", "layers", "lensApp", "lettering", "text", "lineBreak", "lineBreakSlash", "lineDash", "lineDashed", "lineDot", "lineDotted", "lineSolid", "link", "linkSlash", "list", "listAdd", "lock", "lockOpen", "logPatternAnalysis", "pattern", "logRateAnalysis", "logoAWS", "logoAWSMono", "logoAerospike", "logoApache", "logoAppSearch", "logoAzure", "logoAzureMono", "logoBeats", "logoBusinessAnalytics", "logoCeph", "logoCloud", "logoCloudEnterprise", "logoCode", "logoCodesandbox", "logoCouchbase", "logoDocker", "logoDropwizard", "logoElastic", "logoElasticStack", "logoElasticsearch", "logoEnterpriseSearch", "logoEtcd", "logoGCP", "logoGCPMono", "logoGithub", "logoGmail", "logoGolang", "logoGoogleG", "logoHAproxy", "logoIBM", "logoIBMMono", "logoKafka", "logoKibana", "logoKubernetes", "logoLogging", "logoLogstash", "logoMaps", "logoMemcached", "logoMetrics", "logoMongodb", "logoMySQL", "logoNginx", "logoObservability", "logoOsquery", "logoPhp", "logoPostgres", "logoPrometheus", "logoRabbitmq", "logoRedis", "logoSecurity", "logoSiteSearch", "logoSketch", "logoSlack", "logoUptime", "logoVulnerabilityManagement", "logoWebhook", "logoWindows", "logoWorkplaceSearch", "logsApp", "logstashFilter", "logstashIf", "logstashInput", "logstashOutput", "logstashQueue", "queue", "machineLearningApp", "magnet", "magnify", "magnifyExclamation", "magnifyMinus", "magnifyPlus", "magnifyWithExclamation", "magnifyWithMinus", "magnifyWithPlus", "managementApp", "map", "mapMarker", "waypoint", "megaphone", "memory", "menu", "menuDown", "menuLeft", "menuRight", "menuUp", "merge", "metricbeatApp", "metricsApp", "minimize", "minus", "minusCircle", "minusInCircle", "minusInCircleFilled", "minusInSquare", "minusSquare", "mobile", "monitoringApp", "moon", "move", "namespace", "nested", "newChat", "node", "vectorTriangle", "notebookApp", "number", "offline", "wifiSlash", "online", "wifi", "outlierDetectionJob", "package", "packetbeatApp", "pageSelect", "pagesSelect", "palette", "paperClip", "partial", "pause", "payment", "pencil", "percent", "pin", "pinFill", "pinFilled", "pipeBreaks", "pipelineApp", "pipeNoBreaks", "pivot", "play", "playFilled", "plugs", "plus", "plusCircle", "plusInCircle", "plusInCircleFilled", "plusInSquare", "plusSquare", "popout", "presentation", "productRobot", "productAgent", "productCloudInfra", "productDashboard", "productDiscover", "productML", "productStreamsClassic", "productStreamsWired", "push", "send", "question", "quote", "radar", "readOnly", "recentlyViewedApp", "refresh", "regressionJob", "reporter", "reportingApp", "return", "returnKey", "save", "savedObjectsApp", "scale", "search", "searchProfilerApp", "section", "securityAnalyticsApp", "securityApp", "securitySignal", "securitySignalDetected", "securitySignalResolved", "server", "sessionViewer", "shard", "share", "significantEvents", "singleMetricViewer", "snowflake", "sortAscending", "sortDescending", "sortDown", "sortLeft", "sortRight", "sortUp", "sortable", "spaces", "spacesApp", "sparkles", "sqlApp", "star", "starEmpty", "starEmptySpace", "starFill", "starFilled", "starFillSpace", "starFilledSpace", "starMinusEmpty", "starMinusFill", "starMinusFilled", "starPlusEmpty", "starPlusFill", "starPlusFilled", "stats", "stop", "stopFill", "stopFilled", "stopSlash", "storage", "streamsClassic", "streamsWired", "string", "submodule", "sun", "swatchInput", "symlink", "tableDensityCompact", "tableDensityHigh", "tableDensityExpanded", "tableDensityLow", "tableDensityNormal", "tableOfContents", "tag", "tear", "temperature", "thermometer", "thumbDown", "thumbUp", "timeline", "timelineWithArrow", "timelionApp", "timeRefresh", "refreshTime", "timeslider", "training", "transitionBottomIn", "transitionBottomOut", "transitionLeftIn", "transitionLeftOut", "transitionTopIn", "transitionTopOut", "trash", "unfold", "unlink", "upgradeAssistantApp", "uptimeApp", "user", "userAvatar", "users", "usersRolesApp", "unarchive", "vector", "vectorSquare", "videoPlayer", "visArea", "visAreaStacked", "visBarHorizontal", "visBarHorizontalStacked", "visBarVertical", "visBarVerticalStacked", "visGauge", "visGoal", "visLine", "visMapCoordinate", "visMapRegion", "visMetric", "chartMetric", "visPie", "visTable", "visTagCloud", "visText", "visTimelion", "visVega", "visVisualBuilder", "visualizeApp", "vulnerabilityManagementApp", "warning", "warningFilled", "warningFill", "watchesApp", "web", "wordWrap", "wordWrapDisabled", "workflowsApp", "workflow", "workplaceSearchApp", "wrench", "tokenAlias", "tokenAnnotation", "tokenArray", "tokenBinary", "tokenBoolean", "tokenClass", "tokenCompletionSuggester", "tokenConstant", "tokenDate", "tokenDimension", "tokenElement", "tokenEnum", "tokenEnumMember", "tokenEvent", "tokenException", "tokenField", "tokenFile", "tokenFlattened", "tokenFunction", "tokenGeo", "tokenHistogram", "tokenInterface", "tokenIP", "tokenJoin", "tokenKey", "tokenKeyword", "tokenMethod", "tokenMetricCounter", "tokenMetricGauge", "tokenModule", "tokenNamespace", "tokenNested", "tokenNull", "tokenNumber", "tokenObject", "tokenOperator", "tokenPackage", "tokenParameter", "tokenPercolator", "tokenProperty", "tokenRange", "tokenRankFeature", "tokenRankFeatures", "tokenRepo", "tokenSearchType", "tokenSemanticText", "tokenShape", "tokenString", "tokenStruct", "tokenSymbol", "tokenTag", "tokenText", "tokenTokenCount", "tokenVariable", "tokenVectorDense", "tokenDenseVector", "tokenVectorSparse"]).isRequired, PropTypes.string.isRequired, PropTypes.elementType.isRequired]).isRequired, PropTypes.shape({
|
|
155
|
-
type: PropTypes.oneOfType([PropTypes.oneOf(["accessibility", "addDataApp", "addToDashboard", "advancedSettingsApp", "agentApp", "aggregate", "alignBottom", "alignBottomLeft", "alignBottomRight", "alignCenterHorizontal", "alignCenterVertical", "alignLeft", "alignRight", "alignTop", "alignTopLeft", "alignTopRight", "alert", "analyzeEvent", "annotation", "anomalyChart", "chartAnomaly", "anomalySwimLane", "apmApp", "apmTrace", "chartWaterfall", "appSearchApp", "apps", "arrowDown", "chevronSingleDown", "arrowLeft", "chevronSingleLeft", "arrowRight", "chevronSingleRight", "arrowUp", "chevronSingleUp", "arrowStart", "chevronLimitLeft", "arrowEnd", "chevronLimitRight", "article", "asterisk", "at", "archive", "axisX", "axisYLeft", "axisYRight", "auditbeatApp", "backgroundTask", "beaker", "bell", "bellSlash", "beta", "bolt", "boxesHorizontal", "boxesVertical", "branch", "briefcase", "branchUser", "broom", "brush", "bug", "bulb", "bullseye", "calendar", "canvasApp", "casesApp", "changePointDetection", "chartChangePoint", "chartArea", "chartAreaStack", "chartBarHorizontal", "chartBarHorizontalStack", "chartBarVertical", "chartBarVerticalStack", "chartGauge", "chartHeatmap", "chartLine", "chartPie", "chartTagCloud", "chartThreshold", "check", "checkCircle", "checkInCircleFilled", "checkCircleFill", "cheer", "popper", "classificationJob", "clickLeft", "clickRight", "clock", "clockCounter", "clockControl", "cloud", "cloudDrizzle", "cloudStormy", "cloudSunny", "cluster", "code", "codeApp", "color", "paintBucket", "commandLine", "comment", "compare", "compute", "processor", "console", "consoleApp", "container", "continuityAbove", "continuityAboveBelow", "continuityBelow", "continuityWithin", "contrast", "contrastHigh", "contrastFill", "controls", "controlsHorizontal", "controlsVertical", "copy", "copyClipboard", "crossProjectSearch", "createAdvancedJob", "createGenericJob", "createGeoJob", "createMultiMetricJob", "createPopulationJob", "createSingleMetricJob", "cross", "crossClusterReplicationApp", "crossInCircle", "crossCircle", "crosshair", "crosshairs", "currency", "money", "cut", "scissors", "dashboardApp", "dashedCircle", "dataVisualizer", "database", "desktop", "display", "devToolsApp", "diff", "discoverApp", "distributeHorizontal", "distributeVertical", "download", "drag", "dragHorizontal", "dragVertical", "discuss", "document", "documentEdit", "documentation", "documents", "dot", "dotInCircle", "doubleArrowLeft", "chevronDoubleLeft", "doubleArrowRight", "chevronDoubleRight", "ellipsis", "editorAlignCenter", "textAlignCenter", "editorAlignLeft", "textAlignLeft", "editorAlignRight", "textAlignRight", "editorBold", "textBold", "editorChecklist", "listCheck", "editorCodeBlock", "editorComment", "editorDistributeHorizontal", "editorDistributeVertical", "editorHeading", "textHeading", "editorItalic", "textItalic", "editorItemAlignBottom", "editorItemAlignCenter", "editorItemAlignLeft", "editorItemAlignMiddle", "editorItemAlignRight", "editorItemAlignTop", "editorLink", "editorOrderedList", "listNumber", "editorPositionBottomLeft", "editorPositionBottomRight", "editorPositionTopLeft", "editorPositionTopRight", "editorRedo", "redo", "editorStrike", "textStrike", "editorTable", "table", "editorUnderline", "textUnderline", "editorUndo", "undo", "editorUnorderedList", "listBullet", "email", "mail", "empty", "emsApp", "endpoint", "eql", "query", "eraser", "error", "errorFilled", "errorFill", "esqlVis", "exit", "logOut", "expand", "maximize", "expandMini", "export", "exportAction", "upload", "external", "eye", "eyeClosed", "eyeSlash", "faceHappy", "faceNeutral", "faceSad", "fieldStatistics", "tableInfo", "filebeatApp", "filter", "filterExclude", "filterIgnore", "filterInclude", "filterInCircle", "flask", "flag", "fleetApp", "fold", "folder", "folderClosed", "folderClose", "folderCheck", "folderExclamation", "folderOpen", "folderOpened", "frameNext", "framePrevious", "fullScreen", "fullScreenExit", "function", "gear", "gisApp", "glasses", "globe", "grab", "grabHorizontal", "grabOmnidirectional", "gradient", "graphApp", "grid", "grokApp", "heart", "heartbeatApp", "heatmap", "help", "home", "hourglass", "if", "info", "image", "importAction", "index", "indexClose", "indexEdit", "indexFlush", "indexManagementApp", "indexMapping", "mapping", "indexOpen", "indexPatternApp", "indexRollupApp", "indexRuntime", "indexSettings", "indexTemporary", "tableTime", "infinity", "inputOutput", "inspect", "invert", "ip", "key", "keyboard", "kqlField", "queryField", "kqlFunction", "kqlOperand", "queryOperand", "kqlSelector", "querySelector", "kqlValue", "queryValue", "kubernetesNode", "kubernetesPod", "launch", "rocket", "layers", "lensApp", "lettering", "text", "lineBreak", "lineBreakSlash", "lineDash", "lineDashed", "lineDot", "lineDotted", "lineSolid", "link", "linkSlash", "list", "listAdd", "lock", "lockOpen", "logPatternAnalysis", "pattern", "logRateAnalysis", "logoAWS", "logoAWSMono", "logoAerospike", "logoApache", "logoAppSearch", "logoAzure", "logoAzureMono", "logoBeats", "logoBusinessAnalytics", "logoCeph", "logoCloud", "logoCloudEnterprise", "logoCode", "logoCodesandbox", "logoCouchbase", "logoDocker", "logoDropwizard", "logoElastic", "logoElasticStack", "logoElasticsearch", "logoEnterpriseSearch", "logoEtcd", "logoGCP", "logoGCPMono", "logoGithub", "logoGmail", "logoGolang", "logoGoogleG", "logoHAproxy", "logoIBM", "logoIBMMono", "logoKafka", "logoKibana", "logoKubernetes", "logoLogging", "logoLogstash", "logoMaps", "logoMemcached", "logoMetrics", "logoMongodb", "logoMySQL", "logoNginx", "logoObservability", "logoOsquery", "logoPhp", "logoPostgres", "logoPrometheus", "logoRabbitmq", "logoRedis", "logoSecurity", "logoSiteSearch", "logoSketch", "logoSlack", "logoUptime", "logoVulnerabilityManagement", "logoWebhook", "logoWindows", "logoWorkplaceSearch", "logsApp", "logstashFilter", "logstashIf", "logstashInput", "logstashOutput", "logstashQueue", "queue", "machineLearningApp", "magnet", "magnify", "magnifyExclamation", "magnifyMinus", "magnifyPlus", "magnifyWithExclamation", "magnifyWithMinus", "magnifyWithPlus", "managementApp", "map", "mapMarker", "waypoint", "megaphone", "memory", "menu", "menuDown", "menuLeft", "menuRight", "menuUp", "merge", "metricbeatApp", "metricsApp", "minimize", "minus", "minusCircle", "minusInCircle", "minusInCircleFilled", "minusInSquare", "minusSquare", "mobile", "monitoringApp", "moon", "move", "namespace", "nested", "newChat", "node", "vectorTriangle", "notebookApp", "number", "offline", "wifiSlash", "online", "wifi", "outlierDetectionJob", "package", "packetbeatApp", "pageSelect", "pagesSelect", "palette", "paperClip", "partial", "pause", "payment", "pencil", "percent", "pin", "pinFill", "pinFilled", "pipeBreaks", "pipelineApp", "pipeNoBreaks", "pivot", "play", "playFilled", "plugs", "plus", "plusCircle", "plusInCircle", "plusInCircleFilled", "plusInSquare", "plusSquare", "popout", "presentation", "productRobot", "productAgent", "productCloudInfra", "productDashboard", "productDiscover", "productML", "productStreamsClassic", "productStreamsWired", "push", "send", "question", "quote", "radar", "readOnly", "recentlyViewedApp", "refresh", "regressionJob", "reporter", "reportingApp", "return", "returnKey", "save", "savedObjectsApp", "scale", "search", "searchProfilerApp", "section", "securityAnalyticsApp", "securityApp", "securitySignal", "securitySignalDetected", "securitySignalResolved", "server", "sessionViewer", "shard", "share", "significantEvents", "singleMetricViewer", "snowflake", "sortAscending", "sortDescending", "sortDown", "sortLeft", "sortRight", "sortUp", "sortable", "spaces", "spacesApp", "sparkles", "sqlApp", "star", "starEmpty", "starEmptySpace", "starFill", "starFilled", "starFillSpace", "starFilledSpace", "starMinusEmpty", "starMinusFill", "starMinusFilled", "starPlusEmpty", "starPlusFill", "starPlusFilled", "stats", "stop", "stopFill", "stopFilled", "stopSlash", "storage", "streamsClassic", "streamsWired", "string", "submodule", "sun", "swatchInput", "symlink", "tableDensityCompact", "tableDensityHigh", "tableDensityExpanded", "tableDensityLow", "tableDensityNormal", "tableOfContents", "tag", "tear", "temperature", "thermometer", "thumbDown", "thumbUp", "timeline", "timelineWithArrow", "timelionApp", "timeRefresh", "refreshTime", "timeslider", "training", "transitionBottomIn", "transitionBottomOut", "transitionLeftIn", "transitionLeftOut", "transitionTopIn", "transitionTopOut", "trash", "unfold", "unlink", "upgradeAssistantApp", "uptimeApp", "user", "userAvatar", "users", "usersRolesApp", "unarchive", "vector", "vectorSquare", "videoPlayer", "visArea", "visAreaStacked", "visBarHorizontal", "visBarHorizontalStacked", "visBarVertical", "visBarVerticalStacked", "visGauge", "visGoal", "visLine", "visMapCoordinate", "visMapRegion", "visMetric", "chartMetric", "visPie", "visTable", "visTagCloud", "visText", "visTimelion", "visVega", "visVisualBuilder", "visualizeApp", "vulnerabilityManagementApp", "warning", "warningFilled", "warningFill", "watchesApp", "web", "wordWrap", "wordWrapDisabled", "workflowsApp", "workflow", "workplaceSearchApp", "wrench", "tokenAlias", "tokenAnnotation", "tokenArray", "tokenBinary", "tokenBoolean", "tokenClass", "tokenCompletionSuggester", "tokenConstant", "tokenDate", "tokenDimension", "tokenElement", "tokenEnum", "tokenEnumMember", "tokenEvent", "tokenException", "tokenField", "tokenFile", "tokenFlattened", "tokenFunction", "tokenGeo", "tokenHistogram", "tokenInterface", "tokenIP", "tokenJoin", "tokenKey", "tokenKeyword", "tokenMethod", "tokenMetricCounter", "tokenMetricGauge", "tokenModule", "tokenNamespace", "tokenNested", "tokenNull", "tokenNumber", "tokenObject", "tokenOperator", "tokenPackage", "tokenParameter", "tokenPercolator", "tokenProperty", "tokenRange", "tokenRankFeature", "tokenRankFeatures", "tokenRepo", "tokenSearchType", "tokenSemanticText", "tokenShape", "tokenString", "tokenStruct", "tokenSymbol", "tokenTag", "tokenText", "tokenTokenCount", "tokenVariable", "tokenVectorDense", "tokenDenseVector", "tokenVectorSparse"]).isRequired, PropTypes.string.isRequired, PropTypes.elementType.isRequired]).isRequired,
|
|
156
|
-
side: PropTypes.any,
|
|
157
|
-
color: PropTypes.oneOfType([PropTypes.string.isRequired, PropTypes.any.isRequired]),
|
|
158
|
-
ref: PropTypes.oneOfType([PropTypes.string.isRequired, PropTypes.func.isRequired])
|
|
159
|
-
}).isRequired]),
|
|
160
|
-
side: PropTypes.any,
|
|
161
|
-
iconsPosition: PropTypes.oneOf(["absolute", "static"]),
|
|
162
|
-
clear: PropTypes.shape({
|
|
163
|
-
className: PropTypes.string,
|
|
164
|
-
"aria-label": PropTypes.string,
|
|
165
|
-
"data-test-subj": PropTypes.string,
|
|
166
|
-
css: PropTypes.any,
|
|
167
|
-
size: PropTypes.oneOf(["s", "m"])
|
|
168
|
-
}),
|
|
169
|
-
isLoading: PropTypes.bool,
|
|
170
|
-
isInvalid: PropTypes.bool,
|
|
171
|
-
isDropdown: PropTypes.bool,
|
|
172
|
-
compressed: PropTypes.bool,
|
|
173
|
-
isDisabled: PropTypes.bool
|
|
71
|
+
// Normalize the icon to an object if it's a string.
|
|
72
|
+
var iconProps = isIconShape(icon) ? icon : {
|
|
73
|
+
type: icon
|
|
74
|
+
};
|
|
75
|
+
var iconRef = iconProps.ref,
|
|
76
|
+
side = iconProps.side,
|
|
77
|
+
iconRest = _objectWithoutProperties(iconProps, _excluded);
|
|
78
|
+
return ___EmotionJSX(EuiFormControlLayoutCustomIcon, _extends({
|
|
79
|
+
size: "m",
|
|
80
|
+
disabled: isDisabled,
|
|
81
|
+
iconRef: iconRef
|
|
82
|
+
}, iconRest));
|
|
83
|
+
};
|
|
84
|
+
var DropdownIcon = function DropdownIcon(_ref3) {
|
|
85
|
+
var isDropdown = _ref3.isDropdown,
|
|
86
|
+
isDisabled = _ref3.isDisabled;
|
|
87
|
+
if (!isDropdown) {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
return ___EmotionJSX(EuiFormControlLayoutCustomIcon, {
|
|
91
|
+
size: "m",
|
|
92
|
+
disabled: isDisabled,
|
|
93
|
+
type: "chevronSingleDown"
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
var LoadingSpinner = function LoadingSpinner(_ref4) {
|
|
97
|
+
var isLoading = _ref4.isLoading;
|
|
98
|
+
if (!isLoading) {
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
return ___EmotionJSX(EuiLoadingSpinner, {
|
|
102
|
+
size: "m"
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
var ClearButton = function ClearButton(_ref5) {
|
|
106
|
+
var clear = _ref5.clear,
|
|
107
|
+
isDisabled = _ref5.isDisabled;
|
|
108
|
+
if (!clear) {
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
return ___EmotionJSX(EuiFormControlLayoutClearButton, _extends({
|
|
112
|
+
size: "m",
|
|
113
|
+
disabled: isDisabled
|
|
114
|
+
}, clear));
|
|
115
|
+
};
|
|
116
|
+
var InvalidIcon = function InvalidIcon(_ref6) {
|
|
117
|
+
var isInvalid = _ref6.isInvalid;
|
|
118
|
+
if (!isInvalid) {
|
|
119
|
+
return null;
|
|
120
|
+
}
|
|
121
|
+
return ___EmotionJSX(EuiIcon, {
|
|
122
|
+
size: "m",
|
|
123
|
+
color: "danger",
|
|
124
|
+
type: "warning"
|
|
125
|
+
});
|
|
174
126
|
};
|
|
@@ -12,7 +12,7 @@ export var euiSelectStyles = function euiSelectStyles(euiThemeContext) {
|
|
|
12
12
|
var formStyles = euiFormControlStyles(euiThemeContext);
|
|
13
13
|
var formVariables = euiFormVariables(euiThemeContext);
|
|
14
14
|
return {
|
|
15
|
-
euiSelect: /*#__PURE__*/css("appearance:none;", formStyles.shared, " &:invalid{", formStyles.invalid, ";}&:focus{", formStyles.focus, ";}&:disabled{", formStyles.disabled, ";}&[readOnly]{", formStyles.readOnly, ";}&:autofill{", formStyles.autoFill, ";};label:euiSelect;"),
|
|
15
|
+
euiSelect: /*#__PURE__*/css("appearance:none;", formStyles.shared, " &:is(:invalid, [aria-invalid='true']){", formStyles.invalid, ";}&:focus{", formStyles.focus, ";}&:disabled{", formStyles.disabled, ";}&[readOnly]{", formStyles.readOnly, ";}&:autofill{", formStyles.autoFill, ";};label:euiSelect;"),
|
|
16
16
|
// Skip the css() on the default height to avoid generating a className
|
|
17
17
|
uncompressed: formStyles.uncompressed,
|
|
18
18
|
compressed: /*#__PURE__*/css(formStyles.compressed, ";label:compressed;"),
|
|
@@ -47,7 +47,7 @@ export var euiTextAreaStyles = function euiTextAreaStyles(euiThemeContext) {
|
|
|
47
47
|
var formStyles = euiFormControlStyles(euiThemeContext);
|
|
48
48
|
var formVars = euiFormVariables(euiThemeContext);
|
|
49
49
|
return {
|
|
50
|
-
euiTextArea: /*#__PURE__*/css(formStyles.shared, "line-height:", euiTheme.font.lineHeightMultiplier, ";/* <textarea>s default to 'inline-block', which causes an extra 2-3px of\n * unnecessary height within its parent 'block' form control wrapper.\n * @see https://stackoverflow.com/a/27536461/4294462 */display:block;&:invalid{", formStyles.invalid, ";}&:focus{", formStyles.focus, ";}&:disabled{", formStyles.disabled, ";}&[readOnly]{", formStyles.readOnly, ";}&:autofill{", formStyles.autoFill, ";};label:euiTextArea;"),
|
|
50
|
+
euiTextArea: /*#__PURE__*/css(formStyles.shared, "line-height:", euiTheme.font.lineHeightMultiplier, ";/* <textarea>s default to 'inline-block', which causes an extra 2-3px of\n * unnecessary height within its parent 'block' form control wrapper.\n * @see https://stackoverflow.com/a/27536461/4294462 */display:block;&:is(:invalid, [aria-invalid='true']){", formStyles.invalid, ";}&:focus{", formStyles.focus, ";}&:disabled{", formStyles.disabled, ";}&[readOnly]{", formStyles.readOnly, ";}&:autofill{", formStyles.autoFill, ";};label:euiTextArea;"),
|
|
51
51
|
resize: {
|
|
52
52
|
vertical: _ref4,
|
|
53
53
|
horizontal: _ref3,
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
2
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
5
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
-
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
7
1
|
/*
|
|
8
2
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
9
3
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -12,43 +6,24 @@ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
|
12
6
|
* Side Public License, v 1.
|
|
13
7
|
*/
|
|
14
8
|
|
|
15
|
-
import { Children, cloneElement,
|
|
16
|
-
import PropTypes from "prop-types";
|
|
17
|
-
function isMutableRef(ref) {
|
|
18
|
-
return ref != null && ref.hasOwnProperty('current');
|
|
19
|
-
}
|
|
9
|
+
import { Children, cloneElement, useEffect } from 'react';
|
|
20
10
|
|
|
21
11
|
/**
|
|
22
12
|
* The `EuiValidatableControl` component should be used in scenarios where
|
|
23
13
|
* we can render the validated `<input>` as its direct child.
|
|
14
|
+
*
|
|
15
|
+
* It flags the underlying control as invalid via `aria-invalid`, which EUI form
|
|
16
|
+
* controls use to render their invalid styling. Note that it intentionally does
|
|
17
|
+
* *not* hook into the native constraint validation API (`setCustomValidity`) -
|
|
18
|
+
* `isInvalid` is a presentational prop, and tying it to native validity would
|
|
19
|
+
* block native form submission and surface a non-localized native error tooltip.
|
|
24
20
|
*/
|
|
25
|
-
|
|
21
|
+
import PropTypes from "prop-types";
|
|
26
22
|
export var EuiValidatableControl = function EuiValidatableControl(_ref) {
|
|
27
23
|
var isInvalid = _ref.isInvalid,
|
|
28
24
|
children = _ref.children;
|
|
29
|
-
// Note that this must be state and not a ref to cause a rerender/set invalid state on initial mount
|
|
30
|
-
var _useState = useState(null),
|
|
31
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
32
|
-
control = _useState2[0],
|
|
33
|
-
setControl = _useState2[1];
|
|
34
25
|
var child = Children.only(children);
|
|
35
|
-
var childRef = child.ref;
|
|
36
|
-
var replacedRef = useCallback(function (element) {
|
|
37
|
-
setControl(element);
|
|
38
|
-
|
|
39
|
-
// Call the original ref, if any
|
|
40
|
-
if (typeof childRef === 'function') {
|
|
41
|
-
childRef(element);
|
|
42
|
-
} else if (isMutableRef(childRef)) {
|
|
43
|
-
childRef.current = element;
|
|
44
|
-
}
|
|
45
|
-
}, [childRef]);
|
|
46
|
-
useSetControlValidity({
|
|
47
|
-
controlEl: control,
|
|
48
|
-
isInvalid: isInvalid
|
|
49
|
-
});
|
|
50
26
|
return /*#__PURE__*/cloneElement(child, {
|
|
51
|
-
ref: replacedRef,
|
|
52
27
|
'aria-invalid': isInvalid || child.props['aria-invalid']
|
|
53
28
|
});
|
|
54
29
|
};
|
|
@@ -71,10 +46,6 @@ EuiValidatableControl.propTypes = {
|
|
|
71
46
|
export var useEuiValidatableControl = function useEuiValidatableControl(_ref2) {
|
|
72
47
|
var isInvalid = _ref2.isInvalid,
|
|
73
48
|
controlEl = _ref2.controlEl;
|
|
74
|
-
useSetControlValidity({
|
|
75
|
-
controlEl: controlEl,
|
|
76
|
-
isInvalid: isInvalid
|
|
77
|
-
});
|
|
78
49
|
useEffect(function () {
|
|
79
50
|
if (!controlEl) return;
|
|
80
51
|
if (typeof isInvalid === 'boolean') {
|
|
@@ -83,22 +54,4 @@ export var useEuiValidatableControl = function useEuiValidatableControl(_ref2) {
|
|
|
83
54
|
controlEl.removeAttribute('aria-invalid');
|
|
84
55
|
}
|
|
85
56
|
}, [isInvalid, controlEl]);
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Internal `setCustomValidity` helper
|
|
90
|
-
*/
|
|
91
|
-
var useSetControlValidity = function useSetControlValidity(_ref3) {
|
|
92
|
-
var controlEl = _ref3.controlEl,
|
|
93
|
-
isInvalid = _ref3.isInvalid;
|
|
94
|
-
useEffect(function () {
|
|
95
|
-
if (controlEl == null || typeof controlEl.setCustomValidity !== 'function') {
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
if (isInvalid) {
|
|
99
|
-
controlEl.setCustomValidity('Invalid');
|
|
100
|
-
} else {
|
|
101
|
-
controlEl.setCustomValidity('');
|
|
102
|
-
}
|
|
103
|
-
}, [isInvalid, controlEl]);
|
|
104
57
|
};
|