@elastic/eui 96.0.0 → 97.0.0-backport.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/README.md +19 -1
- package/es/components/button/button_display/_button_display.styles.js +2 -2
- package/es/components/datagrid/body/data_grid_body_custom.js +48 -31
- package/es/components/date_picker/date_picker_range.styles.js +1 -1
- package/es/components/date_picker/super_date_picker/date_popover/absolute_tab.js +8 -2
- package/es/components/date_picker/super_date_picker/date_popover/date_popover_button.js +8 -2
- package/es/components/date_picker/super_date_picker/date_popover/date_popover_content.js +8 -2
- package/es/components/date_picker/super_date_picker/super_date_picker.js +27 -5
- package/es/components/link/external_link_icon.js +10 -8
- package/eui.d.ts +31 -5
- package/i18ntokens.json +64 -64
- package/lib/components/button/button_display/_button_display.styles.js +1 -1
- package/lib/components/datagrid/body/data_grid_body_custom.js +47 -30
- package/lib/components/date_picker/date_picker_range.styles.js +1 -1
- package/lib/components/date_picker/super_date_picker/date_popover/absolute_tab.js +8 -2
- package/lib/components/date_picker/super_date_picker/date_popover/date_popover_button.js +8 -2
- package/lib/components/date_picker/super_date_picker/date_popover/date_popover_content.js +8 -2
- package/lib/components/date_picker/super_date_picker/super_date_picker.js +27 -5
- package/lib/components/link/external_link_icon.js +9 -7
- package/optimize/es/components/button/button_display/_button_display.styles.js +2 -2
- package/optimize/es/components/datagrid/body/data_grid_body_custom.js +47 -30
- package/optimize/es/components/date_picker/date_picker_range.styles.js +1 -1
- package/optimize/es/components/date_picker/super_date_picker/date_popover/absolute_tab.js +5 -1
- package/optimize/es/components/date_picker/super_date_picker/date_popover/date_popover_button.js +6 -2
- package/optimize/es/components/date_picker/super_date_picker/date_popover/date_popover_content.js +6 -2
- package/optimize/es/components/date_picker/super_date_picker/super_date_picker.js +11 -5
- package/optimize/es/components/link/external_link_icon.js +10 -8
- package/optimize/lib/components/button/button_display/_button_display.styles.js +1 -1
- package/optimize/lib/components/datagrid/body/data_grid_body_custom.js +46 -29
- package/optimize/lib/components/date_picker/date_picker_range.styles.js +1 -1
- package/optimize/lib/components/date_picker/super_date_picker/date_popover/absolute_tab.js +5 -1
- package/optimize/lib/components/date_picker/super_date_picker/date_popover/date_popover_button.js +6 -2
- package/optimize/lib/components/date_picker/super_date_picker/date_popover/date_popover_content.js +6 -2
- package/optimize/lib/components/date_picker/super_date_picker/super_date_picker.js +11 -5
- package/optimize/lib/components/link/external_link_icon.js +9 -7
- package/package.json +3 -2
- package/src/global_styling/mixins/_index.scss +1 -4
- package/src/global_styling/mixins/_tool_tip.scss +0 -7
- package/src/themes/amsterdam/global_styling/mixins/_index.scss +1 -4
- package/test-env/components/button/button_display/_button_display.styles.js +1 -1
- package/test-env/components/datagrid/body/data_grid_body_custom.js +47 -30
- package/test-env/components/date_picker/date_picker_range.styles.js +1 -1
- package/test-env/components/date_picker/super_date_picker/date_popover/absolute_tab.js +8 -2
- package/test-env/components/date_picker/super_date_picker/date_popover/date_popover_button.js +8 -2
- package/test-env/components/date_picker/super_date_picker/date_popover/date_popover_content.js +8 -2
- package/test-env/components/date_picker/super_date_picker/super_date_picker.js +27 -5
- package/test-env/components/link/external_link_icon.js +9 -7
- package/src/global_styling/mixins/_button.scss +0 -149
- package/src/global_styling/mixins/_form.scss +0 -28
- package/src/global_styling/mixins/_panel.scss +0 -55
package/README.md
CHANGED
|
@@ -1 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
<!-- Note: this README is what renders to our published NPM package, and should remain nice-looking & have useful links without repeating too much information from the top-level README -->
|
|
2
|
+
<img src="https://repository-images.githubusercontent.com/107422373/b6180480-a1d7-11eb-8a3c-902086232aa7" alt="" />
|
|
3
|
+
|
|
4
|
+
# Elastic UI Framework
|
|
5
|
+
|
|
6
|
+
**The Elastic UI Framework is a collection of React UI components for quickly building user interfaces at Elastic.**
|
|
7
|
+
|
|
8
|
+
## Resources
|
|
9
|
+
|
|
10
|
+
- Check out our [full documentation site](https://eui.elastic.co), which contains many examples of components in the EUI framework aesthetic, and how to use them in your products.
|
|
11
|
+
- [Our FAQ](https://github.com/elastic/eui#frequently-asked-questions) covers common usage questions — for other general questions regarding EUI, check out the [Discussions tab](https://github.com/elastic/eui/discussions).
|
|
12
|
+
- For technical instructions and guidelines on usage and development, please [refer to our wiki](https://github.com/elastic/eui/tree/main/wiki).
|
|
13
|
+
|
|
14
|
+
## License
|
|
15
|
+
|
|
16
|
+
[Dual-licensed under Elastic v2 and Server Side Public License, v1][license]. See Elastic's [licensing FAQ][licensing-faq] for details.
|
|
17
|
+
|
|
18
|
+
[license]: LICENSE.txt
|
|
19
|
+
[licensing-faq]: https://www.elastic.co/pricing/faq/licensing#im-using-eui-or-elastic-charts-in-my-application-outside-of-kibana-how-does-this-affect-me
|
|
@@ -7,12 +7,12 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
7
7
|
* Side Public License, v 1.
|
|
8
8
|
*/
|
|
9
9
|
import { css } from '@emotion/react';
|
|
10
|
-
import { euiFontSize, logicalCSS, logicalShorthandCSS,
|
|
10
|
+
import { euiFontSize, logicalCSS, logicalShorthandCSS, logicalTextAlignCSS } from '../../../global_styling';
|
|
11
11
|
import { euiButtonSizeMap } from '../../../themes/amsterdam/global_styling/mixins';
|
|
12
12
|
// Provides a solid reset and base for handling sizing layout
|
|
13
13
|
// Does not include any visual styles
|
|
14
14
|
export var euiButtonBaseCSS = function euiButtonBaseCSS() {
|
|
15
|
-
return "\n display: inline-block;\n appearance: none;\n cursor: pointer;\n ".concat(
|
|
15
|
+
return "\n display: inline-block;\n appearance: none;\n cursor: pointer;\n ".concat(logicalTextAlignCSS('center'), ";\n white-space: nowrap;\n ").concat(logicalCSS('max-width', '100%'), ";\n vertical-align: middle;\n ");
|
|
16
16
|
};
|
|
17
17
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
18
18
|
name: "8595p9-isDisabled",
|
|
@@ -26,7 +26,7 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
|
|
|
26
26
|
* Side Public License, v 1.
|
|
27
27
|
*/
|
|
28
28
|
|
|
29
|
-
import React, { useState, useMemo,
|
|
29
|
+
import React, { useState, useMemo, memo } from 'react';
|
|
30
30
|
import PropTypes from "prop-types";
|
|
31
31
|
import classNames from 'classnames';
|
|
32
32
|
import { useDefaultColumnWidth, useColumnWidths } from '../utils/col_widths';
|
|
@@ -35,7 +35,7 @@ import { useDataGridHeader } from './header';
|
|
|
35
35
|
import { useDataGridFooter } from './footer';
|
|
36
36
|
import { CellWrapper } from './cell';
|
|
37
37
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
38
|
-
export var EuiDataGridBodyCustomRender = function
|
|
38
|
+
export var EuiDataGridBodyCustomRender = /*#__PURE__*/memo(function (_ref) {
|
|
39
39
|
var renderCustomGridBody = _ref.renderCustomGridBody,
|
|
40
40
|
renderCellValue = _ref.renderCellValue,
|
|
41
41
|
cellContext = _ref.cellContext,
|
|
@@ -91,27 +91,31 @@ export var EuiDataGridBodyCustomRender = function EuiDataGridBodyCustomRender(_r
|
|
|
91
91
|
}),
|
|
92
92
|
setRowHeight = _useDefaultRowHeight.setRowHeight,
|
|
93
93
|
getRowHeight = _useDefaultRowHeight.getRowHeight;
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
* Header & footer
|
|
97
|
-
*/
|
|
98
|
-
var _useDataGridHeader = useDataGridHeader({
|
|
94
|
+
var headerRowProps = useMemo(function () {
|
|
95
|
+
return {
|
|
99
96
|
leadingControlColumns: leadingControlColumns,
|
|
100
97
|
trailingControlColumns: trailingControlColumns,
|
|
101
98
|
columns: columns,
|
|
102
99
|
columnWidths: columnWidths,
|
|
103
100
|
defaultColumnWidth: defaultColumnWidth,
|
|
104
101
|
setColumnWidth: setColumnWidth,
|
|
105
|
-
visibleColCount: visibleColCount,
|
|
106
102
|
setVisibleColumns: setVisibleColumns,
|
|
103
|
+
visibleColCount: visibleColCount,
|
|
107
104
|
switchColumnPos: switchColumnPos,
|
|
108
105
|
sorting: sorting,
|
|
109
106
|
schema: schema,
|
|
110
107
|
schemaDetectors: schemaDetectors,
|
|
111
108
|
gridStyles: gridStyles
|
|
112
|
-
}
|
|
109
|
+
};
|
|
110
|
+
}, [leadingControlColumns, trailingControlColumns, columns, columnWidths, defaultColumnWidth, setColumnWidth, visibleColCount, setVisibleColumns, switchColumnPos, sorting, schema, schemaDetectors, gridStyles]);
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Header & footer
|
|
114
|
+
*/
|
|
115
|
+
var _useDataGridHeader = useDataGridHeader(headerRowProps),
|
|
113
116
|
headerRow = _useDataGridHeader.headerRow;
|
|
114
|
-
var
|
|
117
|
+
var footerRowProps = useMemo(function () {
|
|
118
|
+
return {
|
|
115
119
|
renderFooterCellValue: renderFooterCellValue,
|
|
116
120
|
renderCellPopover: renderCellPopover,
|
|
117
121
|
rowIndex: visibleRows.visibleRowCount,
|
|
@@ -125,7 +129,9 @@ export var EuiDataGridBodyCustomRender = function EuiDataGridBodyCustomRender(_r
|
|
|
125
129
|
defaultColumnWidth: defaultColumnWidth,
|
|
126
130
|
schema: schema,
|
|
127
131
|
gridStyles: gridStyles
|
|
128
|
-
}
|
|
132
|
+
};
|
|
133
|
+
}, [renderFooterCellValue, renderCellPopover, visibleRows.visibleRowCount, visibleColCount, interactiveCellId, leadingControlColumns, trailingControlColumns, columns, columnWidths, defaultColumnWidth, schema, gridStyles]);
|
|
134
|
+
var _useDataGridFooter = useDataGridFooter(footerRowProps),
|
|
129
135
|
footerRow = _useDataGridFooter.footerRow;
|
|
130
136
|
|
|
131
137
|
/**
|
|
@@ -152,19 +158,22 @@ export var EuiDataGridBodyCustomRender = function EuiDataGridBodyCustomRender(_r
|
|
|
152
158
|
gridStyles: gridStyles
|
|
153
159
|
};
|
|
154
160
|
}, [schema, schemaDetectors, pagination, columns, leadingControlColumns, trailingControlColumns, visibleColCount, columnWidths, defaultColumnWidth, renderCellValue, cellContext, renderCellPopover, interactiveCellId, setRowHeight, rowHeightsOptions, rowHeightUtils, gridStyles]);
|
|
155
|
-
var Cell =
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
+
var Cell = useMemo(function () {
|
|
162
|
+
return function (_ref2) {
|
|
163
|
+
var _rest$rowHeightsOptio;
|
|
164
|
+
var colIndex = _ref2.colIndex,
|
|
165
|
+
visibleRowIndex = _ref2.visibleRowIndex,
|
|
166
|
+
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
167
|
+
var style = {
|
|
168
|
+
height: rowHeightUtils.isAutoHeight(visibleRowIndex, (_rest$rowHeightsOptio = rest.rowHeightsOptions) !== null && _rest$rowHeightsOptio !== void 0 ? _rest$rowHeightsOptio : rowHeightsOptions) ? 'auto' : getRowHeight(visibleRowIndex)
|
|
169
|
+
};
|
|
170
|
+
var props = _objectSpread({
|
|
171
|
+
colIndex: colIndex,
|
|
172
|
+
visibleRowIndex: visibleRowIndex,
|
|
173
|
+
style: style
|
|
174
|
+
}, cellProps);
|
|
175
|
+
return ___EmotionJSX(CellWrapper, _extends({}, props, rest));
|
|
161
176
|
};
|
|
162
|
-
var props = _objectSpread({
|
|
163
|
-
colIndex: colIndex,
|
|
164
|
-
visibleRowIndex: visibleRowIndex,
|
|
165
|
-
style: style
|
|
166
|
-
}, cellProps);
|
|
167
|
-
return ___EmotionJSX(CellWrapper, _extends({}, props, rest));
|
|
168
177
|
}, [cellProps, getRowHeight, rowHeightUtils, rowHeightsOptions]);
|
|
169
178
|
|
|
170
179
|
// Allow consumers to pass custom props/attributes/listeners etc. to the wrapping div
|
|
@@ -172,15 +181,22 @@ export var EuiDataGridBodyCustomRender = function EuiDataGridBodyCustomRender(_r
|
|
|
172
181
|
_useState2 = _slicedToArray(_useState, 2),
|
|
173
182
|
customGridBodyProps = _useState2[0],
|
|
174
183
|
setCustomGridBodyProps = _useState2[1];
|
|
184
|
+
var customDataGridBodyProps = useMemo(function () {
|
|
185
|
+
return {
|
|
186
|
+
gridWidth: gridWidth,
|
|
187
|
+
visibleColumns: visibleColumns,
|
|
188
|
+
visibleRowData: visibleRows,
|
|
189
|
+
Cell: Cell,
|
|
190
|
+
setCustomGridBodyProps: setCustomGridBodyProps,
|
|
191
|
+
headerRow: headerRow,
|
|
192
|
+
footerRow: footerRow
|
|
193
|
+
};
|
|
194
|
+
}, [gridWidth, visibleColumns, visibleRows, Cell, setCustomGridBodyProps, headerRow, footerRow]);
|
|
195
|
+
var BodyElement = renderCustomGridBody;
|
|
175
196
|
return ___EmotionJSX("div", _extends({}, customGridBodyProps, {
|
|
176
197
|
className: classNames('euiDataGrid__customRenderBody', className, customGridBodyProps === null || customGridBodyProps === void 0 ? void 0 : customGridBodyProps.className)
|
|
177
|
-
}),
|
|
178
|
-
|
|
179
|
-
visibleRowData: visibleRows,
|
|
180
|
-
Cell: Cell,
|
|
181
|
-
setCustomGridBodyProps: setCustomGridBodyProps
|
|
182
|
-
}), footerRow);
|
|
183
|
-
};
|
|
198
|
+
}), ___EmotionJSX(BodyElement, customDataGridBodyProps));
|
|
199
|
+
});
|
|
184
200
|
EuiDataGridBodyCustomRender.propTypes = {
|
|
185
201
|
leadingControlColumns: PropTypes.arrayOf(PropTypes.shape({
|
|
186
202
|
/**
|
|
@@ -801,4 +817,5 @@ EuiDataGridBodyCustomRender.propTypes = {
|
|
|
801
817
|
gridItemsRendered: PropTypes.any.isRequired,
|
|
802
818
|
wrapperRef: PropTypes.any.isRequired,
|
|
803
819
|
className: PropTypes.string
|
|
804
|
-
};
|
|
820
|
+
};
|
|
821
|
+
EuiDataGridBodyCustomRender.displayName = 'EuiDataGridBodyCustomRender';
|
|
@@ -11,7 +11,7 @@ import { css } from '@emotion/react';
|
|
|
11
11
|
import { logicalCSS } from '../../global_styling';
|
|
12
12
|
import { euiShadowMedium } from '../../themes/amsterdam/global_styling/mixins';
|
|
13
13
|
export var euiDatePickerRangeStyles = {
|
|
14
|
-
euiDatePickerRange: /*#__PURE__*/css(".euiPopover,.react-datepicker__input-container,.euiDatePicker{", logicalCSS('height', '100%'), ";};label:euiDatePickerRange;")
|
|
14
|
+
euiDatePickerRange: /*#__PURE__*/css(".euiPopover,.react-datepicker__input-container,.euiDatePicker{", logicalCSS('height', '100%'), ";}.euiPopover{flex:1;};label:euiDatePickerRange;")
|
|
15
15
|
};
|
|
16
16
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
17
17
|
name: "bicgs9-noShadow",
|
|
@@ -38,6 +38,8 @@ export var EuiAbsoluteTab = function EuiAbsoluteTab(_ref) {
|
|
|
38
38
|
locale = _ref.locale,
|
|
39
39
|
roundUp = _ref.roundUp,
|
|
40
40
|
utcOffset = _ref.utcOffset,
|
|
41
|
+
minDate = _ref.minDate,
|
|
42
|
+
maxDate = _ref.maxDate,
|
|
41
43
|
labelPrefix = _ref.labelPrefix;
|
|
42
44
|
var styles = useEuiMemoizedStyles(euiAbsoluteTabDateFormStyles);
|
|
43
45
|
var _useState = useState(function () {
|
|
@@ -131,7 +133,9 @@ export var EuiAbsoluteTab = function EuiAbsoluteTab(_ref) {
|
|
|
131
133
|
dateFormat: dateFormat,
|
|
132
134
|
timeFormat: timeFormat,
|
|
133
135
|
locale: locale,
|
|
134
|
-
utcOffset: utcOffset
|
|
136
|
+
utcOffset: utcOffset,
|
|
137
|
+
minDate: minDate,
|
|
138
|
+
maxDate: maxDate
|
|
135
139
|
}), ___EmotionJSX(EuiFlexGroup, {
|
|
136
140
|
component: "form",
|
|
137
141
|
onSubmit: function onSubmit(e) {
|
|
@@ -176,5 +180,7 @@ EuiAbsoluteTab.propTypes = {
|
|
|
176
180
|
onChange: PropTypes.func.isRequired,
|
|
177
181
|
roundUp: PropTypes.bool.isRequired,
|
|
178
182
|
labelPrefix: PropTypes.string.isRequired,
|
|
179
|
-
utcOffset: PropTypes.number
|
|
183
|
+
utcOffset: PropTypes.number,
|
|
184
|
+
minDate: PropTypes.any,
|
|
185
|
+
maxDate: PropTypes.any
|
|
180
186
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["position", "isDisabled", "isInvalid", "needsUpdating", "value", "buttonProps", "canRoundRelativeUnits", "roundUp", "onChange", "locale", "dateFormat", "utcOffset", "timeFormat", "isOpen", "onPopoverToggle", "onPopoverClose", "compressed", "timeOptions"];
|
|
1
|
+
var _excluded = ["position", "isDisabled", "isInvalid", "needsUpdating", "value", "buttonProps", "canRoundRelativeUnits", "roundUp", "onChange", "locale", "dateFormat", "utcOffset", "minDate", "maxDate", "timeFormat", "isOpen", "onPopoverToggle", "onPopoverClose", "compressed", "timeOptions"];
|
|
2
2
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
3
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
4
4
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
@@ -35,6 +35,8 @@ export var EuiDatePopoverButton = function EuiDatePopoverButton(props) {
|
|
|
35
35
|
locale = props.locale,
|
|
36
36
|
dateFormat = props.dateFormat,
|
|
37
37
|
utcOffset = props.utcOffset,
|
|
38
|
+
minDate = props.minDate,
|
|
39
|
+
maxDate = props.maxDate,
|
|
38
40
|
timeFormat = props.timeFormat,
|
|
39
41
|
isOpen = props.isOpen,
|
|
40
42
|
onPopoverToggle = props.onPopoverToggle,
|
|
@@ -95,7 +97,9 @@ export var EuiDatePopoverButton = function EuiDatePopoverButton(props) {
|
|
|
95
97
|
locale: locale,
|
|
96
98
|
position: position,
|
|
97
99
|
utcOffset: utcOffset,
|
|
98
|
-
timeOptions: timeOptions
|
|
100
|
+
timeOptions: timeOptions,
|
|
101
|
+
minDate: minDate,
|
|
102
|
+
maxDate: maxDate
|
|
99
103
|
}));
|
|
100
104
|
};
|
|
101
105
|
EuiDatePopoverButton.propTypes = {
|
|
@@ -121,6 +125,8 @@ EuiDatePopoverButton.propTypes = {
|
|
|
121
125
|
timeFormat: PropTypes.string.isRequired,
|
|
122
126
|
value: PropTypes.string.isRequired,
|
|
123
127
|
utcOffset: PropTypes.number,
|
|
128
|
+
minDate: PropTypes.any,
|
|
129
|
+
maxDate: PropTypes.any,
|
|
124
130
|
compressed: PropTypes.bool,
|
|
125
131
|
timeOptions: PropTypes.shape({
|
|
126
132
|
timeTenseOptions: PropTypes.arrayOf(PropTypes.any.isRequired).isRequired,
|
|
@@ -31,7 +31,9 @@ export var EuiDatePopoverContent = function EuiDatePopoverContent(_ref) {
|
|
|
31
31
|
locale = _ref.locale,
|
|
32
32
|
position = _ref.position,
|
|
33
33
|
utcOffset = _ref.utcOffset,
|
|
34
|
-
timeOptions = _ref.timeOptions
|
|
34
|
+
timeOptions = _ref.timeOptions,
|
|
35
|
+
minDate = _ref.minDate,
|
|
36
|
+
maxDate = _ref.maxDate;
|
|
35
37
|
var styles = useEuiMemoizedStyles(euiDatePopoverContentStyles);
|
|
36
38
|
var onTabClick = function onTabClick(selectedTab) {
|
|
37
39
|
switch (selectedTab.id) {
|
|
@@ -60,7 +62,9 @@ export var EuiDatePopoverContent = function EuiDatePopoverContent(_ref) {
|
|
|
60
62
|
onChange: onChange,
|
|
61
63
|
roundUp: roundUp,
|
|
62
64
|
labelPrefix: labelPrefix,
|
|
63
|
-
utcOffset: utcOffset
|
|
65
|
+
utcOffset: utcOffset,
|
|
66
|
+
minDate: minDate,
|
|
67
|
+
maxDate: maxDate
|
|
64
68
|
}),
|
|
65
69
|
'data-test-subj': 'superDatePickerAbsoluteTab',
|
|
66
70
|
'aria-label': "".concat(labelPrefix, ": ").concat(absoluteLabel)
|
|
@@ -130,6 +134,8 @@ EuiDatePopoverContent.propTypes = {
|
|
|
130
134
|
locale: PropTypes.any,
|
|
131
135
|
position: PropTypes.oneOf(["start", "end"]).isRequired,
|
|
132
136
|
utcOffset: PropTypes.number,
|
|
137
|
+
minDate: PropTypes.any,
|
|
138
|
+
maxDate: PropTypes.any,
|
|
133
139
|
timeOptions: PropTypes.shape({
|
|
134
140
|
timeTenseOptions: PropTypes.arrayOf(PropTypes.any.isRequired).isRequired,
|
|
135
141
|
timeUnitsOptions: PropTypes.arrayOf(PropTypes.any.isRequired).isRequired,
|
|
@@ -45,7 +45,7 @@ import { EuiDatePopoverButton } from './date_popover/date_popover_button';
|
|
|
45
45
|
import { EuiAutoRefresh, EuiAutoRefreshButton } from '../auto_refresh/auto_refresh';
|
|
46
46
|
import { euiSuperDatePickerStyles } from './super_date_picker.styles';
|
|
47
47
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
48
|
-
function isRangeInvalid(start, end) {
|
|
48
|
+
function isRangeInvalid(start, end, minDate, maxDate) {
|
|
49
49
|
if (start === 'now' && end === 'now') {
|
|
50
50
|
return true;
|
|
51
51
|
}
|
|
@@ -53,7 +53,7 @@ function isRangeInvalid(start, end) {
|
|
|
53
53
|
var endMoment = dateMath.parse(end, {
|
|
54
54
|
roundUp: true
|
|
55
55
|
});
|
|
56
|
-
var isInvalid = !startMoment || !endMoment || !startMoment.isValid() || !endMoment.isValid() || !moment(startMoment).isValid() || !moment(endMoment).isValid() || startMoment.isAfter(endMoment);
|
|
56
|
+
var isInvalid = !startMoment || !endMoment || !startMoment.isValid() || !endMoment.isValid() || !moment(startMoment).isValid() || !moment(endMoment).isValid() || startMoment.isAfter(endMoment) || endMoment.isBefore(startMoment) || minDate != null && startMoment.isBefore(minDate) || maxDate != null && endMoment.isAfter(maxDate);
|
|
57
57
|
return isInvalid;
|
|
58
58
|
}
|
|
59
59
|
export var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
|
|
@@ -72,7 +72,7 @@ export var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
|
|
|
72
72
|
},
|
|
73
73
|
start: _this.props.start,
|
|
74
74
|
end: _this.props.end,
|
|
75
|
-
isInvalid: isRangeInvalid(_this.props.start, _this.props.end),
|
|
75
|
+
isInvalid: isRangeInvalid(_this.props.start, _this.props.end, _this.props.minDate, _this.props.maxDate),
|
|
76
76
|
hasChanged: false,
|
|
77
77
|
showPrettyDuration: showPrettyDuration(_this.props.start, _this.props.end, _this.props.commonlyUsedRanges),
|
|
78
78
|
isStartDatePopoverOpen: false,
|
|
@@ -81,7 +81,7 @@ export var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
|
|
|
81
81
|
_defineProperty(_this, "setTime", function (_ref) {
|
|
82
82
|
var end = _ref.end,
|
|
83
83
|
start = _ref.start;
|
|
84
|
-
var isInvalid = isRangeInvalid(start, end);
|
|
84
|
+
var isInvalid = isRangeInvalid(start, end, _this.props.minDate, _this.props.maxDate);
|
|
85
85
|
_this.setState({
|
|
86
86
|
start: start,
|
|
87
87
|
end: end,
|
|
@@ -270,6 +270,8 @@ export var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
|
|
|
270
270
|
locale = _this$props3.locale,
|
|
271
271
|
timeFormat = _this$props3.timeFormat,
|
|
272
272
|
utcOffset = _this$props3.utcOffset,
|
|
273
|
+
minDate = _this$props3.minDate,
|
|
274
|
+
maxDate = _this$props3.maxDate,
|
|
273
275
|
compressed = _this$props3.compressed,
|
|
274
276
|
onFocus = _this$props3.onFocus,
|
|
275
277
|
styles = _this$props3.memoizedStyles;
|
|
@@ -344,6 +346,8 @@ export var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
|
|
|
344
346
|
utcOffset: utcOffset,
|
|
345
347
|
timeFormat: timeFormat,
|
|
346
348
|
locale: locale || contextLocale,
|
|
349
|
+
minDate: minDate,
|
|
350
|
+
maxDate: maxDate,
|
|
347
351
|
canRoundRelativeUnits: canRoundRelativeUnits,
|
|
348
352
|
isOpen: _this.state.isStartDatePopoverOpen,
|
|
349
353
|
onPopoverToggle: _this.onStartDatePopoverToggle,
|
|
@@ -366,6 +370,8 @@ export var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
|
|
|
366
370
|
utcOffset: utcOffset,
|
|
367
371
|
timeFormat: timeFormat,
|
|
368
372
|
locale: locale || contextLocale,
|
|
373
|
+
minDate: minDate,
|
|
374
|
+
maxDate: maxDate,
|
|
369
375
|
canRoundRelativeUnits: canRoundRelativeUnits,
|
|
370
376
|
roundUp: true,
|
|
371
377
|
isOpen: _this.state.isEndDatePopoverOpen,
|
|
@@ -471,7 +477,7 @@ export var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
|
|
|
471
477
|
},
|
|
472
478
|
start: nextProps.start,
|
|
473
479
|
end: nextProps.end,
|
|
474
|
-
isInvalid: isRangeInvalid(nextProps.start, nextProps.end),
|
|
480
|
+
isInvalid: isRangeInvalid(nextProps.start, nextProps.end, nextProps.minDate, nextProps.maxDate),
|
|
475
481
|
hasChanged: false,
|
|
476
482
|
showPrettyDuration: showPrettyDuration(nextProps.start, nextProps.end, nextProps.commonlyUsedRanges)
|
|
477
483
|
};
|
|
@@ -604,6 +610,14 @@ EuiSuperDatePickerInternal.propTypes = {
|
|
|
604
610
|
refreshIntervalUnits: PropTypes.any,
|
|
605
611
|
start: PropTypes.oneOfType([PropTypes.oneOfType([PropTypes.oneOf(["now"]), PropTypes.string.isRequired]), PropTypes.oneOfType([PropTypes.oneOf(["now"]), PropTypes.string.isRequired]).isRequired]),
|
|
606
612
|
end: PropTypes.oneOfType([PropTypes.oneOfType([PropTypes.oneOf(["now"]), PropTypes.string.isRequired]), PropTypes.oneOfType([PropTypes.oneOf(["now"]), PropTypes.string.isRequired]).isRequired]),
|
|
613
|
+
/**
|
|
614
|
+
* Defines min. date accepted as a selection (in moment format)
|
|
615
|
+
*/
|
|
616
|
+
minDate: PropTypes.any,
|
|
617
|
+
/**
|
|
618
|
+
* Defines max. date accepted as a selection (in moment format)
|
|
619
|
+
*/
|
|
620
|
+
maxDate: PropTypes.any,
|
|
607
621
|
/**
|
|
608
622
|
* Specifies the formatted used when displaying times
|
|
609
623
|
* @default 'HH:mm'
|
|
@@ -787,6 +801,14 @@ EuiSuperDatePicker.propTypes = {
|
|
|
787
801
|
*/
|
|
788
802
|
start: PropTypes.oneOfType([PropTypes.oneOf(["now"]), PropTypes.string.isRequired]),
|
|
789
803
|
end: PropTypes.oneOfType([PropTypes.oneOf(["now"]), PropTypes.string.isRequired]),
|
|
804
|
+
/**
|
|
805
|
+
* Defines min. date accepted as a selection (in moment format)
|
|
806
|
+
*/
|
|
807
|
+
minDate: PropTypes.any,
|
|
808
|
+
/**
|
|
809
|
+
* Defines max. date accepted as a selection (in moment format)
|
|
810
|
+
*/
|
|
811
|
+
maxDate: PropTypes.any,
|
|
790
812
|
/**
|
|
791
813
|
* Specifies the formatted used when displaying times
|
|
792
814
|
* @default 'HH:mm'
|
|
@@ -15,7 +15,7 @@ import PropTypes from "prop-types";
|
|
|
15
15
|
import { useEuiMemoizedStyles } from '../../services';
|
|
16
16
|
import { logicalStyle } from '../../global_styling';
|
|
17
17
|
import { EuiIcon } from '../icon';
|
|
18
|
-
import { EuiI18n
|
|
18
|
+
import { EuiI18n } from '../i18n';
|
|
19
19
|
import { EuiScreenReaderOnly } from '../accessibility';
|
|
20
20
|
|
|
21
21
|
/**
|
|
@@ -33,16 +33,18 @@ export var EuiExternalLinkIcon = function EuiExternalLinkIcon(_ref2) {
|
|
|
33
33
|
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
34
34
|
var iconCssStyle = useEuiMemoizedStyles(iconStyle);
|
|
35
35
|
var showExternalLinkIcon = target === '_blank' && external !== false || external === true;
|
|
36
|
-
|
|
37
|
-
return ___EmotionJSX(React.Fragment, null, showExternalLinkIcon && ___EmotionJSX(EuiIcon, _extends({
|
|
36
|
+
return ___EmotionJSX(React.Fragment, null, showExternalLinkIcon && ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiIcon, _extends({
|
|
38
37
|
css: iconCssStyle,
|
|
39
|
-
"aria-label": iconAriaLabel,
|
|
40
38
|
size: "s",
|
|
41
|
-
type: "popout"
|
|
42
|
-
|
|
39
|
+
type: "popout",
|
|
40
|
+
role: "presentation"
|
|
41
|
+
}, rest)), target === '_blank' ? ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("span", null, ___EmotionJSX(EuiI18n, {
|
|
43
42
|
token: "euiExternalLinkIcon.newTarget.screenReaderOnlyText",
|
|
44
|
-
default: "(opens in a new tab or window)"
|
|
45
|
-
})))
|
|
43
|
+
default: "(external, opens in a new tab or window)"
|
|
44
|
+
}))) : ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("span", null, ___EmotionJSX(EuiI18n, {
|
|
45
|
+
token: "euiExternalLinkIcon.externalTarget.screenReaderOnlyText",
|
|
46
|
+
default: "(external)"
|
|
47
|
+
}))))));
|
|
46
48
|
};
|
|
47
49
|
EuiExternalLinkIcon.propTypes = {
|
|
48
50
|
target: PropTypes.any,
|
package/eui.d.ts
CHANGED
|
@@ -14913,6 +14913,18 @@ declare module '@elastic/eui/src/components/datagrid/data_grid_types' {
|
|
|
14913
14913
|
* It's best to wrap calls to `setCustomGridBodyProps` in a `useEffect` hook
|
|
14914
14914
|
*/
|
|
14915
14915
|
setCustomGridBodyProps: (props: EuiDataGridSetCustomGridBodyProps) => void;
|
|
14916
|
+
/**
|
|
14917
|
+
* The width of the grid, can be used by consumer as a layout utility
|
|
14918
|
+
*/
|
|
14919
|
+
gridWidth: number;
|
|
14920
|
+
/**
|
|
14921
|
+
* Header row component to render by custom renderer
|
|
14922
|
+
* */
|
|
14923
|
+
headerRow: React.JSX.Element;
|
|
14924
|
+
/**
|
|
14925
|
+
* Footer row component to render by custom renderer
|
|
14926
|
+
* */
|
|
14927
|
+
footerRow: React.JSX.Element | null;
|
|
14916
14928
|
}
|
|
14917
14929
|
export type EuiDataGridSetCustomGridBodyProps = CommonProps & HTMLAttributes<HTMLDivElement> & {
|
|
14918
14930
|
ref?: MutableRefObject<HTMLDivElement> | Ref<HTMLDivElement>;
|
|
@@ -17342,7 +17354,7 @@ declare module '@elastic/eui/src/components/date_picker/super_date_picker/date_p
|
|
|
17342
17354
|
}
|
|
17343
17355
|
declare module '@elastic/eui/src/components/date_picker/super_date_picker/date_popover/date_popover_content' {
|
|
17344
17356
|
import { FunctionComponent } from 'react';
|
|
17345
|
-
import { LocaleSpecifier } from 'moment';
|
|
17357
|
+
import { LocaleSpecifier, Moment } from 'moment';
|
|
17346
17358
|
import { TimeOptions } from '@elastic/eui/src/components/date_picker/super_date_picker/time_options';
|
|
17347
17359
|
export interface EuiDatePopoverContentProps {
|
|
17348
17360
|
value: string;
|
|
@@ -17354,6 +17366,8 @@ declare module '@elastic/eui/src/components/date_picker/super_date_picker/date_p
|
|
|
17354
17366
|
locale?: LocaleSpecifier;
|
|
17355
17367
|
position: 'start' | 'end';
|
|
17356
17368
|
utcOffset?: number;
|
|
17369
|
+
minDate?: Moment;
|
|
17370
|
+
maxDate?: Moment;
|
|
17357
17371
|
timeOptions: TimeOptions;
|
|
17358
17372
|
}
|
|
17359
17373
|
export const EuiDatePopoverContent: FunctionComponent<EuiDatePopoverContentProps>;
|
|
@@ -17370,7 +17384,7 @@ declare module '@elastic/eui/src/components/date_picker/super_date_picker/date_p
|
|
|
17370
17384
|
}
|
|
17371
17385
|
declare module '@elastic/eui/src/components/date_picker/super_date_picker/date_popover/absolute_tab' {
|
|
17372
17386
|
import { FunctionComponent } from 'react';
|
|
17373
|
-
import { LocaleSpecifier } from 'moment';
|
|
17387
|
+
import { Moment, LocaleSpecifier } from 'moment';
|
|
17374
17388
|
import { EuiDatePopoverContentProps } from '@elastic/eui/src/components/date_picker/super_date_picker/date_popover/date_popover_content';
|
|
17375
17389
|
export interface EuiAbsoluteTabProps {
|
|
17376
17390
|
dateFormat: string;
|
|
@@ -17381,6 +17395,8 @@ declare module '@elastic/eui/src/components/date_picker/super_date_picker/date_p
|
|
|
17381
17395
|
roundUp: boolean;
|
|
17382
17396
|
labelPrefix: string;
|
|
17383
17397
|
utcOffset?: number;
|
|
17398
|
+
minDate?: Moment;
|
|
17399
|
+
maxDate?: Moment;
|
|
17384
17400
|
}
|
|
17385
17401
|
export const EuiAbsoluteTab: FunctionComponent<EuiAbsoluteTabProps>;
|
|
17386
17402
|
|
|
@@ -17452,7 +17468,7 @@ declare module '@elastic/eui/src/components/date_picker/super_date_picker/date_p
|
|
|
17452
17468
|
}
|
|
17453
17469
|
declare module '@elastic/eui/src/components/date_picker/super_date_picker/date_popover/date_popover_button' {
|
|
17454
17470
|
import { FunctionComponent, ButtonHTMLAttributes, MouseEventHandler } from 'react';
|
|
17455
|
-
import { LocaleSpecifier } from 'moment';
|
|
17471
|
+
import { LocaleSpecifier, Moment } from 'moment';
|
|
17456
17472
|
import { CommonProps } from '@elastic/eui/src/components/common';
|
|
17457
17473
|
import { EuiPopoverProps } from '@elastic/eui/src/components/popover';
|
|
17458
17474
|
import { TimeOptions } from '@elastic/eui/src/components/date_picker/super_date_picker/time_options';
|
|
@@ -17475,6 +17491,8 @@ declare module '@elastic/eui/src/components/date_picker/super_date_picker/date_p
|
|
|
17475
17491
|
timeFormat: string;
|
|
17476
17492
|
value: string;
|
|
17477
17493
|
utcOffset?: number;
|
|
17494
|
+
minDate?: Moment;
|
|
17495
|
+
maxDate?: Moment;
|
|
17478
17496
|
compressed?: boolean;
|
|
17479
17497
|
timeOptions: TimeOptions;
|
|
17480
17498
|
}
|
|
@@ -17917,7 +17935,7 @@ declare module '@elastic/eui/src/components/date_picker/auto_refresh/auto_refres
|
|
|
17917
17935
|
}
|
|
17918
17936
|
declare module '@elastic/eui/src/components/date_picker/super_date_picker/super_date_picker' {
|
|
17919
17937
|
import React, { Component, FocusEventHandler, FunctionComponent, ReactNode } from 'react';
|
|
17920
|
-
import { LocaleSpecifier } from 'moment';
|
|
17938
|
+
import moment, { LocaleSpecifier } from 'moment';
|
|
17921
17939
|
import { CommonProps } from '@elastic/eui/src/components/common';
|
|
17922
17940
|
import { ShortDate, Milliseconds, DurationRange, ApplyTime, ApplyRefreshInterval, RefreshUnitsOptions, QuickSelectPanel } from '@elastic/eui/src/components/date_picker/types';
|
|
17923
17941
|
import { TimeOptions } from '@elastic/eui/src/components/date_picker/super_date_picker/time_options';
|
|
@@ -18028,6 +18046,14 @@ declare module '@elastic/eui/src/components/date_picker/super_date_picker/super_
|
|
|
18028
18046
|
* @default 'now'
|
|
18029
18047
|
*/
|
|
18030
18048
|
end?: ShortDate;
|
|
18049
|
+
/**
|
|
18050
|
+
* Defines min. date accepted as a selection (in moment format)
|
|
18051
|
+
*/
|
|
18052
|
+
minDate?: moment.Moment;
|
|
18053
|
+
/**
|
|
18054
|
+
* Defines max. date accepted as a selection (in moment format)
|
|
18055
|
+
*/
|
|
18056
|
+
maxDate?: moment.Moment;
|
|
18031
18057
|
/**
|
|
18032
18058
|
* Specifies the formatted used when displaying times
|
|
18033
18059
|
* @default 'HH:mm'
|
|
@@ -31362,8 +31388,8 @@ declare module '@elastic/eui' {
|
|
|
31362
31388
|
"euiInlineEditForm.cancelButtonAriaLabel": any;
|
|
31363
31389
|
"euiInlineEditForm.inputKeyboardInstructions": any;
|
|
31364
31390
|
"euiInlineEditForm.activateEditModeDescription": any;
|
|
31365
|
-
"euiExternalLinkIcon.ariaLabel": any;
|
|
31366
31391
|
"euiExternalLinkIcon.newTarget.screenReaderOnlyText": any;
|
|
31392
|
+
"euiExternalLinkIcon.externalTarget.screenReaderOnlyText": any;
|
|
31367
31393
|
"euiPinnableListGroup.pinExtraActionLabel": any;
|
|
31368
31394
|
"euiPinnableListGroup.pinnedExtraActionLabel": any;
|
|
31369
31395
|
"euiLoadingStrings.ariaLabel": any;
|