@splunk/react-ui 4.21.0 → 4.22.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.
Files changed (92) hide show
  1. package/Accordion.js +425 -325
  2. package/Anchor.js +147 -117
  3. package/Animation.js +142 -94
  4. package/AnimationToggle.js +197 -193
  5. package/Box.js +145 -118
  6. package/Breadcrumbs.js +288 -206
  7. package/Button.js +488 -465
  8. package/ButtonGroup.js +160 -128
  9. package/ButtonSimple.js +543 -462
  10. package/CHANGELOG.md +24 -3
  11. package/Calendar.js +1111 -1001
  12. package/Card.js +771 -598
  13. package/CardLayout.js +205 -147
  14. package/Chip.js +509 -488
  15. package/Clickable.js +414 -352
  16. package/CloseButton.js +165 -142
  17. package/Code.js +1807 -2084
  18. package/CollapsiblePanel.js +586 -519
  19. package/Color.js +1068 -1068
  20. package/ColumnLayout.js +402 -363
  21. package/ComboBox.js +903 -794
  22. package/Concertina.js +997 -802
  23. package/ControlGroup.js +687 -594
  24. package/Date.js +567 -547
  25. package/DefinitionList.js +308 -234
  26. package/Divider.js +149 -118
  27. package/Dropdown.js +459 -416
  28. package/DualListbox.js +1479 -1541
  29. package/EventListener.js +94 -97
  30. package/File.js +1051 -969
  31. package/FormRows.js +883 -696
  32. package/Heading.js +216 -193
  33. package/Image.js +446 -402
  34. package/JSONTree.js +690 -551
  35. package/Layer.js +437 -410
  36. package/Link.js +336 -255
  37. package/List.js +213 -161
  38. package/Markdown.js +509 -487
  39. package/Menu.js +1104 -1056
  40. package/Message.js +475 -441
  41. package/MessageBar.js +387 -373
  42. package/Modal.js +810 -634
  43. package/ModalLayer.js +326 -243
  44. package/Monogram.js +308 -276
  45. package/Multiselect.js +3564 -3364
  46. package/Number.js +729 -687
  47. package/Paginator.js +510 -449
  48. package/Paragraph.js +145 -112
  49. package/Popover.js +1459 -1432
  50. package/Progress.js +301 -246
  51. package/RadioBar.js +634 -527
  52. package/RadioList.js +483 -444
  53. package/Resize.js +530 -489
  54. package/ResultsMenu.js +479 -455
  55. package/ScreenReaderContent.js +142 -111
  56. package/Scroll.js +595 -456
  57. package/ScrollContainerContext.js +197 -206
  58. package/Search.js +756 -650
  59. package/Select.js +2446 -2345
  60. package/SidePanel.js +390 -284
  61. package/Slider.js +680 -676
  62. package/SlidingPanels.js +639 -503
  63. package/SplitButton.js +464 -367
  64. package/StaticContent.js +161 -133
  65. package/StepBar.js +386 -358
  66. package/Switch.js +710 -640
  67. package/TabBar.js +741 -680
  68. package/TabLayout.js +406 -322
  69. package/Table.js +4974 -4616
  70. package/Text.js +1170 -1138
  71. package/TextArea.js +1102 -1090
  72. package/Tooltip.js +624 -581
  73. package/TransitionOpen.js +489 -422
  74. package/Typography.js +176 -153
  75. package/WaitSpinner.js +230 -206
  76. package/package.json +7 -7
  77. package/types/src/Color/Color.d.ts +0 -1
  78. package/types/src/JSONTree/JSONTreeContext.d.ts +7 -0
  79. package/types/src/JSONTree/TreeNode.d.ts +5 -0
  80. package/types/src/RadioBar/RadioBar.d.ts +1 -0
  81. package/types/src/ResultsMenu/ResultsMenu.d.ts +0 -2
  82. package/types/src/Select/docs/examples/Icons.d.ts +1 -9
  83. package/types/src/Slider/Slider.d.ts +1 -0
  84. package/types/src/TabBar/Tab.d.ts +10 -1
  85. package/types/src/TabBar/TabBar.d.ts +4 -2
  86. package/types/src/Table/Head.d.ts +7 -3
  87. package/types/src/Table/Table.d.ts +3 -2
  88. package/types/src/Table/TableContext.d.ts +2 -0
  89. package/useForceUpdate.js +112 -82
  90. package/useKeyPress.js +74 -71
  91. package/usePrevious.js +65 -65
  92. package/useRovingFocus.js +122 -138
package/Calendar.js CHANGED
@@ -1,1018 +1,1128 @@
1
- /******/ (() => { // webpackBootstrap
2
- /******/ "use strict";
3
- /******/ // The require scope
4
- /******/ var __webpack_require__ = {};
5
- /******/
6
- /************************************************************************/
7
- /******/ /* webpack/runtime/compat get default export */
8
- /******/ (() => {
9
- /******/ // getDefaultExport function for compatibility with non-harmony modules
10
- /******/ __webpack_require__.n = (module) => {
11
- /******/ var getter = module && module.__esModule ?
12
- /******/ () => (module['default']) :
13
- /******/ () => (module);
14
- /******/ __webpack_require__.d(getter, { a: getter });
15
- /******/ return getter;
16
- /******/ };
17
- /******/ })();
18
- /******/
19
- /******/ /* webpack/runtime/define property getters */
20
- /******/ (() => {
21
- /******/ // define getter functions for harmony exports
22
- /******/ __webpack_require__.d = (exports, definition) => {
23
- /******/ for(var key in definition) {
24
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
25
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
26
- /******/ }
27
- /******/ }
28
- /******/ };
29
- /******/ })();
30
- /******/
31
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
32
- /******/ (() => {
33
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
34
- /******/ })();
35
- /******/
36
- /******/ /* webpack/runtime/make namespace object */
37
- /******/ (() => {
38
- /******/ // define __esModule on exports
39
- /******/ __webpack_require__.r = (exports) => {
40
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
41
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
42
- /******/ }
43
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
44
- /******/ };
45
- /******/ })();
46
- /******/
47
- /************************************************************************/
48
- var __webpack_exports__ = {};
49
- // ESM COMPAT FLAG
50
- __webpack_require__.r(__webpack_exports__);
51
-
52
- // EXPORTS
53
- __webpack_require__.d(__webpack_exports__, {
54
- calendarActiveSelector: () => (/* reexport */ calendarActiveSelector),
55
- "default": () => (/* reexport */ Calendar_Calendar)
56
- });
57
-
58
- ;// CONCATENATED MODULE: external "react"
59
- const external_react_namespaceObject = require("react");
60
- var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_namespaceObject);
61
- ;// CONCATENATED MODULE: external "prop-types"
62
- const external_prop_types_namespaceObject = require("prop-types");
63
- var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_namespaceObject);
64
- ;// CONCATENATED MODULE: external "lodash/keys"
65
- const keys_namespaceObject = require("lodash/keys");
66
- var keys_default = /*#__PURE__*/__webpack_require__.n(keys_namespaceObject);
67
- ;// CONCATENATED MODULE: external "lodash/omit"
68
- const omit_namespaceObject = require("lodash/omit");
69
- var omit_default = /*#__PURE__*/__webpack_require__.n(omit_namespaceObject);
70
- ;// CONCATENATED MODULE: external "moment"
71
- const external_moment_namespaceObject = require("moment");
72
- var external_moment_default = /*#__PURE__*/__webpack_require__.n(external_moment_namespaceObject);
73
- ;// CONCATENATED MODULE: external "@splunk/ui-utils/id"
74
- const id_namespaceObject = require("@splunk/ui-utils/id");
75
- ;// CONCATENATED MODULE: external "lodash/times"
76
- const times_namespaceObject = require("lodash/times");
77
- var times_default = /*#__PURE__*/__webpack_require__.n(times_namespaceObject);
78
- ;// CONCATENATED MODULE: external "@splunk/themes"
79
- const themes_namespaceObject = require("@splunk/themes");
80
- ;// CONCATENATED MODULE: external "@splunk/ui-utils/keyboard"
81
- const keyboard_namespaceObject = require("@splunk/ui-utils/keyboard");
82
- ;// CONCATENATED MODULE: external "@splunk/react-ui/ScreenReaderContent"
83
- const ScreenReaderContent_namespaceObject = require("@splunk/react-ui/ScreenReaderContent");
84
- var ScreenReaderContent_default = /*#__PURE__*/__webpack_require__.n(ScreenReaderContent_namespaceObject);
85
- ;// CONCATENATED MODULE: external "styled-components"
86
- const external_styled_components_namespaceObject = require("styled-components");
87
- var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_namespaceObject);
88
- ;// CONCATENATED MODULE: ./src/Calendar/DayStyles.ts
89
-
90
-
91
- /* Element used to prevent vertical shift on firefox when the font-weight is increased with $selected */
92
-
93
- var StyledValue = external_styled_components_default().div.withConfig({
94
- displayName: "DayStyles__StyledValue",
95
- componentId: "sc-1nryhyt-0"
96
- })(["left:0;line-height:", ";position:absolute;top:0;width:100%;"], (0,themes_namespaceObject.pick)({
97
- enterprise: '2em',
98
- prisma: '36px '
99
- }));
100
- var StyledInner = external_styled_components_default().div.withConfig({
101
- displayName: "DayStyles__StyledInner",
102
- componentId: "sc-1nryhyt-1"
103
- })(["border:", ";border-radius:", ";color:", ";height:", ";position:relative;text-align:center;width:", ";"], (0,themes_namespaceObject.pick)({
104
- enterprise: '1px solid transparent',
105
- prisma: 'none'
106
- }), (0,themes_namespaceObject.pick)({
107
- enterprise: themes_namespaceObject.variables.borderRadius,
108
- prisma: '50%'
109
- }), (0,themes_namespaceObject.pick)({
110
- enterprise: {
111
- light: themes_namespaceObject.variables.gray45,
112
- dark: themes_namespaceObject.variables.gray98
113
- },
114
- prisma: themes_namespaceObject.variables.contentColorActive
115
- }), (0,themes_namespaceObject.pick)({
116
- enterprise: '2em',
117
- prisma: '36px '
118
- }), (0,themes_namespaceObject.pick)({
119
- enterprise: 'calc(2em - 2px)',
120
- prisma: '36px'
121
- }));
122
- var StyledCell = external_styled_components_default().td.withConfig({
123
- displayName: "DayStyles__StyledCell",
124
- componentId: "sc-1nryhyt-2"
125
- })(["", ";cursor:pointer;", ";", ";"], themes_namespaceObject.mixins.reset('table-cell'), (0,themes_namespaceObject.pickVariant)('$today', {
126
- "true": {
127
- enterprise: (0,external_styled_components_namespaceObject.css)(["& > ", "{background-color:", ";}&:focus{& > ", "{box-shadow:", ";}}"],
128
- /* sc-sel */
129
- StyledInner, (0,themes_namespaceObject.pick)({
130
- light: themes_namespaceObject.variables.gray92,
131
- dark: themes_namespaceObject.variables.gray45
132
- }),
133
- /* sc-sel */
134
- StyledInner, themes_namespaceObject.variables.focusShadow),
135
- prisma: (0,external_styled_components_namespaceObject.css)(["& > ", "{box-shadow:inset 0 0 0 1px ", ";}&:focus{& > ", "{box-shadow:inset 0 0 0 1px ", ",", ";}}"],
136
- /* sc-sel */
137
- StyledInner, themes_namespaceObject.variables.interactiveColorBorder,
138
- /* sc-sel */
139
- StyledInner, themes_namespaceObject.variables.interactiveColorBorder, themes_namespaceObject.variables.focusShadow)
140
- },
141
- "false": (0,external_styled_components_namespaceObject.css)(["&:focus{& > ", "{box-shadow:", ";}}"],
142
- /* sc-sel */
143
- StyledInner, themes_namespaceObject.variables.focusShadow)
144
- }), (0,themes_namespaceObject.pickVariant)('$selected', {
145
- "true": (0,themes_namespaceObject.pick)({
146
- enterprise: (0,external_styled_components_namespaceObject.css)(["& > ", "{border-color:", ";}"],
147
- /* sc-sel */
148
- StyledInner, themes_namespaceObject.variables.linkColor),
149
- prisma: (0,external_styled_components_namespaceObject.css)(["& > ", "{background-color:", ";font-weight:", ";}"],
150
- /* sc-sel */
151
- StyledInner, themes_namespaceObject.variables.interactiveColorOverlaySelected, themes_namespaceObject.variables.fontWeightBold)
152
- }),
153
- "false": (0,themes_namespaceObject.pick)({
154
- enterprise: (0,external_styled_components_namespaceObject.css)(["&:hover{& > ", "{background-color:", ";color:", ";}}"],
155
- /* sc-sel */
156
- StyledInner, themes_namespaceObject.variables.backgroundColorHover, themes_namespaceObject.variables.linkColor),
157
- prisma: (0,external_styled_components_namespaceObject.css)(["&:hover{& > ", "{background-color:", ";}}"],
158
- /* sc-sel */
159
- StyledInner, themes_namespaceObject.variables.interactiveColorOverlayHover)
160
- })
161
- }));
162
-
163
- ;// CONCATENATED MODULE: ./src/Calendar/Day.tsx
164
- function _extends() { _extends = Object.assign || 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); }
165
-
166
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
167
-
168
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
169
-
170
-
171
-
172
-
173
-
174
- var propTypes = {
175
- active: (external_prop_types_default()).bool,
176
- locale: (external_prop_types_default()).string,
177
- onClick: (external_prop_types_default()).func,
178
- onKeydown: (external_prop_types_default()).func,
179
- selected: (external_prop_types_default()).bool,
180
- today: (external_prop_types_default()).bool,
181
- value: (external_prop_types_default()).string
182
- };
183
-
184
- function Day(_ref) {
185
- var _ref$active = _ref.active,
186
- active = _ref$active === void 0 ? false : _ref$active,
187
- _ref$locale = _ref.locale,
188
- locale = _ref$locale === void 0 ? 'en_US' : _ref$locale,
189
- onClick = _ref.onClick,
190
- onKeyDown = _ref.onKeyDown,
191
- _ref$selected = _ref.selected,
192
- selected = _ref$selected === void 0 ? false : _ref$selected,
193
- _ref$today = _ref.today,
194
- today = _ref$today === void 0 ? false : _ref$today,
195
- value = _ref.value,
196
- otherProps = _objectWithoutProperties(_ref, ["active", "locale", "onClick", "onKeyDown", "selected", "today", "value"]);
197
-
198
- var handleClick = (0,external_react_namespaceObject.useCallback)(function (e) {
199
- e.preventDefault();
200
- onClick === null || onClick === void 0 ? void 0 : onClick(e, {
201
- value: value
202
- });
203
- }, [onClick, value]);
204
- var handleKeyDown = (0,external_react_namespaceObject.useCallback)(function (e) {
205
- e.preventDefault();
206
- onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e, {
207
- value: value
1
+ /******/ (() => {
2
+ // webpackBootstrap
3
+ /******/ "use strict";
4
+ /******/ // The require scope
5
+ /******/ var e = {};
6
+ /******/
7
+ /************************************************************************/
8
+ /******/ /* webpack/runtime/compat get default export */
9
+ /******/ (() => {
10
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
11
+ /******/ e.n = t => {
12
+ /******/ var r = t && t.__esModule ?
13
+ /******/ () => t["default"]
14
+ /******/ : () => t
15
+ /******/;
16
+ e.d(r, {
17
+ a: r
18
+ });
19
+ /******/ return r;
20
+ /******/ };
21
+ /******/ })();
22
+ /******/
23
+ /******/ /* webpack/runtime/define property getters */
24
+ /******/ (() => {
25
+ /******/ // define getter functions for harmony exports
26
+ /******/ e.d = (t, r) => {
27
+ /******/ for (var n in r) {
28
+ /******/ if (e.o(r, n) && !e.o(t, n)) {
29
+ /******/ Object.defineProperty(t, n, {
30
+ enumerable: true,
31
+ get: r[n]
32
+ });
33
+ /******/ }
34
+ /******/ }
35
+ /******/ };
36
+ /******/ })();
37
+ /******/
38
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
39
+ /******/ (() => {
40
+ /******/ e.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t)
41
+ /******/;
42
+ })();
43
+ /******/
44
+ /******/ /* webpack/runtime/make namespace object */
45
+ /******/ (() => {
46
+ /******/ // define __esModule on exports
47
+ /******/ e.r = e => {
48
+ /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
49
+ /******/ Object.defineProperty(e, Symbol.toStringTag, {
50
+ value: "Module"
51
+ });
52
+ /******/ }
53
+ /******/ Object.defineProperty(e, "__esModule", {
54
+ value: true
55
+ });
56
+ /******/ };
57
+ /******/ })();
58
+ /******/
59
+ /************************************************************************/ var t = {};
60
+ // ESM COMPAT FLAG
61
+ e.r(t);
62
+ // EXPORTS
63
+ e.d(t, {
64
+ calendarActiveSelector: () => /* reexport */ qe,
65
+ default: () => /* reexport */ He
208
66
  });
209
- }, [onKeyDown, value]);
210
- var day = value && external_moment_default()(value, 'YYYY-MM-DD', locale).format('D');
211
- return /*#__PURE__*/external_react_default().createElement(StyledCell, _extends({
212
- tabIndex: active ? 0 : -1,
213
- "aria-selected": selected,
214
- "data-test-day": day,
215
- "data-test": "day-of-month",
216
- "data-active-day": active,
217
- "data-is-today": today,
218
- onClick: handleClick,
219
- onKeyDown: handleKeyDown,
220
- $today: today,
221
- $selected: selected
222
- }, otherProps), /*#__PURE__*/external_react_default().createElement(StyledInner, null, /*#__PURE__*/external_react_default().createElement(StyledValue, null, day)));
223
- }
224
-
225
- Day.propTypes = propTypes;
226
- /* harmony default export */ const Calendar_Day = (Day);
227
- ;// CONCATENATED MODULE: ./src/Calendar/DateTableStyles.ts
228
-
229
-
230
- var Styled = external_styled_components_default().table.withConfig({
231
- displayName: "DateTableStyles__Styled",
232
- componentId: "sc-1lbrjq0-0"
233
- })(["", ";table-layout:fixed;border-spacing:", ";width:", ";margin:", ";"], themes_namespaceObject.mixins.reset('table'), (0,themes_namespaceObject.pick)({
234
- enterprise: '3px',
235
- prisma: themes_namespaceObject.variables.spacingSmall
236
- }), (0,themes_namespaceObject.pick)({
237
- enterprise: '100%',
238
- prisma: 'calc(100% + 16px)'
239
- }), (0,themes_namespaceObject.pick)({
240
- enterprise: '0',
241
- prisma: '-8px'
242
- }));
243
- var StyledTableHeader = external_styled_components_default().th.withConfig({
244
- displayName: "DateTableStyles__StyledTableHeader",
245
- componentId: "sc-1lbrjq0-1"
246
- })(["", ";text-align:center;padding-bottom:", ";color:", ";font-size:", ";"], themes_namespaceObject.mixins.reset('table-cell'), (0,themes_namespaceObject.pick)({
247
- enterprise: '2px',
248
- prisma: themes_namespaceObject.variables.spacingXSmall
249
- }), themes_namespaceObject.variables.contentColorMuted, (0,themes_namespaceObject.pick)({
250
- enterprise: themes_namespaceObject.variables.fontSizeSmall,
251
- prisma: themes_namespaceObject.variables.fontSize
252
- }));
253
-
254
- ;// CONCATENATED MODULE: ./src/Calendar/DateTable.tsx
255
- function DateTable_extends() { DateTable_extends = Object.assign || 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 DateTable_extends.apply(this, arguments); }
256
-
257
- function DateTable_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = DateTable_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
258
-
259
- function DateTable_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
260
-
261
-
262
-
263
-
264
-
265
-
266
-
267
-
268
-
269
-
270
- var DateTable_propTypes = {
271
- displayValue: (external_prop_types_default()).string.isRequired,
272
- highlightToday: (external_prop_types_default()).bool,
273
- labelledBy: (external_prop_types_default()).string,
274
- locale: (external_prop_types_default()).string,
275
- onChange: (external_prop_types_default()).func,
276
- onInternalChange: (external_prop_types_default()).func,
277
- selectedValue: (external_prop_types_default()).string.isRequired,
278
- todayValue: (external_prop_types_default()).string
279
- };
280
-
281
- function renderPaddingCells(count) {
282
- return times_default()(count, function (i) {
283
- return /*#__PURE__*/external_react_default().createElement("td", {
284
- key: "".concat(i)
285
- });
286
- });
287
- }
288
-
289
- function renderDays(_ref) {
290
- var displayValue = _ref.displayValue,
291
- endDate = _ref.endDate,
292
- highlightToday = _ref.highlightToday,
293
- locale = _ref.locale,
294
- onChange = _ref.onChange,
295
- onKeyDown = _ref.onKeyDown,
296
- selectedDate = _ref.selectedDate,
297
- selectedValue = _ref.selectedValue,
298
- startDate = _ref.startDate,
299
- todayValue = _ref.todayValue;
300
- var cursor = external_moment_default()(startDate).locale(locale).startOf('month');
301
- var days = [];
302
-
303
- while (cursor.isSameOrBefore(endDate)) {
304
- var cursorString = cursor.format('YYYY-MM-DD');
305
- var isToday = cursorString === todayValue;
306
- var isSelected = cursorString === selectedValue;
307
- var isActive = cursorString === displayValue;
308
- days.push( /*#__PURE__*/external_react_default().createElement(Calendar_Day, {
309
- key: cursorString,
310
- locale: locale,
311
- onClick: onChange,
312
- onKeyDown: onKeyDown,
313
- active: selectedDate ? isActive : isToday,
314
- today: highlightToday && isToday,
315
- value: cursorString,
316
- selected: isSelected
67
+ // CONCATENATED MODULE: external "react"
68
+ const r = require("react");
69
+ var n = e.n(r);
70
+ // CONCATENATED MODULE: external "prop-types"
71
+ const a = require("prop-types");
72
+ var o = e.n(a);
73
+ // CONCATENATED MODULE: external "lodash/keys"
74
+ const l = require("lodash/keys");
75
+ var i = e.n(l);
76
+ // CONCATENATED MODULE: external "lodash/omit"
77
+ const u = require("lodash/omit");
78
+ var c = e.n(u);
79
+ // CONCATENATED MODULE: external "moment"
80
+ const s = require("moment");
81
+ var f = e.n(s);
82
+ // CONCATENATED MODULE: external "@splunk/ui-utils/id"
83
+ const d = require("@splunk/ui-utils/id");
84
+ // CONCATENATED MODULE: external "lodash/times"
85
+ const p = require("lodash/times");
86
+ var v = e.n(p);
87
+ // CONCATENATED MODULE: external "@splunk/themes"
88
+ const y = require("@splunk/themes");
89
+ // CONCATENATED MODULE: external "@splunk/ui-utils/keyboard"
90
+ const h = require("@splunk/ui-utils/keyboard");
91
+ // CONCATENATED MODULE: external "@splunk/react-ui/ScreenReaderContent"
92
+ const m = require("@splunk/react-ui/ScreenReaderContent");
93
+ var b = e.n(m);
94
+ // CONCATENATED MODULE: external "styled-components"
95
+ const Y = require("styled-components");
96
+ var g = e.n(Y);
97
+ // CONCATENATED MODULE: ./src/Calendar/DayStyles.ts
98
+ /* Element used to prevent vertical shift on firefox when the font-weight is increased with $selected */
99
+ var M = g().div.withConfig({
100
+ displayName: "DayStyles__StyledValue",
101
+ componentId: "sc-1nryhyt-0"
102
+ })([ "left:0;line-height:", ";position:absolute;top:0;width:100%;" ], (0, y.pick)({
103
+ enterprise: "2em",
104
+ prisma: "36px "
317
105
  }));
318
- cursor.add(1, 'day');
319
- }
320
-
321
- return days;
322
- }
323
-
324
- function renderRows(cells) {
325
- return cells.reduce(function (accum, el, i) {
326
- var row = Math.floor(i / 7);
327
- accum[row].push(el);
328
- return accum;
329
- }, times_default()(7, function () {
330
- return [];
331
- })).map(function (row, i) {
332
- return (
333
- /*#__PURE__*/
334
- // eslint-disable-next-line react/no-array-index-key
335
- external_react_default().createElement("tr", {
336
- key: "$week-".concat(i)
337
- }, row)
338
- );
339
- });
340
- }
341
-
342
- function renderHeader(locale, dayFormat) {
343
- return /*#__PURE__*/external_react_default().createElement("thead", null, /*#__PURE__*/external_react_default().createElement("tr", null, times_default()(7, function (i) {
344
- var text = external_moment_default()().locale(locale).weekday(i).format(dayFormat);
345
- var label = external_moment_default()().locale(locale).weekday(i).format('dddd');
346
- return /*#__PURE__*/external_react_default().createElement(StyledTableHeader, {
347
- key: text
348
- }, /*#__PURE__*/external_react_default().createElement((ScreenReaderContent_default()), null, label), /*#__PURE__*/external_react_default().createElement("span", {
349
- "aria-hidden": true
350
- }, text));
351
- })));
352
- }
353
-
354
- function DateTable(_ref2) {
355
- var displayValue = _ref2.displayValue,
356
- _ref2$highlightToday = _ref2.highlightToday,
357
- highlightToday = _ref2$highlightToday === void 0 ? false : _ref2$highlightToday,
358
- labelledBy = _ref2.labelledBy,
359
- _ref2$locale = _ref2.locale,
360
- locale = _ref2$locale === void 0 ? 'en_US' : _ref2$locale,
361
- onChange = _ref2.onChange,
362
- onInternalChange = _ref2.onInternalChange,
363
- selectedValue = _ref2.selectedValue,
364
- todayValue = _ref2.todayValue,
365
- otherProps = DateTable_objectWithoutProperties(_ref2, ["displayValue", "highlightToday", "labelledBy", "locale", "onChange", "onInternalChange", "selectedValue", "todayValue"]);
366
-
367
- var _useSplunkTheme = (0,themes_namespaceObject.useSplunkTheme)(),
368
- family = _useSplunkTheme.family;
369
-
370
- var dayFormat = family === 'prisma' ? 'dd' : 'ddd';
371
- var displayDate = external_moment_default()(displayValue, 'YYYY-MM-DD', locale);
372
- var selectedDate = external_moment_default()(selectedValue, 'YYYY-MM-DD', locale);
373
- var startDate = external_moment_default()(displayDate).startOf('month');
374
- var endDate = external_moment_default()(displayDate).endOf('month').startOf('day');
375
-
376
- var handleOnChange = function handleOnChange(event, data) {
377
- event.preventDefault();
378
- onChange === null || onChange === void 0 ? void 0 : onChange(event, data);
379
- };
380
-
381
- var handlePreviousDay = function handlePreviousDay(event, _ref3) {
382
- var value = _ref3.value;
383
- event.preventDefault();
384
- onInternalChange === null || onInternalChange === void 0 ? void 0 : onInternalChange(event, {
385
- value: external_moment_default()(value, 'YYYY-MM-DD').add(-1, 'd').format('YYYY-MM-DD')
386
- });
387
- };
388
-
389
- var handleNextDay = function handleNextDay(event, _ref4) {
390
- var value = _ref4.value;
391
- event.preventDefault();
392
- onInternalChange === null || onInternalChange === void 0 ? void 0 : onInternalChange(event, {
393
- value: external_moment_default()(value, 'YYYY-MM-DD').add(1, 'd').format('YYYY-MM-DD')
394
- });
395
- };
396
-
397
- var handlePreviousWeek = function handlePreviousWeek(event, _ref5) {
398
- var value = _ref5.value;
399
- event.preventDefault();
400
- onInternalChange === null || onInternalChange === void 0 ? void 0 : onInternalChange(event, {
401
- value: external_moment_default()(value, 'YYYY-MM-DD').add(-1, 'w').format('YYYY-MM-DD')
402
- });
403
- };
404
-
405
- var handleNextWeek = function handleNextWeek(event, _ref6) {
406
- var value = _ref6.value;
407
- event.preventDefault();
408
- onInternalChange === null || onInternalChange === void 0 ? void 0 : onInternalChange(event, {
409
- value: external_moment_default()(value, 'YYYY-MM-DD').add(1, 'w').format('YYYY-MM-DD')
410
- });
411
- };
412
-
413
- var handlePreviousMonth = function handlePreviousMonth(event, _ref7) {
414
- var value = _ref7.value;
415
- event.preventDefault();
416
- onInternalChange === null || onInternalChange === void 0 ? void 0 : onInternalChange(event, {
417
- value: external_moment_default()(value, 'YYYY-MM-DD').add(-1, 'M').format('YYYY-MM-DD')
418
- });
419
- };
420
-
421
- var handleNextMonth = function handleNextMonth(event, _ref8) {
422
- var value = _ref8.value;
423
- event.preventDefault();
424
- onInternalChange === null || onInternalChange === void 0 ? void 0 : onInternalChange(event, {
425
- value: external_moment_default()(value, 'YYYY-MM-DD').add(1, 'M').format('YYYY-MM-DD')
426
- });
427
- };
428
-
429
- var handlePreviousYear = function handlePreviousYear(event, _ref9) {
430
- var value = _ref9.value;
431
- event.preventDefault();
432
- onInternalChange === null || onInternalChange === void 0 ? void 0 : onInternalChange(event, {
433
- value: external_moment_default()(value, 'YYYY-MM-DD').add(-1, 'y').format('YYYY-MM-DD')
434
- });
435
- };
436
-
437
- var handleNextYear = function handleNextYear(event, _ref10) {
438
- var value = _ref10.value;
439
- event.preventDefault();
440
- onInternalChange === null || onInternalChange === void 0 ? void 0 : onInternalChange(event, {
441
- value: external_moment_default()(value, 'YYYY-MM-DD').add(1, 'y').format('YYYY-MM-DD')
442
- });
443
- };
444
-
445
- var handleStartOfWeek = function handleStartOfWeek(event, _ref11) {
446
- var value = _ref11.value;
447
- event.preventDefault();
448
- onInternalChange === null || onInternalChange === void 0 ? void 0 : onInternalChange(event, {
449
- value: external_moment_default()(value, 'YYYY-MM-DD').startOf('week').format('YYYY-MM-DD')
450
- });
451
- };
452
-
453
- var handleEndOfWeek = function handleEndOfWeek(event, _ref12) {
454
- var value = _ref12.value;
455
- event.preventDefault();
456
- onInternalChange === null || onInternalChange === void 0 ? void 0 : onInternalChange(event, {
457
- value: external_moment_default()(value, 'YYYY-MM-DD').endOf('week').format('YYYY-MM-DD')
458
- });
459
- };
460
-
461
- var handleKeyDown = function handleKeyDown(event, data) {
462
- var eventKeyCode = (0,keyboard_namespaceObject.keycode)(event.nativeEvent);
463
-
464
- switch (eventKeyCode) {
465
- case 'enter':
466
- case 'space':
467
- handleOnChange(event, data);
468
- break;
469
-
470
- case 'up':
471
- handlePreviousWeek(event, data);
472
- break;
473
-
474
- case 'down':
475
- handleNextWeek(event, data);
476
- break;
477
-
478
- case 'left':
479
- handlePreviousDay(event, data);
480
- break;
481
-
482
- case 'right':
483
- handleNextDay(event, data);
484
- break;
485
-
486
- case 'page up':
487
- if (event.shiftKey) {
488
- handlePreviousYear(event, data);
489
- } else {
490
- handlePreviousMonth(event, data);
106
+ var D = g().div.withConfig({
107
+ displayName: "DayStyles__StyledInner",
108
+ componentId: "sc-1nryhyt-1"
109
+ })([ "border:", ";border-radius:", ";color:", ";height:", ";position:relative;text-align:center;width:", ";" ], (0,
110
+ y.pick)({
111
+ enterprise: "1px solid transparent",
112
+ prisma: "none"
113
+ }), (0, y.pick)({
114
+ enterprise: y.variables.borderRadius,
115
+ prisma: "50%"
116
+ }), (0, y.pick)({
117
+ enterprise: {
118
+ light: y.variables.gray45,
119
+ dark: y.variables.gray98
120
+ },
121
+ prisma: y.variables.contentColorActive
122
+ }), (0, y.pick)({
123
+ enterprise: "2em",
124
+ prisma: "36px "
125
+ }), (0, y.pick)({
126
+ enterprise: "calc(2em - 2px)",
127
+ prisma: "36px"
128
+ }));
129
+ var k = g().td.withConfig({
130
+ displayName: "DayStyles__StyledCell",
131
+ componentId: "sc-1nryhyt-2"
132
+ })([ "", ";cursor:pointer;", ";", ";" ], y.mixins.reset("table-cell"), (0, y.pickVariant)("$today", {
133
+ true: {
134
+ enterprise: (0, Y.css)([ "& > ", "{background-color:", ";}&:focus{& > ", "{box-shadow:", ";}}" ],
135
+ /* sc-sel */
136
+ D, (0, y.pick)({
137
+ light: y.variables.gray92,
138
+ dark: y.variables.gray45
139
+ }),
140
+ /* sc-sel */
141
+ D, y.variables.focusShadow),
142
+ prisma: (0, Y.css)([ "& > ", "{box-shadow:inset 0 0 0 1px ", ";}&:focus{& > ", "{box-shadow:inset 0 0 0 1px ", ",", ";}}" ],
143
+ /* sc-sel */
144
+ D, y.variables.interactiveColorBorder,
145
+ /* sc-sel */
146
+ D, y.variables.interactiveColorBorder, y.variables.focusShadow)
147
+ },
148
+ false: (0, Y.css)([ "&:focus{& > ", "{box-shadow:", ";}}" ],
149
+ /* sc-sel */
150
+ D, y.variables.focusShadow)
151
+ }), (0, y.pickVariant)("$selected", {
152
+ true: (0, y.pick)({
153
+ enterprise: (0, Y.css)([ "& > ", "{border-color:", ";}" ],
154
+ /* sc-sel */
155
+ D, y.variables.linkColor),
156
+ prisma: (0, Y.css)([ "& > ", "{background-color:", ";font-weight:", ";}" ],
157
+ /* sc-sel */
158
+ D, y.variables.interactiveColorOverlaySelected, y.variables.fontWeightBold)
159
+ }),
160
+ false: (0, y.pick)({
161
+ enterprise: (0, Y.css)([ "&:hover{& > ", "{background-color:", ";color:", ";}}" ],
162
+ /* sc-sel */
163
+ D, y.variables.backgroundColorHover, y.variables.linkColor),
164
+ prisma: (0, Y.css)([ "&:hover{& > ", "{background-color:", ";}}" ],
165
+ /* sc-sel */
166
+ D, y.variables.interactiveColorOverlayHover)
167
+ })
168
+ }));
169
+ // CONCATENATED MODULE: ./src/Calendar/Day.tsx
170
+ function w() {
171
+ w = Object.assign || function(e) {
172
+ for (var t = 1; t < arguments.length; t++) {
173
+ var r = arguments[t];
174
+ for (var n in r) {
175
+ if (Object.prototype.hasOwnProperty.call(r, n)) {
176
+ e[n] = r[n];
177
+ }
178
+ }
179
+ }
180
+ return e;
181
+ };
182
+ return w.apply(this, arguments);
183
+ }
184
+ function O(e, t) {
185
+ if (e == null) return {};
186
+ var r = C(e, t);
187
+ var n, a;
188
+ if (Object.getOwnPropertySymbols) {
189
+ var o = Object.getOwnPropertySymbols(e);
190
+ for (a = 0; a < o.length; a++) {
191
+ n = o[a];
192
+ if (t.indexOf(n) >= 0) continue;
193
+ if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
194
+ r[n] = e[n];
195
+ }
491
196
  }
492
-
493
- break;
494
-
495
- case 'page down':
496
- if (event.shiftKey) {
497
- handleNextYear(event, data);
197
+ return r;
198
+ }
199
+ function C(e, t) {
200
+ if (e == null) return {};
201
+ var r = {};
202
+ var n = Object.keys(e);
203
+ var a, o;
204
+ for (o = 0; o < n.length; o++) {
205
+ a = n[o];
206
+ if (t.indexOf(a) >= 0) continue;
207
+ r[a] = e[a];
208
+ }
209
+ return r;
210
+ }
211
+ var S = {
212
+ active: o().bool,
213
+ locale: o().string,
214
+ onClick: o().func,
215
+ onKeydown: o().func,
216
+ selected: o().bool,
217
+ today: o().bool,
218
+ value: o().string
219
+ };
220
+ function x(e) {
221
+ var t = e.active, a = t === void 0 ? false : t, o = e.locale, l = o === void 0 ? "en_US" : o, i = e.onClick, u = e.onKeyDown, c = e.selected, s = c === void 0 ? false : c, d = e.today, p = d === void 0 ? false : d, v = e.value, y = O(e, [ "active", "locale", "onClick", "onKeyDown", "selected", "today", "value" ]);
222
+ var h = (0, r.useCallback)((function(e) {
223
+ e.preventDefault();
224
+ i === null || i === void 0 ? void 0 : i(e, {
225
+ value: v
226
+ });
227
+ }), [ i, v ]);
228
+ var m = (0, r.useCallback)((function(e) {
229
+ e.preventDefault();
230
+ u === null || u === void 0 ? void 0 : u(e, {
231
+ value: v
232
+ });
233
+ }), [ u, v ]);
234
+ var b = v && f()(v, "YYYY-MM-DD", l).format("D");
235
+
236
+ return n().createElement(k, w({
237
+ tabIndex: a ? 0 : -1,
238
+ "aria-selected": s,
239
+ "data-test-day": b,
240
+ "data-test": "day-of-month",
241
+ "data-active-day": a,
242
+ "data-is-today": p,
243
+ onClick: h,
244
+ onKeyDown: m,
245
+ $today: p,
246
+ $selected: s
247
+ }, y), n().createElement(D, null, n().createElement(M, null, b)));
248
+ }
249
+ x.propTypes = S;
250
+ /* harmony default export */ const j = x;
251
+ // CONCATENATED MODULE: ./src/Calendar/DateTableStyles.ts
252
+ var _ = g().table.withConfig({
253
+ displayName: "DateTableStyles__Styled",
254
+ componentId: "sc-1lbrjq0-0"
255
+ })([ "", ";table-layout:fixed;border-spacing:", ";width:", ";margin:", ";" ], y.mixins.reset("table"), (0,
256
+ y.pick)({
257
+ enterprise: "3px",
258
+ prisma: y.variables.spacingSmall
259
+ }), (0, y.pick)({
260
+ enterprise: "100%",
261
+ prisma: "calc(100% + 16px)"
262
+ }), (0, y.pick)({
263
+ enterprise: "0",
264
+ prisma: "-8px"
265
+ }));
266
+ var T = g().th.withConfig({
267
+ displayName: "DateTableStyles__StyledTableHeader",
268
+ componentId: "sc-1lbrjq0-1"
269
+ })([ "", ";text-align:center;padding-bottom:", ";color:", ";font-size:", ";" ], y.mixins.reset("table-cell"), (0,
270
+ y.pick)({
271
+ enterprise: "2px",
272
+ prisma: y.variables.spacingXSmall
273
+ }), y.variables.contentColorMuted, (0, y.pick)({
274
+ enterprise: y.variables.fontSizeSmall,
275
+ prisma: y.variables.fontSize
276
+ }));
277
+ // CONCATENATED MODULE: ./src/Calendar/DateTable.tsx
278
+ function E() {
279
+ E = Object.assign || function(e) {
280
+ for (var t = 1; t < arguments.length; t++) {
281
+ var r = arguments[t];
282
+ for (var n in r) {
283
+ if (Object.prototype.hasOwnProperty.call(r, n)) {
284
+ e[n] = r[n];
285
+ }
286
+ }
287
+ }
288
+ return e;
289
+ };
290
+ return E.apply(this, arguments);
291
+ }
292
+ function P(e, t) {
293
+ if (e == null) return {};
294
+ var r = I(e, t);
295
+ var n, a;
296
+ if (Object.getOwnPropertySymbols) {
297
+ var o = Object.getOwnPropertySymbols(e);
298
+ for (a = 0; a < o.length; a++) {
299
+ n = o[a];
300
+ if (t.indexOf(n) >= 0) continue;
301
+ if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
302
+ r[n] = e[n];
303
+ }
304
+ }
305
+ return r;
306
+ }
307
+ function I(e, t) {
308
+ if (e == null) return {};
309
+ var r = {};
310
+ var n = Object.keys(e);
311
+ var a, o;
312
+ for (o = 0; o < n.length; o++) {
313
+ a = n[o];
314
+ if (t.indexOf(a) >= 0) continue;
315
+ r[a] = e[a];
316
+ }
317
+ return r;
318
+ }
319
+ var V = {
320
+ displayValue: o().string.isRequired,
321
+ highlightToday: o().bool,
322
+ labelledBy: o().string,
323
+ locale: o().string,
324
+ onChange: o().func,
325
+ onInternalChange: o().func,
326
+ selectedValue: o().string.isRequired,
327
+ todayValue: o().string
328
+ };
329
+ function R(e) {
330
+ return v()(e, (function(e) {
331
+
332
+ return n().createElement("td", {
333
+ key: "".concat(e)
334
+ });
335
+ }));
336
+ }
337
+ function q(e) {
338
+ var t = e.displayValue, r = e.endDate, a = e.highlightToday, o = e.locale, l = e.onChange, i = e.onKeyDown, u = e.selectedDate, c = e.selectedValue, s = e.startDate, d = e.todayValue;
339
+ var p = f()(s).locale(o).startOf("month");
340
+ var v = [];
341
+ while (p.isSameOrBefore(r)) {
342
+ var y = p.format("YYYY-MM-DD");
343
+ var h = y === d;
344
+ var m = y === c;
345
+ var b = y === t;
346
+ v.push( n().createElement(j, {
347
+ key: y,
348
+ locale: o,
349
+ onClick: l,
350
+ onKeyDown: i,
351
+ active: u ? b : h,
352
+ today: a && h,
353
+ value: y,
354
+ selected: m
355
+ }));
356
+ p.add(1, "day");
357
+ }
358
+ return v;
359
+ }
360
+ function B(e) {
361
+ return e.reduce((function(e, t, r) {
362
+ var n = Math.floor(r / 7);
363
+ e[n].push(t);
364
+ return e;
365
+ }), v()(7, (function() {
366
+ return [];
367
+ }))).map((function(e, t) {
368
+
369
+ // eslint-disable-next-line react/no-array-index-key
370
+ return n().createElement("tr", {
371
+ key: "$week-".concat(t)
372
+ }, e);
373
+ }));
374
+ }
375
+ function F(e, t) {
376
+
377
+ return n().createElement("thead", null, n().createElement("tr", null, v()(7, (function(r) {
378
+ var a = f()().locale(e).weekday(r).format(t);
379
+ var o = f()().locale(e).weekday(r).format("dddd");
380
+
381
+ return n().createElement(T, {
382
+ key: a
383
+ }, n().createElement(b(), null, o), n().createElement("span", {
384
+ "aria-hidden": true
385
+ }, a));
386
+ }))));
387
+ }
388
+ function z(e) {
389
+ var t = e.displayValue, r = e.highlightToday, a = r === void 0 ? false : r, o = e.labelledBy, l = e.locale, i = l === void 0 ? "en_US" : l, u = e.onChange, c = e.onInternalChange, s = e.selectedValue, d = e.todayValue, p = P(e, [ "displayValue", "highlightToday", "labelledBy", "locale", "onChange", "onInternalChange", "selectedValue", "todayValue" ]);
390
+ var v = (0, y.useSplunkTheme)(), m = v.family;
391
+ var b = m === "prisma" ? "dd" : "ddd";
392
+ var Y = f()(t, "YYYY-MM-DD", i);
393
+ var g = f()(s, "YYYY-MM-DD", i);
394
+ var M = f()(Y).startOf("month");
395
+ var D = f()(Y).endOf("month").startOf("day");
396
+ var k = function e(t, r) {
397
+ t.preventDefault();
398
+ u === null || u === void 0 ? void 0 : u(t, r);
399
+ };
400
+ var w = function e(t, r) {
401
+ var n = r.value;
402
+ t.preventDefault();
403
+ c === null || c === void 0 ? void 0 : c(t, {
404
+ value: f()(n, "YYYY-MM-DD").add(-1, "d").format("YYYY-MM-DD")
405
+ });
406
+ };
407
+ var O = function e(t, r) {
408
+ var n = r.value;
409
+ t.preventDefault();
410
+ c === null || c === void 0 ? void 0 : c(t, {
411
+ value: f()(n, "YYYY-MM-DD").add(1, "d").format("YYYY-MM-DD")
412
+ });
413
+ };
414
+ var C = function e(t, r) {
415
+ var n = r.value;
416
+ t.preventDefault();
417
+ c === null || c === void 0 ? void 0 : c(t, {
418
+ value: f()(n, "YYYY-MM-DD").add(-1, "w").format("YYYY-MM-DD")
419
+ });
420
+ };
421
+ var S = function e(t, r) {
422
+ var n = r.value;
423
+ t.preventDefault();
424
+ c === null || c === void 0 ? void 0 : c(t, {
425
+ value: f()(n, "YYYY-MM-DD").add(1, "w").format("YYYY-MM-DD")
426
+ });
427
+ };
428
+ var x = function e(t, r) {
429
+ var n = r.value;
430
+ t.preventDefault();
431
+ c === null || c === void 0 ? void 0 : c(t, {
432
+ value: f()(n, "YYYY-MM-DD").add(-1, "M").format("YYYY-MM-DD")
433
+ });
434
+ };
435
+ var j = function e(t, r) {
436
+ var n = r.value;
437
+ t.preventDefault();
438
+ c === null || c === void 0 ? void 0 : c(t, {
439
+ value: f()(n, "YYYY-MM-DD").add(1, "M").format("YYYY-MM-DD")
440
+ });
441
+ };
442
+ var T = function e(t, r) {
443
+ var n = r.value;
444
+ t.preventDefault();
445
+ c === null || c === void 0 ? void 0 : c(t, {
446
+ value: f()(n, "YYYY-MM-DD").add(-1, "y").format("YYYY-MM-DD")
447
+ });
448
+ };
449
+ var I = function e(t, r) {
450
+ var n = r.value;
451
+ t.preventDefault();
452
+ c === null || c === void 0 ? void 0 : c(t, {
453
+ value: f()(n, "YYYY-MM-DD").add(1, "y").format("YYYY-MM-DD")
454
+ });
455
+ };
456
+ var V = function e(t, r) {
457
+ var n = r.value;
458
+ t.preventDefault();
459
+ c === null || c === void 0 ? void 0 : c(t, {
460
+ value: f()(n, "YYYY-MM-DD").startOf("week").format("YYYY-MM-DD")
461
+ });
462
+ };
463
+ var z = function e(t, r) {
464
+ var n = r.value;
465
+ t.preventDefault();
466
+ c === null || c === void 0 ? void 0 : c(t, {
467
+ value: f()(n, "YYYY-MM-DD").endOf("week").format("YYYY-MM-DD")
468
+ });
469
+ };
470
+ var H = function e(t, r) {
471
+ var n = (0, h.keycode)(t.nativeEvent);
472
+ switch (n) {
473
+ case "enter":
474
+ case "space":
475
+ k(t, r);
476
+ break;
477
+
478
+ case "up":
479
+ C(t, r);
480
+ break;
481
+
482
+ case "down":
483
+ S(t, r);
484
+ break;
485
+
486
+ case "left":
487
+ w(t, r);
488
+ break;
489
+
490
+ case "right":
491
+ O(t, r);
492
+ break;
493
+
494
+ case "page up":
495
+ if (t.shiftKey) {
496
+ T(t, r);
497
+ } else {
498
+ x(t, r);
499
+ }
500
+ break;
501
+
502
+ case "page down":
503
+ if (t.shiftKey) {
504
+ I(t, r);
505
+ } else {
506
+ j(t, r);
507
+ }
508
+ break;
509
+
510
+ case "home":
511
+ V(t, r);
512
+ break;
513
+
514
+ case "end":
515
+ z(t, r);
516
+ break;
517
+
518
+ default:
519
+ // do nothing
520
+ }
521
+ };
522
+ var N = R(M.format("e")).concat(q({
523
+ displayValue: t,
524
+ endDate: D,
525
+ highlightToday: a,
526
+ locale: i,
527
+ onChange: u,
528
+ onKeyDown: H,
529
+ selectedDate: g,
530
+ selectedValue: s,
531
+ startDate: M,
532
+ todayValue: d
533
+ })).concat(R(6 - D.format("e")));
534
+
535
+ return n().createElement(_, E({
536
+ role: "grid",
537
+ "aria-labelledby": o
538
+ }, p), F(i, b), n().createElement("tbody", null, B(N)));
539
+ }
540
+ z.propTypes = V;
541
+ /* harmony default export */ const H = z;
542
+ // CONCATENATED MODULE: external "@splunk/react-icons/ChevronLeft"
543
+ const N = require("@splunk/react-icons/ChevronLeft");
544
+ var K = e.n(N);
545
+ // CONCATENATED MODULE: external "@splunk/react-icons/ChevronRight"
546
+ const A = require("@splunk/react-icons/ChevronRight");
547
+ var U = e.n(A);
548
+ // CONCATENATED MODULE: external "@splunk/react-icons/enterprise/ChevronLeft"
549
+ const $ = require("@splunk/react-icons/enterprise/ChevronLeft");
550
+ var L = e.n($);
551
+ // CONCATENATED MODULE: external "@splunk/react-icons/enterprise/ChevronRight"
552
+ const W = require("@splunk/react-icons/enterprise/ChevronRight");
553
+ var X = e.n(W);
554
+ // CONCATENATED MODULE: external "@splunk/react-ui/Button"
555
+ const G = require("@splunk/react-ui/Button");
556
+ var J = e.n(G);
557
+ // CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
558
+ const Q = require("@splunk/ui-utils/i18n");
559
+ // CONCATENATED MODULE: ./src/Calendar/MonthHeaderStyles.ts
560
+ var Z = g().div.withConfig({
561
+ displayName: "MonthHeaderStyles__StyledBox",
562
+ componentId: "sc-18bmbh7-0"
563
+ })([ "display:flex;position:relative;line-height:", ";padding:0 2px;margin-bottom:10px;" ], y.variables.inputHeight);
564
+ var ee = g().span.withConfig({
565
+ displayName: "MonthHeaderStyles__StyledHeading",
566
+ componentId: "sc-18bmbh7-1"
567
+ })([ "display:block;text-align:center;text-transform:", ";flex:1 0 1px;", ";" ], (0,
568
+ y.pick)({
569
+ enterprise: "capitalize",
570
+ prisma: "uppercase"
571
+ }), (0, y.pick)({
572
+ prisma: (0, Y.css)([ "font-size:20px;font-weight:bold;color:", ";" ], y.variables.contentColorActive)
573
+ }));
574
+ // CONCATENATED MODULE: ./src/Calendar/MonthHeader.tsx
575
+ function te(e) {
576
+ "@babel/helpers - typeof";
577
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
578
+ te = function e(t) {
579
+ return typeof t;
580
+ };
498
581
  } else {
499
- handleNextMonth(event, data);
582
+ te = function e(t) {
583
+ return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
584
+ };
500
585
  }
501
-
502
- break;
503
-
504
- case 'home':
505
- handleStartOfWeek(event, data);
506
- break;
507
-
508
- case 'end':
509
- handleEndOfWeek(event, data);
510
- break;
511
-
512
- default: // do nothing
513
-
586
+ return te(e);
514
587
  }
515
- };
516
-
517
- var cells = renderPaddingCells(startDate.format('e')).concat(renderDays({
518
- displayValue: displayValue,
519
- endDate: endDate,
520
- highlightToday: highlightToday,
521
- locale: locale,
522
- onChange: onChange,
523
- onKeyDown: handleKeyDown,
524
- selectedDate: selectedDate,
525
- selectedValue: selectedValue,
526
- startDate: startDate,
527
- todayValue: todayValue
528
- })).concat(renderPaddingCells(6 - endDate.format('e')));
529
- return /*#__PURE__*/external_react_default().createElement(Styled, DateTable_extends({
530
- role: "grid",
531
- "aria-labelledby": labelledBy
532
- }, otherProps), renderHeader(locale, dayFormat), /*#__PURE__*/external_react_default().createElement("tbody", null, renderRows(cells)));
533
- }
534
-
535
- DateTable.propTypes = DateTable_propTypes;
536
- /* harmony default export */ const Calendar_DateTable = (DateTable);
537
- ;// CONCATENATED MODULE: external "@splunk/react-icons/ChevronLeft"
538
- const ChevronLeft_namespaceObject = require("@splunk/react-icons/ChevronLeft");
539
- var ChevronLeft_default = /*#__PURE__*/__webpack_require__.n(ChevronLeft_namespaceObject);
540
- ;// CONCATENATED MODULE: external "@splunk/react-icons/ChevronRight"
541
- const ChevronRight_namespaceObject = require("@splunk/react-icons/ChevronRight");
542
- var ChevronRight_default = /*#__PURE__*/__webpack_require__.n(ChevronRight_namespaceObject);
543
- ;// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/ChevronLeft"
544
- const enterprise_ChevronLeft_namespaceObject = require("@splunk/react-icons/enterprise/ChevronLeft");
545
- var enterprise_ChevronLeft_default = /*#__PURE__*/__webpack_require__.n(enterprise_ChevronLeft_namespaceObject);
546
- ;// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/ChevronRight"
547
- const enterprise_ChevronRight_namespaceObject = require("@splunk/react-icons/enterprise/ChevronRight");
548
- var enterprise_ChevronRight_default = /*#__PURE__*/__webpack_require__.n(enterprise_ChevronRight_namespaceObject);
549
- ;// CONCATENATED MODULE: external "@splunk/react-ui/Button"
550
- const Button_namespaceObject = require("@splunk/react-ui/Button");
551
- var Button_default = /*#__PURE__*/__webpack_require__.n(Button_namespaceObject);
552
- ;// CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
553
- const i18n_namespaceObject = require("@splunk/ui-utils/i18n");
554
- ;// CONCATENATED MODULE: ./src/Calendar/MonthHeaderStyles.ts
555
-
556
-
557
- var StyledBox = external_styled_components_default().div.withConfig({
558
- displayName: "MonthHeaderStyles__StyledBox",
559
- componentId: "sc-18bmbh7-0"
560
- })(["display:flex;position:relative;line-height:", ";padding:0 2px;margin-bottom:10px;"], themes_namespaceObject.variables.inputHeight);
561
- var StyledHeading = external_styled_components_default().span.withConfig({
562
- displayName: "MonthHeaderStyles__StyledHeading",
563
- componentId: "sc-18bmbh7-1"
564
- })(["display:block;text-align:center;text-transform:", ";flex:1 0 1px;", ";"], (0,themes_namespaceObject.pick)({
565
- enterprise: 'capitalize',
566
- prisma: 'uppercase'
567
- }), (0,themes_namespaceObject.pick)({
568
- prisma: (0,external_styled_components_namespaceObject.css)(["font-size:20px;font-weight:bold;color:", ";"], themes_namespaceObject.variables.contentColorActive)
569
- }));
570
-
571
- ;// CONCATENATED MODULE: ./src/Calendar/MonthHeader.tsx
572
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
573
-
574
- function MonthHeader_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = MonthHeader_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
575
-
576
- function MonthHeader_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
577
-
578
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
579
-
580
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
581
-
582
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
583
-
584
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
585
-
586
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
587
-
588
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
589
-
590
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
591
-
592
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
593
-
594
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
595
-
596
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
597
-
598
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
599
-
600
-
601
-
602
-
603
-
604
-
605
-
606
-
607
-
608
-
609
-
610
-
611
-
612
- var MonthHeader_propTypes = {
613
- headingId: (external_prop_types_default()).string,
614
- locale: (external_prop_types_default()).string,
615
- onChange: (external_prop_types_default()).func,
616
-
617
- /** @private */
618
- splunkTheme: (external_prop_types_default()).object,
619
- value: (external_prop_types_default()).string.isRequired
620
- };
621
- var defaultProps = {
622
- locale: 'en_US'
623
- };
624
-
625
- var MonthHeader = /*#__PURE__*/function (_Component) {
626
- _inherits(MonthHeader, _Component);
627
-
628
- var _super = _createSuper(MonthHeader);
629
-
630
- function MonthHeader() {
631
- var _this;
632
-
633
- _classCallCheck(this, MonthHeader);
634
-
635
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
636
- args[_key] = arguments[_key];
588
+ function re(e, t) {
589
+ if (e == null) return {};
590
+ var r = ne(e, t);
591
+ var n, a;
592
+ if (Object.getOwnPropertySymbols) {
593
+ var o = Object.getOwnPropertySymbols(e);
594
+ for (a = 0; a < o.length; a++) {
595
+ n = o[a];
596
+ if (t.indexOf(n) >= 0) continue;
597
+ if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
598
+ r[n] = e[n];
599
+ }
600
+ }
601
+ return r;
637
602
  }
638
-
639
- _this = _super.call.apply(_super, [this].concat(args));
640
-
641
- _defineProperty(_assertThisInitialized(_this), "handlePrevMonthClick", function (e) {
642
- _this.handleChange(e, -1);
603
+ function ne(e, t) {
604
+ if (e == null) return {};
605
+ var r = {};
606
+ var n = Object.keys(e);
607
+ var a, o;
608
+ for (o = 0; o < n.length; o++) {
609
+ a = n[o];
610
+ if (t.indexOf(a) >= 0) continue;
611
+ r[a] = e[a];
612
+ }
613
+ return r;
614
+ }
615
+ function ae(e, t) {
616
+ if (!(e instanceof t)) {
617
+ throw new TypeError("Cannot call a class as a function");
618
+ }
619
+ }
620
+ function oe(e, t) {
621
+ for (var r = 0; r < t.length; r++) {
622
+ var n = t[r];
623
+ n.enumerable = n.enumerable || false;
624
+ n.configurable = true;
625
+ if ("value" in n) n.writable = true;
626
+ Object.defineProperty(e, n.key, n);
627
+ }
628
+ }
629
+ function le(e, t, r) {
630
+ if (t) oe(e.prototype, t);
631
+ if (r) oe(e, r);
632
+ return e;
633
+ }
634
+ function ie(e, t) {
635
+ if (typeof t !== "function" && t !== null) {
636
+ throw new TypeError("Super expression must either be null or a function");
637
+ }
638
+ e.prototype = Object.create(t && t.prototype, {
639
+ constructor: {
640
+ value: e,
641
+ writable: true,
642
+ configurable: true
643
+ }
644
+ });
645
+ if (t) ue(e, t);
646
+ }
647
+ function ue(e, t) {
648
+ ue = Object.setPrototypeOf || function e(t, r) {
649
+ t.__proto__ = r;
650
+ return t;
651
+ };
652
+ return ue(e, t);
653
+ }
654
+ function ce(e) {
655
+ var t = de();
656
+ return function r() {
657
+ var n = pe(e), a;
658
+ if (t) {
659
+ var o = pe(this).constructor;
660
+ a = Reflect.construct(n, arguments, o);
661
+ } else {
662
+ a = n.apply(this, arguments);
663
+ }
664
+ return se(this, a);
665
+ };
666
+ }
667
+ function se(e, t) {
668
+ if (t && (te(t) === "object" || typeof t === "function")) {
669
+ return t;
670
+ }
671
+ return fe(e);
672
+ }
673
+ function fe(e) {
674
+ if (e === void 0) {
675
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
676
+ }
677
+ return e;
678
+ }
679
+ function de() {
680
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
681
+ if (Reflect.construct.sham) return false;
682
+ if (typeof Proxy === "function") return true;
683
+ try {
684
+ Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
685
+ return true;
686
+ } catch (e) {
687
+ return false;
688
+ }
689
+ }
690
+ function pe(e) {
691
+ pe = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
692
+ return t.__proto__ || Object.getPrototypeOf(t);
693
+ };
694
+ return pe(e);
695
+ }
696
+ function ve(e, t, r) {
697
+ if (t in e) {
698
+ Object.defineProperty(e, t, {
699
+ value: r,
700
+ enumerable: true,
701
+ configurable: true,
702
+ writable: true
703
+ });
704
+ } else {
705
+ e[t] = r;
706
+ }
707
+ return e;
708
+ }
709
+ var ye = {
710
+ headingId: o().string,
711
+ locale: o().string,
712
+ onChange: o().func,
713
+ /** @private */
714
+ splunkTheme: o().object,
715
+ value: o().string.isRequired
716
+ };
717
+ var he = {
718
+ locale: "en_US"
719
+ };
720
+ var me = function(e) {
721
+ ie(r, e);
722
+ var t = ce(r);
723
+ function r() {
724
+ var e;
725
+ ae(this, r);
726
+ for (var n = arguments.length, a = new Array(n), o = 0; o < n; o++) {
727
+ a[o] = arguments[o];
728
+ }
729
+ e = t.call.apply(t, [ this ].concat(a));
730
+ ve(fe(e), "handlePrevMonthClick", (function(t) {
731
+ e.handleChange(t, -1);
732
+ }));
733
+ ve(fe(e), "handleNextMonthClick", (function(t) {
734
+ e.handleChange(t, 1);
735
+ }));
736
+ return e;
737
+ }
738
+ le(r, [ {
739
+ key: "handleChange",
740
+ value: function e(t, r) {
741
+ var n, a;
742
+ t.stopPropagation();
743
+ var o = f()(this.props.value, "YYYY-MM-DD").add(r, "M").format("YYYY-MM-DD");
744
+ (n = (a = this.props).onChange) === null || n === void 0 ? void 0 : n.call(a, t, {
745
+ value: o
746
+ });
747
+ }
748
+ }, {
749
+ key: "render",
750
+ value: function e() {
751
+ var t = this.props, a = t.headingId, o = t.locale, l = t.value, i = t.splunkTheme, u = re(t, [ "headingId", "locale", "value", "splunkTheme" ]);
752
+ var s = i.isEnterprise, d = i.isPrisma;
753
+ var p = f()(l, "YYYY-MM-DD", o);
754
+ var v = p.format(r.getMonthYearFormat(o, d));
755
+ var h = {
756
+ flex: "0 0 auto"
757
+ };
758
+ var m = (0, Q._)("Previous month");
759
+ var b = (0, Q._)("Next month");
760
+
761
+ return n().createElement(y.SplunkThemeProvider, {
762
+ density: d ? "comfortable" : i.density
763
+ }, n().createElement(Z, c()(u, "onChange"), n().createElement(J(), {
764
+ appearance: "pill",
765
+ icon: s ? n().createElement(L(), {
766
+ hideDefaultTooltip: true,
767
+ screenReaderText: m,
768
+ size: 1
769
+ }) : n().createElement(K(), {
770
+ "aria-label": m,
771
+ height: "24",
772
+ width: "24"
773
+ }),
774
+ "data-test": "previous-month",
775
+ onClick: this.handlePrevMonthClick,
776
+ style: h
777
+ }), n().createElement(ee, {
778
+ id: a,
779
+ "data-test": "header-label"
780
+ }, v), n().createElement(J(), {
781
+ appearance: "pill",
782
+ icon: s ? n().createElement(X(), {
783
+ hideDefaultTooltip: true,
784
+ screenReaderText: b,
785
+ size: 1
786
+ }) : n().createElement(U(), {
787
+ "aria-label": b,
788
+ height: "24",
789
+ width: "24"
790
+ }),
791
+ "data-test": "next-month",
792
+ onClick: this.handleNextMonthClick,
793
+ style: h
794
+ })));
795
+ }
796
+ } ], [ {
797
+ key: "getMonthYearFormat",
798
+ value: function e(t) {
799
+ var n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
800
+ var a = t.toLowerCase().replace("_", "-");
801
+ return n ? r.monthYearFormatsShortForm[a] || // full locale match
802
+ r.monthYearFormatsShortForm[a.substr(0, 2)] || // language match
803
+ r.monthYearFormatsShortForm["default"] : r.monthYearFormats[a] || // full locale match
804
+ r.monthYearFormats[a.substr(0, 2)] || // language match
805
+ r.monthYearFormats["default"];
806
+ // default
807
+ }
808
+ } ]);
809
+ return r;
810
+ }(r.Component);
811
+ ve(me, "propTypes", ye);
812
+ ve(me, "defaultProps", he);
813
+ ve(me, "monthYearFormats", {
814
+ default: "MMMM YYYY",
815
+ ja: "YYYY年MMM",
816
+ ko: "YYYY년 MMMM",
817
+ "zh-cn": "YYYY年MMM",
818
+ "zh-tw": "YYYY年MMM"
643
819
  });
644
-
645
- _defineProperty(_assertThisInitialized(_this), "handleNextMonthClick", function (e) {
646
- _this.handleChange(e, 1);
820
+ ve(me, "monthYearFormatsShortForm", {
821
+ default: "MMM YYYY",
822
+ ja: "YYYY年 MMM",
823
+ ko: "YYYY년 MMMM",
824
+ "zh-cn": "YYYY年 MMM",
825
+ "zh-tw": "YYYY年 MMM"
647
826
  });
648
-
649
- return _this;
650
- }
651
-
652
- _createClass(MonthHeader, [{
653
- key: "handleChange",
654
- value: function handleChange(e, diff) {
655
- var _this$props$onChange, _this$props;
656
-
657
- e.stopPropagation();
658
- var newValue = external_moment_default()(this.props.value, 'YYYY-MM-DD').add(diff, 'M').format('YYYY-MM-DD');
659
- (_this$props$onChange = (_this$props = this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props, e, {
660
- value: newValue
661
- });
662
- }
663
- }, {
664
- key: "render",
665
- value: function render() {
666
- var _this$props2 = this.props,
667
- headingId = _this$props2.headingId,
668
- locale = _this$props2.locale,
669
- value = _this$props2.value,
670
- splunkTheme = _this$props2.splunkTheme,
671
- otherProps = MonthHeader_objectWithoutProperties(_this$props2, ["headingId", "locale", "value", "splunkTheme"]);
672
-
673
- var isEnterprise = splunkTheme.isEnterprise,
674
- isPrisma = splunkTheme.isPrisma;
675
- var date = external_moment_default()(value, 'YYYY-MM-DD', locale);
676
- var monthYear = date.format(MonthHeader.getMonthYearFormat(locale, isPrisma));
677
- var buttonStyles = {
678
- flex: '0 0 auto'
679
- };
680
-
681
- var previousScreenReaderText = (0,i18n_namespaceObject._)('Previous month');
682
-
683
- var nextScreenReaderText = (0,i18n_namespaceObject._)('Next month');
684
-
685
- return /*#__PURE__*/external_react_default().createElement(themes_namespaceObject.SplunkThemeProvider, {
686
- density: isPrisma ? 'comfortable' : splunkTheme.density
687
- }, /*#__PURE__*/external_react_default().createElement(StyledBox, omit_default()(otherProps, 'onChange'), /*#__PURE__*/external_react_default().createElement((Button_default()), {
688
- appearance: "pill",
689
- icon: isEnterprise ? /*#__PURE__*/external_react_default().createElement((enterprise_ChevronLeft_default()), {
690
- hideDefaultTooltip: true,
691
- screenReaderText: previousScreenReaderText,
692
- size: 1
693
- }) : /*#__PURE__*/external_react_default().createElement((ChevronLeft_default()), {
694
- "aria-label": previousScreenReaderText,
695
- height: "24",
696
- width: "24"
697
- }),
698
- "data-test": "previous-month",
699
- onClick: this.handlePrevMonthClick,
700
- style: buttonStyles
701
- }), /*#__PURE__*/external_react_default().createElement(StyledHeading, {
702
- id: headingId,
703
- "data-test": "header-label"
704
- }, monthYear), /*#__PURE__*/external_react_default().createElement((Button_default()), {
705
- appearance: "pill",
706
- icon: isEnterprise ? /*#__PURE__*/external_react_default().createElement((enterprise_ChevronRight_default()), {
707
- hideDefaultTooltip: true,
708
- screenReaderText: nextScreenReaderText,
709
- size: 1
710
- }) : /*#__PURE__*/external_react_default().createElement((ChevronRight_default()), {
711
- "aria-label": nextScreenReaderText,
712
- height: "24",
713
- width: "24"
714
- }),
715
- "data-test": "next-month",
716
- onClick: this.handleNextMonthClick,
717
- style: buttonStyles
718
- })));
719
- }
720
- }], [{
721
- key: "getMonthYearFormat",
722
- value: function getMonthYearFormat(locale) {
723
- var shortForm = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
724
- var localeNormalized = locale.toLowerCase().replace('_', '-');
725
- return shortForm ? MonthHeader.monthYearFormatsShortForm[localeNormalized] || // full locale match
726
- MonthHeader.monthYearFormatsShortForm[localeNormalized.substr(0, 2)] || // language match
727
- MonthHeader.monthYearFormatsShortForm["default"] : MonthHeader.monthYearFormats[localeNormalized] || // full locale match
728
- MonthHeader.monthYearFormats[localeNormalized.substr(0, 2)] || // language match
729
- MonthHeader.monthYearFormats["default"]; // default
730
- }
731
- }]);
732
-
733
- return MonthHeader;
734
- }(external_react_namespaceObject.Component);
735
-
736
- _defineProperty(MonthHeader, "propTypes", MonthHeader_propTypes);
737
-
738
- _defineProperty(MonthHeader, "defaultProps", defaultProps);
739
-
740
- _defineProperty(MonthHeader, "monthYearFormats", {
741
- "default": 'MMMM YYYY',
742
- ja: 'YYYY年MMM',
743
- ko: 'YYYY년 MMMM',
744
- 'zh-cn': 'YYYY年MMM',
745
- 'zh-tw': 'YYYY年MMM'
746
- });
747
-
748
- _defineProperty(MonthHeader, "monthYearFormatsShortForm", {
749
- "default": 'MMM YYYY',
750
- ja: 'YYYY年 MMM',
751
- ko: 'YYYY년 MMMM',
752
- 'zh-cn': 'YYYY年 MMM',
753
- 'zh-tw': 'YYYY年 MMM'
754
- });
755
-
756
- var MonthHeaderWithTheme = (0,themes_namespaceObject.withSplunkTheme)(MonthHeader);
757
- MonthHeaderWithTheme.propTypes = MonthHeader.propTypes;
758
- /* harmony default export */ const Calendar_MonthHeader = (MonthHeaderWithTheme);
759
- ;// CONCATENATED MODULE: external "@splunk/react-ui/Box"
760
- const Box_namespaceObject = require("@splunk/react-ui/Box");
761
- var Box_default = /*#__PURE__*/__webpack_require__.n(Box_namespaceObject);
762
- ;// CONCATENATED MODULE: ./src/Calendar/CalendarStyles.ts
763
-
764
-
765
-
766
- var CalendarStyles_StyledBox = external_styled_components_default()((Box_default())).withConfig({
767
- displayName: "CalendarStyles__StyledBox",
768
- componentId: "sc-18925wt-0"
769
- })(["width:", ";padding:", ";"], (0,themes_namespaceObject.pick)({
770
- enterprise: '220px',
771
- prisma: '332px'
772
- }), (0,themes_namespaceObject.pick)({
773
- enterprise: '8px',
774
- prisma: themes_namespaceObject.variables.spacingLarge
775
- }));
776
-
777
- ;// CONCATENATED MODULE: ./src/utils/updateReactRef.ts
778
- /**
827
+ var be = (0, y.withSplunkTheme)(me);
828
+ be.propTypes = me.propTypes;
829
+ /* harmony default export */ const Ye = be;
830
+ // CONCATENATED MODULE: external "@splunk/react-ui/Box"
831
+ const ge = require("@splunk/react-ui/Box");
832
+ var Me = e.n(ge);
833
+ // CONCATENATED MODULE: ./src/Calendar/CalendarStyles.ts
834
+ var De = g()(Me()).withConfig({
835
+ displayName: "CalendarStyles__StyledBox",
836
+ componentId: "sc-18925wt-0"
837
+ })([ "width:", ";padding:", ";" ], (0, y.pick)({
838
+ enterprise: "220px",
839
+ prisma: "332px"
840
+ }), (0, y.pick)({
841
+ enterprise: "8px",
842
+ prisma: y.variables.spacingLarge
843
+ }));
844
+ // CONCATENATED MODULE: ./src/utils/updateReactRef.ts
845
+ /**
779
846
  * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
780
847
  *
781
848
  * @param ref - The React callback or object ref. Can be `null` or `undefined`.
782
849
  * @param current - The new value of the ref.
783
850
  */
784
- function updateReactRef(ref, current) {
785
- if (ref) {
786
- if (typeof ref === 'function') {
787
- ref(current);
788
- } else {
789
- // the public signature of this util uses React.Ref<T> to mirror the way React types refs.
790
- // the intention here is to signal "we will take care of setting 'current', not you".
791
- ref.current = current; // eslint-disable-line no-param-reassign
792
- }
793
- }
794
- }
795
-
796
-
797
- ;// CONCATENATED MODULE: ./src/Calendar/Calendar.tsx
798
- function Calendar_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Calendar_typeof = function _typeof(obj) { return typeof obj; }; } else { Calendar_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Calendar_typeof(obj); }
799
-
800
- function Calendar_extends() { Calendar_extends = Object.assign || 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 Calendar_extends.apply(this, arguments); }
801
-
802
- function Calendar_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
803
-
804
- function Calendar_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
805
-
806
- function Calendar_createClass(Constructor, protoProps, staticProps) { if (protoProps) Calendar_defineProperties(Constructor.prototype, protoProps); if (staticProps) Calendar_defineProperties(Constructor, staticProps); return Constructor; }
807
-
808
- function Calendar_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Calendar_setPrototypeOf(subClass, superClass); }
809
-
810
- function Calendar_setPrototypeOf(o, p) { Calendar_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Calendar_setPrototypeOf(o, p); }
811
-
812
- function Calendar_createSuper(Derived) { var hasNativeReflectConstruct = Calendar_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Calendar_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Calendar_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Calendar_possibleConstructorReturn(this, result); }; }
813
-
814
- function Calendar_possibleConstructorReturn(self, call) { if (call && (Calendar_typeof(call) === "object" || typeof call === "function")) { return call; } return Calendar_assertThisInitialized(self); }
815
-
816
- function Calendar_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
817
-
818
- function Calendar_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
819
-
820
- function Calendar_getPrototypeOf(o) { Calendar_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Calendar_getPrototypeOf(o); }
821
-
822
- function Calendar_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
823
-
824
-
825
-
826
-
827
-
828
-
829
-
830
-
831
-
832
-
833
-
834
- var calendarActiveSelector = '[data-active-day="true"]';
835
- var Calendar_propTypes = {
836
- describedBy: (external_prop_types_default()).string,
837
- highlightToday: (external_prop_types_default()).bool,
838
- labelledBy: (external_prop_types_default()).string,
839
- locale: (external_prop_types_default()).string,
840
- onChange: (external_prop_types_default()).func,
841
-
842
- /** @private. */
843
- required: (external_prop_types_default()).bool,
844
- value: (external_prop_types_default()).string,
845
- elementRef: external_prop_types_default().oneOfType([(external_prop_types_default()).func, (external_prop_types_default()).object])
846
- };
847
- var Calendar_defaultProps = {
848
- locale: 'en_US',
849
- value: external_moment_default()().format('YYYY-MM-DD')
850
- };
851
-
852
- var Calendar = /*#__PURE__*/function (_Component) {
853
- Calendar_inherits(Calendar, _Component);
854
-
855
- var _super = Calendar_createSuper(Calendar);
856
-
857
- function Calendar(props) {
858
- var _this;
859
-
860
- Calendar_classCallCheck(this, Calendar);
861
-
862
- _this = _super.call(this, props);
863
-
864
- Calendar_defineProperty(Calendar_assertThisInitialized(_this), "monthHeaderId", void 0);
865
-
866
- Calendar_defineProperty(Calendar_assertThisInitialized(_this), "todayTimerId", void 0);
867
-
868
- Calendar_defineProperty(Calendar_assertThisInitialized(_this), "calendarRef", void 0);
869
-
870
- Calendar_defineProperty(Calendar_assertThisInitialized(_this), "handleMonthChange", function (e, _ref) {
871
- var value = _ref.value;
872
-
873
- _this.setState({
874
- internalValue: value,
875
- source: 'month'
876
- });
877
- });
878
-
879
- Calendar_defineProperty(Calendar_assertThisInitialized(_this), "handleDayChange", function (e, _ref2) {
880
- var value = _ref2.value;
881
-
882
- _this.setState({
883
- internalValue: value,
884
- source: 'day'
885
- });
886
- });
887
-
888
- Calendar_defineProperty(Calendar_assertThisInitialized(_this), "handleCalendarMount", function (el) {
889
- updateReactRef(_this.calendarRef, el);
890
- updateReactRef(_this.props.elementRef, el);
891
- });
892
-
893
- _this.state = {
894
- internalValue: props.value,
895
- todayValue: _this.getToday(),
896
- source: null
897
- };
898
- _this.monthHeaderId = (0,id_namespaceObject.createDOMID)('header');
899
- _this.calendarRef = /*#__PURE__*/external_react_default().createRef();
900
-
901
- if (false) {}
902
-
903
- return _this;
904
- }
905
-
906
- Calendar_createClass(Calendar, [{
907
- key: "componentDidMount",
908
- value: function componentDidMount() {
909
- var _this2 = this;
910
-
911
- this.todayTimerId = setInterval(function () {
912
- var todayValue = _this2.getToday();
913
-
914
- if (todayValue !== _this2.state.todayValue) {
915
- _this2.setState({
916
- todayValue: todayValue
917
- });
851
+ function ke(e, t) {
852
+ if (e) {
853
+ if (typeof e === "function") {
854
+ e(t);
855
+ } else {
856
+ // the public signature of this util uses React.Ref<T> to mirror the way React types refs.
857
+ // the intention here is to signal "we will take care of setting 'current', not you".
858
+ e.current = t;
859
+ // eslint-disable-line no-param-reassign
860
+ }
918
861
  }
919
- }, 1000);
920
- }
921
- }, {
922
- key: "componentWillUnmount",
923
- value: function componentWillUnmount() {
924
- if (this.todayTimerId !== undefined) {
925
- clearInterval(this.todayTimerId);
926
- }
927
- }
928
- }, {
929
- key: "componentDidUpdate",
930
- value: function componentDidUpdate(prevProps, prevState) {
931
- if (false) {}
932
-
933
- if (this.state.internalValue !== prevState.internalValue && this.state.source === 'day') {
934
- this.focusActiveDay();
935
- }
936
862
  }
937
- /**
938
- * Place focus on the active day.
939
- */
940
-
941
- }, {
942
- key: "focusActiveDay",
943
- value: function focusActiveDay() {
944
- var _this$calendarRef, _this$calendarRef$cur;
945
-
946
- var current = (_this$calendarRef = this.calendarRef) === null || _this$calendarRef === void 0 ? void 0 : (_this$calendarRef$cur = _this$calendarRef.current) === null || _this$calendarRef$cur === void 0 ? void 0 : _this$calendarRef$cur.querySelector(calendarActiveSelector);
947
- current === null || current === void 0 ? void 0 : current.focus();
948
- }
949
- }, {
950
- key: "getToday",
951
- value: function getToday() {
952
- var today = external_moment_default()().locale(this.props.locale).format('YYYY-MM-DD');
953
- return today;
954
- }
955
- }, {
956
- key: "render",
957
- value: function render() {
958
- var _this$props = this.props,
959
- describedBy = _this$props.describedBy,
960
- highlightToday = _this$props.highlightToday,
961
- labelledBy = _this$props.labelledBy,
962
- locale = _this$props.locale,
963
- onChange = _this$props.onChange,
964
- required = _this$props.required,
965
- value = _this$props.value;
966
- var _this$state = this.state,
967
- internalValue = _this$state.internalValue,
968
- todayValue = _this$state.todayValue;
969
- return /*#__PURE__*/external_react_default().createElement(CalendarStyles_StyledBox, Calendar_extends({
970
- inline: true,
971
- "aria-labelledby": labelledBy,
972
- "aria-describedby": describedBy,
973
- "aria-required": required,
974
- "data-test": "calendar"
975
- }, omit_default()(this.props, keys_default()(Calendar.propTypes)), {
976
- elementRef: this.handleCalendarMount
977
- }), /*#__PURE__*/external_react_default().createElement(Calendar_MonthHeader, {
978
- headingId: this.monthHeaderId,
979
- locale: locale,
980
- onChange: this.handleMonthChange,
981
- value: internalValue
982
- }), /*#__PURE__*/external_react_default().createElement(Calendar_DateTable, {
983
- displayValue: internalValue,
984
- highlightToday: highlightToday,
985
- labelledBy: this.monthHeaderId,
986
- locale: locale,
987
- onChange: onChange,
988
- onInternalChange: this.handleDayChange,
989
- selectedValue: value,
990
- todayValue: todayValue
991
- }));
992
- }
993
- }], [{
994
- key: "validateValue",
995
- value: function validateValue(value) {
996
- if (!external_moment_default()(value, 'YYYY-MM-DD').isValid()) {
997
- return new Error("Invalid value prop ".concat(value, " passed to Calendar. value must be a string date formatted 'YYYY-MM-DD'."));
998
- }
999
-
1000
- return null;
863
+ // CONCATENATED MODULE: ./src/Calendar/Calendar.tsx
864
+ function we(e) {
865
+ "@babel/helpers - typeof";
866
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
867
+ we = function e(t) {
868
+ return typeof t;
869
+ };
870
+ } else {
871
+ we = function e(t) {
872
+ return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
873
+ };
874
+ }
875
+ return we(e);
1001
876
  }
1002
- }]);
1003
-
1004
- return Calendar;
1005
- }(external_react_namespaceObject.Component);
1006
-
1007
- Calendar_defineProperty(Calendar, "propTypes", Calendar_propTypes);
1008
-
1009
- Calendar_defineProperty(Calendar, "defaultProps", Calendar_defaultProps);
1010
-
1011
- /* harmony default export */ const Calendar_Calendar = (Calendar);
1012
-
1013
- ;// CONCATENATED MODULE: ./src/Calendar/index.ts
1014
-
1015
-
1016
- module.exports = __webpack_exports__;
1017
- /******/ })()
1018
- ;
877
+ function Oe() {
878
+ Oe = Object.assign || function(e) {
879
+ for (var t = 1; t < arguments.length; t++) {
880
+ var r = arguments[t];
881
+ for (var n in r) {
882
+ if (Object.prototype.hasOwnProperty.call(r, n)) {
883
+ e[n] = r[n];
884
+ }
885
+ }
886
+ }
887
+ return e;
888
+ };
889
+ return Oe.apply(this, arguments);
890
+ }
891
+ function Ce(e, t) {
892
+ if (!(e instanceof t)) {
893
+ throw new TypeError("Cannot call a class as a function");
894
+ }
895
+ }
896
+ function Se(e, t) {
897
+ for (var r = 0; r < t.length; r++) {
898
+ var n = t[r];
899
+ n.enumerable = n.enumerable || false;
900
+ n.configurable = true;
901
+ if ("value" in n) n.writable = true;
902
+ Object.defineProperty(e, n.key, n);
903
+ }
904
+ }
905
+ function xe(e, t, r) {
906
+ if (t) Se(e.prototype, t);
907
+ if (r) Se(e, r);
908
+ return e;
909
+ }
910
+ function je(e, t) {
911
+ if (typeof t !== "function" && t !== null) {
912
+ throw new TypeError("Super expression must either be null or a function");
913
+ }
914
+ e.prototype = Object.create(t && t.prototype, {
915
+ constructor: {
916
+ value: e,
917
+ writable: true,
918
+ configurable: true
919
+ }
920
+ });
921
+ if (t) _e(e, t);
922
+ }
923
+ function _e(e, t) {
924
+ _e = Object.setPrototypeOf || function e(t, r) {
925
+ t.__proto__ = r;
926
+ return t;
927
+ };
928
+ return _e(e, t);
929
+ }
930
+ function Te(e) {
931
+ var t = Ie();
932
+ return function r() {
933
+ var n = Ve(e), a;
934
+ if (t) {
935
+ var o = Ve(this).constructor;
936
+ a = Reflect.construct(n, arguments, o);
937
+ } else {
938
+ a = n.apply(this, arguments);
939
+ }
940
+ return Ee(this, a);
941
+ };
942
+ }
943
+ function Ee(e, t) {
944
+ if (t && (we(t) === "object" || typeof t === "function")) {
945
+ return t;
946
+ }
947
+ return Pe(e);
948
+ }
949
+ function Pe(e) {
950
+ if (e === void 0) {
951
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
952
+ }
953
+ return e;
954
+ }
955
+ function Ie() {
956
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
957
+ if (Reflect.construct.sham) return false;
958
+ if (typeof Proxy === "function") return true;
959
+ try {
960
+ Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
961
+ return true;
962
+ } catch (e) {
963
+ return false;
964
+ }
965
+ }
966
+ function Ve(e) {
967
+ Ve = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
968
+ return t.__proto__ || Object.getPrototypeOf(t);
969
+ };
970
+ return Ve(e);
971
+ }
972
+ function Re(e, t, r) {
973
+ if (t in e) {
974
+ Object.defineProperty(e, t, {
975
+ value: r,
976
+ enumerable: true,
977
+ configurable: true,
978
+ writable: true
979
+ });
980
+ } else {
981
+ e[t] = r;
982
+ }
983
+ return e;
984
+ }
985
+ var qe = '[data-active-day="true"]';
986
+ var Be = {
987
+ describedBy: o().string,
988
+ highlightToday: o().bool,
989
+ labelledBy: o().string,
990
+ locale: o().string,
991
+ onChange: o().func,
992
+ /** @private. */
993
+ required: o().bool,
994
+ value: o().string,
995
+ elementRef: o().oneOfType([ o().func, o().object ])
996
+ };
997
+ var Fe = {
998
+ locale: "en_US",
999
+ value: f()().format("YYYY-MM-DD")
1000
+ };
1001
+ var ze = function(e) {
1002
+ je(r, e);
1003
+ var t = Te(r);
1004
+ function r(e) {
1005
+ var a;
1006
+ Ce(this, r);
1007
+ a = t.call(this, e);
1008
+ Re(Pe(a), "monthHeaderId", void 0);
1009
+ Re(Pe(a), "todayTimerId", void 0);
1010
+ Re(Pe(a), "calendarRef", void 0);
1011
+ Re(Pe(a), "handleMonthChange", (function(e, t) {
1012
+ var r = t.value;
1013
+ a.setState({
1014
+ internalValue: r,
1015
+ source: "month"
1016
+ });
1017
+ }));
1018
+ Re(Pe(a), "handleDayChange", (function(e, t) {
1019
+ var r = t.value;
1020
+ a.setState({
1021
+ internalValue: r,
1022
+ source: "day"
1023
+ });
1024
+ }));
1025
+ Re(Pe(a), "handleCalendarMount", (function(e) {
1026
+ ke(a.calendarRef, e);
1027
+ ke(a.props.elementRef, e);
1028
+ }));
1029
+ a.state = {
1030
+ internalValue: e.value,
1031
+ todayValue: a.getToday(),
1032
+ source: null
1033
+ };
1034
+ a.monthHeaderId = (0, d.createDOMID)("header");
1035
+ a.calendarRef = n().createRef();
1036
+ if (false) {}
1037
+ return a;
1038
+ }
1039
+ xe(r, [ {
1040
+ key: "componentDidMount",
1041
+ value: function e() {
1042
+ var t = this;
1043
+ this.todayTimerId = setInterval((function() {
1044
+ var e = t.getToday();
1045
+ if (e !== t.state.todayValue) {
1046
+ t.setState({
1047
+ todayValue: e
1048
+ });
1049
+ }
1050
+ }), 1e3);
1051
+ }
1052
+ }, {
1053
+ key: "componentWillUnmount",
1054
+ value: function e() {
1055
+ if (this.todayTimerId !== undefined) {
1056
+ clearInterval(this.todayTimerId);
1057
+ }
1058
+ }
1059
+ }, {
1060
+ key: "componentDidUpdate",
1061
+ value: function e(t, r) {
1062
+ if (false) {}
1063
+ if (this.state.internalValue !== r.internalValue && this.state.source === "day") {
1064
+ this.focusActiveDay();
1065
+ }
1066
+ }
1067
+ /**
1068
+ * Place focus on the active day.
1069
+ */ }, {
1070
+ key: "focusActiveDay",
1071
+ value: function e() {
1072
+ var t, r;
1073
+ var n = (t = this.calendarRef) === null || t === void 0 ? void 0 : (r = t.current) === null || r === void 0 ? void 0 : r.querySelector(qe);
1074
+ n === null || n === void 0 ? void 0 : n.focus();
1075
+ }
1076
+ }, {
1077
+ key: "getToday",
1078
+ value: function e() {
1079
+ var t = f()().locale(this.props.locale).format("YYYY-MM-DD");
1080
+ return t;
1081
+ }
1082
+ }, {
1083
+ key: "render",
1084
+ value: function e() {
1085
+ var t = this.props, a = t.describedBy, o = t.highlightToday, l = t.labelledBy, u = t.locale, s = t.onChange, f = t.required, d = t.value;
1086
+ var p = this.state, v = p.internalValue, y = p.todayValue;
1087
+
1088
+ return n().createElement(De, Oe({
1089
+ inline: true,
1090
+ "aria-labelledby": l,
1091
+ "aria-describedby": a,
1092
+ "aria-required": f,
1093
+ "data-test": "calendar"
1094
+ }, c()(this.props, i()(r.propTypes)), {
1095
+ elementRef: this.handleCalendarMount
1096
+ }), n().createElement(Ye, {
1097
+ headingId: this.monthHeaderId,
1098
+ locale: u,
1099
+ onChange: this.handleMonthChange,
1100
+ value: v
1101
+ }), n().createElement(H, {
1102
+ displayValue: v,
1103
+ highlightToday: o,
1104
+ labelledBy: this.monthHeaderId,
1105
+ locale: u,
1106
+ onChange: s,
1107
+ onInternalChange: this.handleDayChange,
1108
+ selectedValue: d,
1109
+ todayValue: y
1110
+ }));
1111
+ }
1112
+ } ], [ {
1113
+ key: "validateValue",
1114
+ value: function e(t) {
1115
+ if (!f()(t, "YYYY-MM-DD").isValid()) {
1116
+ return new Error("Invalid value prop ".concat(t, " passed to Calendar. value must be a string date formatted 'YYYY-MM-DD'."));
1117
+ }
1118
+ return null;
1119
+ }
1120
+ } ]);
1121
+ return r;
1122
+ }(r.Component);
1123
+ Re(ze, "propTypes", Be);
1124
+ Re(ze, "defaultProps", Fe);
1125
+ /* harmony default export */ const He = ze;
1126
+ // CONCATENATED MODULE: ./src/Calendar/index.ts
1127
+ module.exports = t;
1128
+ /******/})();