@elastic/eui 88.3.0 → 88.4.1
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/dist/eui_theme_dark.css +7 -142
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +7 -142
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/basic_table/in_memory_table.js +85 -34
- package/es/components/card/card.js +3 -3
- package/es/components/combo_box/combo_box.js +16 -4
- package/es/components/combo_box/combo_box_input/combo_box_input.js +4 -1
- package/es/components/combo_box/combo_box_input/combo_box_pill.js +5 -1
- package/es/components/combo_box/combo_box_options_list/combo_box_option.js +2 -0
- package/es/components/combo_box/combo_box_options_list/combo_box_options_list.js +62 -13
- package/es/components/datagrid/controls/column_selector.js +5 -3
- package/es/components/datagrid/controls/column_sorting_draggable.js +4 -1
- package/es/components/description_list/description_list_title.js +0 -1
- package/es/components/description_list/description_list_title.styles.js +1 -1
- package/es/components/drag_and_drop/draggable.js +18 -23
- package/es/components/drag_and_drop/draggable.styles.js +56 -0
- package/es/components/drag_and_drop/droppable.js +24 -21
- package/es/components/drag_and_drop/droppable.styles.js +51 -0
- package/es/components/search_bar/search_box.js +54 -88
- package/es/components/table/table_pagination/table_pagination.js +1 -0
- package/es/components/text_truncate/text_truncate.js +12 -6
- package/es/components/text_truncate/text_truncate.styles.js +10 -10
- package/es/test/rtl/custom_render.js +1 -1
- package/eui.d.ts +480 -420
- package/i18ntokens.json +142 -88
- package/lib/components/basic_table/in_memory_table.js +85 -34
- package/lib/components/card/card.js +3 -3
- package/lib/components/combo_box/combo_box.js +16 -4
- package/lib/components/combo_box/combo_box_input/combo_box_input.js +4 -1
- package/lib/components/combo_box/combo_box_input/combo_box_pill.js +5 -1
- package/lib/components/combo_box/combo_box_options_list/combo_box_option.js +2 -0
- package/lib/components/combo_box/combo_box_options_list/combo_box_options_list.js +62 -13
- package/lib/components/datagrid/controls/column_selector.js +4 -2
- package/lib/components/datagrid/controls/column_sorting_draggable.js +4 -1
- package/lib/components/description_list/description_list_title.js +0 -1
- package/lib/components/description_list/description_list_title.styles.js +1 -1
- package/lib/components/drag_and_drop/draggable.js +17 -22
- package/lib/components/drag_and_drop/draggable.styles.js +62 -0
- package/lib/components/drag_and_drop/droppable.js +26 -22
- package/lib/components/drag_and_drop/droppable.styles.js +57 -0
- package/lib/components/search_bar/search_box.js +61 -93
- package/lib/components/table/table_pagination/table_pagination.js +1 -0
- package/lib/components/text_truncate/text_truncate.js +10 -4
- package/lib/components/text_truncate/text_truncate.styles.js +10 -10
- package/lib/test/rtl/custom_render.js +2 -2
- package/optimize/es/components/basic_table/in_memory_table.js +62 -34
- package/optimize/es/components/card/card.js +3 -3
- package/optimize/es/components/combo_box/combo_box.js +6 -4
- package/optimize/es/components/combo_box/combo_box_input/combo_box_input.js +2 -1
- package/optimize/es/components/combo_box/combo_box_input/combo_box_pill.js +3 -1
- package/optimize/es/components/combo_box/combo_box_options_list/combo_box_options_list.js +52 -10
- package/optimize/es/components/datagrid/controls/column_selector.js +5 -3
- package/optimize/es/components/datagrid/controls/column_sorting_draggable.js +4 -1
- package/optimize/es/components/description_list/description_list_title.js +0 -1
- package/optimize/es/components/description_list/description_list_title.styles.js +1 -1
- package/optimize/es/components/drag_and_drop/draggable.js +17 -22
- package/optimize/es/components/drag_and_drop/draggable.styles.js +56 -0
- package/optimize/es/components/drag_and_drop/droppable.js +23 -20
- package/optimize/es/components/drag_and_drop/droppable.styles.js +51 -0
- package/optimize/es/components/search_bar/search_box.js +50 -83
- package/optimize/es/components/table/table_pagination/table_pagination.js +1 -0
- package/optimize/es/components/text_truncate/text_truncate.js +12 -6
- package/optimize/es/components/text_truncate/text_truncate.styles.js +10 -10
- package/optimize/es/test/rtl/custom_render.js +1 -1
- package/optimize/lib/components/basic_table/in_memory_table.js +62 -34
- package/optimize/lib/components/card/card.js +3 -3
- package/optimize/lib/components/combo_box/combo_box.js +6 -4
- package/optimize/lib/components/combo_box/combo_box_input/combo_box_input.js +2 -1
- package/optimize/lib/components/combo_box/combo_box_input/combo_box_pill.js +3 -1
- package/optimize/lib/components/combo_box/combo_box_options_list/combo_box_options_list.js +52 -10
- package/optimize/lib/components/datagrid/controls/column_selector.js +4 -2
- package/optimize/lib/components/datagrid/controls/column_sorting_draggable.js +4 -1
- package/optimize/lib/components/description_list/description_list_title.js +0 -1
- package/optimize/lib/components/description_list/description_list_title.styles.js +1 -1
- package/optimize/lib/components/drag_and_drop/draggable.js +16 -21
- package/optimize/lib/components/drag_and_drop/draggable.styles.js +62 -0
- package/optimize/lib/components/drag_and_drop/droppable.js +25 -21
- package/optimize/lib/components/drag_and_drop/droppable.styles.js +57 -0
- package/optimize/lib/components/search_bar/search_box.js +57 -89
- package/optimize/lib/components/table/table_pagination/table_pagination.js +1 -0
- package/optimize/lib/components/text_truncate/text_truncate.js +10 -4
- package/optimize/lib/components/text_truncate/text_truncate.styles.js +10 -10
- package/optimize/lib/test/rtl/custom_render.js +2 -2
- package/package.json +4 -4
- package/src/components/combo_box/combo_box_input/_combo_box_pill.scss +0 -1
- package/src/components/combo_box/combo_box_options_list/_combo_box_options_list.scss +8 -0
- package/src/components/index.scss +0 -1
- package/src/themes/amsterdam/overrides/_index.scss +0 -1
- package/test-env/components/basic_table/in_memory_table.js +85 -34
- package/test-env/components/card/card.js +3 -3
- package/test-env/components/combo_box/combo_box.js +16 -4
- package/test-env/components/combo_box/combo_box_input/combo_box_input.js +4 -1
- package/test-env/components/combo_box/combo_box_input/combo_box_pill.js +5 -1
- package/test-env/components/combo_box/combo_box_options_list/combo_box_option.js +2 -0
- package/test-env/components/combo_box/combo_box_options_list/combo_box_options_list.js +61 -12
- package/test-env/components/datagrid/controls/column_selector.js +4 -2
- package/test-env/components/datagrid/controls/column_sorting_draggable.js +4 -1
- package/test-env/components/description_list/description_list_title.js +0 -1
- package/test-env/components/description_list/description_list_title.styles.js +1 -1
- package/test-env/components/drag_and_drop/draggable.js +17 -22
- package/test-env/components/drag_and_drop/draggable.styles.js +62 -0
- package/test-env/components/drag_and_drop/droppable.js +26 -22
- package/test-env/components/drag_and_drop/droppable.styles.js +57 -0
- package/test-env/components/search_bar/search_box.js +60 -88
- package/test-env/components/table/table_pagination/table_pagination.js +1 -0
- package/test-env/components/text_truncate/text_truncate.js +10 -4
- package/test-env/components/text_truncate/text_truncate.styles.js +10 -10
- package/test-env/test/rtl/custom_render.js +2 -2
- package/src/components/drag_and_drop/_draggable.scss +0 -41
- package/src/components/drag_and_drop/_droppable.scss +0 -40
- package/src/components/drag_and_drop/_index.scss +0 -3
- package/src/components/drag_and_drop/_variables.scss +0 -5
- package/src/themes/amsterdam/overrides/_description_list.scss +0 -7
|
@@ -9,14 +9,14 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
11
|
var _services = require("../../services");
|
|
12
|
+
var _accessibility = require("../../services/accessibility");
|
|
13
|
+
var _href_validator = require("../../services/security/href_validator");
|
|
12
14
|
var _text = require("../text");
|
|
13
15
|
var _title = require("../title");
|
|
14
16
|
var _beta_badge = require("../badge/beta_badge");
|
|
15
|
-
var _card_select = require("./card_select");
|
|
16
|
-
var _accessibility = require("../../services/accessibility");
|
|
17
|
-
var _href_validator = require("../../services/security/href_validator");
|
|
18
17
|
var _panel = require("../panel");
|
|
19
18
|
var _spacer = require("../spacer");
|
|
19
|
+
var _card_select = require("./card_select");
|
|
20
20
|
var _card = require("./card.styles");
|
|
21
21
|
var _react2 = require("@emotion/react");
|
|
22
22
|
var _excluded = ["className", "description", "isDisabled", "title", "titleElement", "titleSize", "icon", "image", "children", "footer", "onClick", "href", "rel", "target", "textAlign", "betaBadgeProps", "layout", "selectable", "display", "paddingSize"],
|
|
@@ -8,14 +8,14 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
10
|
var _services = require("../../services");
|
|
11
|
+
var _popover = require("../../services/popover");
|
|
11
12
|
var _portal = require("../portal");
|
|
12
13
|
var _i18n = require("../i18n");
|
|
13
|
-
var _combo_box_options_list = require("./combo_box_options_list");
|
|
14
14
|
var _matching_options = require("./matching_options");
|
|
15
15
|
var _combo_box_input = require("./combo_box_input/combo_box_input");
|
|
16
|
-
var
|
|
16
|
+
var _combo_box_options_list = require("./combo_box_options_list");
|
|
17
17
|
var _react2 = require("@emotion/react");
|
|
18
|
-
var _excluded = ["data-test-subj", "async", "className", "compressed", "customOptionText", "fullWidth", "id", "inputRef", "isCaseSensitive", "isClearable", "isDisabled", "isInvalid", "isLoading", "noSuggestions", "onBlur", "onChange", "onCreateOption", "onSearchChange", "options", "placeholder", "renderOption", "rowHeight", "selectedOptions", "singleSelection", "prepend", "sortMatchesBy", "delimiter", "append", "autoFocus", "aria-label", "aria-labelledby"];
|
|
18
|
+
var _excluded = ["data-test-subj", "async", "className", "compressed", "customOptionText", "fullWidth", "id", "inputRef", "isCaseSensitive", "isClearable", "isDisabled", "isInvalid", "isLoading", "noSuggestions", "onBlur", "onChange", "onCreateOption", "onSearchChange", "options", "placeholder", "renderOption", "rowHeight", "selectedOptions", "singleSelection", "prepend", "sortMatchesBy", "delimiter", "append", "autoFocus", "truncationProps", "aria-label", "aria-labelledby"];
|
|
19
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
20
|
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); }
|
|
21
21
|
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; }
|
|
@@ -645,6 +645,7 @@ var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
645
645
|
delimiter = _this$props8.delimiter,
|
|
646
646
|
append = _this$props8.append,
|
|
647
647
|
autoFocus = _this$props8.autoFocus,
|
|
648
|
+
truncationProps = _this$props8.truncationProps,
|
|
648
649
|
ariaLabel = _this$props8['aria-label'],
|
|
649
650
|
ariaLabelledby = _this$props8['aria-labelledby'],
|
|
650
651
|
rest = _objectWithoutProperties(_this$props8, _excluded);
|
|
@@ -713,7 +714,8 @@ var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
713
714
|
width: width,
|
|
714
715
|
delimiter: delimiter,
|
|
715
716
|
getSelectedOptionForSearchValue: _matching_options.getSelectedOptionForSearchValue,
|
|
716
|
-
listboxAriaLabel: listboxAriaLabel
|
|
717
|
+
listboxAriaLabel: listboxAriaLabel,
|
|
718
|
+
truncationProps: truncationProps
|
|
717
719
|
});
|
|
718
720
|
}));
|
|
719
721
|
}
|
|
@@ -910,5 +912,15 @@ EuiComboBox.propTypes = {
|
|
|
910
912
|
* supplied by `aria-label` or from [EuiFormRow](/#/forms/form-layouts).
|
|
911
913
|
*/
|
|
912
914
|
"aria-labelledby": _propTypes.default.string,
|
|
915
|
+
/**
|
|
916
|
+
* By default, EuiComboBox will truncate option labels at the end of
|
|
917
|
+
* the string. You can use pass in a custom truncation configuration that
|
|
918
|
+
* accepts any prop that [EuiTextTruncate](/#/utilities/text-truncate) prop
|
|
919
|
+
* except for `text` and `children`.
|
|
920
|
+
*
|
|
921
|
+
* Note: when searching, custom truncation props are ignored. The highlighted search
|
|
922
|
+
* text will always take precedence.
|
|
923
|
+
*/
|
|
924
|
+
truncationProps: _propTypes.default.any,
|
|
913
925
|
css: _propTypes.default.any
|
|
914
926
|
};
|
|
@@ -14,7 +14,7 @@ var _form_control_layout = require("../../form/form_control_layout");
|
|
|
14
14
|
var _num_icons = require("../../form/form_control_layout/_num_icons");
|
|
15
15
|
var _combo_box_pill = require("./combo_box_pill");
|
|
16
16
|
var _react2 = require("@emotion/react");
|
|
17
|
-
var _excluded = ["key", "label", "color", "onClick", "append", "prepend"];
|
|
17
|
+
var _excluded = ["key", "label", "color", "onClick", "append", "prepend", "truncationProps"];
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
19
|
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); }
|
|
20
20
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -161,6 +161,7 @@ var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
|
|
|
161
161
|
onClick = option.onClick,
|
|
162
162
|
append = option.append,
|
|
163
163
|
prepend = option.prepend,
|
|
164
|
+
truncationProps = option.truncationProps,
|
|
164
165
|
rest = _objectWithoutProperties(option, _excluded);
|
|
165
166
|
var pillOnClose = isDisabled || singleSelection || onClick ? undefined : onRemoveOption;
|
|
166
167
|
return (0, _react2.jsx)(_combo_box_pill.EuiComboBoxPill, _extends({
|
|
@@ -306,6 +307,7 @@ EuiComboBoxInput.propTypes = {
|
|
|
306
307
|
value: _propTypes.default.any,
|
|
307
308
|
prepend: _propTypes.default.node,
|
|
308
309
|
append: _propTypes.default.node,
|
|
310
|
+
truncationProps: _propTypes.default.any,
|
|
309
311
|
className: _propTypes.default.string,
|
|
310
312
|
"aria-label": _propTypes.default.string,
|
|
311
313
|
"data-test-subj": _propTypes.default.string,
|
|
@@ -314,6 +316,7 @@ EuiComboBoxInput.propTypes = {
|
|
|
314
316
|
value: _propTypes.default.any,
|
|
315
317
|
prepend: _propTypes.default.node,
|
|
316
318
|
append: _propTypes.default.node,
|
|
319
|
+
truncationProps: _propTypes.default.any,
|
|
317
320
|
className: _propTypes.default.string,
|
|
318
321
|
"aria-label": _propTypes.default.string,
|
|
319
322
|
"data-test-subj": _propTypes.default.string,
|
|
@@ -80,7 +80,9 @@ var EuiComboBoxPill = /*#__PURE__*/function (_Component) {
|
|
|
80
80
|
} : {};
|
|
81
81
|
var content = (0, _react2.jsx)(_react.default.Fragment, null, option.prepend && (0, _react2.jsx)("span", {
|
|
82
82
|
className: "euiComboBoxPill__prepend"
|
|
83
|
-
}, option.prepend),
|
|
83
|
+
}, option.prepend), (0, _react2.jsx)("span", {
|
|
84
|
+
className: "eui-textTruncate"
|
|
85
|
+
}, children), option.append && (0, _react2.jsx)("span", {
|
|
84
86
|
className: "euiComboBoxPill__append"
|
|
85
87
|
}, option.append));
|
|
86
88
|
if (onClose) {
|
|
@@ -143,6 +145,7 @@ EuiComboBoxPill.propTypes = {
|
|
|
143
145
|
value: _propTypes.default.any,
|
|
144
146
|
prepend: _propTypes.default.node,
|
|
145
147
|
append: _propTypes.default.node,
|
|
148
|
+
truncationProps: _propTypes.default.any,
|
|
146
149
|
className: _propTypes.default.string,
|
|
147
150
|
"aria-label": _propTypes.default.string,
|
|
148
151
|
"data-test-subj": _propTypes.default.string,
|
|
@@ -151,6 +154,7 @@ EuiComboBoxPill.propTypes = {
|
|
|
151
154
|
value: _propTypes.default.any,
|
|
152
155
|
prepend: _propTypes.default.node,
|
|
153
156
|
append: _propTypes.default.node,
|
|
157
|
+
truncationProps: _propTypes.default.any,
|
|
154
158
|
className: _propTypes.default.string,
|
|
155
159
|
"aria-label": _propTypes.default.string,
|
|
156
160
|
"data-test-subj": _propTypes.default.string,
|
|
@@ -125,6 +125,7 @@ EuiComboBoxOption.propTypes = {
|
|
|
125
125
|
value: _propTypes.default.any,
|
|
126
126
|
prepend: _propTypes.default.node,
|
|
127
127
|
append: _propTypes.default.node,
|
|
128
|
+
truncationProps: _propTypes.default.any,
|
|
128
129
|
className: _propTypes.default.string,
|
|
129
130
|
"aria-label": _propTypes.default.string,
|
|
130
131
|
"data-test-subj": _propTypes.default.string,
|
|
@@ -133,6 +134,7 @@ EuiComboBoxOption.propTypes = {
|
|
|
133
134
|
value: _propTypes.default.any,
|
|
134
135
|
prepend: _propTypes.default.node,
|
|
135
136
|
append: _propTypes.default.node,
|
|
137
|
+
truncationProps: _propTypes.default.any,
|
|
136
138
|
className: _propTypes.default.string,
|
|
137
139
|
"aria-label": _propTypes.default.string,
|
|
138
140
|
"data-test-subj": _propTypes.default.string,
|
|
@@ -10,6 +10,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
10
10
|
var _reactWindow = require("react-window");
|
|
11
11
|
var _flex = require("../../flex");
|
|
12
12
|
var _highlight = require("../../highlight");
|
|
13
|
+
var _mark = require("../../mark");
|
|
13
14
|
var _text = require("../../text");
|
|
14
15
|
var _loading = require("../../loading");
|
|
15
16
|
var _combo_box_title = require("./combo_box_title");
|
|
@@ -17,16 +18,17 @@ var _i18n = require("../../i18n");
|
|
|
17
18
|
var _filter_select_item = require("../../filter_group/filter_select_item");
|
|
18
19
|
var _badge = require("../../badge");
|
|
19
20
|
var _popover_panel = require("../../popover/popover_panel");
|
|
21
|
+
var _text_truncate = require("../../text_truncate");
|
|
20
22
|
var _react2 = require("@emotion/react");
|
|
21
|
-
var _excluded = ["key", "isGroupLabelOption", "label", "value", "prepend", "append"],
|
|
22
|
-
_excluded2 = ["data-test-subj", "activeOptionIndex", "areAllOptionsSelected", "customOptionText", "fullWidth", "getSelectedOptionForSearchValue", "isCaseSensitive", "isLoading", "listRef", "matchingOptions", "onCloseList", "onCreateOption", "onOptionClick", "onOptionEnterKey", "onScroll", "optionRef", "options", "position", "renderOption", "rootId", "rowHeight", "scrollToIndex", "searchValue", "selectedOptions", "singleSelection", "updatePosition", "width", "delimiter", "zIndex", "style", "listboxAriaLabel"];
|
|
23
|
+
var _excluded = ["key", "isGroupLabelOption", "label", "value", "prepend", "append", "truncationProps"],
|
|
24
|
+
_excluded2 = ["data-test-subj", "activeOptionIndex", "areAllOptionsSelected", "customOptionText", "fullWidth", "getSelectedOptionForSearchValue", "isCaseSensitive", "isLoading", "listRef", "matchingOptions", "onCloseList", "onCreateOption", "onOptionClick", "onOptionEnterKey", "onScroll", "optionRef", "options", "position", "renderOption", "rootId", "rowHeight", "scrollToIndex", "searchValue", "selectedOptions", "singleSelection", "updatePosition", "width", "delimiter", "zIndex", "style", "truncationProps", "listboxAriaLabel"];
|
|
23
25
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
26
|
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); }
|
|
25
27
|
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; }
|
|
26
28
|
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); }
|
|
29
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
27
30
|
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; }
|
|
28
31
|
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; }
|
|
29
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
30
32
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
31
33
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
32
34
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -48,7 +50,6 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
48
50
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
49
51
|
* Side Public License, v 1.
|
|
50
52
|
*/
|
|
51
|
-
var OPTION_CONTENT_CLASSNAME = 'euiComboBoxOption__content';
|
|
52
53
|
var hitEnterBadge = (0, _react2.jsx)(_badge.EuiBadge, {
|
|
53
54
|
className: "euiComboBoxOption__enterBadge",
|
|
54
55
|
color: "hollow",
|
|
@@ -109,6 +110,7 @@ var EuiComboBoxOptionsList = /*#__PURE__*/function (_Component) {
|
|
|
109
110
|
value = option.value,
|
|
110
111
|
prepend = option.prepend,
|
|
111
112
|
append = option.append,
|
|
113
|
+
_truncationProps = option.truncationProps,
|
|
112
114
|
rest = _objectWithoutProperties(option, _excluded);
|
|
113
115
|
var _this$props = _this.props,
|
|
114
116
|
singleSelection = _this$props.singleSelection,
|
|
@@ -119,6 +121,9 @@ var EuiComboBoxOptionsList = /*#__PURE__*/function (_Component) {
|
|
|
119
121
|
renderOption = _this$props.renderOption,
|
|
120
122
|
searchValue = _this$props.searchValue,
|
|
121
123
|
rootId = _this$props.rootId;
|
|
124
|
+
var hasTruncationProps = _this.props.truncationProps || _truncationProps;
|
|
125
|
+
var truncationProps = hasTruncationProps ? // Individual truncation settings should override component prop
|
|
126
|
+
_objectSpread(_objectSpread({}, _this.props.truncationProps), _truncationProps) : undefined;
|
|
122
127
|
if (isGroupLabelOption) {
|
|
123
128
|
return (0, _react2.jsx)("div", {
|
|
124
129
|
key: key !== null && key !== void 0 ? key : label,
|
|
@@ -149,16 +154,52 @@ var EuiComboBoxOptionsList = /*#__PURE__*/function (_Component) {
|
|
|
149
154
|
className: "euiComboBoxOption__contentWrapper"
|
|
150
155
|
}, prepend && (0, _react2.jsx)("span", {
|
|
151
156
|
className: "euiComboBoxOption__prepend"
|
|
152
|
-
}, prepend),
|
|
153
|
-
className:
|
|
154
|
-
}, renderOption(option, searchValue, 'euiComboBoxOption__renderOption')
|
|
155
|
-
search: searchValue,
|
|
156
|
-
strict: _this.props.isCaseSensitive,
|
|
157
|
-
className: OPTION_CONTENT_CLASSNAME
|
|
158
|
-
}, label), append && (0, _react2.jsx)("span", {
|
|
157
|
+
}, prepend), (0, _react2.jsx)("span", {
|
|
158
|
+
className: "euiComboBoxOption__content"
|
|
159
|
+
}, renderOption ? renderOption(option, searchValue, 'euiComboBoxOption__renderOption') : _this.renderTruncatedOption(label, truncationProps)), append && (0, _react2.jsx)("span", {
|
|
159
160
|
className: "euiComboBoxOption__append"
|
|
160
161
|
}, append), optionIsFocused && !optionIsDisabled ? hitEnterBadge : null));
|
|
161
162
|
});
|
|
163
|
+
_defineProperty(_assertThisInitialized(_this), "optionWidth", void 0);
|
|
164
|
+
_defineProperty(_assertThisInitialized(_this), "setOptionWidth", function (width) {
|
|
165
|
+
_this.optionWidth = width;
|
|
166
|
+
});
|
|
167
|
+
_defineProperty(_assertThisInitialized(_this), "renderTruncatedOption", function (text, truncationProps) {
|
|
168
|
+
var searchValue = _this.props.searchValue.trim();
|
|
169
|
+
if (!truncationProps && !searchValue) {
|
|
170
|
+
// Default to CSS text-overflow
|
|
171
|
+
return text;
|
|
172
|
+
}
|
|
173
|
+
if (!searchValue) {
|
|
174
|
+
return (0, _react2.jsx)(_text_truncate.EuiTextTruncate, _extends({
|
|
175
|
+
width: _this.optionWidth,
|
|
176
|
+
onResize: _this.setOptionWidth
|
|
177
|
+
}, truncationProps, {
|
|
178
|
+
text: text
|
|
179
|
+
}), function (text) {
|
|
180
|
+
return text;
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
var searchPositionStart = _this.props.isCaseSensitive ? text.indexOf(searchValue) : text.toLowerCase().indexOf(searchValue.toLowerCase());
|
|
184
|
+
var searchPositionCenter = searchPositionStart + Math.floor(searchValue.length / 2);
|
|
185
|
+
return (0, _react2.jsx)(_text_truncate.EuiTextTruncate, _extends({
|
|
186
|
+
width: _this.optionWidth,
|
|
187
|
+
onResize: _this.setOptionWidth
|
|
188
|
+
}, truncationProps, {
|
|
189
|
+
// When searching, don't allow overriding the truncation settings
|
|
190
|
+
truncation: "startEnd",
|
|
191
|
+
truncationPosition: searchPositionCenter,
|
|
192
|
+
text: text
|
|
193
|
+
}), function (text) {
|
|
194
|
+
return (0, _react2.jsx)(_react.default.Fragment, null, text.length >= searchValue.length ? (0, _react2.jsx)(_highlight.EuiHighlight, {
|
|
195
|
+
search: searchValue,
|
|
196
|
+
strict: _this.props.isCaseSensitive
|
|
197
|
+
}, text) :
|
|
198
|
+
// If the available truncated text is shorter than the full search string,
|
|
199
|
+
// just highlight the entire truncated text
|
|
200
|
+
(0, _react2.jsx)(_mark.EuiMark, null, text));
|
|
201
|
+
});
|
|
202
|
+
});
|
|
162
203
|
return _this;
|
|
163
204
|
}
|
|
164
205
|
_createClass(EuiComboBoxOptionsList, [{
|
|
@@ -242,6 +283,7 @@ var EuiComboBoxOptionsList = /*#__PURE__*/function (_Component) {
|
|
|
242
283
|
delimiter = _this$props2.delimiter,
|
|
243
284
|
zIndex = _this$props2.zIndex,
|
|
244
285
|
style = _this$props2.style,
|
|
286
|
+
truncationProps = _this$props2.truncationProps,
|
|
245
287
|
listboxAriaLabel = _this$props2.listboxAriaLabel,
|
|
246
288
|
rest = _objectWithoutProperties(_this$props2, _excluded2);
|
|
247
289
|
var emptyStateContent;
|
|
@@ -387,7 +429,7 @@ _defineProperty(EuiComboBoxOptionsList, "defaultProps", {
|
|
|
387
429
|
EuiComboBoxOptionsList.propTypes = {
|
|
388
430
|
className: _propTypes.default.string,
|
|
389
431
|
"aria-label": _propTypes.default.string,
|
|
390
|
-
"data-test-subj": _propTypes.default.
|
|
432
|
+
"data-test-subj": _propTypes.default.string,
|
|
391
433
|
css: _propTypes.default.any,
|
|
392
434
|
activeOptionIndex: _propTypes.default.number,
|
|
393
435
|
areAllOptionsSelected: _propTypes.default.bool,
|
|
@@ -414,6 +456,7 @@ EuiComboBoxOptionsList.propTypes = {
|
|
|
414
456
|
value: _propTypes.default.any,
|
|
415
457
|
prepend: _propTypes.default.node,
|
|
416
458
|
append: _propTypes.default.node,
|
|
459
|
+
truncationProps: _propTypes.default.any,
|
|
417
460
|
className: _propTypes.default.string,
|
|
418
461
|
"aria-label": _propTypes.default.string,
|
|
419
462
|
"data-test-subj": _propTypes.default.string,
|
|
@@ -422,6 +465,7 @@ EuiComboBoxOptionsList.propTypes = {
|
|
|
422
465
|
value: _propTypes.default.any,
|
|
423
466
|
prepend: _propTypes.default.node,
|
|
424
467
|
append: _propTypes.default.node,
|
|
468
|
+
truncationProps: _propTypes.default.any,
|
|
425
469
|
className: _propTypes.default.string,
|
|
426
470
|
"aria-label": _propTypes.default.string,
|
|
427
471
|
"data-test-subj": _propTypes.default.string,
|
|
@@ -448,6 +492,7 @@ EuiComboBoxOptionsList.propTypes = {
|
|
|
448
492
|
value: _propTypes.default.any,
|
|
449
493
|
prepend: _propTypes.default.node,
|
|
450
494
|
append: _propTypes.default.node,
|
|
495
|
+
truncationProps: _propTypes.default.any,
|
|
451
496
|
className: _propTypes.default.string,
|
|
452
497
|
"aria-label": _propTypes.default.string,
|
|
453
498
|
"data-test-subj": _propTypes.default.string,
|
|
@@ -456,6 +501,7 @@ EuiComboBoxOptionsList.propTypes = {
|
|
|
456
501
|
value: _propTypes.default.any,
|
|
457
502
|
prepend: _propTypes.default.node,
|
|
458
503
|
append: _propTypes.default.node,
|
|
504
|
+
truncationProps: _propTypes.default.any,
|
|
459
505
|
className: _propTypes.default.string,
|
|
460
506
|
"aria-label": _propTypes.default.string,
|
|
461
507
|
"data-test-subj": _propTypes.default.string,
|
|
@@ -479,6 +525,7 @@ EuiComboBoxOptionsList.propTypes = {
|
|
|
479
525
|
value: _propTypes.default.any,
|
|
480
526
|
prepend: _propTypes.default.node,
|
|
481
527
|
append: _propTypes.default.node,
|
|
528
|
+
truncationProps: _propTypes.default.any,
|
|
482
529
|
className: _propTypes.default.string,
|
|
483
530
|
"aria-label": _propTypes.default.string,
|
|
484
531
|
"data-test-subj": _propTypes.default.string,
|
|
@@ -487,6 +534,7 @@ EuiComboBoxOptionsList.propTypes = {
|
|
|
487
534
|
value: _propTypes.default.any,
|
|
488
535
|
prepend: _propTypes.default.node,
|
|
489
536
|
append: _propTypes.default.node,
|
|
537
|
+
truncationProps: _propTypes.default.any,
|
|
490
538
|
className: _propTypes.default.string,
|
|
491
539
|
"aria-label": _propTypes.default.string,
|
|
492
540
|
"data-test-subj": _propTypes.default.string,
|
|
@@ -498,5 +546,6 @@ EuiComboBoxOptionsList.propTypes = {
|
|
|
498
546
|
asPlainText: _propTypes.default.bool
|
|
499
547
|
}).isRequired]),
|
|
500
548
|
delimiter: _propTypes.default.string,
|
|
501
|
-
zIndex: _propTypes.default.number
|
|
549
|
+
zIndex: _propTypes.default.number,
|
|
550
|
+
truncationProps: _propTypes.default.any
|
|
502
551
|
};
|
|
@@ -153,7 +153,7 @@ var useDataGridColumnSelector = function useDataGridColumnSelector(availableColu
|
|
|
153
153
|
}, (0, _react2.jsx)(_drag_and_drop.EuiDroppable, {
|
|
154
154
|
droppableId: "columnOrder",
|
|
155
155
|
isDropDisabled: !isDragEnabled
|
|
156
|
-
}, (0, _react2.jsx)(_react.Fragment, null, filteredColumns.map(function (id, index) {
|
|
156
|
+
}, (0, _react2.jsx)(_react.default.Fragment, null, filteredColumns.map(function (id, index) {
|
|
157
157
|
return (0, _react2.jsx)(_drag_and_drop.EuiDraggable, {
|
|
158
158
|
key: id,
|
|
159
159
|
draggableId: id,
|
|
@@ -163,7 +163,9 @@ var useDataGridColumnSelector = function useDataGridColumnSelector(availableColu
|
|
|
163
163
|
customDragHandle: true
|
|
164
164
|
}, function (provided, state) {
|
|
165
165
|
return (0, _react2.jsx)("div", {
|
|
166
|
-
className:
|
|
166
|
+
className: (0, _classnames.default)('euiDataGridColumnSelector__item', {
|
|
167
|
+
'euiDataGridColumnSelector__item-isDragging': state.isDragging
|
|
168
|
+
}),
|
|
167
169
|
"data-test-subj": "dataGridColumnSelectorColumnItem-".concat(id)
|
|
168
170
|
}, (0, _react2.jsx)(_flex.EuiFlexGroup, {
|
|
169
171
|
responsive: false,
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.defaultSortDescLabel = exports.defaultSortAscLabel = exports.EuiDataGridColumnSortingDraggable = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
10
|
var _accessibility = require("../../accessibility");
|
|
10
11
|
var _button = require("../../button");
|
|
11
12
|
var _drag_and_drop = require("../../drag_and_drop");
|
|
@@ -75,7 +76,9 @@ var EuiDataGridColumnSortingDraggable = function EuiDataGridColumnSortingDraggab
|
|
|
75
76
|
customDragHandle: true
|
|
76
77
|
}, rest), function (provided, state) {
|
|
77
78
|
return (0, _react2.jsx)("div", {
|
|
78
|
-
className:
|
|
79
|
+
className: (0, _classnames.default)('euiDataGridColumnSorting__item', {
|
|
80
|
+
'euiDataGridColumnSorting__item-isDragging': state.isDragging
|
|
81
|
+
})
|
|
79
82
|
}, (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("p", null, (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
80
83
|
token: "euiColumnSortingDraggable.activeSortLabel",
|
|
81
84
|
default: "{display} is sorting this data grid",
|
|
@@ -49,7 +49,6 @@ var EuiDescriptionListTitle = function EuiDescriptionListTitle(_ref) {
|
|
|
49
49
|
switch (type) {
|
|
50
50
|
case 'inline':
|
|
51
51
|
conditionalStyles = compressed ? [styles.inlineStyles.compressed] : [styles.inlineStyles.normal];
|
|
52
|
-
conditionalStyles.push(styles[rowGutterSize]);
|
|
53
52
|
break;
|
|
54
53
|
case 'row':
|
|
55
54
|
conditionalStyles.push(styles[rowGutterSize]);
|
|
@@ -33,7 +33,7 @@ var euiDescriptionListTitleStyles = function euiDescriptionListTitleStyles(euiTh
|
|
|
33
33
|
// Inline types
|
|
34
34
|
inlineStyles: {
|
|
35
35
|
normal: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiFontSize)(euiThemeContext, 's'), " ", (0, _global_styling.logicalCSS)('padding-vertical', '1px'), " ", (0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.xs), ";;label:normal;"),
|
|
36
|
-
compressed: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiFontSize)(euiThemeContext, 'xs'), " ", (0, _global_styling.logicalCSS)('padding-vertical', '0'), " ", (0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.xs), ";;label:compressed;")
|
|
36
|
+
compressed: /*#__PURE__*/(0, _react.css)("font-size:", (0, _global_styling.euiFontSize)(euiThemeContext, 'xs').fontSize, ";line-height:", euiTheme.font.lineHeightMultiplier, ";", (0, _global_styling.logicalCSS)('padding-vertical', '0'), " ", (0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.xs), ";;label:compressed;")
|
|
37
37
|
},
|
|
38
38
|
// Alignment
|
|
39
39
|
right: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalTextAlignCSS)('right'), ";;label:right;"),
|
|
@@ -9,7 +9,9 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
10
|
var _dnd = require("@hello-pangea/dnd");
|
|
11
11
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
|
+
var _services = require("../../services");
|
|
12
13
|
var _droppable = require("./droppable");
|
|
14
|
+
var _draggable = require("./draggable.styles");
|
|
13
15
|
var _react2 = require("@emotion/react");
|
|
14
16
|
var _excluded = ["customDragHandle", "draggableId", "isDragDisabled", "hasInteractiveChildren", "isRemovable", "index", "children", "className", "spacing", "style", "data-test-subj"];
|
|
15
17
|
/*
|
|
@@ -30,12 +32,6 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
|
|
|
30
32
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
31
33
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
32
34
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
33
|
-
var spacingToClassNameMap = {
|
|
34
|
-
none: null,
|
|
35
|
-
s: 'euiDraggable--s',
|
|
36
|
-
m: 'euiDraggable--m',
|
|
37
|
-
l: 'euiDraggable--l'
|
|
38
|
-
};
|
|
39
35
|
var EuiDraggable = function EuiDraggable(_ref) {
|
|
40
36
|
var _ref$customDragHandle = _ref.customDragHandle,
|
|
41
37
|
customDragHandle = _ref$customDragHandle === void 0 ? false : _ref$customDragHandle,
|
|
@@ -57,29 +53,26 @@ var EuiDraggable = function EuiDraggable(_ref) {
|
|
|
57
53
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
58
54
|
var _useContext = (0, _react.useContext)(_droppable.EuiDroppableContext),
|
|
59
55
|
cloneItems = _useContext.cloneItems;
|
|
56
|
+
var euiTheme = (0, _services.useEuiTheme)();
|
|
57
|
+
var styles = (0, _draggable.euiDraggableStyles)(euiTheme);
|
|
60
58
|
return (0, _react2.jsx)(_dnd.Draggable, _extends({
|
|
61
59
|
draggableId: draggableId,
|
|
62
60
|
index: index,
|
|
63
61
|
isDragDisabled: isDragDisabled
|
|
64
62
|
}, rest), function (provided, snapshot, rubric) {
|
|
65
63
|
var _provided$dragHandleP, _provided$dragHandleP2;
|
|
66
|
-
var
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
'euiDraggable--isDragging': snapshot.isDragging,
|
|
70
|
-
'euiDraggable--withoutDropAnimation': isRemovable
|
|
71
|
-
}, spacingToClassNameMap[spacing], className);
|
|
64
|
+
var isDragging = snapshot.isDragging;
|
|
65
|
+
var cssStyles = [styles.euiDraggable, cloneItems && !isDragging && styles.hasClone, isDragging && styles.isDragging, isRemovable && styles.isRemovable, styles.spacing[spacing]];
|
|
66
|
+
var classes = (0, _classnames.default)('euiDraggable', className);
|
|
72
67
|
var childClasses = (0, _classnames.default)('euiDraggable__item', {
|
|
73
|
-
'euiDraggable__item
|
|
74
|
-
'euiDraggable__item--isDisabled': isDragDisabled,
|
|
75
|
-
'euiDraggable__item--isDragging': snapshot.isDragging,
|
|
76
|
-
'euiDraggable__item--isDropAnimating': snapshot.isDropAnimating
|
|
68
|
+
'euiDraggable__item-isDisabled': isDragDisabled
|
|
77
69
|
});
|
|
78
70
|
var DraggableElement = typeof children === 'function' ? children(provided, snapshot, rubric) : children;
|
|
79
|
-
return (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)("div", _extends({}, provided.draggableProps, !customDragHandle ? provided.dragHandleProps : {}, {
|
|
71
|
+
return (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)("div", _extends({}, provided.draggableProps, !customDragHandle ? provided.dragHandleProps : {}, {
|
|
80
72
|
ref: provided.innerRef,
|
|
81
73
|
"data-test-subj": dataTestSubj,
|
|
82
74
|
className: classes,
|
|
75
|
+
css: cssStyles,
|
|
83
76
|
style: _objectSpread(_objectSpread({}, style), provided.draggableProps.style)
|
|
84
77
|
// We use [role="group"] instead of [role="button"] when we expect a nested
|
|
85
78
|
// interactive element. Screen readers will cue users that this is a container
|
|
@@ -90,10 +83,12 @@ var EuiDraggable = function EuiDraggable(_ref) {
|
|
|
90
83
|
// because [role="group"] does not permit or warrant a tab stop
|
|
91
84
|
,
|
|
92
85
|
tabIndex: hasInteractiveChildren ? undefined : (_provided$dragHandleP2 = provided.dragHandleProps) === null || _provided$dragHandleP2 === void 0 ? void 0 : _provided$dragHandleP2.tabIndex
|
|
93
|
-
}),
|
|
94
|
-
className: (0, _classnames.default)(DraggableElement.props.className, childClasses)
|
|
95
|
-
|
|
96
|
-
|
|
86
|
+
}), (0, _services.cloneElementWithCss)(DraggableElement, {
|
|
87
|
+
className: (0, _classnames.default)(DraggableElement.props.className, childClasses),
|
|
88
|
+
css: [_draggable.euiDraggableItemStyles.euiDraggable__item, isDragDisabled && _draggable.euiDraggableItemStyles.disabled]
|
|
89
|
+
})), cloneItems && isDragging && (0, _react2.jsx)("div", {
|
|
90
|
+
className: (0, _classnames.default)(classes, 'euiDraggable--clone'),
|
|
91
|
+
css: cssStyles
|
|
97
92
|
}, DraggableElement));
|
|
98
93
|
});
|
|
99
94
|
};
|
|
@@ -120,7 +115,7 @@ EuiDraggable.propTypes = {
|
|
|
120
115
|
/**
|
|
121
116
|
* Adds padding to the draggable item
|
|
122
117
|
*/
|
|
123
|
-
spacing: _propTypes.default.
|
|
118
|
+
spacing: _propTypes.default.any,
|
|
124
119
|
style: _propTypes.default.any,
|
|
125
120
|
"aria-label": _propTypes.default.string,
|
|
126
121
|
"data-test-subj": _propTypes.default.string,
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.euiDraggableStyles = exports.euiDraggableItemStyles = void 0;
|
|
7
|
+
var _react = require("@emotion/react");
|
|
8
|
+
var _droppable = require("./droppable.styles");
|
|
9
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /*
|
|
10
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
11
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
12
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
13
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
14
|
+
* Side Public License, v 1.
|
|
15
|
+
*/
|
|
16
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
17
|
+
name: "1nohugb-isRemovable",
|
|
18
|
+
styles: "transition-duration:0.001s!important;label:isRemovable;"
|
|
19
|
+
} : {
|
|
20
|
+
name: "1nohugb-isRemovable",
|
|
21
|
+
styles: "transition-duration:0.001s!important;label:isRemovable;",
|
|
22
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
23
|
+
};
|
|
24
|
+
var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
25
|
+
name: "1wvdf2m-hasClone",
|
|
26
|
+
styles: "transform:none!important;label:hasClone;"
|
|
27
|
+
} : {
|
|
28
|
+
name: "1wvdf2m-hasClone",
|
|
29
|
+
styles: "transform:none!important;label:hasClone;",
|
|
30
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
31
|
+
};
|
|
32
|
+
var _ref3 = process.env.NODE_ENV === "production" ? {
|
|
33
|
+
name: "oyhf1i-euiDraggable",
|
|
34
|
+
styles: "&:focus{outline:none;&>.euiDraggable__item{outline:auto;}};label:euiDraggable;"
|
|
35
|
+
} : {
|
|
36
|
+
name: "oyhf1i-euiDraggable",
|
|
37
|
+
styles: "&:focus{outline:none;&>.euiDraggable__item{outline:auto;}};label:euiDraggable;",
|
|
38
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
39
|
+
};
|
|
40
|
+
var euiDraggableStyles = function euiDraggableStyles(euiThemeContext) {
|
|
41
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
42
|
+
return {
|
|
43
|
+
euiDraggable: _ref3,
|
|
44
|
+
isDragging: /*#__PURE__*/(0, _react.css)("z-index:", euiTheme.levels.toast, "!important;;label:isDragging;"),
|
|
45
|
+
hasClone: _ref2,
|
|
46
|
+
isRemovable: _ref,
|
|
47
|
+
spacing: (0, _droppable.sharedSpacingPadding)(euiThemeContext)
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
exports.euiDraggableStyles = euiDraggableStyles;
|
|
51
|
+
var euiDraggableItemStyles = {
|
|
52
|
+
euiDraggable__item: /*#__PURE__*/(0, _react.css)(";label:euiDraggable__item;"),
|
|
53
|
+
disabled: process.env.NODE_ENV === "production" ? {
|
|
54
|
+
name: "b86pnw-disabled",
|
|
55
|
+
styles: "cursor:not-allowed;label:disabled;"
|
|
56
|
+
} : {
|
|
57
|
+
name: "b86pnw-disabled",
|
|
58
|
+
styles: "cursor:not-allowed;label:disabled;",
|
|
59
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
exports.euiDraggableItemStyles = euiDraggableItemStyles;
|