@elastic/eui 97.0.0-backport.0 → 97.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/datagrid/body/cell/data_grid_cell.styles.js +4 -2
- package/es/components/datagrid/body/cell/focus_utils.js +14 -4
- package/es/components/datagrid/body/data_grid_body.js +2 -1
- package/es/components/datagrid/body/data_grid_body_custom.js +5 -2
- package/es/components/datagrid/body/data_grid_body_virtualized.js +8 -4
- package/es/components/datagrid/body/header/column_actions.js +262 -27
- package/es/components/datagrid/body/header/{data_grid_column_resizer.js → column_resizer.js} +10 -4
- package/es/components/datagrid/body/header/{data_grid_column_resizer.styles.js → column_resizer.styles.js} +6 -1
- package/es/components/datagrid/body/header/column_sorting.js +134 -0
- package/es/components/datagrid/body/header/data_grid_control_header_cell.js +3 -3
- package/es/components/datagrid/body/header/data_grid_header_cell.js +86 -305
- package/es/components/datagrid/body/header/data_grid_header_cell.styles.js +1 -1
- package/es/components/datagrid/body/header/data_grid_header_cell_wrapper.js +19 -17
- package/es/components/datagrid/body/header/data_grid_header_cell_wrapper.styles.js +1 -2
- package/es/components/datagrid/body/header/data_grid_header_row.js +25 -10
- package/es/components/datagrid/body/header/draggable_columns.js +301 -0
- package/es/components/datagrid/body/header/draggable_columns.styles.js +38 -0
- package/es/components/datagrid/data_grid.js +2 -1
- package/es/components/datagrid/data_grid.stories.utils.js +9 -6
- package/es/components/datagrid/utils/col_widths.js +17 -13
- package/es/components/datagrid/utils/focus.js +2 -2
- package/es/components/datagrid/utils/scrolling.js +13 -10
- package/es/components/drag_and_drop/draggable.js +13 -5
- package/es/components/header/header.styles.js +6 -12
- package/es/components/page_template/inner/page_inner.styles.js +3 -4
- package/es/components/tabs/tab.js +1 -1
- package/eui.d.ts +406 -311
- package/i18ntokens.json +123 -123
- package/lib/components/datagrid/body/cell/data_grid_cell.styles.js +4 -2
- package/lib/components/datagrid/body/cell/focus_utils.js +14 -4
- package/lib/components/datagrid/body/data_grid_body.js +2 -1
- package/lib/components/datagrid/body/data_grid_body_custom.js +5 -2
- package/lib/components/datagrid/body/data_grid_body_virtualized.js +8 -4
- package/lib/components/datagrid/body/header/column_actions.js +265 -29
- package/lib/components/datagrid/body/header/{data_grid_column_resizer.js → column_resizer.js} +11 -5
- package/{optimize/lib/components/datagrid/body/header/data_grid_column_resizer.styles.js → lib/components/datagrid/body/header/column_resizer.styles.js} +6 -1
- package/lib/components/datagrid/body/header/column_sorting.js +144 -0
- package/lib/components/datagrid/body/header/data_grid_control_header_cell.js +3 -3
- package/lib/components/datagrid/body/header/data_grid_header_cell.js +86 -305
- package/lib/components/datagrid/body/header/data_grid_header_cell.styles.js +1 -1
- package/lib/components/datagrid/body/header/data_grid_header_cell_wrapper.js +19 -17
- package/lib/components/datagrid/body/header/data_grid_header_cell_wrapper.styles.js +1 -2
- package/lib/components/datagrid/body/header/data_grid_header_row.js +24 -9
- package/lib/components/datagrid/body/header/draggable_columns.js +308 -0
- package/lib/components/datagrid/body/header/draggable_columns.styles.js +42 -0
- package/lib/components/datagrid/data_grid.js +2 -1
- package/lib/components/datagrid/data_grid.stories.utils.js +9 -6
- package/lib/components/datagrid/utils/col_widths.js +17 -13
- package/lib/components/datagrid/utils/focus.js +2 -2
- package/lib/components/datagrid/utils/scrolling.js +13 -10
- package/lib/components/drag_and_drop/draggable.js +13 -5
- package/lib/components/header/header.styles.js +6 -12
- package/lib/components/page_template/inner/page_inner.styles.js +3 -4
- package/lib/components/tabs/tab.js +1 -1
- package/optimize/es/components/datagrid/body/cell/data_grid_cell.styles.js +4 -2
- package/optimize/es/components/datagrid/body/cell/focus_utils.js +13 -4
- package/optimize/es/components/datagrid/body/data_grid_body_custom.js +3 -1
- package/optimize/es/components/datagrid/body/data_grid_body_virtualized.js +6 -3
- package/optimize/es/components/datagrid/body/header/column_actions.js +250 -26
- package/optimize/es/components/datagrid/body/header/{data_grid_column_resizer.js → column_resizer.js} +8 -3
- package/optimize/es/components/datagrid/body/header/{data_grid_column_resizer.styles.js → column_resizer.styles.js} +6 -1
- package/optimize/es/components/datagrid/body/header/column_sorting.js +134 -0
- package/optimize/es/components/datagrid/body/header/data_grid_control_header_cell.js +2 -2
- package/optimize/es/components/datagrid/body/header/data_grid_header_cell.js +82 -302
- package/optimize/es/components/datagrid/body/header/data_grid_header_cell.styles.js +1 -1
- package/optimize/es/components/datagrid/body/header/data_grid_header_cell_wrapper.js +15 -14
- package/optimize/es/components/datagrid/body/header/data_grid_header_cell_wrapper.styles.js +1 -2
- package/optimize/es/components/datagrid/body/header/data_grid_header_row.js +25 -10
- package/optimize/es/components/datagrid/body/header/draggable_columns.js +223 -0
- package/optimize/es/components/datagrid/body/header/draggable_columns.styles.js +38 -0
- package/optimize/es/components/datagrid/data_grid.js +2 -1
- package/optimize/es/components/datagrid/data_grid.stories.utils.js +7 -5
- package/optimize/es/components/datagrid/utils/col_widths.js +17 -13
- package/optimize/es/components/datagrid/utils/focus.js +2 -2
- package/optimize/es/components/datagrid/utils/scrolling.js +13 -10
- package/optimize/es/components/drag_and_drop/draggable.js +8 -3
- package/optimize/es/components/header/header.styles.js +6 -12
- package/optimize/es/components/page_template/inner/page_inner.styles.js +3 -4
- package/optimize/es/components/tabs/tab.js +1 -1
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell.styles.js +4 -2
- package/optimize/lib/components/datagrid/body/cell/focus_utils.js +13 -4
- package/optimize/lib/components/datagrid/body/data_grid_body_custom.js +3 -1
- package/optimize/lib/components/datagrid/body/data_grid_body_virtualized.js +6 -3
- package/optimize/lib/components/datagrid/body/header/column_actions.js +253 -27
- package/optimize/lib/components/datagrid/body/header/{data_grid_column_resizer.js → column_resizer.js} +9 -4
- package/{test-env/components/datagrid/body/header/data_grid_column_resizer.styles.js → optimize/lib/components/datagrid/body/header/column_resizer.styles.js} +6 -1
- package/optimize/lib/components/datagrid/body/header/column_sorting.js +144 -0
- package/optimize/lib/components/datagrid/body/header/data_grid_control_header_cell.js +2 -2
- package/optimize/lib/components/datagrid/body/header/data_grid_header_cell.js +80 -300
- package/optimize/lib/components/datagrid/body/header/data_grid_header_cell.styles.js +1 -1
- package/optimize/lib/components/datagrid/body/header/data_grid_header_cell_wrapper.js +15 -14
- package/optimize/lib/components/datagrid/body/header/data_grid_header_cell_wrapper.styles.js +1 -2
- package/optimize/lib/components/datagrid/body/header/data_grid_header_row.js +24 -9
- package/optimize/lib/components/datagrid/body/header/draggable_columns.js +231 -0
- package/optimize/lib/components/datagrid/body/header/draggable_columns.styles.js +43 -0
- package/optimize/lib/components/datagrid/data_grid.js +2 -1
- package/optimize/lib/components/datagrid/data_grid.stories.utils.js +7 -5
- package/optimize/lib/components/datagrid/utils/col_widths.js +17 -13
- package/optimize/lib/components/datagrid/utils/focus.js +2 -2
- package/optimize/lib/components/datagrid/utils/scrolling.js +13 -10
- package/optimize/lib/components/drag_and_drop/draggable.js +8 -3
- package/optimize/lib/components/header/header.styles.js +6 -12
- package/optimize/lib/components/page_template/inner/page_inner.styles.js +3 -4
- package/optimize/lib/components/tabs/tab.js +1 -1
- package/package.json +2 -3
- package/test-env/components/datagrid/body/cell/data_grid_cell.styles.js +4 -2
- package/test-env/components/datagrid/body/cell/focus_utils.js +13 -4
- package/test-env/components/datagrid/body/data_grid_body.js +2 -1
- package/test-env/components/datagrid/body/data_grid_body_custom.js +5 -2
- package/test-env/components/datagrid/body/data_grid_body_virtualized.js +8 -4
- package/test-env/components/datagrid/body/header/column_actions.js +261 -27
- package/test-env/components/datagrid/body/header/{data_grid_column_resizer.js → column_resizer.js} +11 -5
- package/{lib/components/datagrid/body/header/data_grid_column_resizer.styles.js → test-env/components/datagrid/body/header/column_resizer.styles.js} +6 -1
- package/test-env/components/datagrid/body/header/column_sorting.js +144 -0
- package/test-env/components/datagrid/body/header/data_grid_control_header_cell.js +3 -3
- package/test-env/components/datagrid/body/header/data_grid_header_cell.js +82 -301
- package/test-env/components/datagrid/body/header/data_grid_header_cell.styles.js +1 -1
- package/test-env/components/datagrid/body/header/data_grid_header_cell_wrapper.js +19 -17
- package/test-env/components/datagrid/body/header/data_grid_header_cell_wrapper.styles.js +1 -2
- package/test-env/components/datagrid/body/header/data_grid_header_row.js +24 -9
- package/test-env/components/datagrid/body/header/draggable_columns.js +305 -0
- package/test-env/components/datagrid/body/header/draggable_columns.styles.js +43 -0
- package/test-env/components/datagrid/data_grid.js +2 -1
- package/test-env/components/datagrid/data_grid.stories.utils.js +9 -6
- package/test-env/components/datagrid/utils/col_widths.js +17 -13
- package/test-env/components/datagrid/utils/focus.js +2 -2
- package/test-env/components/datagrid/utils/scrolling.js +13 -10
- package/test-env/components/drag_and_drop/draggable.js +13 -5
- package/test-env/components/header/header.styles.js +6 -12
- package/test-env/components/page_template/inner/page_inner.styles.js +3 -4
- package/test-env/components/tabs/tab.js +1 -1
|
@@ -49,11 +49,11 @@ var useFocus = exports.useFocus = function useFocus() {
|
|
|
49
49
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
50
50
|
focusedCell = _useState4[0],
|
|
51
51
|
_setFocusedCell = _useState4[1];
|
|
52
|
-
var setFocusedCell = (0, _react.useCallback)(function (nextFocusedCell) {
|
|
52
|
+
var setFocusedCell = (0, _react.useCallback)(function (nextFocusedCell, forceUpdate) {
|
|
53
53
|
_setFocusedCell(function (prevFocusedCell) {
|
|
54
54
|
// If the x/y coordinates remained the same, don't update. This keeps the focusedCell
|
|
55
55
|
// reference stable, and allows it to be used in places that need reference equality.
|
|
56
|
-
if (nextFocusedCell[0] === (prevFocusedCell === null || prevFocusedCell === void 0 ? void 0 : prevFocusedCell[0]) && nextFocusedCell[1] === (prevFocusedCell === null || prevFocusedCell === void 0 ? void 0 : prevFocusedCell[1])) {
|
|
56
|
+
if (!forceUpdate && nextFocusedCell[0] === (prevFocusedCell === null || prevFocusedCell === void 0 ? void 0 : prevFocusedCell[0]) && nextFocusedCell[1] === (prevFocusedCell === null || prevFocusedCell === void 0 ? void 0 : prevFocusedCell[1])) {
|
|
57
57
|
return prevFocusedCell;
|
|
58
58
|
} else {
|
|
59
59
|
setIsFocusedCellInView(true); // scrolling.ts ensures focused cells are fully in view
|
|
@@ -71,7 +71,8 @@ var useScrollCellIntoView = exports.useScrollCellIntoView = function useScrollCe
|
|
|
71
71
|
headerRowHeight = _ref.headerRowHeight,
|
|
72
72
|
footerRowHeight = _ref.footerRowHeight,
|
|
73
73
|
visibleRowCount = _ref.visibleRowCount,
|
|
74
|
-
hasStickyFooter = _ref.hasStickyFooter
|
|
74
|
+
hasStickyFooter = _ref.hasStickyFooter,
|
|
75
|
+
canDragAndDropColumns = _ref.canDragAndDropColumns;
|
|
75
76
|
var scrollCellIntoView = (0, _react.useCallback)(
|
|
76
77
|
/*#__PURE__*/
|
|
77
78
|
// Note: in order for this UX to work correctly with react-window's APIs,
|
|
@@ -82,7 +83,7 @@ var useScrollCellIntoView = exports.useScrollCellIntoView = function useScrollCe
|
|
|
82
83
|
var rowIndex = _ref3.rowIndex,
|
|
83
84
|
colIndex = _ref3.colIndex;
|
|
84
85
|
return /*#__PURE__*/_regenerator.default.mark(function _callee(_adjustedScrollLeft) {
|
|
85
|
-
var getCell, cell, cellIsInView, _outerGridRef$current, scrollTop, scrollLeft, adjustedScrollTop, adjustedScrollLeft, cellRightPos, rightScrollBound, rightWidthOutOfView,
|
|
86
|
+
var getCell, cell, cellIsInView, isStickyHeader, isStickyFooter, isDraggableHeader, isDraggableHeaderCell, _outerGridRef$current, scrollTop, scrollLeft, adjustedScrollTop, adjustedScrollLeft, cellLeftPos, cellRightPos, rightScrollBound, rightWidthOutOfView, leftScrollBound, leftWidthOutOfView, _adjustedScrollTop, parentRow, cellBottomPos, bottomScrollBound, bottomHeightOutOfView, cellTopPos, topScrollBound, topHeightOutOfView, _adjustedScrollLeft2, _adjustedScrollTop2;
|
|
86
87
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
87
88
|
while (1) switch (_context.prev = _context.next) {
|
|
88
89
|
case 0:
|
|
@@ -128,7 +129,10 @@ var useScrollCellIntoView = exports.useScrollCellIntoView = function useScrollCe
|
|
|
128
129
|
return _context.abrupt("return");
|
|
129
130
|
case 14:
|
|
130
131
|
// If for some reason we can't find a valid cell, short-circuit
|
|
131
|
-
|
|
132
|
+
isStickyHeader = rowIndex === -1;
|
|
133
|
+
isStickyFooter = hasStickyFooter && rowIndex === visibleRowCount;
|
|
134
|
+
isDraggableHeader = canDragAndDropColumns && isStickyHeader;
|
|
135
|
+
isDraggableHeaderCell = isDraggableHeader && cell.offsetLeft === 0 && colIndex !== 0; // We now manually adjust scroll positioning around the cell to ensure it's
|
|
132
136
|
// fully in view on all sides. A couple of notes on this:
|
|
133
137
|
// 1. We're avoiding relying on react-window's scrollToItem for this because it also
|
|
134
138
|
// does not account for sticky items (see https://github.com/bvaughn/react-window/issues/586)
|
|
@@ -137,8 +141,10 @@ var useScrollCellIntoView = exports.useScrollCellIntoView = function useScrollCe
|
|
|
137
141
|
// halfway there, but doesn't guarantee the *full* cell in view, or account for
|
|
138
142
|
// sticky positioned rows or OS scrollbars, hence these workarounds
|
|
139
143
|
_outerGridRef$current = outerGridRef.current, scrollTop = _outerGridRef$current.scrollTop, scrollLeft = _outerGridRef$current.scrollLeft;
|
|
140
|
-
//
|
|
141
|
-
|
|
144
|
+
// Draggable header columns are nested within EuiDraggables,
|
|
145
|
+
// and their offsetLeft needs to go up a wrapper as a result
|
|
146
|
+
cellLeftPos = isDraggableHeaderCell ? cell.offsetParent.offsetLeft : cell.offsetLeft; // Check if the cell's right side is outside the current scrolling bounds
|
|
147
|
+
cellRightPos = cellLeftPos + cell.offsetWidth;
|
|
142
148
|
rightScrollBound = scrollLeft + outerGridRef.current.clientWidth; // Note: We specifically want clientWidth and not offsetWidth here to account for scrollbars
|
|
143
149
|
rightWidthOutOfView = cellRightPos - rightScrollBound;
|
|
144
150
|
if (rightWidthOutOfView > 0) {
|
|
@@ -146,7 +152,6 @@ var useScrollCellIntoView = exports.useScrollCellIntoView = function useScrollCe
|
|
|
146
152
|
}
|
|
147
153
|
|
|
148
154
|
// Check if the cell's left side is outside the current scrolling bounds
|
|
149
|
-
cellLeftPos = cell.offsetLeft;
|
|
150
155
|
leftScrollBound = (_adjustedScrollLeft = adjustedScrollLeft) !== null && _adjustedScrollLeft !== void 0 ? _adjustedScrollLeft : scrollLeft;
|
|
151
156
|
leftWidthOutOfView = leftScrollBound - cellLeftPos;
|
|
152
157
|
if (leftWidthOutOfView > 0) {
|
|
@@ -157,8 +162,6 @@ var useScrollCellIntoView = exports.useScrollCellIntoView = function useScrollCe
|
|
|
157
162
|
|
|
158
163
|
// Skip top/bottom scroll adjustments for sticky headers & footers
|
|
159
164
|
// since they should always be in view vertically
|
|
160
|
-
isStickyHeader = rowIndex === -1;
|
|
161
|
-
isStickyFooter = hasStickyFooter && rowIndex === visibleRowCount;
|
|
162
165
|
if (!isStickyHeader && !isStickyFooter) {
|
|
163
166
|
parentRow = cell.parentNode; // Check if the cell's bottom side is outside the current scrolling bounds
|
|
164
167
|
cellBottomPos = parentRow.offsetTop + cell.offsetHeight;
|
|
@@ -188,7 +191,7 @@ var useScrollCellIntoView = exports.useScrollCellIntoView = function useScrollCe
|
|
|
188
191
|
scrollTop: (_adjustedScrollTop2 = adjustedScrollTop) !== null && _adjustedScrollTop2 !== void 0 ? _adjustedScrollTop2 : scrollTop
|
|
189
192
|
});
|
|
190
193
|
}
|
|
191
|
-
case
|
|
194
|
+
case 29:
|
|
192
195
|
case "end":
|
|
193
196
|
return _context.stop();
|
|
194
197
|
}
|
|
@@ -198,7 +201,7 @@ var useScrollCellIntoView = exports.useScrollCellIntoView = function useScrollCe
|
|
|
198
201
|
return function (_x) {
|
|
199
202
|
return _ref2.apply(this, arguments);
|
|
200
203
|
};
|
|
201
|
-
}(), [gridRef, outerGridRef, hasGridScrolling, headerRowHeight, footerRowHeight, visibleRowCount, hasStickyFooter]);
|
|
204
|
+
}(), [gridRef, outerGridRef, hasGridScrolling, headerRowHeight, footerRowHeight, visibleRowCount, hasStickyFooter, canDragAndDropColumns]);
|
|
202
205
|
return {
|
|
203
206
|
scrollCellIntoView: scrollCellIntoView
|
|
204
207
|
};
|
|
@@ -55,6 +55,7 @@ var EuiDraggable = exports.EuiDraggable = function EuiDraggable(_ref) {
|
|
|
55
55
|
cloneItems = _useContext.cloneItems;
|
|
56
56
|
var euiTheme = (0, _services.useEuiTheme)();
|
|
57
57
|
var styles = (0, _draggable.euiDraggableStyles)(euiTheme);
|
|
58
|
+
var hasCustomDragHandle = customDragHandle !== false;
|
|
58
59
|
return (0, _react2.jsx)(_dnd.Draggable, (0, _extends2.default)({
|
|
59
60
|
draggableId: draggableId,
|
|
60
61
|
index: index,
|
|
@@ -62,13 +63,14 @@ var EuiDraggable = exports.EuiDraggable = function EuiDraggable(_ref) {
|
|
|
62
63
|
}, rest), function (provided, snapshot, rubric) {
|
|
63
64
|
var _provided$dragHandleP, _provided$dragHandleP2;
|
|
64
65
|
var isDragging = snapshot.isDragging;
|
|
66
|
+
var isFullyCustomDragHandle = customDragHandle === 'custom';
|
|
65
67
|
var cssStyles = [styles.euiDraggable, cloneItems && !isDragging && styles.hasClone, isDragging && styles.isDragging, isRemovable && styles.isRemovable, styles.spacing[spacing]];
|
|
66
68
|
var classes = (0, _classnames.default)('euiDraggable', className);
|
|
67
69
|
var childClasses = (0, _classnames.default)('euiDraggable__item', {
|
|
68
70
|
'euiDraggable__item-isDisabled': isDragDisabled
|
|
69
71
|
});
|
|
70
72
|
var DraggableElement = typeof children === 'function' ? children(provided, snapshot, rubric) : children;
|
|
71
|
-
var content = (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)("div", (0, _extends2.default)({}, provided.draggableProps, !
|
|
73
|
+
var content = (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)("div", (0, _extends2.default)({}, provided.draggableProps, !hasCustomDragHandle ? provided.dragHandleProps : {}, {
|
|
72
74
|
ref: provided.innerRef,
|
|
73
75
|
"data-test-subj": dataTestSubj,
|
|
74
76
|
className: classes,
|
|
@@ -78,11 +80,14 @@ var EuiDraggable = exports.EuiDraggable = function EuiDraggable(_ref) {
|
|
|
78
80
|
// interactive element. Screen readers will cue users that this is a container
|
|
79
81
|
// and has one or more elements inside that are part of a related group.
|
|
80
82
|
,
|
|
81
|
-
role:
|
|
83
|
+
role: isFullyCustomDragHandle ? undefined // prevent wrapper role from removing semantics of the children
|
|
84
|
+
: hasInteractiveChildren ? 'group' : (_provided$dragHandleP = provided.dragHandleProps) === null || _provided$dragHandleP === void 0 ? void 0 : _provided$dragHandleP.role
|
|
82
85
|
// If the container includes an interactive element, we remove the tabindex=0
|
|
83
86
|
// because [role="group"] does not permit or warrant a tab stop
|
|
87
|
+
// additionally we remove the tabindex when the child is a fully custom handle
|
|
88
|
+
// that has its own tabindex and handle props
|
|
84
89
|
,
|
|
85
|
-
tabIndex: hasInteractiveChildren ? undefined : (_provided$dragHandleP2 = provided.dragHandleProps) === null || _provided$dragHandleP2 === void 0 ? void 0 : _provided$dragHandleP2.tabIndex
|
|
90
|
+
tabIndex: hasInteractiveChildren || isFullyCustomDragHandle ? undefined : (_provided$dragHandleP2 = provided.dragHandleProps) === null || _provided$dragHandleP2 === void 0 ? void 0 : _provided$dragHandleP2.tabIndex
|
|
86
91
|
}), (0, _services.cloneElementWithCss)(DraggableElement, {
|
|
87
92
|
className: (0, _classnames.default)(DraggableElement.props.className, childClasses),
|
|
88
93
|
css: [_draggable.euiDraggableItemStyles.euiDraggable__item, isDragDisabled && _draggable.euiDraggableItemStyles.disabled]
|
|
@@ -100,9 +105,12 @@ EuiDraggable.propTypes = {
|
|
|
100
105
|
children: _propTypes.default.oneOfType([_propTypes.default.element.isRequired, _propTypes.default.any.isRequired]).isRequired,
|
|
101
106
|
className: _propTypes.default.string,
|
|
102
107
|
/**
|
|
103
|
-
* Whether the `children` will provide and set up its own drag handle
|
|
108
|
+
* Whether the `children` will provide and set up its own drag handle.
|
|
109
|
+
* The `custom` value additionally removes the `role` from the draggable container.
|
|
110
|
+
* Use this if the `children` element is focusable and should keep its
|
|
111
|
+
* semantic role for accessibility purposes.
|
|
104
112
|
*/
|
|
105
|
-
customDragHandle: _propTypes.default.bool,
|
|
113
|
+
customDragHandle: _propTypes.default.oneOfType([_propTypes.default.bool.isRequired, _propTypes.default.oneOf(["custom"])]),
|
|
106
114
|
/**
|
|
107
115
|
* Whether the container has interactive children and should have `role="group"` instead of `"button"`.
|
|
108
116
|
* Setting this flag ensures your drag & drop container is keyboard and screen reader accessible.
|
|
@@ -26,23 +26,18 @@ var euiHeaderVariables = exports.euiHeaderVariables = function euiHeaderVariable
|
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
28
|
var euiHeaderStyles = exports.euiHeaderStyles = function euiHeaderStyles(euiThemeContext) {
|
|
29
|
-
var euiTheme = euiThemeContext.euiTheme
|
|
30
|
-
colorMode = euiThemeContext.colorMode;
|
|
29
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
31
30
|
var _euiHeaderVariables = euiHeaderVariables(euiThemeContext),
|
|
32
31
|
height = _euiHeaderVariables.height,
|
|
33
32
|
padding = _euiHeaderVariables.padding;
|
|
34
|
-
|
|
35
|
-
// Curated border color to fade into the shadow without looking too much like a border
|
|
36
|
-
// It adds separation between the header and flyout
|
|
37
|
-
var borderColor = colorMode === 'DARK' ? (0, _services.shade)(euiTheme.colors.emptyShade, 0.35) : (0, _services.shade)(euiTheme.border.color, 0.03);
|
|
38
33
|
return {
|
|
39
|
-
euiHeader: /*#__PURE__*/(0, _react.css)("display:flex;justify-content:space-between;", (0, _global_styling.logicalCSS)('height', height), " ", (0, _global_styling.logicalCSS)('padding-horizontal', padding), " ", (0, _mixins.euiShadowSmall)(euiThemeContext), ";;label:euiHeader;"),
|
|
34
|
+
euiHeader: /*#__PURE__*/(0, _react.css)("display:flex;justify-content:space-between;", (0, _global_styling.logicalCSS)('height', height), " ", (0, _global_styling.logicalCSS)('padding-horizontal', padding), " ", (0, _global_styling.logicalCSS)('border-bottom', euiTheme.border.thin), " ", (0, _mixins.euiShadowSmall)(euiThemeContext), ";;label:euiHeader;"),
|
|
40
35
|
// Position
|
|
41
36
|
static: /*#__PURE__*/(0, _react.css)("z-index:", Number(euiTheme.levels.header) - 1, ";position:relative;;label:static;"),
|
|
42
37
|
fixed: /*#__PURE__*/(0, _react.css)("z-index:", euiTheme.levels.header, ";position:fixed;", (0, _global_styling.logicalCSS)('top', 0), " ", (0, _global_styling.logicalCSS)('horizontal', 0), ";;label:fixed;"),
|
|
43
38
|
// Theme
|
|
44
|
-
default: /*#__PURE__*/(0, _react.css)("background-color:", euiTheme.colors.emptyShade, "
|
|
45
|
-
dark: /*#__PURE__*/(0, _react.css)(euiHeaderDarkStyles(euiThemeContext
|
|
39
|
+
default: /*#__PURE__*/(0, _react.css)("background-color:", euiTheme.colors.emptyShade, ";;label:default;"),
|
|
40
|
+
dark: /*#__PURE__*/(0, _react.css)(euiHeaderDarkStyles(euiThemeContext), ";label:dark;")
|
|
46
41
|
};
|
|
47
42
|
};
|
|
48
43
|
|
|
@@ -56,12 +51,11 @@ var euiHeaderStyles = exports.euiHeaderStyles = function euiHeaderStyles(euiThem
|
|
|
56
51
|
* by Kibana in the near future, at which point we can remove this
|
|
57
52
|
*/
|
|
58
53
|
|
|
59
|
-
var euiHeaderDarkStyles = function euiHeaderDarkStyles(euiThemeContext
|
|
54
|
+
var euiHeaderDarkStyles = function euiHeaderDarkStyles(euiThemeContext) {
|
|
60
55
|
var euiTheme = euiThemeContext.euiTheme,
|
|
61
56
|
colorMode = euiThemeContext.colorMode;
|
|
62
57
|
var _euiFormVariables = (0, _form.euiFormVariables)(euiThemeContext),
|
|
63
58
|
controlPlaceholderText = _euiFormVariables.controlPlaceholderText;
|
|
64
59
|
var backgroundColor = colorMode === 'DARK' ? (0, _services.shade)(euiTheme.colors.lightestShade, 0.5) : (0, _services.shade)(euiTheme.colors.darkestShade, 0.28);
|
|
65
|
-
|
|
66
|
-
return "\n background-color: ".concat(backgroundColor, ";\n ").concat((0, _global_styling.logicalCSS)('border-bottom-color', borderColor), "\n\n .euiHeaderLogo__text,\n .euiHeaderLink,\n .euiHeaderSectionItemButton {\n color: ").concat(euiTheme.colors.ghost, ";\n }\n\n .euiHeaderLink-isActive {\n color: ").concat((0, _services.makeHighContrastColor)(euiTheme.colors.primary)(backgroundColor), ";\n }\n\n .euiHeaderLogo,\n .euiHeaderLink,\n .euiHeaderSectionItemButton {\n &:focus {\n background-color: ").concat((0, _services.shade)(euiTheme.colors.primary, 0.5), ";\n }\n }\n\n .euiHeaderSectionItemButton__notification--badge {\n box-shadow: 0 0 0 ").concat(euiTheme.border.width.thin, " ").concat(backgroundColor, ";\n }\n\n .euiHeaderSectionItemButton__notification--dot {\n stroke: ").concat(backgroundColor, ";\n }\n\n .euiSelectableTemplateSitewide .euiFormControlLayout {\n background-color: transparent;\n\n &--group {\n border-color: ").concat((0, _services.transparentize)(euiTheme.colors.ghost, 0.3), ";\n }\n\n &:not(:focus-within) {\n /* Increase contrast of filled text to be more than placeholder text */\n color: ").concat(euiTheme.colors.ghost, ";\n\n input {\n /* Increase contrast of placeholder text */\n &::placeholder {\n color: ").concat((0, _services.makeHighContrastColor)(controlPlaceholderText, 8)(backgroundColor), ";\n }\n\n /* Inherit color from form control layout */\n color: inherit;\n background-color: transparent;\n }\n\n .euiFormControlLayout__append,\n .euiFormControlLayout__prepend {\n background-color: transparent;\n }\n\n .euiFormLabel {\n color: inherit;\n }\n }\n }\n ");
|
|
60
|
+
return "\n background-color: ".concat(backgroundColor, ";\n\n .euiHeaderLogo__text,\n .euiHeaderLink,\n .euiHeaderSectionItemButton {\n color: ").concat(euiTheme.colors.ghost, ";\n }\n\n .euiHeaderLink-isActive {\n color: ").concat((0, _services.makeHighContrastColor)(euiTheme.colors.primary)(backgroundColor), ";\n }\n\n .euiHeaderLogo,\n .euiHeaderLink,\n .euiHeaderSectionItemButton {\n &:focus {\n background-color: ").concat((0, _services.shade)(euiTheme.colors.primary, 0.5), ";\n }\n }\n\n .euiHeaderSectionItemButton__notification--badge {\n box-shadow: 0 0 0 ").concat(euiTheme.border.width.thin, " ").concat(backgroundColor, ";\n }\n\n .euiHeaderSectionItemButton__notification--dot {\n stroke: ").concat(backgroundColor, ";\n }\n\n .euiSelectableTemplateSitewide .euiFormControlLayout {\n background-color: transparent;\n\n &--group {\n border-color: ").concat((0, _services.transparentize)(euiTheme.colors.ghost, 0.3), ";\n }\n\n &:not(:focus-within) {\n /* Increase contrast of filled text to be more than placeholder text */\n color: ").concat(euiTheme.colors.ghost, ";\n\n input {\n /* Increase contrast of placeholder text */\n &::placeholder {\n color: ").concat((0, _services.makeHighContrastColor)(controlPlaceholderText, 8)(backgroundColor), ";\n }\n\n /* Inherit color from form control layout */\n color: inherit;\n background-color: transparent;\n }\n\n .euiFormControlLayout__append,\n .euiFormControlLayout__prepend {\n background-color: transparent;\n }\n\n .euiFormLabel {\n color: inherit;\n }\n }\n }\n ");
|
|
67
61
|
};
|
|
@@ -7,7 +7,6 @@ exports.euiPageInnerStyles = void 0;
|
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
8
|
var _mixins = require("../../../themes/amsterdam/global_styling/mixins");
|
|
9
9
|
var _global_styling = require("../../../global_styling");
|
|
10
|
-
var _services = require("../../../services");
|
|
11
10
|
/*
|
|
12
11
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
13
12
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -17,13 +16,13 @@ var _services = require("../../../services");
|
|
|
17
16
|
*/
|
|
18
17
|
|
|
19
18
|
var euiPageInnerStyles = exports.euiPageInnerStyles = function euiPageInnerStyles(euiThemeContext) {
|
|
20
|
-
var
|
|
19
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
21
20
|
return {
|
|
22
21
|
euiPageInner: /*#__PURE__*/(0, _react.css)("display:flex;flex-direction:column;align-items:stretch;flex:1 1 100%;", (0, _global_styling.logicalCSS)('max-width', '100%'), " ", (0, _global_styling.logicalCSS)('min-width', '0'), ";;label:euiPageInner;"),
|
|
23
22
|
panelled: /*#__PURE__*/(0, _react.css)("background:", (0, _global_styling.euiBackgroundColor)(euiThemeContext, 'plain'), ";", (0, _mixins.euiShadow)(euiThemeContext, 'm'), ";;label:panelled;"),
|
|
24
23
|
border: {
|
|
25
|
-
top: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('border-top',
|
|
26
|
-
left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('border-left',
|
|
24
|
+
top: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('border-top', euiTheme.border.thin), ";;label:top;"),
|
|
25
|
+
left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('border-left', euiTheme.border.thin), ";;label:left;")
|
|
27
26
|
}
|
|
28
27
|
};
|
|
29
28
|
};
|
|
@@ -75,7 +75,7 @@ var EuiTab = exports.EuiTab = function EuiTab(_ref) {
|
|
|
75
75
|
target: target,
|
|
76
76
|
rel: secureRel
|
|
77
77
|
}, rest), prependNode, (0, _react2.jsx)("span", {
|
|
78
|
-
className: "euiTab__content",
|
|
78
|
+
className: "euiTab__content eui-textTruncate",
|
|
79
79
|
css: cssTabContentStyles
|
|
80
80
|
}, children), appendNode);
|
|
81
81
|
}
|