@elastic/eui 94.5.0 → 94.5.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/NOTICE.txt +1 -1
- package/es/components/badge/badge.js +12 -4
- package/es/components/badge/badge.styles.js +13 -10
- package/es/components/date_picker/react-datepicker/src/calendar.js +6 -2
- package/es/components/date_picker/react-datepicker/src/time.js +5 -4
- package/es/components/form/range/dual_range.js +2 -2
- package/es/components/selectable/selectable_list/selectable_list.js +6 -6
- package/i18ntokens.json +2 -2
- package/lib/components/badge/badge.js +12 -4
- package/lib/components/badge/badge.styles.js +13 -10
- package/lib/components/date_picker/react-datepicker/src/calendar.js +6 -2
- package/lib/components/date_picker/react-datepicker/src/time.js +5 -4
- package/lib/components/form/range/dual_range.js +2 -2
- package/lib/components/selectable/selectable_list/selectable_list.js +6 -6
- package/optimize/es/components/badge/badge.js +7 -4
- package/optimize/es/components/badge/badge.styles.js +13 -10
- package/optimize/es/components/date_picker/react-datepicker/src/calendar.js +6 -2
- package/optimize/es/components/date_picker/react-datepicker/src/time.js +5 -4
- package/optimize/es/components/form/range/dual_range.js +2 -2
- package/optimize/es/components/selectable/selectable_list/selectable_list.js +6 -6
- package/optimize/lib/components/badge/badge.js +7 -4
- package/optimize/lib/components/badge/badge.styles.js +13 -10
- package/optimize/lib/components/date_picker/react-datepicker/src/calendar.js +6 -2
- package/optimize/lib/components/date_picker/react-datepicker/src/time.js +5 -4
- package/optimize/lib/components/form/range/dual_range.js +2 -2
- package/optimize/lib/components/selectable/selectable_list/selectable_list.js +6 -6
- package/package.json +1 -1
- package/src/components/date_picker/react-datepicker/LICENSE +21 -0
- package/src/components/date_picker/react-datepicker/README.md +168 -0
- package/src/services/theme/README.md +153 -0
- package/src/test/README.md +44 -0
- package/test-env/components/badge/badge.js +7 -4
- package/test-env/components/badge/badge.styles.js +13 -10
- package/test-env/components/date_picker/react-datepicker/src/calendar.js +6 -2
- package/test-env/components/date_picker/react-datepicker/src/time.js +5 -4
- package/test-env/components/form/range/dual_range.js +2 -2
- package/test-env/components/selectable/selectable_list/selectable_list.js +6 -6
package/NOTICE.txt
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
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); }
|
|
2
2
|
var _excluded = ["children", "color", "iconType", "iconSide", "className", "isDisabled", "onClick", "iconOnClick", "onClickAriaLabel", "iconOnClickAriaLabel", "closeButtonProps", "href", "rel", "target", "style"];
|
|
3
3
|
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); }
|
|
4
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
5
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
7
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
8
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
9
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
4
10
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
11
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
12
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -52,6 +58,8 @@ export var EuiBadge = function EuiBadge(_ref) {
|
|
|
52
58
|
var isNamedColor = COLORS.includes(color);
|
|
53
59
|
var euiTheme = useEuiTheme();
|
|
54
60
|
var customColorStyles = useMemo(function () {
|
|
61
|
+
// Disabled badges should not have custom colors
|
|
62
|
+
if (isDisabled) return style;
|
|
55
63
|
// Named colors set their styles via Emotion CSS and not inline styles
|
|
56
64
|
if (isNamedColor) return style;
|
|
57
65
|
|
|
@@ -66,17 +74,17 @@ export var EuiBadge = function EuiBadge(_ref) {
|
|
|
66
74
|
console.warn("Warning: ".concat(color, " badge has a low contrast of ").concat(contrastRatio.toFixed(2), ". Should be above ").concat(wcagContrastMin, "."));
|
|
67
75
|
}
|
|
68
76
|
return _objectSpread({
|
|
69
|
-
|
|
70
|
-
|
|
77
|
+
'--euiBadgeBackgroundColor': color,
|
|
78
|
+
'--euiBadgeTextColor': textColor
|
|
71
79
|
}, style);
|
|
72
80
|
} catch (err) {
|
|
73
81
|
if (!getIsValidColor(color)) {
|
|
74
82
|
console.warn('EuiBadge expects a valid color. This can either be a three or six ' + "character hex value, rgb(a) value, hsv value, hollow, or one of the following: ".concat(COLORS, ". ") + "Instead got ".concat(color, "."));
|
|
75
83
|
}
|
|
76
84
|
}
|
|
77
|
-
}, [color, isNamedColor, style, euiTheme]);
|
|
85
|
+
}, [color, isNamedColor, isDisabled, style, euiTheme]);
|
|
78
86
|
var styles = useEuiMemoizedStyles(euiBadgeStyles);
|
|
79
|
-
var cssStyles = [styles.euiBadge
|
|
87
|
+
var cssStyles = [styles.euiBadge].concat(_toConsumableArray(isDisabled ? [styles.disabled] : [isNamedColor && styles[color], !iconOnClick && (onClick || href) && styles.clickable]));
|
|
80
88
|
var textCssStyles = [styles.text.euiBadge__text, (onClick || href) && !isDisabled && styles.text.clickable];
|
|
81
89
|
var iconCssStyles = [styles.icon.euiBadge__icon, styles.icon[iconSide]];
|
|
82
90
|
var iconButtonCssStyles = [styles.iconButton.euiBadge__iconButton, styles.iconButton[iconSide]];
|
|
@@ -22,24 +22,27 @@ var _ref = process.env.NODE_ENV === "production" ? {
|
|
|
22
22
|
export var euiBadgeStyles = function euiBadgeStyles(euiThemeContext) {
|
|
23
23
|
var euiTheme = euiThemeContext.euiTheme;
|
|
24
24
|
var badgeColors = euiBadgeColors(euiThemeContext);
|
|
25
|
+
var setBadgeColorVars = function setBadgeColorVars(colors) {
|
|
26
|
+
return "\n --euiBadgeTextColor: ".concat(colors.color, ";\n --euiBadgeBackgroundColor: ").concat(colors.backgroundColor, ";\n ");
|
|
27
|
+
};
|
|
25
28
|
return {
|
|
26
29
|
euiBadge: /*#__PURE__*/css("display:inline-block;vertical-align:middle;", logicalShorthandCSS('padding', "0 ".concat(euiTheme.size.s)), " ", logicalCSS('max-width', '100%'), " font-size:", euiFontSize(euiThemeContext, 'xs').fontSize, ";line-height:", mathWithUnits(
|
|
27
30
|
// Account for the border
|
|
28
31
|
[euiTheme.size.base, euiTheme.border.width.thin], function (x, y) {
|
|
29
32
|
return x + y * 2;
|
|
30
|
-
}), ";font-weight:", euiTheme.font.weight.medium, ";white-space:nowrap;text-decoration:none;cursor:default;
|
|
33
|
+
}), ";font-weight:", euiTheme.font.weight.medium, ";white-space:nowrap;text-decoration:none;cursor:default;border:", euiTheme.border.width.thin, " solid transparent;border-radius:", mathWithUnits(euiTheme.border.radius.medium, function (x) {
|
|
31
34
|
return x / 2;
|
|
32
|
-
}), ";", logicalTextAlignCSS('left'), " &:focus-within{", euiFocusRing(euiThemeContext), ";}&+.euiBadge{", logicalCSS('margin-left', euiTheme.size.xs), ";};label:euiBadge;"),
|
|
35
|
+
}), ";", logicalTextAlignCSS('left'), "color:var(--euiBadgeTextColor, ", badgeColors.default.color, ");background-color:var(\n --euiBadgeBackgroundColor,\n ", badgeColors.default.backgroundColor, "\n );*::selection{color:var(\n --euiBadgeBackgroundColor,\n ", badgeColors.default.backgroundColor, "\n );background-color:var(\n --euiBadgeTextColor,\n ", badgeColors.default.color, "\n );}&:focus-within{", euiFocusRing(euiThemeContext), ";}&+.euiBadge{", logicalCSS('margin-left', euiTheme.size.xs), ";};label:euiBadge;"),
|
|
33
36
|
clickable: /*#__PURE__*/css("&:not(:disabled){&:hover,&:focus{text-decoration:underline;}}&:focus{", euiFocusRing(euiThemeContext), ";}&:disabled{cursor:not-allowed;};label:clickable;"),
|
|
34
37
|
// Colors
|
|
35
|
-
default: /*#__PURE__*/css(badgeColors.default, ";label:default;"),
|
|
36
|
-
hollow: /*#__PURE__*/css(
|
|
37
|
-
primary: /*#__PURE__*/css(badgeColors.primary, ";label:primary;"),
|
|
38
|
-
accent: /*#__PURE__*/css(badgeColors.accent, ";label:accent;"),
|
|
39
|
-
warning: /*#__PURE__*/css(badgeColors.warning, ";label:warning;"),
|
|
40
|
-
danger: /*#__PURE__*/css(badgeColors.danger, ";label:danger;"),
|
|
41
|
-
success: /*#__PURE__*/css(badgeColors.success, ";label:success;"),
|
|
42
|
-
disabled: /*#__PURE__*/css(
|
|
38
|
+
default: /*#__PURE__*/css(setBadgeColorVars(badgeColors.default), ";label:default;"),
|
|
39
|
+
hollow: /*#__PURE__*/css(setBadgeColorVars(badgeColors.hollow), " border-color:", badgeColors.hollow.borderColor, ";;label:hollow;"),
|
|
40
|
+
primary: /*#__PURE__*/css(setBadgeColorVars(badgeColors.primary), ";label:primary;"),
|
|
41
|
+
accent: /*#__PURE__*/css(setBadgeColorVars(badgeColors.accent), ";label:accent;"),
|
|
42
|
+
warning: /*#__PURE__*/css(setBadgeColorVars(badgeColors.warning), ";label:warning;"),
|
|
43
|
+
danger: /*#__PURE__*/css(setBadgeColorVars(badgeColors.danger), ";label:danger;"),
|
|
44
|
+
success: /*#__PURE__*/css(setBadgeColorVars(badgeColors.success), ";label:success;"),
|
|
45
|
+
disabled: /*#__PURE__*/css(setBadgeColorVars(badgeColors.disabled), "*::selection{color:", euiTheme.colors.emptyShade, ";};label:disabled;"),
|
|
43
46
|
// Content wrapper
|
|
44
47
|
euiBadge__content: /*#__PURE__*/css(logicalCSS(
|
|
45
48
|
// Ensure proper height in case of just displaying an icon
|
|
@@ -49,8 +49,9 @@ import React from "react";
|
|
|
49
49
|
import PropTypes from "prop-types";
|
|
50
50
|
import classnames from "classnames";
|
|
51
51
|
import CalendarContainer from "./calendar_container";
|
|
52
|
-
import { now, setMonth, getMonth, addMonths, subtractMonths, getStartOfWeek, getStartOfDate, getStartOfMonth, addDays, cloneDate, formatDate, localizeDate, setYear, getYear, isBefore, isAfter, getLocaleData, getFormattedWeekdayInLocale, getWeekdayShortInLocale, getWeekdayMinInLocale, isSameDay, allDaysDisabledBefore, allDaysDisabledAfter, getEffectiveMinDate, getEffectiveMaxDate } from "./date_utils";
|
|
53
52
|
import { EuiFocusTrap } from '../../../focus_trap';
|
|
53
|
+
import { EuiScreenReaderOnly } from '../../../accessibility/screen_reader_only';
|
|
54
|
+
import { now, setMonth, getMonth, addMonths, subtractMonths, getStartOfWeek, getStartOfDate, getStartOfMonth, addDays, cloneDate, formatDate, localizeDate, setYear, getYear, isBefore, isAfter, getLocaleData, getFormattedWeekdayInLocale, getWeekdayShortInLocale, getWeekdayMinInLocale, isSameDay, allDaysDisabledBefore, allDaysDisabledAfter, getEffectiveMinDate, getEffectiveMaxDate } from "./date_utils";
|
|
54
55
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
55
56
|
var FocusTrapContainer = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
56
57
|
return ___EmotionJSX("div", _extends({
|
|
@@ -217,10 +218,13 @@ var Calendar = /*#__PURE__*/function (_React$Component) {
|
|
|
217
218
|
var day = addDays(cloneDate(startOfWeek), offset);
|
|
218
219
|
var localeData = getLocaleData(day);
|
|
219
220
|
var weekDayName = _this.formatWeekday(localeData, day);
|
|
221
|
+
var weekDayNameLong = localeData.weekdays(day);
|
|
220
222
|
return ___EmotionJSX("div", {
|
|
221
223
|
key: offset,
|
|
222
224
|
className: "react-datepicker__day-name"
|
|
223
|
-
},
|
|
225
|
+
}, ___EmotionJSX("span", {
|
|
226
|
+
"aria-hidden": "true"
|
|
227
|
+
}, weekDayName), ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("span", null, weekDayNameLong)));
|
|
224
228
|
}));
|
|
225
229
|
});
|
|
226
230
|
_defineProperty(_assertThisInitialized(_this), "formatWeekday", function (localeData, day) {
|
|
@@ -252,9 +252,7 @@ var Time = /*#__PURE__*/function (_React$Component) {
|
|
|
252
252
|
});
|
|
253
253
|
var screenReaderInstructions;
|
|
254
254
|
if (this.state.readInstructions) {
|
|
255
|
-
screenReaderInstructions = ___EmotionJSX("p",
|
|
256
|
-
"aria-live": true
|
|
257
|
-
}, "You are a in a time selector. Use the up and down keys to select from other common times then press enter to confirm.", this.state.preSelection ? "".concat(formatDate(this.state.preSelection, this.timeFormat), " is currently\n focused.") : "No time is currently focused.");
|
|
255
|
+
screenReaderInstructions = ___EmotionJSX(React.Fragment, null, ___EmotionJSX("p", null, "You are a in a time selector. Use the up and down keys to select from other common times then press enter to confirm."), ___EmotionJSX("p", null, this.state.preSelection ? "".concat(formatDate(this.state.preSelection, this.timeFormat), " is currently\n focused.") : "No time is currently focused."));
|
|
258
256
|
}
|
|
259
257
|
return ___EmotionJSX("div", {
|
|
260
258
|
className: classNames
|
|
@@ -265,7 +263,10 @@ var Time = /*#__PURE__*/function (_React$Component) {
|
|
|
265
263
|
}
|
|
266
264
|
}, ___EmotionJSX("div", {
|
|
267
265
|
className: "react-datepicker-time__header"
|
|
268
|
-
}, this.props.timeCaption), ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("span",
|
|
266
|
+
}, this.props.timeCaption), ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("span", {
|
|
267
|
+
"aria-live": "polite",
|
|
268
|
+
"aria-atomic": "false"
|
|
269
|
+
}, screenReaderInstructions))), ___EmotionJSX("div", {
|
|
269
270
|
className: "react-datepicker__time"
|
|
270
271
|
}, ___EmotionJSX("div", {
|
|
271
272
|
className: timeBoxClassNames,
|
|
@@ -386,7 +386,7 @@ export var EuiDualRangeClass = /*#__PURE__*/function (_Component) {
|
|
|
386
386
|
// Non-overridable props
|
|
387
387
|
side: "min",
|
|
388
388
|
min: min,
|
|
389
|
-
max: Number(this.upperValue),
|
|
389
|
+
max: this.upperValue === '' ? max : Number(this.upperValue),
|
|
390
390
|
step: step,
|
|
391
391
|
compressed: compressed,
|
|
392
392
|
autoSize: !showInputOnly,
|
|
@@ -441,7 +441,7 @@ export var EuiDualRangeClass = /*#__PURE__*/function (_Component) {
|
|
|
441
441
|
}, maxInputProps, {
|
|
442
442
|
// Non-overridable props
|
|
443
443
|
side: "max",
|
|
444
|
-
min: Number(this.lowerValue),
|
|
444
|
+
min: this.lowerValue === '' ? min : Number(this.lowerValue),
|
|
445
445
|
max: max,
|
|
446
446
|
step: step,
|
|
447
447
|
compressed: compressed,
|
|
@@ -491,18 +491,18 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
491
491
|
}
|
|
492
492
|
}
|
|
493
493
|
}
|
|
494
|
+
var optionArray = visibleOptions || options;
|
|
494
495
|
if (prevProps.visibleOptions !== visibleOptions || prevProps.options !== options) {
|
|
495
|
-
var optionArray = visibleOptions || options;
|
|
496
496
|
this.setState(_objectSpread({
|
|
497
497
|
optionArray: optionArray,
|
|
498
498
|
itemData: _objectSpread({}, optionArray)
|
|
499
499
|
}, this.calculateAriaSetAttrs(optionArray)));
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
// ensure that ListRow updates based on item props
|
|
503
|
-
if (isVirtualized) {
|
|
500
|
+
} else if (isVirtualized) {
|
|
501
|
+
// ensure that ListRow updates based on item props
|
|
504
502
|
if (prevProps.allowExclusions !== allowExclusions || prevProps.showIcons !== showIcons || prevProps.paddingSize !== paddingSize || prevProps.textWrap !== textWrap || prevProps.onFocusBadge !== onFocusBadge || prevProps.searchable !== searchable) {
|
|
505
|
-
this.
|
|
503
|
+
this.setState({
|
|
504
|
+
itemData: _objectSpread({}, optionArray)
|
|
505
|
+
});
|
|
506
506
|
}
|
|
507
507
|
}
|
|
508
508
|
}
|
package/i18ntokens.json
CHANGED
|
@@ -4903,12 +4903,12 @@
|
|
|
4903
4903
|
"start": {
|
|
4904
4904
|
"line": 593,
|
|
4905
4905
|
"column": 6,
|
|
4906
|
-
"index":
|
|
4906
|
+
"index": 17675
|
|
4907
4907
|
},
|
|
4908
4908
|
"end": {
|
|
4909
4909
|
"line": 596,
|
|
4910
4910
|
"column": 8,
|
|
4911
|
-
"index":
|
|
4911
|
+
"index": 17910
|
|
4912
4912
|
}
|
|
4913
4913
|
},
|
|
4914
4914
|
"filepath": "src/components/form/range/dual_range.tsx"
|
|
@@ -27,6 +27,12 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
27
27
|
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); }
|
|
28
28
|
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; }
|
|
29
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
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
31
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
32
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
33
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
34
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
35
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
30
36
|
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; }
|
|
31
37
|
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; }
|
|
32
38
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -62,6 +68,8 @@ var EuiBadge = function EuiBadge(_ref) {
|
|
|
62
68
|
var isNamedColor = COLORS.includes(color);
|
|
63
69
|
var euiTheme = (0, _services.useEuiTheme)();
|
|
64
70
|
var customColorStyles = (0, _react.useMemo)(function () {
|
|
71
|
+
// Disabled badges should not have custom colors
|
|
72
|
+
if (isDisabled) return style;
|
|
65
73
|
// Named colors set their styles via Emotion CSS and not inline styles
|
|
66
74
|
if (isNamedColor) return style;
|
|
67
75
|
|
|
@@ -76,17 +84,17 @@ var EuiBadge = function EuiBadge(_ref) {
|
|
|
76
84
|
console.warn("Warning: ".concat(color, " badge has a low contrast of ").concat(contrastRatio.toFixed(2), ". Should be above ").concat(_services.wcagContrastMin, "."));
|
|
77
85
|
}
|
|
78
86
|
return _objectSpread({
|
|
79
|
-
|
|
80
|
-
|
|
87
|
+
'--euiBadgeBackgroundColor': color,
|
|
88
|
+
'--euiBadgeTextColor': textColor
|
|
81
89
|
}, style);
|
|
82
90
|
} catch (err) {
|
|
83
91
|
if (!(0, _color_utils.getIsValidColor)(color)) {
|
|
84
92
|
console.warn('EuiBadge expects a valid color. This can either be a three or six ' + "character hex value, rgb(a) value, hsv value, hollow, or one of the following: ".concat(COLORS, ". ") + "Instead got ".concat(color, "."));
|
|
85
93
|
}
|
|
86
94
|
}
|
|
87
|
-
}, [color, isNamedColor, style, euiTheme]);
|
|
95
|
+
}, [color, isNamedColor, isDisabled, style, euiTheme]);
|
|
88
96
|
var styles = (0, _services.useEuiMemoizedStyles)(_badge.euiBadgeStyles);
|
|
89
|
-
var cssStyles = [styles.euiBadge
|
|
97
|
+
var cssStyles = [styles.euiBadge].concat(_toConsumableArray(isDisabled ? [styles.disabled] : [isNamedColor && styles[color], !iconOnClick && (onClick || href) && styles.clickable]));
|
|
90
98
|
var textCssStyles = [styles.text.euiBadge__text, (onClick || href) && !isDisabled && styles.text.clickable];
|
|
91
99
|
var iconCssStyles = [styles.icon.euiBadge__icon, styles.icon[iconSide]];
|
|
92
100
|
var iconButtonCssStyles = [styles.iconButton.euiBadge__iconButton, styles.iconButton[iconSide]];
|
|
@@ -26,24 +26,27 @@ var _ref = process.env.NODE_ENV === "production" ? {
|
|
|
26
26
|
var euiBadgeStyles = function euiBadgeStyles(euiThemeContext) {
|
|
27
27
|
var euiTheme = euiThemeContext.euiTheme;
|
|
28
28
|
var badgeColors = (0, _color_utils.euiBadgeColors)(euiThemeContext);
|
|
29
|
+
var setBadgeColorVars = function setBadgeColorVars(colors) {
|
|
30
|
+
return "\n --euiBadgeTextColor: ".concat(colors.color, ";\n --euiBadgeBackgroundColor: ").concat(colors.backgroundColor, ";\n ");
|
|
31
|
+
};
|
|
29
32
|
return {
|
|
30
33
|
euiBadge: /*#__PURE__*/(0, _react.css)("display:inline-block;vertical-align:middle;", (0, _global_styling.logicalShorthandCSS)('padding', "0 ".concat(euiTheme.size.s)), " ", (0, _global_styling.logicalCSS)('max-width', '100%'), " font-size:", (0, _global_styling.euiFontSize)(euiThemeContext, 'xs').fontSize, ";line-height:", (0, _global_styling.mathWithUnits)(
|
|
31
34
|
// Account for the border
|
|
32
35
|
[euiTheme.size.base, euiTheme.border.width.thin], function (x, y) {
|
|
33
36
|
return x + y * 2;
|
|
34
|
-
}), ";font-weight:", euiTheme.font.weight.medium, ";white-space:nowrap;text-decoration:none;cursor:default;
|
|
37
|
+
}), ";font-weight:", euiTheme.font.weight.medium, ";white-space:nowrap;text-decoration:none;cursor:default;border:", euiTheme.border.width.thin, " solid transparent;border-radius:", (0, _global_styling.mathWithUnits)(euiTheme.border.radius.medium, function (x) {
|
|
35
38
|
return x / 2;
|
|
36
|
-
}), ";", (0, _global_styling.logicalTextAlignCSS)('left'), " &:focus-within{", (0, _global_styling.euiFocusRing)(euiThemeContext), ";}&+.euiBadge{", (0, _global_styling.logicalCSS)('margin-left', euiTheme.size.xs), ";};label:euiBadge;"),
|
|
39
|
+
}), ";", (0, _global_styling.logicalTextAlignCSS)('left'), "color:var(--euiBadgeTextColor, ", badgeColors.default.color, ");background-color:var(\n --euiBadgeBackgroundColor,\n ", badgeColors.default.backgroundColor, "\n );*::selection{color:var(\n --euiBadgeBackgroundColor,\n ", badgeColors.default.backgroundColor, "\n );background-color:var(\n --euiBadgeTextColor,\n ", badgeColors.default.color, "\n );}&:focus-within{", (0, _global_styling.euiFocusRing)(euiThemeContext), ";}&+.euiBadge{", (0, _global_styling.logicalCSS)('margin-left', euiTheme.size.xs), ";};label:euiBadge;"),
|
|
37
40
|
clickable: /*#__PURE__*/(0, _react.css)("&:not(:disabled){&:hover,&:focus{text-decoration:underline;}}&:focus{", (0, _global_styling.euiFocusRing)(euiThemeContext), ";}&:disabled{cursor:not-allowed;};label:clickable;"),
|
|
38
41
|
// Colors
|
|
39
|
-
default: /*#__PURE__*/(0, _react.css)(badgeColors.default, ";label:default;"),
|
|
40
|
-
hollow: /*#__PURE__*/(0, _react.css)(
|
|
41
|
-
primary: /*#__PURE__*/(0, _react.css)(badgeColors.primary, ";label:primary;"),
|
|
42
|
-
accent: /*#__PURE__*/(0, _react.css)(badgeColors.accent, ";label:accent;"),
|
|
43
|
-
warning: /*#__PURE__*/(0, _react.css)(badgeColors.warning, ";label:warning;"),
|
|
44
|
-
danger: /*#__PURE__*/(0, _react.css)(badgeColors.danger, ";label:danger;"),
|
|
45
|
-
success: /*#__PURE__*/(0, _react.css)(badgeColors.success, ";label:success;"),
|
|
46
|
-
disabled: /*#__PURE__*/(0, _react.css)(
|
|
42
|
+
default: /*#__PURE__*/(0, _react.css)(setBadgeColorVars(badgeColors.default), ";label:default;"),
|
|
43
|
+
hollow: /*#__PURE__*/(0, _react.css)(setBadgeColorVars(badgeColors.hollow), " border-color:", badgeColors.hollow.borderColor, ";;label:hollow;"),
|
|
44
|
+
primary: /*#__PURE__*/(0, _react.css)(setBadgeColorVars(badgeColors.primary), ";label:primary;"),
|
|
45
|
+
accent: /*#__PURE__*/(0, _react.css)(setBadgeColorVars(badgeColors.accent), ";label:accent;"),
|
|
46
|
+
warning: /*#__PURE__*/(0, _react.css)(setBadgeColorVars(badgeColors.warning), ";label:warning;"),
|
|
47
|
+
danger: /*#__PURE__*/(0, _react.css)(setBadgeColorVars(badgeColors.danger), ";label:danger;"),
|
|
48
|
+
success: /*#__PURE__*/(0, _react.css)(setBadgeColorVars(badgeColors.success), ";label:success;"),
|
|
49
|
+
disabled: /*#__PURE__*/(0, _react.css)(setBadgeColorVars(badgeColors.disabled), "*::selection{color:", euiTheme.colors.emptyShade, ";};label:disabled;"),
|
|
47
50
|
// Content wrapper
|
|
48
51
|
euiBadge__content: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)(
|
|
49
52
|
// Ensure proper height in case of just displaying an icon
|
|
@@ -14,8 +14,9 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
14
14
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
15
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
16
16
|
var _calendar_container = _interopRequireDefault(require("./calendar_container"));
|
|
17
|
-
var _date_utils = require("./date_utils");
|
|
18
17
|
var _focus_trap = require("../../../focus_trap");
|
|
18
|
+
var _screen_reader_only = require("../../../accessibility/screen_reader_only");
|
|
19
|
+
var _date_utils = require("./date_utils");
|
|
19
20
|
var _react2 = require("@emotion/react");
|
|
20
21
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
22
|
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; }
|
|
@@ -222,10 +223,13 @@ var Calendar = /*#__PURE__*/function (_React$Component) {
|
|
|
222
223
|
var day = (0, _date_utils.addDays)((0, _date_utils.cloneDate)(startOfWeek), offset);
|
|
223
224
|
var localeData = (0, _date_utils.getLocaleData)(day);
|
|
224
225
|
var weekDayName = _this.formatWeekday(localeData, day);
|
|
226
|
+
var weekDayNameLong = localeData.weekdays(day);
|
|
225
227
|
return (0, _react2.jsx)("div", {
|
|
226
228
|
key: offset,
|
|
227
229
|
className: "react-datepicker__day-name"
|
|
228
|
-
},
|
|
230
|
+
}, (0, _react2.jsx)("span", {
|
|
231
|
+
"aria-hidden": "true"
|
|
232
|
+
}, weekDayName), (0, _react2.jsx)(_screen_reader_only.EuiScreenReaderOnly, null, (0, _react2.jsx)("span", null, weekDayNameLong)));
|
|
229
233
|
}));
|
|
230
234
|
});
|
|
231
235
|
_defineProperty(_assertThisInitialized(_this), "formatWeekday", function (localeData, day) {
|
|
@@ -257,9 +257,7 @@ var Time = /*#__PURE__*/function (_React$Component) {
|
|
|
257
257
|
});
|
|
258
258
|
var screenReaderInstructions;
|
|
259
259
|
if (this.state.readInstructions) {
|
|
260
|
-
screenReaderInstructions = (0, _react2.jsx)("p",
|
|
261
|
-
"aria-live": true
|
|
262
|
-
}, "You are a in a time selector. Use the up and down keys to select from other common times then press enter to confirm.", this.state.preSelection ? "".concat((0, _date_utils.formatDate)(this.state.preSelection, this.timeFormat), " is currently\n focused.") : "No time is currently focused.");
|
|
260
|
+
screenReaderInstructions = (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)("p", null, "You are a in a time selector. Use the up and down keys to select from other common times then press enter to confirm."), (0, _react2.jsx)("p", null, this.state.preSelection ? "".concat((0, _date_utils.formatDate)(this.state.preSelection, this.timeFormat), " is currently\n focused.") : "No time is currently focused."));
|
|
263
261
|
}
|
|
264
262
|
return (0, _react2.jsx)("div", {
|
|
265
263
|
className: classNames
|
|
@@ -270,7 +268,10 @@ var Time = /*#__PURE__*/function (_React$Component) {
|
|
|
270
268
|
}
|
|
271
269
|
}, (0, _react2.jsx)("div", {
|
|
272
270
|
className: "react-datepicker-time__header"
|
|
273
|
-
}, this.props.timeCaption), (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("span",
|
|
271
|
+
}, this.props.timeCaption), (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("span", {
|
|
272
|
+
"aria-live": "polite",
|
|
273
|
+
"aria-atomic": "false"
|
|
274
|
+
}, screenReaderInstructions))), (0, _react2.jsx)("div", {
|
|
274
275
|
className: "react-datepicker__time"
|
|
275
276
|
}, (0, _react2.jsx)("div", {
|
|
276
277
|
className: timeBoxClassNames,
|
|
@@ -393,7 +393,7 @@ var EuiDualRangeClass = /*#__PURE__*/function (_Component) {
|
|
|
393
393
|
// Non-overridable props
|
|
394
394
|
side: "min",
|
|
395
395
|
min: min,
|
|
396
|
-
max: Number(this.upperValue),
|
|
396
|
+
max: this.upperValue === '' ? max : Number(this.upperValue),
|
|
397
397
|
step: step,
|
|
398
398
|
compressed: compressed,
|
|
399
399
|
autoSize: !showInputOnly,
|
|
@@ -448,7 +448,7 @@ var EuiDualRangeClass = /*#__PURE__*/function (_Component) {
|
|
|
448
448
|
}, maxInputProps, {
|
|
449
449
|
// Non-overridable props
|
|
450
450
|
side: "max",
|
|
451
|
-
min: Number(this.lowerValue),
|
|
451
|
+
min: this.lowerValue === '' ? min : Number(this.lowerValue),
|
|
452
452
|
max: max,
|
|
453
453
|
step: step,
|
|
454
454
|
compressed: compressed,
|
|
@@ -496,18 +496,18 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
498
|
}
|
|
499
|
+
var optionArray = visibleOptions || options;
|
|
499
500
|
if (prevProps.visibleOptions !== visibleOptions || prevProps.options !== options) {
|
|
500
|
-
var optionArray = visibleOptions || options;
|
|
501
501
|
this.setState(_objectSpread({
|
|
502
502
|
optionArray: optionArray,
|
|
503
503
|
itemData: _objectSpread({}, optionArray)
|
|
504
504
|
}, this.calculateAriaSetAttrs(optionArray)));
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
// ensure that ListRow updates based on item props
|
|
508
|
-
if (isVirtualized) {
|
|
505
|
+
} else if (isVirtualized) {
|
|
506
|
+
// ensure that ListRow updates based on item props
|
|
509
507
|
if (prevProps.allowExclusions !== allowExclusions || prevProps.showIcons !== showIcons || prevProps.paddingSize !== paddingSize || prevProps.textWrap !== textWrap || prevProps.onFocusBadge !== onFocusBadge || prevProps.searchable !== searchable) {
|
|
510
|
-
this.
|
|
508
|
+
this.setState({
|
|
509
|
+
itemData: _objectSpread({}, optionArray)
|
|
510
|
+
});
|
|
511
511
|
}
|
|
512
512
|
}
|
|
513
513
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
5
|
var _excluded = ["children", "color", "iconType", "iconSide", "className", "isDisabled", "onClick", "iconOnClick", "onClickAriaLabel", "iconOnClickAriaLabel", "closeButtonProps", "href", "rel", "target", "style"];
|
|
@@ -47,6 +48,8 @@ export var EuiBadge = function EuiBadge(_ref) {
|
|
|
47
48
|
var isNamedColor = COLORS.includes(color);
|
|
48
49
|
var euiTheme = useEuiTheme();
|
|
49
50
|
var customColorStyles = useMemo(function () {
|
|
51
|
+
// Disabled badges should not have custom colors
|
|
52
|
+
if (isDisabled) return style;
|
|
50
53
|
// Named colors set their styles via Emotion CSS and not inline styles
|
|
51
54
|
if (isNamedColor) return style;
|
|
52
55
|
|
|
@@ -61,17 +64,17 @@ export var EuiBadge = function EuiBadge(_ref) {
|
|
|
61
64
|
console.warn("Warning: ".concat(color, " badge has a low contrast of ").concat(contrastRatio.toFixed(2), ". Should be above ").concat(wcagContrastMin, "."));
|
|
62
65
|
}
|
|
63
66
|
return _objectSpread({
|
|
64
|
-
|
|
65
|
-
|
|
67
|
+
'--euiBadgeBackgroundColor': color,
|
|
68
|
+
'--euiBadgeTextColor': textColor
|
|
66
69
|
}, style);
|
|
67
70
|
} catch (err) {
|
|
68
71
|
if (!getIsValidColor(color)) {
|
|
69
72
|
console.warn('EuiBadge expects a valid color. This can either be a three or six ' + "character hex value, rgb(a) value, hsv value, hollow, or one of the following: ".concat(COLORS, ". ") + "Instead got ".concat(color, "."));
|
|
70
73
|
}
|
|
71
74
|
}
|
|
72
|
-
}, [color, isNamedColor, style, euiTheme]);
|
|
75
|
+
}, [color, isNamedColor, isDisabled, style, euiTheme]);
|
|
73
76
|
var styles = useEuiMemoizedStyles(euiBadgeStyles);
|
|
74
|
-
var cssStyles = [styles.euiBadge
|
|
77
|
+
var cssStyles = [styles.euiBadge].concat(_toConsumableArray(isDisabled ? [styles.disabled] : [isNamedColor && styles[color], !iconOnClick && (onClick || href) && styles.clickable]));
|
|
75
78
|
var textCssStyles = [styles.text.euiBadge__text, (onClick || href) && !isDisabled && styles.text.clickable];
|
|
76
79
|
var iconCssStyles = [styles.icon.euiBadge__icon, styles.icon[iconSide]];
|
|
77
80
|
var iconButtonCssStyles = [styles.iconButton.euiBadge__iconButton, styles.iconButton[iconSide]];
|
|
@@ -22,24 +22,27 @@ var _ref = process.env.NODE_ENV === "production" ? {
|
|
|
22
22
|
export var euiBadgeStyles = function euiBadgeStyles(euiThemeContext) {
|
|
23
23
|
var euiTheme = euiThemeContext.euiTheme;
|
|
24
24
|
var badgeColors = euiBadgeColors(euiThemeContext);
|
|
25
|
+
var setBadgeColorVars = function setBadgeColorVars(colors) {
|
|
26
|
+
return "\n --euiBadgeTextColor: ".concat(colors.color, ";\n --euiBadgeBackgroundColor: ").concat(colors.backgroundColor, ";\n ");
|
|
27
|
+
};
|
|
25
28
|
return {
|
|
26
29
|
euiBadge: /*#__PURE__*/css("display:inline-block;vertical-align:middle;", logicalShorthandCSS('padding', "0 ".concat(euiTheme.size.s)), " ", logicalCSS('max-width', '100%'), " font-size:", euiFontSize(euiThemeContext, 'xs').fontSize, ";line-height:", mathWithUnits(
|
|
27
30
|
// Account for the border
|
|
28
31
|
[euiTheme.size.base, euiTheme.border.width.thin], function (x, y) {
|
|
29
32
|
return x + y * 2;
|
|
30
|
-
}), ";font-weight:", euiTheme.font.weight.medium, ";white-space:nowrap;text-decoration:none;cursor:default;
|
|
33
|
+
}), ";font-weight:", euiTheme.font.weight.medium, ";white-space:nowrap;text-decoration:none;cursor:default;border:", euiTheme.border.width.thin, " solid transparent;border-radius:", mathWithUnits(euiTheme.border.radius.medium, function (x) {
|
|
31
34
|
return x / 2;
|
|
32
|
-
}), ";", logicalTextAlignCSS('left'), " &:focus-within{", euiFocusRing(euiThemeContext), ";}&+.euiBadge{", logicalCSS('margin-left', euiTheme.size.xs), ";};label:euiBadge;"),
|
|
35
|
+
}), ";", logicalTextAlignCSS('left'), "color:var(--euiBadgeTextColor, ", badgeColors.default.color, ");background-color:var(\n --euiBadgeBackgroundColor,\n ", badgeColors.default.backgroundColor, "\n );*::selection{color:var(\n --euiBadgeBackgroundColor,\n ", badgeColors.default.backgroundColor, "\n );background-color:var(\n --euiBadgeTextColor,\n ", badgeColors.default.color, "\n );}&:focus-within{", euiFocusRing(euiThemeContext), ";}&+.euiBadge{", logicalCSS('margin-left', euiTheme.size.xs), ";};label:euiBadge;"),
|
|
33
36
|
clickable: /*#__PURE__*/css("&:not(:disabled){&:hover,&:focus{text-decoration:underline;}}&:focus{", euiFocusRing(euiThemeContext), ";}&:disabled{cursor:not-allowed;};label:clickable;"),
|
|
34
37
|
// Colors
|
|
35
|
-
default: /*#__PURE__*/css(badgeColors.default, ";label:default;"),
|
|
36
|
-
hollow: /*#__PURE__*/css(
|
|
37
|
-
primary: /*#__PURE__*/css(badgeColors.primary, ";label:primary;"),
|
|
38
|
-
accent: /*#__PURE__*/css(badgeColors.accent, ";label:accent;"),
|
|
39
|
-
warning: /*#__PURE__*/css(badgeColors.warning, ";label:warning;"),
|
|
40
|
-
danger: /*#__PURE__*/css(badgeColors.danger, ";label:danger;"),
|
|
41
|
-
success: /*#__PURE__*/css(badgeColors.success, ";label:success;"),
|
|
42
|
-
disabled: /*#__PURE__*/css(
|
|
38
|
+
default: /*#__PURE__*/css(setBadgeColorVars(badgeColors.default), ";label:default;"),
|
|
39
|
+
hollow: /*#__PURE__*/css(setBadgeColorVars(badgeColors.hollow), " border-color:", badgeColors.hollow.borderColor, ";;label:hollow;"),
|
|
40
|
+
primary: /*#__PURE__*/css(setBadgeColorVars(badgeColors.primary), ";label:primary;"),
|
|
41
|
+
accent: /*#__PURE__*/css(setBadgeColorVars(badgeColors.accent), ";label:accent;"),
|
|
42
|
+
warning: /*#__PURE__*/css(setBadgeColorVars(badgeColors.warning), ";label:warning;"),
|
|
43
|
+
danger: /*#__PURE__*/css(setBadgeColorVars(badgeColors.danger), ";label:danger;"),
|
|
44
|
+
success: /*#__PURE__*/css(setBadgeColorVars(badgeColors.success), ";label:success;"),
|
|
45
|
+
disabled: /*#__PURE__*/css(setBadgeColorVars(badgeColors.disabled), "*::selection{color:", euiTheme.colors.emptyShade, ";};label:disabled;"),
|
|
43
46
|
// Content wrapper
|
|
44
47
|
euiBadge__content: /*#__PURE__*/css(logicalCSS(
|
|
45
48
|
// Ensure proper height in case of just displaying an icon
|
|
@@ -44,8 +44,9 @@ import React from "react";
|
|
|
44
44
|
import PropTypes from "prop-types";
|
|
45
45
|
import classnames from "classnames";
|
|
46
46
|
import CalendarContainer from "./calendar_container";
|
|
47
|
-
import { now, setMonth, getMonth, addMonths, subtractMonths, getStartOfWeek, getStartOfDate, getStartOfMonth, addDays, cloneDate, formatDate, localizeDate, setYear, getYear, isBefore, isAfter, getLocaleData, getFormattedWeekdayInLocale, getWeekdayShortInLocale, getWeekdayMinInLocale, isSameDay, allDaysDisabledBefore, allDaysDisabledAfter, getEffectiveMinDate, getEffectiveMaxDate } from "./date_utils";
|
|
48
47
|
import { EuiFocusTrap } from '../../../focus_trap';
|
|
48
|
+
import { EuiScreenReaderOnly } from '../../../accessibility/screen_reader_only';
|
|
49
|
+
import { now, setMonth, getMonth, addMonths, subtractMonths, getStartOfWeek, getStartOfDate, getStartOfMonth, addDays, cloneDate, formatDate, localizeDate, setYear, getYear, isBefore, isAfter, getLocaleData, getFormattedWeekdayInLocale, getWeekdayShortInLocale, getWeekdayMinInLocale, isSameDay, allDaysDisabledBefore, allDaysDisabledAfter, getEffectiveMinDate, getEffectiveMaxDate } from "./date_utils";
|
|
49
50
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
50
51
|
var FocusTrapContainer = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
51
52
|
return ___EmotionJSX("div", _extends({
|
|
@@ -212,10 +213,13 @@ var Calendar = /*#__PURE__*/function (_React$Component) {
|
|
|
212
213
|
var day = addDays(cloneDate(startOfWeek), offset);
|
|
213
214
|
var localeData = getLocaleData(day);
|
|
214
215
|
var weekDayName = _this.formatWeekday(localeData, day);
|
|
216
|
+
var weekDayNameLong = localeData.weekdays(day);
|
|
215
217
|
return ___EmotionJSX("div", {
|
|
216
218
|
key: offset,
|
|
217
219
|
className: "react-datepicker__day-name"
|
|
218
|
-
},
|
|
220
|
+
}, ___EmotionJSX("span", {
|
|
221
|
+
"aria-hidden": "true"
|
|
222
|
+
}, weekDayName), ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("span", null, weekDayNameLong)));
|
|
219
223
|
}));
|
|
220
224
|
});
|
|
221
225
|
_defineProperty(_assertThisInitialized(_this), "formatWeekday", function (localeData, day) {
|
|
@@ -247,9 +247,7 @@ var Time = /*#__PURE__*/function (_React$Component) {
|
|
|
247
247
|
});
|
|
248
248
|
var screenReaderInstructions;
|
|
249
249
|
if (this.state.readInstructions) {
|
|
250
|
-
screenReaderInstructions = ___EmotionJSX("p",
|
|
251
|
-
"aria-live": true
|
|
252
|
-
}, "You are a in a time selector. Use the up and down keys to select from other common times then press enter to confirm.", this.state.preSelection ? "".concat(formatDate(this.state.preSelection, this.timeFormat), " is currently\n focused.") : "No time is currently focused.");
|
|
250
|
+
screenReaderInstructions = ___EmotionJSX(React.Fragment, null, ___EmotionJSX("p", null, "You are a in a time selector. Use the up and down keys to select from other common times then press enter to confirm."), ___EmotionJSX("p", null, this.state.preSelection ? "".concat(formatDate(this.state.preSelection, this.timeFormat), " is currently\n focused.") : "No time is currently focused."));
|
|
253
251
|
}
|
|
254
252
|
return ___EmotionJSX("div", {
|
|
255
253
|
className: classNames
|
|
@@ -260,7 +258,10 @@ var Time = /*#__PURE__*/function (_React$Component) {
|
|
|
260
258
|
}
|
|
261
259
|
}, ___EmotionJSX("div", {
|
|
262
260
|
className: "react-datepicker-time__header"
|
|
263
|
-
}, this.props.timeCaption), ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("span",
|
|
261
|
+
}, this.props.timeCaption), ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("span", {
|
|
262
|
+
"aria-live": "polite",
|
|
263
|
+
"aria-atomic": "false"
|
|
264
|
+
}, screenReaderInstructions))), ___EmotionJSX("div", {
|
|
264
265
|
className: "react-datepicker__time"
|
|
265
266
|
}, ___EmotionJSX("div", {
|
|
266
267
|
className: timeBoxClassNames,
|
|
@@ -379,7 +379,7 @@ export var EuiDualRangeClass = /*#__PURE__*/function (_Component) {
|
|
|
379
379
|
// Non-overridable props
|
|
380
380
|
side: "min",
|
|
381
381
|
min: min,
|
|
382
|
-
max: Number(this.upperValue),
|
|
382
|
+
max: this.upperValue === '' ? max : Number(this.upperValue),
|
|
383
383
|
step: step,
|
|
384
384
|
compressed: compressed,
|
|
385
385
|
autoSize: !showInputOnly,
|
|
@@ -434,7 +434,7 @@ export var EuiDualRangeClass = /*#__PURE__*/function (_Component) {
|
|
|
434
434
|
}, maxInputProps, {
|
|
435
435
|
// Non-overridable props
|
|
436
436
|
side: "max",
|
|
437
|
-
min: Number(this.lowerValue),
|
|
437
|
+
min: this.lowerValue === '' ? min : Number(this.lowerValue),
|
|
438
438
|
max: max,
|
|
439
439
|
step: step,
|
|
440
440
|
compressed: compressed,
|
|
@@ -485,18 +485,18 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
485
485
|
}
|
|
486
486
|
}
|
|
487
487
|
}
|
|
488
|
+
var optionArray = visibleOptions || options;
|
|
488
489
|
if (prevProps.visibleOptions !== visibleOptions || prevProps.options !== options) {
|
|
489
|
-
var optionArray = visibleOptions || options;
|
|
490
490
|
this.setState(_objectSpread({
|
|
491
491
|
optionArray: optionArray,
|
|
492
492
|
itemData: _objectSpread({}, optionArray)
|
|
493
493
|
}, this.calculateAriaSetAttrs(optionArray)));
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
// ensure that ListRow updates based on item props
|
|
497
|
-
if (isVirtualized) {
|
|
494
|
+
} else if (isVirtualized) {
|
|
495
|
+
// ensure that ListRow updates based on item props
|
|
498
496
|
if (prevProps.allowExclusions !== allowExclusions || prevProps.showIcons !== showIcons || prevProps.paddingSize !== paddingSize || prevProps.textWrap !== textWrap || prevProps.onFocusBadge !== onFocusBadge || prevProps.searchable !== searchable) {
|
|
499
|
-
this.
|
|
497
|
+
this.setState({
|
|
498
|
+
itemData: _objectSpread({}, optionArray)
|
|
499
|
+
});
|
|
500
500
|
}
|
|
501
501
|
}
|
|
502
502
|
}
|