@elastic/eui 77.1.0 → 77.1.2
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/focus_trap/focus_trap.js +21 -5
- package/es/components/index.js +0 -1
- package/eui.d.ts +8 -119
- package/i18ntokens.json +0 -36
- package/lib/components/focus_trap/focus_trap.js +21 -5
- package/lib/components/index.js +0 -11
- package/optimize/es/components/focus_trap/focus_trap.js +15 -5
- package/optimize/es/components/index.js +0 -1
- package/optimize/lib/components/focus_trap/focus_trap.js +15 -5
- package/optimize/lib/components/index.js +0 -11
- package/package.json +2 -1
- package/test-env/components/index.js +0 -11
- package/es/components/inline_edit/index.js +0 -10
- package/es/components/inline_edit/inline_edit.styles.js +0 -15
- package/es/components/inline_edit/inline_edit_form.js +0 -190
- package/es/components/inline_edit/inline_edit_text.js +0 -97
- package/es/components/inline_edit/inline_edit_title.js +0 -105
- package/lib/components/inline_edit/index.js +0 -19
- package/lib/components/inline_edit/inline_edit.styles.js +0 -22
- package/lib/components/inline_edit/inline_edit_form.js +0 -193
- package/lib/components/inline_edit/inline_edit_text.js +0 -97
- package/lib/components/inline_edit/inline_edit_title.js +0 -106
- package/optimize/es/components/inline_edit/index.js +0 -10
- package/optimize/es/components/inline_edit/inline_edit.styles.js +0 -15
- package/optimize/es/components/inline_edit/inline_edit_form.js +0 -133
- package/optimize/es/components/inline_edit/inline_edit_text.js +0 -52
- package/optimize/es/components/inline_edit/inline_edit_title.js +0 -56
- package/optimize/lib/components/inline_edit/index.js +0 -19
- package/optimize/lib/components/inline_edit/inline_edit.styles.js +0 -22
- package/optimize/lib/components/inline_edit/inline_edit_form.js +0 -144
- package/optimize/lib/components/inline_edit/inline_edit_text.js +0 -52
- package/optimize/lib/components/inline_edit/inline_edit_title.js +0 -57
- package/test-env/components/inline_edit/index.js +0 -19
- package/test-env/components/inline_edit/inline_edit.styles.js +0 -22
- package/test-env/components/inline_edit/inline_edit_form.js +0 -196
- package/test-env/components/inline_edit/inline_edit_text.js +0 -96
- package/test-env/components/inline_edit/inline_edit_title.js +0 -105
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["children", "clickOutsideDisables", "disabled", "returnFocus", "noIsolation", "scrollLock"];
|
|
1
|
+
var _excluded = ["children", "clickOutsideDisables", "disabled", "returnFocus", "noIsolation", "scrollLock", "gapMode"];
|
|
2
2
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
3
3
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
4
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -28,6 +28,7 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
28
28
|
import React, { Component } from 'react';
|
|
29
29
|
import PropTypes from "prop-types";
|
|
30
30
|
import { FocusOn } from 'react-focus-on';
|
|
31
|
+
import { RemoveScrollBar } from 'react-remove-scroll-bar';
|
|
31
32
|
import { findElementBySelectorOrRef } from '../../services';
|
|
32
33
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
33
34
|
export var EuiFocusTrap = /*#__PURE__*/function (_Component) {
|
|
@@ -116,17 +117,25 @@ export var EuiFocusTrap = /*#__PURE__*/function (_Component) {
|
|
|
116
117
|
returnFocus = _this$props3.returnFocus,
|
|
117
118
|
noIsolation = _this$props3.noIsolation,
|
|
118
119
|
scrollLock = _this$props3.scrollLock,
|
|
120
|
+
gapMode = _this$props3.gapMode,
|
|
119
121
|
rest = _objectWithoutProperties(_this$props3, _excluded);
|
|
120
122
|
var isDisabled = disabled || this.state.hasBeenDisabledByClick;
|
|
121
123
|
var focusOnProps = _objectSpread(_objectSpread({
|
|
122
124
|
returnFocus: returnFocus,
|
|
123
125
|
noIsolation: noIsolation,
|
|
124
|
-
scrollLock: scrollLock,
|
|
125
126
|
enabled: !isDisabled
|
|
126
127
|
}, rest), {}, {
|
|
127
|
-
onClickOutside: this.handleOutsideClick
|
|
128
|
+
onClickOutside: this.handleOutsideClick,
|
|
129
|
+
/**
|
|
130
|
+
* `scrollLock` should always be unset on FocusOn, as it can prevent scrolling on
|
|
131
|
+
* portals (i.e. popovers, comboboxes, dropdown menus, etc.) within modals & flyouts
|
|
132
|
+
* @see https://github.com/theKashey/react-focus-on/issues/49
|
|
133
|
+
*/
|
|
134
|
+
scrollLock: false
|
|
128
135
|
});
|
|
129
|
-
return ___EmotionJSX(FocusOn, focusOnProps, children
|
|
136
|
+
return ___EmotionJSX(FocusOn, focusOnProps, children, scrollLock && ___EmotionJSX(RemoveScrollBar, {
|
|
137
|
+
gapMode: gapMode
|
|
138
|
+
}));
|
|
130
139
|
}
|
|
131
140
|
}]);
|
|
132
141
|
return EuiFocusTrap;
|
|
@@ -136,7 +145,8 @@ _defineProperty(EuiFocusTrap, "defaultProps", {
|
|
|
136
145
|
disabled: false,
|
|
137
146
|
returnFocus: true,
|
|
138
147
|
noIsolation: true,
|
|
139
|
-
scrollLock: false
|
|
148
|
+
scrollLock: false,
|
|
149
|
+
gapMode: 'padding' // EUI defaults to padding because Kibana's body/layout CSS ignores `margin`
|
|
140
150
|
});
|
|
141
151
|
EuiFocusTrap.propTypes = {
|
|
142
152
|
className: PropTypes.string,
|
|
@@ -157,5 +167,11 @@ EuiFocusTrap.propTypes = {
|
|
|
157
167
|
*/
|
|
158
168
|
initialFocus: PropTypes.any,
|
|
159
169
|
style: PropTypes.any,
|
|
170
|
+
/**
|
|
171
|
+
* if `scrollLock` is set to true, the body's scrollbar width will be preserved on lock
|
|
172
|
+
* via the `gapMode` CSS property. Depending on your custom CSS, you may prefer to use
|
|
173
|
+
* `margin` instead of `padding`.
|
|
174
|
+
*/
|
|
175
|
+
gapMode: PropTypes.oneOf(["padding", "margin"]),
|
|
160
176
|
disabled: PropTypes.bool
|
|
161
177
|
};
|
package/es/components/index.js
CHANGED
package/eui.d.ts
CHANGED
|
@@ -2582,8 +2582,7 @@ declare module '@elastic/eui/src/components/button/button_empty/button_empty' {
|
|
|
2582
2582
|
* Object of props passed to the <span/> wrapping the button's content
|
|
2583
2583
|
*/
|
|
2584
2584
|
contentProps?: CommonProps & EuiButtonContentType;
|
|
2585
|
-
} type EuiButtonEmptyPropsForAnchor = PropsForAnchor<CommonEuiButtonEmptyProps>;
|
|
2586
|
-
export type EuiButtonEmptyPropsForButton = PropsForButton<CommonEuiButtonEmptyProps>;
|
|
2585
|
+
} type EuiButtonEmptyPropsForAnchor = PropsForAnchor<CommonEuiButtonEmptyProps>; type EuiButtonEmptyPropsForButton = PropsForButton<CommonEuiButtonEmptyProps>;
|
|
2587
2586
|
export type EuiButtonEmptyProps = ExclusiveUnion<EuiButtonEmptyPropsForAnchor, EuiButtonEmptyPropsForButton>;
|
|
2588
2587
|
export const EuiButtonEmpty: FunctionComponent<EuiButtonEmptyProps>;
|
|
2589
2588
|
export {};
|
|
@@ -4262,6 +4261,12 @@ declare module '@elastic/eui/src/components/focus_trap/focus_trap' {
|
|
|
4262
4261
|
*/
|
|
4263
4262
|
initialFocus?: FocusTarget;
|
|
4264
4263
|
style?: CSSProperties;
|
|
4264
|
+
/**
|
|
4265
|
+
* if `scrollLock` is set to true, the body's scrollbar width will be preserved on lock
|
|
4266
|
+
* via the `gapMode` CSS property. Depending on your custom CSS, you may prefer to use
|
|
4267
|
+
* `margin` instead of `padding`.
|
|
4268
|
+
*/
|
|
4269
|
+
gapMode?: 'padding' | 'margin';
|
|
4265
4270
|
disabled?: boolean;
|
|
4266
4271
|
}
|
|
4267
4272
|
export interface EuiFocusTrapProps extends CommonProps, Omit<ReactFocusOnProps, 'enabled'>, // Inverted `disabled` prop used instead
|
|
@@ -4277,6 +4282,7 @@ declare module '@elastic/eui/src/components/focus_trap/focus_trap' {
|
|
|
4277
4282
|
returnFocus: boolean;
|
|
4278
4283
|
noIsolation: boolean;
|
|
4279
4284
|
scrollLock: boolean;
|
|
4285
|
+
gapMode: string;
|
|
4280
4286
|
};
|
|
4281
4287
|
state: State;
|
|
4282
4288
|
lastInterceptedEvent: Event | null;
|
|
@@ -15621,113 +15627,6 @@ declare module '@elastic/eui/src/components/image' {
|
|
|
15621
15627
|
export type { EuiImageProps } from '@elastic/eui/src/components/image/image_types';
|
|
15622
15628
|
export { EuiImage } from '@elastic/eui/src/components/image/image';
|
|
15623
15629
|
|
|
15624
|
-
}
|
|
15625
|
-
declare module '@elastic/eui/src/components/inline_edit/inline_edit_form' {
|
|
15626
|
-
import { ReactNode, FunctionComponent } from 'react';
|
|
15627
|
-
import { CommonProps } from '@elastic/eui/src/components/common';
|
|
15628
|
-
import { EuiFieldTextProps } from '@elastic/eui/src/components/form';
|
|
15629
|
-
import { EuiButtonEmptyProps } from '@elastic/eui/src/components/button';
|
|
15630
|
-
import { EuiButtonEmptyPropsForButton } from '@elastic/eui/src/components/button/button_empty/button_empty';
|
|
15631
|
-
export type EuiInlineEditCommonProps = CommonProps & {
|
|
15632
|
-
defaultValue: string;
|
|
15633
|
-
/**
|
|
15634
|
-
* Allow users to pass in a function that is called when the confirm button is clicked
|
|
15635
|
-
* The function should return a boolean flag that will determine if the value will be saved.
|
|
15636
|
-
* When the flag is true, the value will be saved. When the flag is false, the user will be
|
|
15637
|
-
* returned to editMode.
|
|
15638
|
-
*/
|
|
15639
|
-
onConfirm?: () => boolean;
|
|
15640
|
-
/**
|
|
15641
|
-
* Form label that appears above the form control
|
|
15642
|
-
* This is required for accessibility because there is no visual label on the input
|
|
15643
|
-
*/
|
|
15644
|
-
inputAriaLabel: string;
|
|
15645
|
-
/**
|
|
15646
|
-
* Aria-label for save button in editMode
|
|
15647
|
-
*/
|
|
15648
|
-
saveButtonAriaLabel?: string;
|
|
15649
|
-
/**
|
|
15650
|
-
* Aria-label for cancel button in editMode
|
|
15651
|
-
*/
|
|
15652
|
-
cancelButtonAriaLabel?: string;
|
|
15653
|
-
/**
|
|
15654
|
-
* Start in editMode
|
|
15655
|
-
*/
|
|
15656
|
-
startWithEditOpen?: boolean;
|
|
15657
|
-
/**
|
|
15658
|
-
* Props that will be applied directly to the EuiEmptyButton displayed in readMode
|
|
15659
|
-
*/
|
|
15660
|
-
readModeProps?: Omit<EuiButtonEmptyPropsForButton, 'onClick'>;
|
|
15661
|
-
/**
|
|
15662
|
-
* Props that will be applied directly to the EuiFieldText displayed in editMode
|
|
15663
|
-
*/
|
|
15664
|
-
editModeProps?: EuiFieldTextProps;
|
|
15665
|
-
};
|
|
15666
|
-
export type EuiInlineEditFormProps = EuiInlineEditCommonProps & {
|
|
15667
|
-
/**
|
|
15668
|
-
* Form sizes
|
|
15669
|
-
*/
|
|
15670
|
-
sizes: {
|
|
15671
|
-
compressed: boolean;
|
|
15672
|
-
buttonSize: EuiButtonEmptyProps['size'];
|
|
15673
|
-
iconSize: EuiButtonEmptyProps['iconSize'];
|
|
15674
|
-
};
|
|
15675
|
-
/**
|
|
15676
|
-
* Render prop that returns the read mode value as an arg
|
|
15677
|
-
*/
|
|
15678
|
-
children: (readModeValue: ReactNode) => ReactNode;
|
|
15679
|
-
};
|
|
15680
|
-
export const SMALL_SIZE_FORM: {
|
|
15681
|
-
readonly iconSize: "s";
|
|
15682
|
-
readonly compressed: true;
|
|
15683
|
-
readonly buttonSize: "s";
|
|
15684
|
-
};
|
|
15685
|
-
export const MEDIUM_SIZE_FORM: {
|
|
15686
|
-
readonly iconSize: "m";
|
|
15687
|
-
readonly compressed: false;
|
|
15688
|
-
readonly buttonSize: "m";
|
|
15689
|
-
};
|
|
15690
|
-
export const EuiInlineEditForm: FunctionComponent<EuiInlineEditFormProps>;
|
|
15691
|
-
|
|
15692
|
-
}
|
|
15693
|
-
declare module '@elastic/eui/src/components/inline_edit/inline_edit_text' {
|
|
15694
|
-
import { FunctionComponent } from 'react';
|
|
15695
|
-
import { EuiTextProps } from '@elastic/eui/src/components/text';
|
|
15696
|
-
import { EuiInlineEditCommonProps } from '@elastic/eui/src/components/inline_edit/inline_edit_form';
|
|
15697
|
-
export type EuiInlineEditTextSizes = Exclude<EuiTextProps['size'], 'relative'>;
|
|
15698
|
-
export type EuiInlineEditTextProps = EuiInlineEditCommonProps & {
|
|
15699
|
-
/**
|
|
15700
|
-
* Text size level
|
|
15701
|
-
*/
|
|
15702
|
-
size?: EuiInlineEditTextSizes;
|
|
15703
|
-
};
|
|
15704
|
-
export const EuiInlineEditText: FunctionComponent<EuiInlineEditTextProps>;
|
|
15705
|
-
|
|
15706
|
-
}
|
|
15707
|
-
declare module '@elastic/eui/src/components/inline_edit/inline_edit_title' {
|
|
15708
|
-
import { FunctionComponent } from 'react';
|
|
15709
|
-
import { EuiTitleSize } from '@elastic/eui/src/components/title';
|
|
15710
|
-
import { EuiInlineEditCommonProps } from '@elastic/eui/src/components/inline_edit/inline_edit_form';
|
|
15711
|
-
export const HEADINGS: readonly ["h1", "h2", "h3", "h4", "h5", "h6"]; type Heading = typeof HEADINGS[number];
|
|
15712
|
-
export type EuiInlineEditTitleProps = EuiInlineEditCommonProps & {
|
|
15713
|
-
/**
|
|
15714
|
-
* Title size level
|
|
15715
|
-
*/
|
|
15716
|
-
size?: EuiTitleSize;
|
|
15717
|
-
/**
|
|
15718
|
-
* Level of heading to be used for the title
|
|
15719
|
-
*/
|
|
15720
|
-
heading: Heading;
|
|
15721
|
-
};
|
|
15722
|
-
export const EuiInlineEditTitle: FunctionComponent<EuiInlineEditTitleProps>;
|
|
15723
|
-
export {};
|
|
15724
|
-
|
|
15725
|
-
}
|
|
15726
|
-
declare module '@elastic/eui/src/components/inline_edit' {
|
|
15727
|
-
export { EuiInlineEditText } from '@elastic/eui/src/components/inline_edit/inline_edit_text';
|
|
15728
|
-
export { EuiInlineEditTitle } from '@elastic/eui/src/components/inline_edit/inline_edit_title';
|
|
15729
|
-
export type { EuiInlineEditTextSizes } from '@elastic/eui/src/components/inline_edit/inline_edit_text';
|
|
15730
|
-
|
|
15731
15630
|
}
|
|
15732
15631
|
declare module '@elastic/eui/src/components/key_pad_menu/key_pad_menu.styles' {
|
|
15733
15632
|
import { UseEuiTheme } from '@elastic/eui/src/services';
|
|
@@ -21487,7 +21386,6 @@ declare module '@elastic/eui/src/components' {
|
|
|
21487
21386
|
export * from '@elastic/eui/src/components/icon';
|
|
21488
21387
|
export * from '@elastic/eui/src/components/image';
|
|
21489
21388
|
export * from '@elastic/eui/src/components/inner_text';
|
|
21490
|
-
export * from '@elastic/eui/src/components/inline_edit';
|
|
21491
21389
|
export * from '@elastic/eui/src/components/i18n';
|
|
21492
21390
|
export * from '@elastic/eui/src/components/loading';
|
|
21493
21391
|
export * from '@elastic/eui/src/components/key_pad_menu';
|
|
@@ -26231,13 +26129,6 @@ declare module '@elastic/eui/src/components/icon/assets/wrench' {
|
|
|
26231
26129
|
export const icon: ({ title, titleId, ...props }: React.SVGProps<SVGSVGElement> & SVGRProps) => JSX.Element;
|
|
26232
26130
|
export {};
|
|
26233
26131
|
|
|
26234
|
-
}
|
|
26235
|
-
declare module '@elastic/eui/src/components/inline_edit/inline_edit.styles' {
|
|
26236
|
-
import { UseEuiTheme } from '@elastic/eui/src/services';
|
|
26237
|
-
export const euiInlineEditStyles: ({ euiTheme }: UseEuiTheme) => {
|
|
26238
|
-
euiInlineEdit: import("@emotion/utils").SerializedStyles;
|
|
26239
|
-
};
|
|
26240
|
-
|
|
26241
26132
|
}
|
|
26242
26133
|
/*
|
|
26243
26134
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -26582,8 +26473,6 @@ declare module '@elastic/eui' {
|
|
|
26582
26473
|
"euiHeaderLinks.appNavigation": any;
|
|
26583
26474
|
"euiImageButton.openFullScreen": any;
|
|
26584
26475
|
"euiImageButton.closeFullScreen": any;
|
|
26585
|
-
"euiInlineEditForm.saveButtonAriaLabel": any;
|
|
26586
|
-
"euiInlineEditForm.cancelButtonAriaLabel": any;
|
|
26587
26476
|
"euiLink.newTarget.screenReaderOnlyText": any;
|
|
26588
26477
|
"euiLink.external.ariaLabel": any;
|
|
26589
26478
|
"euiPinnableListGroup.pinExtraActionLabel": any;
|
package/i18ntokens.json
CHANGED
|
@@ -4967,42 +4967,6 @@
|
|
|
4967
4967
|
},
|
|
4968
4968
|
"filepath": "src/components/image/image_button.tsx"
|
|
4969
4969
|
},
|
|
4970
|
-
{
|
|
4971
|
-
"token": "euiInlineEditForm.saveButtonAriaLabel",
|
|
4972
|
-
"defString": "Save edit",
|
|
4973
|
-
"highlighting": "string",
|
|
4974
|
-
"loc": {
|
|
4975
|
-
"start": {
|
|
4976
|
-
"line": 105,
|
|
4977
|
-
"column": 37,
|
|
4978
|
-
"index": 3359
|
|
4979
|
-
},
|
|
4980
|
-
"end": {
|
|
4981
|
-
"line": 108,
|
|
4982
|
-
"column": 3,
|
|
4983
|
-
"index": 3435
|
|
4984
|
-
}
|
|
4985
|
-
},
|
|
4986
|
-
"filepath": "src/components/inline_edit/inline_edit_form.tsx"
|
|
4987
|
-
},
|
|
4988
|
-
{
|
|
4989
|
-
"token": "euiInlineEditForm.cancelButtonAriaLabel",
|
|
4990
|
-
"defString": "Cancel edit",
|
|
4991
|
-
"highlighting": "string",
|
|
4992
|
-
"loc": {
|
|
4993
|
-
"start": {
|
|
4994
|
-
"line": 109,
|
|
4995
|
-
"column": 39,
|
|
4996
|
-
"index": 3476
|
|
4997
|
-
},
|
|
4998
|
-
"end": {
|
|
4999
|
-
"line": 112,
|
|
5000
|
-
"column": 3,
|
|
5001
|
-
"index": 3556
|
|
5002
|
-
}
|
|
5003
|
-
},
|
|
5004
|
-
"filepath": "src/components/inline_edit/inline_edit_form.tsx"
|
|
5005
|
-
},
|
|
5006
4970
|
{
|
|
5007
4971
|
"token": "euiLink.newTarget.screenReaderOnlyText",
|
|
5008
4972
|
"defString": "(opens in a new tab or window)",
|
|
@@ -7,9 +7,10 @@ exports.EuiFocusTrap = void 0;
|
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _reactFocusOn = require("react-focus-on");
|
|
10
|
+
var _reactRemoveScrollBar = require("react-remove-scroll-bar");
|
|
10
11
|
var _services = require("../../services");
|
|
11
12
|
var _react2 = require("@emotion/react");
|
|
12
|
-
var _excluded = ["children", "clickOutsideDisables", "disabled", "returnFocus", "noIsolation", "scrollLock"];
|
|
13
|
+
var _excluded = ["children", "clickOutsideDisables", "disabled", "returnFocus", "noIsolation", "scrollLock", "gapMode"];
|
|
13
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
15
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -117,17 +118,25 @@ var EuiFocusTrap = /*#__PURE__*/function (_Component) {
|
|
|
117
118
|
returnFocus = _this$props3.returnFocus,
|
|
118
119
|
noIsolation = _this$props3.noIsolation,
|
|
119
120
|
scrollLock = _this$props3.scrollLock,
|
|
121
|
+
gapMode = _this$props3.gapMode,
|
|
120
122
|
rest = _objectWithoutProperties(_this$props3, _excluded);
|
|
121
123
|
var isDisabled = disabled || this.state.hasBeenDisabledByClick;
|
|
122
124
|
var focusOnProps = _objectSpread(_objectSpread({
|
|
123
125
|
returnFocus: returnFocus,
|
|
124
126
|
noIsolation: noIsolation,
|
|
125
|
-
scrollLock: scrollLock,
|
|
126
127
|
enabled: !isDisabled
|
|
127
128
|
}, rest), {}, {
|
|
128
|
-
onClickOutside: this.handleOutsideClick
|
|
129
|
+
onClickOutside: this.handleOutsideClick,
|
|
130
|
+
/**
|
|
131
|
+
* `scrollLock` should always be unset on FocusOn, as it can prevent scrolling on
|
|
132
|
+
* portals (i.e. popovers, comboboxes, dropdown menus, etc.) within modals & flyouts
|
|
133
|
+
* @see https://github.com/theKashey/react-focus-on/issues/49
|
|
134
|
+
*/
|
|
135
|
+
scrollLock: false
|
|
129
136
|
});
|
|
130
|
-
return (0, _react2.jsx)(_reactFocusOn.FocusOn, focusOnProps, children)
|
|
137
|
+
return (0, _react2.jsx)(_reactFocusOn.FocusOn, focusOnProps, children, scrollLock && (0, _react2.jsx)(_reactRemoveScrollBar.RemoveScrollBar, {
|
|
138
|
+
gapMode: gapMode
|
|
139
|
+
}));
|
|
131
140
|
}
|
|
132
141
|
}]);
|
|
133
142
|
return EuiFocusTrap;
|
|
@@ -138,7 +147,8 @@ _defineProperty(EuiFocusTrap, "defaultProps", {
|
|
|
138
147
|
disabled: false,
|
|
139
148
|
returnFocus: true,
|
|
140
149
|
noIsolation: true,
|
|
141
|
-
scrollLock: false
|
|
150
|
+
scrollLock: false,
|
|
151
|
+
gapMode: 'padding' // EUI defaults to padding because Kibana's body/layout CSS ignores `margin`
|
|
142
152
|
});
|
|
143
153
|
EuiFocusTrap.propTypes = {
|
|
144
154
|
className: _propTypes.default.string,
|
|
@@ -159,5 +169,11 @@ EuiFocusTrap.propTypes = {
|
|
|
159
169
|
*/
|
|
160
170
|
initialFocus: _propTypes.default.any,
|
|
161
171
|
style: _propTypes.default.any,
|
|
172
|
+
/**
|
|
173
|
+
* if `scrollLock` is set to true, the body's scrollbar width will be preserved on lock
|
|
174
|
+
* via the `gapMode` CSS property. Depending on your custom CSS, you may prefer to use
|
|
175
|
+
* `margin` instead of `padding`.
|
|
176
|
+
*/
|
|
177
|
+
gapMode: _propTypes.default.oneOf(["padding", "margin"]),
|
|
162
178
|
disabled: _propTypes.default.bool
|
|
163
179
|
};
|
package/lib/components/index.js
CHANGED
|
@@ -476,17 +476,6 @@ Object.keys(_inner_text).forEach(function (key) {
|
|
|
476
476
|
}
|
|
477
477
|
});
|
|
478
478
|
});
|
|
479
|
-
var _inline_edit = require("./inline_edit");
|
|
480
|
-
Object.keys(_inline_edit).forEach(function (key) {
|
|
481
|
-
if (key === "default" || key === "__esModule") return;
|
|
482
|
-
if (key in exports && exports[key] === _inline_edit[key]) return;
|
|
483
|
-
Object.defineProperty(exports, key, {
|
|
484
|
-
enumerable: true,
|
|
485
|
-
get: function get() {
|
|
486
|
-
return _inline_edit[key];
|
|
487
|
-
}
|
|
488
|
-
});
|
|
489
|
-
});
|
|
490
479
|
var _i18n = require("./i18n");
|
|
491
480
|
Object.keys(_i18n).forEach(function (key) {
|
|
492
481
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -6,7 +6,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
6
6
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
7
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
-
var _excluded = ["children", "clickOutsideDisables", "disabled", "returnFocus", "noIsolation", "scrollLock"];
|
|
9
|
+
var _excluded = ["children", "clickOutsideDisables", "disabled", "returnFocus", "noIsolation", "scrollLock", "gapMode"];
|
|
10
10
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11
11
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
12
12
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
@@ -21,6 +21,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
21
21
|
|
|
22
22
|
import React, { Component } from 'react';
|
|
23
23
|
import { FocusOn } from 'react-focus-on';
|
|
24
|
+
import { RemoveScrollBar } from 'react-remove-scroll-bar';
|
|
24
25
|
import { findElementBySelectorOrRef } from '../../services';
|
|
25
26
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
26
27
|
export var EuiFocusTrap = /*#__PURE__*/function (_Component) {
|
|
@@ -109,17 +110,25 @@ export var EuiFocusTrap = /*#__PURE__*/function (_Component) {
|
|
|
109
110
|
returnFocus = _this$props3.returnFocus,
|
|
110
111
|
noIsolation = _this$props3.noIsolation,
|
|
111
112
|
scrollLock = _this$props3.scrollLock,
|
|
113
|
+
gapMode = _this$props3.gapMode,
|
|
112
114
|
rest = _objectWithoutProperties(_this$props3, _excluded);
|
|
113
115
|
var isDisabled = disabled || this.state.hasBeenDisabledByClick;
|
|
114
116
|
var focusOnProps = _objectSpread(_objectSpread({
|
|
115
117
|
returnFocus: returnFocus,
|
|
116
118
|
noIsolation: noIsolation,
|
|
117
|
-
scrollLock: scrollLock,
|
|
118
119
|
enabled: !isDisabled
|
|
119
120
|
}, rest), {}, {
|
|
120
|
-
onClickOutside: this.handleOutsideClick
|
|
121
|
+
onClickOutside: this.handleOutsideClick,
|
|
122
|
+
/**
|
|
123
|
+
* `scrollLock` should always be unset on FocusOn, as it can prevent scrolling on
|
|
124
|
+
* portals (i.e. popovers, comboboxes, dropdown menus, etc.) within modals & flyouts
|
|
125
|
+
* @see https://github.com/theKashey/react-focus-on/issues/49
|
|
126
|
+
*/
|
|
127
|
+
scrollLock: false
|
|
121
128
|
});
|
|
122
|
-
return ___EmotionJSX(FocusOn, focusOnProps, children
|
|
129
|
+
return ___EmotionJSX(FocusOn, focusOnProps, children, scrollLock && ___EmotionJSX(RemoveScrollBar, {
|
|
130
|
+
gapMode: gapMode
|
|
131
|
+
}));
|
|
123
132
|
}
|
|
124
133
|
}]);
|
|
125
134
|
return EuiFocusTrap;
|
|
@@ -129,5 +138,6 @@ _defineProperty(EuiFocusTrap, "defaultProps", {
|
|
|
129
138
|
disabled: false,
|
|
130
139
|
returnFocus: true,
|
|
131
140
|
noIsolation: true,
|
|
132
|
-
scrollLock: false
|
|
141
|
+
scrollLock: false,
|
|
142
|
+
gapMode: 'padding' // EUI defaults to padding because Kibana's body/layout CSS ignores `margin`
|
|
133
143
|
});
|
|
@@ -16,9 +16,10 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
|
16
16
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
17
17
|
var _react = _interopRequireWildcard(require("react"));
|
|
18
18
|
var _reactFocusOn = require("react-focus-on");
|
|
19
|
+
var _reactRemoveScrollBar = require("react-remove-scroll-bar");
|
|
19
20
|
var _services = require("../../services");
|
|
20
21
|
var _react2 = require("@emotion/react");
|
|
21
|
-
var _excluded = ["children", "clickOutsideDisables", "disabled", "returnFocus", "noIsolation", "scrollLock"];
|
|
22
|
+
var _excluded = ["children", "clickOutsideDisables", "disabled", "returnFocus", "noIsolation", "scrollLock", "gapMode"];
|
|
22
23
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
24
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
24
25
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -111,17 +112,25 @@ var EuiFocusTrap = /*#__PURE__*/function (_Component) {
|
|
|
111
112
|
returnFocus = _this$props3.returnFocus,
|
|
112
113
|
noIsolation = _this$props3.noIsolation,
|
|
113
114
|
scrollLock = _this$props3.scrollLock,
|
|
115
|
+
gapMode = _this$props3.gapMode,
|
|
114
116
|
rest = (0, _objectWithoutProperties2.default)(_this$props3, _excluded);
|
|
115
117
|
var isDisabled = disabled || this.state.hasBeenDisabledByClick;
|
|
116
118
|
var focusOnProps = _objectSpread(_objectSpread({
|
|
117
119
|
returnFocus: returnFocus,
|
|
118
120
|
noIsolation: noIsolation,
|
|
119
|
-
scrollLock: scrollLock,
|
|
120
121
|
enabled: !isDisabled
|
|
121
122
|
}, rest), {}, {
|
|
122
|
-
onClickOutside: this.handleOutsideClick
|
|
123
|
+
onClickOutside: this.handleOutsideClick,
|
|
124
|
+
/**
|
|
125
|
+
* `scrollLock` should always be unset on FocusOn, as it can prevent scrolling on
|
|
126
|
+
* portals (i.e. popovers, comboboxes, dropdown menus, etc.) within modals & flyouts
|
|
127
|
+
* @see https://github.com/theKashey/react-focus-on/issues/49
|
|
128
|
+
*/
|
|
129
|
+
scrollLock: false
|
|
123
130
|
});
|
|
124
|
-
return (0, _react2.jsx)(_reactFocusOn.FocusOn, focusOnProps, children)
|
|
131
|
+
return (0, _react2.jsx)(_reactFocusOn.FocusOn, focusOnProps, children, scrollLock && (0, _react2.jsx)(_reactRemoveScrollBar.RemoveScrollBar, {
|
|
132
|
+
gapMode: gapMode
|
|
133
|
+
}));
|
|
125
134
|
}
|
|
126
135
|
}]);
|
|
127
136
|
return EuiFocusTrap;
|
|
@@ -132,5 +141,6 @@ exports.EuiFocusTrap = EuiFocusTrap;
|
|
|
132
141
|
disabled: false,
|
|
133
142
|
returnFocus: true,
|
|
134
143
|
noIsolation: true,
|
|
135
|
-
scrollLock: false
|
|
144
|
+
scrollLock: false,
|
|
145
|
+
gapMode: 'padding' // EUI defaults to padding because Kibana's body/layout CSS ignores `margin`
|
|
136
146
|
});
|
|
@@ -476,17 +476,6 @@ Object.keys(_inner_text).forEach(function (key) {
|
|
|
476
476
|
}
|
|
477
477
|
});
|
|
478
478
|
});
|
|
479
|
-
var _inline_edit = require("./inline_edit");
|
|
480
|
-
Object.keys(_inline_edit).forEach(function (key) {
|
|
481
|
-
if (key === "default" || key === "__esModule") return;
|
|
482
|
-
if (key in exports && exports[key] === _inline_edit[key]) return;
|
|
483
|
-
Object.defineProperty(exports, key, {
|
|
484
|
-
enumerable: true,
|
|
485
|
-
get: function get() {
|
|
486
|
-
return _inline_edit[key];
|
|
487
|
-
}
|
|
488
|
-
});
|
|
489
|
-
});
|
|
490
479
|
var _i18n = require("./i18n");
|
|
491
480
|
Object.keys(_i18n).forEach(function (key) {
|
|
492
481
|
if (key === "default" || key === "__esModule") return;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elastic/eui",
|
|
3
3
|
"description": "Elastic UI Component Library",
|
|
4
|
-
"version": "77.1.
|
|
4
|
+
"version": "77.1.2",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "lib",
|
|
7
7
|
"module": "es",
|
|
@@ -80,6 +80,7 @@
|
|
|
80
80
|
"react-focus-on": "^3.7.0",
|
|
81
81
|
"react-input-autosize": "^3.0.0",
|
|
82
82
|
"react-is": "^17.0.2",
|
|
83
|
+
"react-remove-scroll-bar": "^2.3.4",
|
|
83
84
|
"react-virtualized-auto-sizer": "^1.0.6",
|
|
84
85
|
"react-window": "^1.8.6",
|
|
85
86
|
"refractor": "^3.5.0",
|
|
@@ -476,17 +476,6 @@ Object.keys(_inner_text).forEach(function (key) {
|
|
|
476
476
|
}
|
|
477
477
|
});
|
|
478
478
|
});
|
|
479
|
-
var _inline_edit = require("./inline_edit");
|
|
480
|
-
Object.keys(_inline_edit).forEach(function (key) {
|
|
481
|
-
if (key === "default" || key === "__esModule") return;
|
|
482
|
-
if (key in exports && exports[key] === _inline_edit[key]) return;
|
|
483
|
-
Object.defineProperty(exports, key, {
|
|
484
|
-
enumerable: true,
|
|
485
|
-
get: function get() {
|
|
486
|
-
return _inline_edit[key];
|
|
487
|
-
}
|
|
488
|
-
});
|
|
489
|
-
});
|
|
490
479
|
var _i18n = require("./i18n");
|
|
491
480
|
Object.keys(_i18n).forEach(function (key) {
|
|
492
481
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
-
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
-
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
5
|
-
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
|
-
* Side Public License, v 1.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
export { EuiInlineEditText } from './inline_edit_text';
|
|
10
|
-
export { EuiInlineEditTitle } from './inline_edit_title';
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
-
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
-
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
5
|
-
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
|
-
* Side Public License, v 1.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { css } from '@emotion/react';
|
|
10
|
-
export var euiInlineEditStyles = function euiInlineEditStyles(_ref) {
|
|
11
|
-
var euiTheme = _ref.euiTheme;
|
|
12
|
-
return {
|
|
13
|
-
euiInlineEdit: /*#__PURE__*/css("color:", euiTheme.colors.primaryText, ";;label:euiInlineEdit;")
|
|
14
|
-
};
|
|
15
|
-
};
|