@elastic/eui 116.3.0 → 116.3.1-snapshot.1782218964187
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/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/form_control_layout/form_control_layout_icons.js +95 -143
- package/es/components/notification_icon/assets/info_fill.js +34 -0
- package/es/components/notification_icon/assets/warning_static.js +40 -0
- package/es/components/notification_icon/notification_icon.js +87 -0
- package/es/components/notification_icon/notification_icon.styles.js +22 -0
- 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/toast/global_toast_list.js +132 -6
- package/es/components/toast/global_toast_list.styles.js +31 -7
- package/es/components/toast/toast.js +242 -47
- package/es/components/toast/toast.styles.js +35 -47
- package/es/components/toast/toast_action.js +34 -0
- package/es/components/toast/types.js +9 -0
- 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 +811 -552
- package/i18ntokens.json +981 -927
- 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/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/form_control_layout/form_control_layout_icons.js +95 -145
- package/lib/components/notification_icon/assets/info_fill.js +41 -0
- package/lib/components/notification_icon/assets/warning_static.js +47 -0
- package/lib/components/notification_icon/notification_icon.js +93 -0
- package/lib/components/notification_icon/notification_icon.styles.js +28 -0
- package/lib/components/notification_icon/svgs/info_fill.svg +3 -0
- package/lib/components/notification_icon/svgs/warning_static.svg +5 -0
- 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/toast/global_toast_list.js +132 -6
- package/lib/components/toast/global_toast_list.styles.js +31 -8
- package/lib/components/toast/toast.js +244 -47
- package/lib/components/toast/toast.styles.js +32 -45
- package/lib/components/toast/toast_action.js +40 -0
- package/lib/components/toast/types.js +15 -0
- 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/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/form_control_layout/form_control_layout_icons.js +96 -115
- package/optimize/es/components/notification_icon/assets/info_fill.js +33 -0
- package/optimize/es/components/notification_icon/assets/warning_static.js +39 -0
- package/optimize/es/components/notification_icon/notification_icon.js +77 -0
- package/optimize/es/components/notification_icon/notification_icon.styles.js +22 -0
- 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/toast/global_toast_list.js +31 -6
- package/optimize/es/components/toast/global_toast_list.styles.js +31 -7
- package/optimize/es/components/toast/toast.js +143 -47
- package/optimize/es/components/toast/toast.styles.js +35 -47
- package/optimize/es/components/toast/toast_action.js +33 -0
- package/optimize/es/components/toast/types.js +9 -0
- 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/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/form_control_layout/form_control_layout_icons.js +96 -117
- package/optimize/lib/components/notification_icon/assets/info_fill.js +41 -0
- package/optimize/lib/components/notification_icon/assets/warning_static.js +47 -0
- package/optimize/lib/components/notification_icon/notification_icon.js +83 -0
- package/optimize/lib/components/notification_icon/notification_icon.styles.js +28 -0
- package/optimize/lib/components/notification_icon/svgs/info_fill.svg +3 -0
- package/optimize/lib/components/notification_icon/svgs/warning_static.svg +5 -0
- 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/toast/global_toast_list.js +31 -6
- package/optimize/lib/components/toast/global_toast_list.styles.js +30 -7
- package/optimize/lib/components/toast/toast.js +146 -47
- package/optimize/lib/components/toast/toast.styles.js +33 -45
- package/optimize/lib/components/toast/toast_action.js +39 -0
- package/optimize/lib/components/toast/types.js +15 -0
- 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 +9 -6
- 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/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/form_control_layout/form_control_layout_icons.js +95 -139
- package/test-env/components/notification_icon/assets/info_fill.js +41 -0
- package/test-env/components/notification_icon/assets/warning_static.js +47 -0
- package/test-env/components/notification_icon/notification_icon.js +46 -0
- package/test-env/components/notification_icon/notification_icon.styles.js +28 -0
- 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/toast/global_toast_list.js +132 -6
- package/test-env/components/toast/global_toast_list.styles.js +30 -7
- package/test-env/components/toast/toast.js +242 -47
- package/test-env/components/toast/toast.styles.js +33 -45
- package/test-env/components/toast/toast_action.js +39 -0
- package/test-env/components/toast/types.js +15 -0
- 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
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
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); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.EuiRefreshInterval = void 0;
|
|
7
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _services = require("../../../services");
|
|
10
10
|
var _i18n = require("../../i18n");
|
|
11
11
|
var _flex = require("../../flex");
|
|
@@ -14,31 +14,19 @@ var _accessibility = require("../../accessibility");
|
|
|
14
14
|
var _time_options = require("../super_date_picker/time_options");
|
|
15
15
|
var _quick_select_panel = require("../super_date_picker/quick_select_popover/quick_select_panel");
|
|
16
16
|
var _react2 = require("@emotion/react");
|
|
17
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
18
17
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
19
18
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
20
|
-
function
|
|
19
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
20
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
21
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
22
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
23
|
+
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); }
|
|
21
24
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
22
25
|
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."); }
|
|
23
26
|
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; } }
|
|
24
27
|
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; }
|
|
25
28
|
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; } }
|
|
26
|
-
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
27
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
28
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
29
|
-
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
30
|
-
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); } }
|
|
31
|
-
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
32
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
33
|
-
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); }
|
|
34
|
-
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
35
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
36
|
-
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
37
|
-
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); }
|
|
38
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
39
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
40
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
41
|
-
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); } /*
|
|
29
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } /*
|
|
42
30
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
43
31
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
44
32
|
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
@@ -86,223 +74,181 @@ var getMinInterval = function getMinInterval(minInterval, unit) {
|
|
|
86
74
|
value = _fromMilliseconds.value;
|
|
87
75
|
return Math.floor(value || 0);
|
|
88
76
|
};
|
|
89
|
-
var EuiRefreshInterval = exports.EuiRefreshInterval =
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
77
|
+
var EuiRefreshInterval = exports.EuiRefreshInterval = function EuiRefreshInterval(_ref) {
|
|
78
|
+
var _ref$isPaused = _ref.isPaused,
|
|
79
|
+
isPaused = _ref$isPaused === void 0 ? true : _ref$isPaused,
|
|
80
|
+
_ref$refreshInterval = _ref.refreshInterval,
|
|
81
|
+
refreshInterval = _ref$refreshInterval === void 0 ? 1000 : _ref$refreshInterval,
|
|
82
|
+
_ref$minInterval = _ref.minInterval,
|
|
83
|
+
minInterval = _ref$minInterval === void 0 ? 0 : _ref$minInterval,
|
|
84
|
+
intervalUnits = _ref.intervalUnits,
|
|
85
|
+
onRefreshChange = _ref.onRefreshChange;
|
|
86
|
+
var _useState = (0, _react.useState)(function () {
|
|
87
|
+
return _objectSpread(_objectSpread({}, fromMilliseconds(refreshInterval || 0, intervalUnits)), {}, {
|
|
88
|
+
min: getMinInterval(minInterval, intervalUnits)
|
|
89
|
+
});
|
|
90
|
+
}),
|
|
91
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
92
|
+
state = _useState2[0],
|
|
93
|
+
setState = _useState2[1];
|
|
94
|
+
var refreshSelectionId = (0, _services.useGeneratedHtmlId)({
|
|
95
|
+
prefix: 'euiRefreshInterval'
|
|
96
|
+
});
|
|
97
|
+
var _useI18nTimeOptions = (0, _time_options.useI18nTimeOptions)(),
|
|
98
|
+
refreshUnitsOptions = _useI18nTimeOptions.refreshUnitsOptions;
|
|
99
|
+
var applyRefreshInterval = function applyRefreshInterval(nextState) {
|
|
100
|
+
var units = nextState.units,
|
|
101
|
+
value = nextState.value;
|
|
102
|
+
if (value === '') {
|
|
103
|
+
return;
|
|
95
104
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
_this.setState({
|
|
105
|
-
value: isNaN(sanitizedValue) ? '' : sanitizedValue
|
|
106
|
-
}, _this.applyRefreshInterval);
|
|
107
|
-
});
|
|
108
|
-
_defineProperty(_this, "onUnitsChange", function (event) {
|
|
109
|
-
var units = event.target.value;
|
|
110
|
-
_this.setState({
|
|
111
|
-
units: units,
|
|
112
|
-
min: getMinInterval(_this.props.minInterval, units)
|
|
113
|
-
}, _this.applyRefreshInterval);
|
|
114
|
-
});
|
|
115
|
-
_defineProperty(_this, "startRefresh", function () {
|
|
116
|
-
var onRefreshChange = _this.props.onRefreshChange;
|
|
117
|
-
var _this$state = _this.state,
|
|
118
|
-
value = _this$state.value,
|
|
119
|
-
units = _this$state.units;
|
|
120
|
-
if (value !== '' && value > 0 && onRefreshChange !== undefined) {
|
|
121
|
-
onRefreshChange({
|
|
122
|
-
refreshInterval: toMilliseconds(units, value),
|
|
123
|
-
intervalUnits: units,
|
|
124
|
-
isPaused: false
|
|
125
|
-
});
|
|
126
|
-
}
|
|
105
|
+
if (!onRefreshChange) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
var refreshIntervalMs = Math.max(toMilliseconds(units, value), minInterval || 0);
|
|
109
|
+
onRefreshChange({
|
|
110
|
+
refreshInterval: refreshIntervalMs,
|
|
111
|
+
intervalUnits: units,
|
|
112
|
+
isPaused: refreshIntervalMs <= 0 ? true : !!isPaused
|
|
127
113
|
});
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
114
|
+
};
|
|
115
|
+
var onValueChange = function onValueChange(event) {
|
|
116
|
+
var sanitizedValue = parseFloat(event.target.value);
|
|
117
|
+
var newValue = isNaN(sanitizedValue) ? '' : sanitizedValue;
|
|
118
|
+
var nextState = _objectSpread(_objectSpread({}, state), {}, {
|
|
119
|
+
value: newValue
|
|
133
120
|
});
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
if (value === '') {
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
if (!onRefreshChange) {
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
var refreshInterval = Math.max(toMilliseconds(units, value), minInterval || 0);
|
|
149
|
-
onRefreshChange({
|
|
150
|
-
refreshInterval: refreshInterval,
|
|
151
|
-
intervalUnits: units,
|
|
152
|
-
isPaused: refreshInterval <= 0 ? true : !!isPaused
|
|
153
|
-
});
|
|
121
|
+
setState(nextState);
|
|
122
|
+
applyRefreshInterval(nextState);
|
|
123
|
+
};
|
|
124
|
+
var onUnitsChange = function onUnitsChange(event) {
|
|
125
|
+
var units = event.target.value;
|
|
126
|
+
var nextState = _objectSpread(_objectSpread({}, state), {}, {
|
|
127
|
+
units: units,
|
|
128
|
+
min: getMinInterval(minInterval, units)
|
|
154
129
|
});
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
if (!onRefreshChange || value === '') {
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
130
|
+
setState(nextState);
|
|
131
|
+
applyRefreshInterval(nextState);
|
|
132
|
+
};
|
|
133
|
+
var startRefresh = function startRefresh() {
|
|
134
|
+
var value = state.value,
|
|
135
|
+
units = state.units;
|
|
136
|
+
if (value !== '' && value > 0 && onRefreshChange !== undefined) {
|
|
165
137
|
onRefreshChange({
|
|
166
138
|
refreshInterval: toMilliseconds(units, value),
|
|
167
139
|
intervalUnits: units,
|
|
168
|
-
isPaused:
|
|
140
|
+
isPaused: false
|
|
169
141
|
});
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
var handleKeyDown = function handleKeyDown(_ref2) {
|
|
145
|
+
var key = _ref2.key;
|
|
146
|
+
if (key === 'Enter') {
|
|
147
|
+
startRefresh();
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
var toggleRefresh = function toggleRefresh() {
|
|
151
|
+
if (!onRefreshChange || state.value === '') {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
var units = state.units,
|
|
155
|
+
value = state.value;
|
|
156
|
+
onRefreshChange({
|
|
157
|
+
refreshInterval: toMilliseconds(units, value),
|
|
158
|
+
intervalUnits: units,
|
|
159
|
+
isPaused: !isPaused
|
|
170
160
|
});
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
var
|
|
177
|
-
|
|
178
|
-
return value === units;
|
|
179
|
-
});
|
|
180
|
-
var optionText = options ? options.text : '';
|
|
181
|
-
var fullDescription = isPaused ? (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
182
|
-
token: "euiRefreshInterval.fullDescriptionOff",
|
|
183
|
-
default: "Refresh is off, interval set to {optionValue} {optionText}.",
|
|
184
|
-
values: {
|
|
185
|
-
optionValue: value,
|
|
186
|
-
optionText: optionText
|
|
187
|
-
}
|
|
188
|
-
}) : (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
189
|
-
token: "euiRefreshInterval.fullDescriptionOn",
|
|
190
|
-
default: "Refresh is on, interval set to {optionValue} {optionText}.",
|
|
191
|
-
values: {
|
|
192
|
-
optionValue: value,
|
|
193
|
-
optionText: optionText
|
|
194
|
-
}
|
|
195
|
-
});
|
|
196
|
-
return (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("p", {
|
|
197
|
-
id: _this.refreshSelectionId
|
|
198
|
-
}, fullDescription));
|
|
161
|
+
};
|
|
162
|
+
var renderScreenReaderText = function renderScreenReaderText() {
|
|
163
|
+
var value = state.value,
|
|
164
|
+
units = state.units;
|
|
165
|
+
var options = refreshUnitsOptions.find(function (_ref3) {
|
|
166
|
+
var value = _ref3.value;
|
|
167
|
+
return value === units;
|
|
199
168
|
});
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
});
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
* Is refresh paused or running.
|
|
287
|
-
*/
|
|
288
|
-
isPaused: _propTypes.default.bool,
|
|
289
|
-
/**
|
|
290
|
-
* Refresh interval in milliseconds.
|
|
291
|
-
*/
|
|
292
|
-
refreshInterval: _propTypes.default.number,
|
|
293
|
-
/**
|
|
294
|
-
* Allows specifying a minimum interval in milliseconds
|
|
295
|
-
*/
|
|
296
|
-
minInterval: _propTypes.default.number,
|
|
297
|
-
/**
|
|
298
|
-
* By default, refresh interval units will be rounded up to next largest unit of time
|
|
299
|
-
* (for example, 90 seconds will become 2m).
|
|
300
|
-
*
|
|
301
|
-
* If you do not want this behavior, you can manually control the rendered unit via this prop.
|
|
302
|
-
*/
|
|
303
|
-
intervalUnits: _propTypes.default.any,
|
|
304
|
-
/**
|
|
305
|
-
* Passes back the updated state of `isPaused`, `refreshInterval`, and `intervalUnits`.
|
|
306
|
-
*/
|
|
307
|
-
onRefreshChange: _propTypes.default.func.isRequired
|
|
308
|
-
};
|
|
169
|
+
var optionText = options ? options.text : '';
|
|
170
|
+
var fullDescription = isPaused ? (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
171
|
+
token: "euiRefreshInterval.fullDescriptionOff",
|
|
172
|
+
default: "Refresh is off, interval set to {optionValue} {optionText}.",
|
|
173
|
+
values: {
|
|
174
|
+
optionValue: value,
|
|
175
|
+
optionText: optionText
|
|
176
|
+
}
|
|
177
|
+
}) : (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
178
|
+
token: "euiRefreshInterval.fullDescriptionOn",
|
|
179
|
+
default: "Refresh is on, interval set to {optionValue} {optionText}.",
|
|
180
|
+
values: {
|
|
181
|
+
optionValue: value,
|
|
182
|
+
optionText: optionText
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
return (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("p", {
|
|
186
|
+
id: refreshSelectionId
|
|
187
|
+
}, fullDescription));
|
|
188
|
+
};
|
|
189
|
+
var value = state.value,
|
|
190
|
+
units = state.units,
|
|
191
|
+
min = state.min;
|
|
192
|
+
return (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
193
|
+
tokens: ['euiRefreshInterval.toggleLabel', 'euiRefreshInterval.toggleAriaLabel', 'euiRefreshInterval.valueAriaLabel', 'euiRefreshInterval.unitsAriaLabel'],
|
|
194
|
+
defaults: ['Refresh every', 'Toggle refresh', 'Refresh interval value', 'Refresh interval units']
|
|
195
|
+
}, function (_ref4) {
|
|
196
|
+
var _ref5 = _slicedToArray(_ref4, 4),
|
|
197
|
+
toggleLabel = _ref5[0],
|
|
198
|
+
toggleAriaLabel = _ref5[1],
|
|
199
|
+
valueAriaLabel = _ref5[2],
|
|
200
|
+
unitsAriaLabel = _ref5[3];
|
|
201
|
+
return (0, _react2.jsx)(_quick_select_panel.EuiQuickSelectPanel, null, (0, _react2.jsx)(_flex.EuiFlexGroup, {
|
|
202
|
+
alignItems: "center",
|
|
203
|
+
gutterSize: "s",
|
|
204
|
+
responsive: false,
|
|
205
|
+
wrap: true
|
|
206
|
+
}, (0, _react2.jsx)(_flex.EuiFlexItem, {
|
|
207
|
+
grow: false
|
|
208
|
+
}, (0, _react2.jsx)(_form.EuiSwitch, {
|
|
209
|
+
"data-test-subj": "superDatePickerToggleRefreshButton",
|
|
210
|
+
checked: !isPaused,
|
|
211
|
+
onChange: toggleRefresh,
|
|
212
|
+
compressed: true
|
|
213
|
+
// The IDs attached to this visible label are unused - we override with our own aria-label
|
|
214
|
+
,
|
|
215
|
+
label: (0, _react2.jsx)(_form.EuiFormLabel, null, toggleLabel),
|
|
216
|
+
"aria-label": toggleAriaLabel,
|
|
217
|
+
"aria-labelledby": undefined,
|
|
218
|
+
"aria-describedby": refreshSelectionId
|
|
219
|
+
})), (0, _react2.jsx)(_flex.EuiFlexItem, {
|
|
220
|
+
style: {
|
|
221
|
+
minWidth: 60
|
|
222
|
+
}
|
|
223
|
+
}, (0, _react2.jsx)(_form.EuiFieldNumber, {
|
|
224
|
+
compressed: true,
|
|
225
|
+
fullWidth: true,
|
|
226
|
+
value: value,
|
|
227
|
+
min: min,
|
|
228
|
+
onChange: onValueChange,
|
|
229
|
+
onKeyDown: handleKeyDown,
|
|
230
|
+
isInvalid: !isPaused && (value === '' || value <= 0),
|
|
231
|
+
disabled: isPaused,
|
|
232
|
+
"aria-label": valueAriaLabel,
|
|
233
|
+
"aria-describedby": refreshSelectionId,
|
|
234
|
+
"data-test-subj": "superDatePickerRefreshIntervalInput"
|
|
235
|
+
})), (0, _react2.jsx)(_flex.EuiFlexItem, {
|
|
236
|
+
style: {
|
|
237
|
+
minWidth: 100
|
|
238
|
+
},
|
|
239
|
+
grow: 2
|
|
240
|
+
}, (0, _react2.jsx)(_form.EuiSelect, {
|
|
241
|
+
compressed: true,
|
|
242
|
+
fullWidth: true,
|
|
243
|
+
"aria-label": unitsAriaLabel,
|
|
244
|
+
"aria-describedby": refreshSelectionId,
|
|
245
|
+
value: units,
|
|
246
|
+
disabled: isPaused,
|
|
247
|
+
options: refreshUnitsOptions,
|
|
248
|
+
onChange: onUnitsChange,
|
|
249
|
+
onKeyDown: handleKeyDown,
|
|
250
|
+
"data-test-subj": "superDatePickerRefreshIntervalUnitsSelect"
|
|
251
|
+
}))), renderScreenReaderText());
|
|
252
|
+
});
|
|
253
|
+
};
|
|
254
|
+
EuiRefreshInterval.displayName = 'EuiRefreshInterval';
|
|
@@ -414,8 +414,10 @@ var EuiFlyoutComponent = exports.EuiFlyoutComponent = /*#__PURE__*/(0, _react.fo
|
|
|
414
414
|
// Main flyout with child flyout - don't close on ESC
|
|
415
415
|
return false;
|
|
416
416
|
}, [isInManagedContext, hasChildFlyout, isChildFlyout]);
|
|
417
|
-
var handleClose = (0, _react.useCallback)(function (event) {
|
|
418
|
-
onClose(event
|
|
417
|
+
var handleClose = (0, _react.useCallback)(function (event, reason) {
|
|
418
|
+
onClose(event, reason ? {
|
|
419
|
+
reason: reason
|
|
420
|
+
} : undefined);
|
|
419
421
|
}, [onClose]);
|
|
420
422
|
|
|
421
423
|
/**
|
|
@@ -424,7 +426,7 @@ var EuiFlyoutComponent = exports.EuiFlyoutComponent = /*#__PURE__*/(0, _react.fo
|
|
|
424
426
|
var onKeyDown = (0, _react.useCallback)(function (event) {
|
|
425
427
|
if (!isPushed && event.key === _services.keys.ESCAPE && shouldCloseOnEscape) {
|
|
426
428
|
event.preventDefault();
|
|
427
|
-
handleClose(event);
|
|
429
|
+
handleClose(event, 'escape');
|
|
428
430
|
}
|
|
429
431
|
}, [handleClose, isPushed, shouldCloseOnEscape]);
|
|
430
432
|
var managedFlyoutIndex = currentZIndexRef.current;
|
|
@@ -658,10 +660,10 @@ var EuiFlyoutComponent = exports.EuiFlyoutComponent = /*#__PURE__*/(0, _react.fo
|
|
|
658
660
|
if (outsideClickCloses === false) return undefined;
|
|
659
661
|
if (hasOverlayMask) {
|
|
660
662
|
// The overlay mask is present, so only clicks on the mask should close the flyout, regardless of outsideClickCloses
|
|
661
|
-
if (event.target === maskRef.current) return handleClose(event);
|
|
663
|
+
if (event.target === maskRef.current) return handleClose(event, 'outside-click');
|
|
662
664
|
} else {
|
|
663
665
|
// No overlay mask is present, so any outside clicks should close the flyout
|
|
664
|
-
if (outsideClickCloses === true) return handleClose(event);
|
|
666
|
+
if (outsideClickCloses === true) return handleClose(event, 'outside-click');
|
|
665
667
|
}
|
|
666
668
|
// Otherwise if ownFocus is false and outsideClickCloses is undefined, outside clicks should not close the flyout
|
|
667
669
|
return undefined;
|
|
@@ -713,7 +715,9 @@ var EuiFlyoutComponent = exports.EuiFlyoutComponent = /*#__PURE__*/(0, _react.fo
|
|
|
713
715
|
}), !isPushed && screenReaderDescription, shouldRenderMenu ? (0, _react2.jsx)(_flyout_menu.EuiFlyoutMenu, _extends({}, flyoutMenuProps, {
|
|
714
716
|
titleId: flyoutMenuId
|
|
715
717
|
})) : !hideCloseButton && (0, _react2.jsx)(_flyout_close_button.EuiFlyoutCloseButton, _extends({}, closeButtonProps, {
|
|
716
|
-
onClose:
|
|
718
|
+
onClose: function onClose(event) {
|
|
719
|
+
return handleClose(event, 'close-button');
|
|
720
|
+
},
|
|
717
721
|
closeButtonPosition: closeButtonPosition,
|
|
718
722
|
side: side
|
|
719
723
|
})), resizable && (0, _react2.jsx)(_flyout_resize_button.EuiFlyoutResizeButton, {
|