@elastic/eui 116.0.0 → 116.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/accordion/accordion.js +95 -134
- package/es/components/basic_table/basic_table.js +6 -0
- package/es/components/basic_table/in_memory_table.js +6 -0
- package/es/components/color_picker/color_picker_swatch.js +4 -0
- package/es/components/context_menu/context_menu_panel.js +2 -2
- package/es/components/copy/copy.js +36 -13
- package/es/components/datagrid/body/cell/data_grid_cell_popover.js +10 -7
- package/es/components/datagrid/data_grid.styles.js +6 -5
- package/es/components/focus_trap/focus_trap.js +110 -177
- package/es/components/observer/mutation_observer/mutation_observer.js +32 -35
- package/es/components/observer/resize_observer/resize_observer.js +46 -60
- package/es/components/observer/use_observer.js +62 -0
- package/es/components/table/table_header_cell.js +4 -0
- package/es/components/tool_tip/icon_tip.js +4 -0
- package/es/components/tool_tip/tool_tip.js +8 -2
- package/eui.d.ts +26 -69
- package/lib/components/accordion/accordion.js +102 -139
- package/lib/components/basic_table/basic_table.js +6 -0
- package/lib/components/basic_table/in_memory_table.js +6 -0
- package/lib/components/color_picker/color_picker_swatch.js +4 -0
- package/lib/components/context_menu/context_menu_panel.js +2 -2
- package/lib/components/copy/copy.js +35 -12
- package/lib/components/datagrid/body/cell/data_grid_cell_popover.js +10 -7
- package/lib/components/datagrid/data_grid.styles.js +6 -5
- package/lib/components/focus_trap/focus_trap.js +117 -183
- package/lib/components/observer/mutation_observer/mutation_observer.js +32 -34
- package/lib/components/observer/resize_observer/resize_observer.js +48 -61
- package/lib/components/observer/use_observer.js +68 -0
- package/lib/components/table/table_header_cell.js +4 -0
- package/lib/components/tool_tip/icon_tip.js +4 -0
- package/lib/components/tool_tip/tool_tip.js +8 -2
- package/optimize/es/components/accordion/accordion.js +88 -126
- package/optimize/es/components/context_menu/context_menu_panel.js +2 -2
- package/optimize/es/components/copy/copy.js +36 -13
- package/optimize/es/components/datagrid/body/cell/data_grid_cell_popover.js +10 -7
- package/optimize/es/components/datagrid/data_grid.styles.js +6 -5
- package/optimize/es/components/focus_trap/focus_trap.js +103 -122
- package/optimize/es/components/observer/mutation_observer/mutation_observer.js +23 -32
- package/optimize/es/components/observer/resize_observer/resize_observer.js +38 -54
- package/optimize/es/components/observer/use_observer.js +62 -0
- package/optimize/es/components/tool_tip/tool_tip.js +4 -2
- package/optimize/lib/components/accordion/accordion.js +90 -127
- package/optimize/lib/components/context_menu/context_menu_panel.js +2 -2
- package/optimize/lib/components/copy/copy.js +35 -12
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell_popover.js +10 -7
- package/optimize/lib/components/datagrid/data_grid.styles.js +6 -5
- package/optimize/lib/components/focus_trap/focus_trap.js +106 -124
- package/optimize/lib/components/observer/mutation_observer/mutation_observer.js +23 -32
- package/optimize/lib/components/observer/resize_observer/resize_observer.js +40 -54
- package/optimize/lib/components/observer/use_observer.js +68 -0
- package/optimize/lib/components/tool_tip/tool_tip.js +4 -2
- package/package.json +2 -2
- package/test-env/components/accordion/accordion.js +92 -129
- package/test-env/components/basic_table/basic_table.js +6 -0
- package/test-env/components/basic_table/in_memory_table.js +6 -0
- package/test-env/components/color_picker/color_picker_swatch.js +4 -0
- package/test-env/components/context_menu/context_menu_panel.js +2 -2
- package/test-env/components/copy/copy.js +35 -12
- package/test-env/components/datagrid/body/cell/data_grid_cell_popover.js +10 -7
- package/test-env/components/datagrid/data_grid.styles.js +6 -5
- package/test-env/components/observer/mutation_observer/mutation_observer.js +32 -32
- package/test-env/components/observer/use_observer.js +68 -0
- package/test-env/components/table/table_header_cell.js +4 -0
- package/test-env/components/tool_tip/icon_tip.js +4 -0
- package/test-env/components/tool_tip/tool_tip.js +8 -2
- package/es/components/observer/observer.js +0 -75
- package/lib/components/observer/observer.js +0 -79
- package/optimize/es/components/observer/observer.js +0 -69
- package/optimize/lib/components/observer/observer.js +0 -74
- package/test-env/components/observer/observer.js +0 -74
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["children", "className", "anchorClassName", "anchorProps", "content", "title", "display", "repositionOnScroll", "disableScreenReaderOutput", "position", "offset", "id", "onMouseOut"];
|
|
1
|
+
var _excluded = ["children", "className", "anchorClassName", "anchorProps", "content", "title", "display", "repositionOnScroll", "disableScreenReaderOutput", "position", "offset", "id", "onMouseOut", "onBlur"];
|
|
2
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); }
|
|
3
3
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
4
4
|
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."); }
|
|
@@ -73,6 +73,7 @@ export var EuiToolTip = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
73
73
|
offset = _ref.offset,
|
|
74
74
|
idProp = _ref.id,
|
|
75
75
|
onMouseOutProp = _ref.onMouseOut,
|
|
76
|
+
onBlurProp = _ref.onBlur,
|
|
76
77
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
77
78
|
var componentDefaultsContext = useContext(EuiComponentDefaultsContext);
|
|
78
79
|
var _useState = useState(false),
|
|
@@ -219,7 +220,8 @@ export var EuiToolTip = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
219
220
|
var onBlur = useCallback(function () {
|
|
220
221
|
setHasFocus(false);
|
|
221
222
|
hideToolTip();
|
|
222
|
-
|
|
223
|
+
onBlurProp === null || onBlurProp === void 0 || onBlurProp();
|
|
224
|
+
}, [hideToolTip, onBlurProp]);
|
|
223
225
|
var onEscapeKey = useCallback(function (event) {
|
|
224
226
|
if (event.key === keys.ESCAPE) {
|
|
225
227
|
// when the tooltip is only visual, we don't want it to add an additional key stop
|
|
@@ -341,6 +343,10 @@ EuiToolTip.propTypes = {
|
|
|
341
343
|
* hidden.
|
|
342
344
|
*/
|
|
343
345
|
onMouseOut: PropTypes.func,
|
|
346
|
+
/**
|
|
347
|
+
* If supplied, called when the trigger loses focus.
|
|
348
|
+
*/
|
|
349
|
+
onBlur: PropTypes.func,
|
|
344
350
|
/**
|
|
345
351
|
* Offset in pixels from the anchor. Defaults to 16.
|
|
346
352
|
*/
|
package/eui.d.ts
CHANGED
|
@@ -2058,36 +2058,27 @@ declare module '@elastic/eui/src/components/i18n' {
|
|
|
2058
2058
|
export { EuiI18nNumber } from '@elastic/eui/src/components/i18n/i18n_number';
|
|
2059
2059
|
|
|
2060
2060
|
}
|
|
2061
|
-
declare module '@elastic/eui/src/components/observer/
|
|
2062
|
-
import { Component, ReactNode } from 'react';
|
|
2063
|
-
interface BaseProps {
|
|
2064
|
-
/**
|
|
2065
|
-
* ReactNode to render as this component's content
|
|
2066
|
-
*/
|
|
2067
|
-
children: (ref: any) => ReactNode;
|
|
2068
|
-
}
|
|
2061
|
+
declare module '@elastic/eui/src/components/observer/use_observer' {
|
|
2069
2062
|
export interface Observer {
|
|
2070
2063
|
disconnect: () => void;
|
|
2071
2064
|
observe: (element: Element, options?: {
|
|
2072
2065
|
[key: string]: any;
|
|
2073
2066
|
}) => void;
|
|
2074
2067
|
}
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
export {};
|
|
2068
|
+
/**
|
|
2069
|
+
* A shared custom hook that provides a pattern for observing DOM nodes
|
|
2070
|
+
* via browser observer APIs. Used by `EuiResizeObserver` and `EuiMutationObserver`.
|
|
2071
|
+
*
|
|
2072
|
+
* @param beginObserve - A callback that receives the target DOM element and should
|
|
2073
|
+
* create and return the observer instance (e.g., `ResizeObserver`).
|
|
2074
|
+
* @param componentName - Optional name used in error messages when no ref is
|
|
2075
|
+
* attached on mount, mirroring the guard previously in `EuiObserver`.
|
|
2076
|
+
*/
|
|
2077
|
+
export const useObserver: (beginObserve: (node: Element) => Observer | undefined, componentName?: string) => (ref: Element | null) => void;
|
|
2086
2078
|
|
|
2087
2079
|
}
|
|
2088
2080
|
declare module '@elastic/eui/src/components/observer/resize_observer/resize_observer' {
|
|
2089
|
-
import { ReactNode } from 'react';
|
|
2090
|
-
import { EuiObserver } from '@elastic/eui/src/components/observer/observer';
|
|
2081
|
+
import { ReactNode, FunctionComponent } from 'react';
|
|
2091
2082
|
export interface EuiResizeObserverProps {
|
|
2092
2083
|
/**
|
|
2093
2084
|
* ReactNode to render as this component's content
|
|
@@ -2099,15 +2090,7 @@ declare module '@elastic/eui/src/components/observer/resize_observer/resize_obse
|
|
|
2099
2090
|
}) => void;
|
|
2100
2091
|
}
|
|
2101
2092
|
export const hasResizeObserver: boolean;
|
|
2102
|
-
export
|
|
2103
|
-
name: string;
|
|
2104
|
-
state: {
|
|
2105
|
-
height: number;
|
|
2106
|
-
width: number;
|
|
2107
|
-
};
|
|
2108
|
-
onResize: ResizeObserverCallback;
|
|
2109
|
-
beginObserve: () => void;
|
|
2110
|
-
}
|
|
2093
|
+
export const EuiResizeObserver: FunctionComponent<EuiResizeObserverProps>;
|
|
2111
2094
|
export const useResizeObserver: (container: Element | null, dimension?: "width" | "height") => {
|
|
2112
2095
|
width: number;
|
|
2113
2096
|
height: number;
|
|
@@ -9936,6 +9919,10 @@ declare module '@elastic/eui/src/components/tool_tip/tool_tip' {
|
|
|
9936
9919
|
* hidden.
|
|
9937
9920
|
*/
|
|
9938
9921
|
onMouseOut?: (event: ReactMouseEvent<HTMLSpanElement, MouseEvent>) => void;
|
|
9922
|
+
/**
|
|
9923
|
+
* If supplied, called when the trigger loses focus.
|
|
9924
|
+
*/
|
|
9925
|
+
onBlur?: () => void;
|
|
9939
9926
|
/**
|
|
9940
9927
|
* Offset in pixels from the anchor. Defaults to 16.
|
|
9941
9928
|
*/
|
|
@@ -16363,7 +16350,7 @@ declare module '@elastic/eui/src/components/context_menu/context_menu_panel' {
|
|
|
16363
16350
|
takeInitialFocus(): void;
|
|
16364
16351
|
reclaimPopoverFocus: () => void;
|
|
16365
16352
|
onTransitionComplete: () => void;
|
|
16366
|
-
componentDidUpdate(
|
|
16353
|
+
componentDidUpdate(prevProps: Props): void;
|
|
16367
16354
|
componentDidMount(): void;
|
|
16368
16355
|
componentWillUnmount(): void;
|
|
16369
16356
|
static getDerivedStateFromProps(nextProps: Props, prevState: State): Partial<State> | null;
|
|
@@ -19848,8 +19835,8 @@ declare module '@elastic/eui/src/components/provider/component_defaults' {
|
|
|
19848
19835
|
declare module '@elastic/eui/src/components/focus_trap/focus_trap' {
|
|
19849
19836
|
import { FunctionComponent, CSSProperties } from 'react';
|
|
19850
19837
|
import { ReactFocusOnProps } from 'react-focus-on/dist/es5/types';
|
|
19851
|
-
import { CommonProps } from '@elastic/eui/src/components/common';
|
|
19852
19838
|
import { ElementTarget } from '@elastic/eui/src/services';
|
|
19839
|
+
import { CommonProps } from '@elastic/eui/src/components/common';
|
|
19853
19840
|
export type FocusTarget = ElementTarget;
|
|
19854
19841
|
export type EuiFocusTrapProps = Omit<ReactFocusOnProps, 'enabled' | 'style' | 'className' | 'css' | 'gapMode' | 'crossFrame' | 'scrollLock' | 'noIsolation' | 'returnFocus'> & {
|
|
19855
19842
|
className?: CommonProps['className'];
|
|
@@ -19909,8 +19896,7 @@ declare module '@elastic/eui/src/components/focus_trap' {
|
|
|
19909
19896
|
|
|
19910
19897
|
}
|
|
19911
19898
|
declare module '@elastic/eui/src/components/observer/mutation_observer/mutation_observer' {
|
|
19912
|
-
import { ReactNode } from 'react';
|
|
19913
|
-
import { EuiObserver } from '@elastic/eui/src/components/observer/observer';
|
|
19899
|
+
import { ReactNode, FunctionComponent } from 'react';
|
|
19914
19900
|
export interface EuiMutationObserverProps {
|
|
19915
19901
|
/**
|
|
19916
19902
|
* ReactNode to render as this component's content
|
|
@@ -19919,11 +19905,7 @@ declare module '@elastic/eui/src/components/observer/mutation_observer/mutation_
|
|
|
19919
19905
|
onMutation: MutationCallback;
|
|
19920
19906
|
observerOptions?: MutationObserverInit;
|
|
19921
19907
|
}
|
|
19922
|
-
export
|
|
19923
|
-
name: string;
|
|
19924
|
-
onMutation: MutationCallback;
|
|
19925
|
-
beginObserve: () => void;
|
|
19926
|
-
}
|
|
19908
|
+
export const EuiMutationObserver: FunctionComponent<EuiMutationObserverProps>;
|
|
19927
19909
|
export const useMutationObserver: (container: Element | null, callback: MutationCallback, observerOptions?: MutationObserverInit) => void;
|
|
19928
19910
|
|
|
19929
19911
|
}
|
|
@@ -21751,8 +21733,7 @@ declare module '@elastic/eui/src/components/accordion/accordion.styles' {
|
|
|
21751
21733
|
|
|
21752
21734
|
}
|
|
21753
21735
|
declare module '@elastic/eui/src/components/accordion/accordion' {
|
|
21754
|
-
import
|
|
21755
|
-
import { WithEuiThemeProps } from '@elastic/eui/src/services';
|
|
21736
|
+
import { FunctionComponent, HTMLAttributes, ReactNode } from 'react';
|
|
21756
21737
|
import { CommonProps } from '@elastic/eui/src/components/common';
|
|
21757
21738
|
import type { EuiButtonIconProps } from '@elastic/eui/src/components/button';
|
|
21758
21739
|
export const PADDING_SIZES: readonly ["none", "xs", "s", "m", "l", "xl"];
|
|
@@ -21843,32 +21824,7 @@ declare module '@elastic/eui/src/components/accordion/accordion' {
|
|
|
21843
21824
|
*/
|
|
21844
21825
|
isDisabled?: boolean;
|
|
21845
21826
|
};
|
|
21846
|
-
|
|
21847
|
-
isOpen: boolean;
|
|
21848
|
-
};
|
|
21849
|
-
export class EuiAccordionClass extends Component<WithEuiThemeProps & EuiAccordionProps, EuiAccordionState> {
|
|
21850
|
-
static defaultProps: {
|
|
21851
|
-
initialIsOpen: boolean;
|
|
21852
|
-
borders: "none";
|
|
21853
|
-
paddingSize: "none";
|
|
21854
|
-
arrowDisplay: "left";
|
|
21855
|
-
isLoading: boolean;
|
|
21856
|
-
isDisabled: boolean;
|
|
21857
|
-
isLoadingMessage: boolean;
|
|
21858
|
-
element: "div";
|
|
21859
|
-
buttonElement: "button";
|
|
21860
|
-
role: "group";
|
|
21861
|
-
};
|
|
21862
|
-
state: {
|
|
21863
|
-
isOpen: boolean;
|
|
21864
|
-
};
|
|
21865
|
-
get isOpen(): boolean;
|
|
21866
|
-
onToggle: () => void;
|
|
21867
|
-
generatedId: string;
|
|
21868
|
-
render(): React.JSX.Element;
|
|
21869
|
-
}
|
|
21870
|
-
export const EuiAccordion: React.ForwardRefExoticComponent<Omit<EuiAccordionProps, "theme"> & React.RefAttributes<Omit<EuiAccordionProps, "theme">>>;
|
|
21871
|
-
export {};
|
|
21827
|
+
export const EuiAccordion: FunctionComponent<EuiAccordionProps>;
|
|
21872
21828
|
|
|
21873
21829
|
}
|
|
21874
21830
|
declare module '@elastic/eui/src/components/accordion' {
|
|
@@ -23231,11 +23187,13 @@ declare module '@elastic/eui/src/components/copy/copy' {
|
|
|
23231
23187
|
}
|
|
23232
23188
|
interface EuiCopyState {
|
|
23233
23189
|
tooltipText: ReactNode;
|
|
23190
|
+
isCopied: boolean;
|
|
23234
23191
|
}
|
|
23235
23192
|
export class EuiCopy extends Component<EuiCopyProps, EuiCopyState> {
|
|
23236
23193
|
static defaultProps: {
|
|
23237
23194
|
afterMessage: string;
|
|
23238
23195
|
};
|
|
23196
|
+
private tooltipRef;
|
|
23239
23197
|
constructor(props: EuiCopyProps);
|
|
23240
23198
|
copy: () => void;
|
|
23241
23199
|
resetTooltipText: () => void;
|
|
@@ -26825,8 +26783,7 @@ declare module '@elastic/eui/src/components/datagrid/data_grid.styles' {
|
|
|
26825
26783
|
m: import("csstype").Property.FontSize<string | number> | undefined;
|
|
26826
26784
|
};
|
|
26827
26785
|
levels: {
|
|
26828
|
-
|
|
26829
|
-
readonly stickyHeader: number;
|
|
26786
|
+
stickyHeader: number;
|
|
26830
26787
|
};
|
|
26831
26788
|
};
|
|
26832
26789
|
export const euiDataGridStyles: (euiThemeContext: UseEuiTheme) => {
|
|
@@ -1,9 +1,10 @@
|
|
|
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
|
-
exports.PADDING_SIZES = exports.
|
|
7
|
+
exports.PADDING_SIZES = exports.EuiAccordion = void 0;
|
|
7
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
@@ -13,150 +14,113 @@ var _accordion_trigger = require("./accordion_trigger");
|
|
|
13
14
|
var _accordion_children = require("./accordion_children");
|
|
14
15
|
var _accordion = require("./accordion.styles");
|
|
15
16
|
var _react2 = require("@emotion/react");
|
|
16
|
-
var _excluded = ["children", "className", "id", "role", "element", "buttonElement", "buttonProps", "buttonClassName", "buttonContentClassName", "buttonContent", "arrowDisplay", "arrowProps", "extraAction", "paddingSize", "borders", "initialIsOpen", "forceState", "isLoading", "isLoadingMessage", "isDisabled", "
|
|
17
|
-
|
|
18
|
-
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
|
-
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 _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); }
|
|
21
|
-
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); }
|
|
22
|
-
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; }
|
|
23
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
24
|
-
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
25
|
-
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); } }
|
|
26
|
-
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
27
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
28
|
-
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); }
|
|
29
|
-
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
30
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
31
|
-
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
32
|
-
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); }
|
|
33
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
34
|
-
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; }
|
|
35
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
36
|
-
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
|
+
var _excluded = ["children", "className", "id", "role", "element", "buttonElement", "buttonProps", "buttonClassName", "buttonContentClassName", "buttonContent", "arrowDisplay", "arrowProps", "extraAction", "paddingSize", "borders", "initialIsOpen", "forceState", "isLoading", "isLoadingMessage", "isDisabled", "onToggle"];
|
|
18
|
+
/*
|
|
37
19
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
38
20
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
39
21
|
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
40
22
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
41
23
|
* Side Public License, v 1.
|
|
42
24
|
*/
|
|
25
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
26
|
+
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); }
|
|
27
|
+
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; }
|
|
28
|
+
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); }
|
|
29
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
30
|
+
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."); }
|
|
31
|
+
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; } }
|
|
32
|
+
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; }
|
|
33
|
+
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; } }
|
|
34
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
35
|
+
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; }
|
|
36
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
43
37
|
var PADDING_SIZES = exports.PADDING_SIZES = ['none', 'xs', 's', 'm', 'l', 'xl'];
|
|
44
|
-
var
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
38
|
+
var EuiAccordion = exports.EuiAccordion = function EuiAccordion(_ref) {
|
|
39
|
+
var _buttonProps$id;
|
|
40
|
+
var children = _ref.children,
|
|
41
|
+
className = _ref.className,
|
|
42
|
+
id = _ref.id,
|
|
43
|
+
_ref$role = _ref.role,
|
|
44
|
+
role = _ref$role === void 0 ? 'group' : _ref$role,
|
|
45
|
+
_ref$element = _ref.element,
|
|
46
|
+
Element = _ref$element === void 0 ? 'div' : _ref$element,
|
|
47
|
+
_ref$buttonElement = _ref.buttonElement,
|
|
48
|
+
buttonElement = _ref$buttonElement === void 0 ? 'button' : _ref$buttonElement,
|
|
49
|
+
buttonProps = _ref.buttonProps,
|
|
50
|
+
buttonClassName = _ref.buttonClassName,
|
|
51
|
+
buttonContentClassName = _ref.buttonContentClassName,
|
|
52
|
+
buttonContent = _ref.buttonContent,
|
|
53
|
+
_ref$arrowDisplay = _ref.arrowDisplay,
|
|
54
|
+
arrowDisplay = _ref$arrowDisplay === void 0 ? 'left' : _ref$arrowDisplay,
|
|
55
|
+
arrowProps = _ref.arrowProps,
|
|
56
|
+
extraAction = _ref.extraAction,
|
|
57
|
+
_ref$paddingSize = _ref.paddingSize,
|
|
58
|
+
paddingSize = _ref$paddingSize === void 0 ? 'none' : _ref$paddingSize,
|
|
59
|
+
_ref$borders = _ref.borders,
|
|
60
|
+
borders = _ref$borders === void 0 ? 'none' : _ref$borders,
|
|
61
|
+
_ref$initialIsOpen = _ref.initialIsOpen,
|
|
62
|
+
initialIsOpen = _ref$initialIsOpen === void 0 ? false : _ref$initialIsOpen,
|
|
63
|
+
forceState = _ref.forceState,
|
|
64
|
+
_ref$isLoading = _ref.isLoading,
|
|
65
|
+
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
|
|
66
|
+
_ref$isLoadingMessage = _ref.isLoadingMessage,
|
|
67
|
+
isLoadingMessage = _ref$isLoadingMessage === void 0 ? false : _ref$isLoadingMessage,
|
|
68
|
+
_ref$isDisabled = _ref.isDisabled,
|
|
69
|
+
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
70
|
+
onToggle = _ref.onToggle,
|
|
71
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
72
|
+
var _useState = (0, _react.useState)(forceState ? forceState === 'open' : initialIsOpen),
|
|
73
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
74
|
+
isOpenState = _useState2[0],
|
|
75
|
+
setIsOpenState = _useState2[1];
|
|
76
|
+
var isOpen = forceState ? forceState === 'open' : isOpenState;
|
|
77
|
+
var onAccordionToggle = function onAccordionToggle() {
|
|
78
|
+
if (forceState) {
|
|
79
|
+
onToggle === null || onToggle === void 0 || onToggle(!isOpen);
|
|
80
|
+
} else {
|
|
81
|
+
var nextState = !isOpenState;
|
|
82
|
+
setIsOpenState(nextState);
|
|
83
|
+
onToggle === null || onToggle === void 0 || onToggle(nextState);
|
|
80
84
|
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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
|
-
buttonId: buttonId
|
|
121
|
-
// Force button element to be a legend if the element is a fieldset
|
|
122
|
-
,
|
|
123
|
-
buttonElement: Element === 'fieldset' ? 'legend' : buttonElement,
|
|
124
|
-
buttonClassName: buttonClassName,
|
|
125
|
-
buttonContent: buttonContent,
|
|
126
|
-
buttonContentClassName: buttonContentClassName,
|
|
127
|
-
buttonProps: buttonProps,
|
|
128
|
-
arrowProps: arrowProps,
|
|
129
|
-
arrowDisplay: arrowDisplay,
|
|
130
|
-
isDisabled: isDisabled,
|
|
131
|
-
isOpen: this.isOpen,
|
|
132
|
-
onToggle: this.onToggle,
|
|
133
|
-
extraAction: isLoading ? (0, _react2.jsx)(_loading.EuiLoadingSpinner, null) : extraAction
|
|
134
|
-
}), (0, _react2.jsx)(_accordion_children.EuiAccordionChildren, {
|
|
135
|
-
role: role,
|
|
136
|
-
id: id,
|
|
137
|
-
"aria-labelledby": buttonId,
|
|
138
|
-
paddingSize: paddingSize,
|
|
139
|
-
isLoading: isLoading,
|
|
140
|
-
isLoadingMessage: isLoadingMessage,
|
|
141
|
-
isOpen: this.isOpen,
|
|
142
|
-
initialIsOpen: initialIsOpen
|
|
143
|
-
}, children));
|
|
144
|
-
}
|
|
145
|
-
}]);
|
|
146
|
-
}(_react.Component);
|
|
147
|
-
_defineProperty(EuiAccordionClass, "defaultProps", {
|
|
148
|
-
initialIsOpen: false,
|
|
149
|
-
borders: 'none',
|
|
150
|
-
paddingSize: 'none',
|
|
151
|
-
arrowDisplay: 'left',
|
|
152
|
-
isLoading: false,
|
|
153
|
-
isDisabled: false,
|
|
154
|
-
isLoadingMessage: false,
|
|
155
|
-
element: 'div',
|
|
156
|
-
buttonElement: 'button',
|
|
157
|
-
role: 'group'
|
|
158
|
-
});
|
|
159
|
-
EuiAccordionClass.propTypes = {
|
|
85
|
+
};
|
|
86
|
+
var generatedId = (0, _services.useGeneratedHtmlId)();
|
|
87
|
+
var buttonId = (_buttonProps$id = buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.id) !== null && _buttonProps$id !== void 0 ? _buttonProps$id : generatedId;
|
|
88
|
+
var classes = (0, _classnames.default)('euiAccordion', {
|
|
89
|
+
'euiAccordion-isOpen': isOpen
|
|
90
|
+
}, className);
|
|
91
|
+
var styles = (0, _services.useEuiMemoizedStyles)(_accordion.euiAccordionStyles);
|
|
92
|
+
var cssStyles = [styles.euiAccordion, borders !== 'none' && styles.borders.borders, borders !== 'none' && styles.borders[borders]];
|
|
93
|
+
return (0, _react2.jsx)(Element, _extends({
|
|
94
|
+
className: classes,
|
|
95
|
+
css: cssStyles
|
|
96
|
+
}, rest), (0, _react2.jsx)(_accordion_trigger.EuiAccordionTrigger, {
|
|
97
|
+
ariaControlsId: id,
|
|
98
|
+
buttonId: buttonId
|
|
99
|
+
// Force button element to be a legend if the element is a fieldset
|
|
100
|
+
,
|
|
101
|
+
buttonElement: Element === 'fieldset' ? 'legend' : buttonElement,
|
|
102
|
+
buttonClassName: buttonClassName,
|
|
103
|
+
buttonContent: buttonContent,
|
|
104
|
+
buttonContentClassName: buttonContentClassName,
|
|
105
|
+
buttonProps: buttonProps,
|
|
106
|
+
arrowProps: arrowProps,
|
|
107
|
+
arrowDisplay: arrowDisplay,
|
|
108
|
+
isDisabled: isDisabled,
|
|
109
|
+
isOpen: isOpen,
|
|
110
|
+
onToggle: onAccordionToggle,
|
|
111
|
+
extraAction: isLoading ? (0, _react2.jsx)(_loading.EuiLoadingSpinner, null) : extraAction
|
|
112
|
+
}), (0, _react2.jsx)(_accordion_children.EuiAccordionChildren, {
|
|
113
|
+
role: role,
|
|
114
|
+
id: id,
|
|
115
|
+
"aria-labelledby": buttonId,
|
|
116
|
+
paddingSize: paddingSize,
|
|
117
|
+
isLoading: isLoading,
|
|
118
|
+
isLoadingMessage: isLoadingMessage,
|
|
119
|
+
isOpen: isOpen,
|
|
120
|
+
initialIsOpen: initialIsOpen
|
|
121
|
+
}, children));
|
|
122
|
+
};
|
|
123
|
+
EuiAccordion.propTypes = {
|
|
160
124
|
className: _propTypes.default.string,
|
|
161
125
|
"aria-label": _propTypes.default.string,
|
|
162
126
|
"data-test-subj": _propTypes.default.string,
|
|
@@ -249,5 +213,4 @@ EuiAccordionClass.propTypes = {
|
|
|
249
213
|
* Disable the open/close interaction and visually subdues the trigger
|
|
250
214
|
*/
|
|
251
215
|
isDisabled: _propTypes.default.bool
|
|
252
|
-
};
|
|
253
|
-
var EuiAccordion = exports.EuiAccordion = (0, _services.withEuiTheme)(EuiAccordionClass);
|
|
216
|
+
};
|
|
@@ -1149,6 +1149,10 @@ EuiBasicTable.propTypes = {
|
|
|
1149
1149
|
* hidden.
|
|
1150
1150
|
*/
|
|
1151
1151
|
onMouseOut: _propTypes.default.func,
|
|
1152
|
+
/**
|
|
1153
|
+
* If supplied, called when the trigger loses focus.
|
|
1154
|
+
*/
|
|
1155
|
+
onBlur: _propTypes.default.func,
|
|
1152
1156
|
/**
|
|
1153
1157
|
* Offset in pixels from the anchor. Defaults to 16.
|
|
1154
1158
|
*/
|
|
@@ -1293,6 +1297,7 @@ EuiBasicTable.propTypes = {
|
|
|
1293
1297
|
repositionOnScroll: _propTypes.default.bool,
|
|
1294
1298
|
disableScreenReaderOutput: _propTypes.default.bool,
|
|
1295
1299
|
onMouseOut: _propTypes.default.func,
|
|
1300
|
+
onBlur: _propTypes.default.func,
|
|
1296
1301
|
offset: _propTypes.default.number,
|
|
1297
1302
|
"aria-label": _propTypes.default.string,
|
|
1298
1303
|
"data-test-subj": _propTypes.default.string,
|
|
@@ -1434,6 +1439,7 @@ EuiBasicTable.propTypes = {
|
|
|
1434
1439
|
repositionOnScroll: _propTypes.default.bool,
|
|
1435
1440
|
disableScreenReaderOutput: _propTypes.default.bool,
|
|
1436
1441
|
onMouseOut: _propTypes.default.func,
|
|
1442
|
+
onBlur: _propTypes.default.func,
|
|
1437
1443
|
offset: _propTypes.default.number,
|
|
1438
1444
|
"aria-label": _propTypes.default.string,
|
|
1439
1445
|
"data-test-subj": _propTypes.default.string,
|
|
@@ -675,6 +675,10 @@ EuiInMemoryTable.propTypes = {
|
|
|
675
675
|
* hidden.
|
|
676
676
|
*/
|
|
677
677
|
onMouseOut: _propTypes.default.func,
|
|
678
|
+
/**
|
|
679
|
+
* If supplied, called when the trigger loses focus.
|
|
680
|
+
*/
|
|
681
|
+
onBlur: _propTypes.default.func,
|
|
678
682
|
/**
|
|
679
683
|
* Offset in pixels from the anchor. Defaults to 16.
|
|
680
684
|
*/
|
|
@@ -819,6 +823,7 @@ EuiInMemoryTable.propTypes = {
|
|
|
819
823
|
repositionOnScroll: _propTypes.default.bool,
|
|
820
824
|
disableScreenReaderOutput: _propTypes.default.bool,
|
|
821
825
|
onMouseOut: _propTypes.default.func,
|
|
826
|
+
onBlur: _propTypes.default.func,
|
|
822
827
|
offset: _propTypes.default.number,
|
|
823
828
|
"aria-label": _propTypes.default.string,
|
|
824
829
|
"data-test-subj": _propTypes.default.string,
|
|
@@ -960,6 +965,7 @@ EuiInMemoryTable.propTypes = {
|
|
|
960
965
|
repositionOnScroll: _propTypes.default.bool,
|
|
961
966
|
disableScreenReaderOutput: _propTypes.default.bool,
|
|
962
967
|
onMouseOut: _propTypes.default.func,
|
|
968
|
+
onBlur: _propTypes.default.func,
|
|
963
969
|
offset: _propTypes.default.number,
|
|
964
970
|
"aria-label": _propTypes.default.string,
|
|
965
971
|
"data-test-subj": _propTypes.default.string,
|
|
@@ -141,6 +141,10 @@ EuiColorPickerSwatch.propTypes = {
|
|
|
141
141
|
* hidden.
|
|
142
142
|
*/
|
|
143
143
|
onMouseOut: _propTypes.default.func,
|
|
144
|
+
/**
|
|
145
|
+
* If supplied, called when the trigger loses focus.
|
|
146
|
+
*/
|
|
147
|
+
onBlur: _propTypes.default.func,
|
|
144
148
|
/**
|
|
145
149
|
* Offset in pixels from the anchor. Defaults to 16.
|
|
146
150
|
*/
|
|
@@ -276,8 +276,8 @@ var EuiContextMenuPanelClass = exports.EuiContextMenuPanelClass = /*#__PURE__*/f
|
|
|
276
276
|
}
|
|
277
277
|
}, {
|
|
278
278
|
key: "componentDidUpdate",
|
|
279
|
-
value: function componentDidUpdate(
|
|
280
|
-
if (
|
|
279
|
+
value: function componentDidUpdate(prevProps) {
|
|
280
|
+
if (prevProps.items !== this.props.items) {
|
|
281
281
|
this.findMenuItems();
|
|
282
282
|
}
|
|
283
283
|
// Focus isn't always ready to be taken on mount, so we need to call it
|