@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/Date.js CHANGED
@@ -1,244 +1,335 @@
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
- DateWithoutTheme: () => (/* reexport */ _Date),
55
- "default": () => (/* reexport */ Date_Date)
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/has"
65
- const has_namespaceObject = require("lodash/has");
66
- var has_default = /*#__PURE__*/__webpack_require__.n(has_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 "@splunk/ui-utils/keyboard"
76
- const keyboard_namespaceObject = require("@splunk/ui-utils/keyboard");
77
- ;// CONCATENATED MODULE: external "@splunk/react-ui/Calendar"
78
- const Calendar_namespaceObject = require("@splunk/react-ui/Calendar");
79
- var Calendar_default = /*#__PURE__*/__webpack_require__.n(Calendar_namespaceObject);
80
- ;// CONCATENATED MODULE: external "@splunk/react-ui/Popover"
81
- const Popover_namespaceObject = require("@splunk/react-ui/Popover");
82
- var Popover_default = /*#__PURE__*/__webpack_require__.n(Popover_namespaceObject);
83
- ;// CONCATENATED MODULE: external "@splunk/themes"
84
- const themes_namespaceObject = require("@splunk/themes");
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: external "@splunk/react-ui/Text"
89
- const Text_namespaceObject = require("@splunk/react-ui/Text");
90
- var Text_default = /*#__PURE__*/__webpack_require__.n(Text_namespaceObject);
91
- ;// CONCATENATED MODULE: ./src/Date/DateStyles.ts
92
-
93
-
94
-
95
- var StyledText = external_styled_components_default()((Text_default())).withConfig({
96
- displayName: "DateStyles__StyledText",
97
- componentId: "kacgdc-0"
98
- })(["cursor:", ";&[data-inline]{flex-basis:", ";width:", ";}"], (0,themes_namespaceObject.pickVariant)('$disabled', {
99
- "false": 'text',
100
- "true": 'not-allowed'
101
- }), (0,themes_namespaceObject.pick)({
102
- enterprise: '105px',
103
- prisma: '150px'
104
- }), (0,themes_namespaceObject.pick)({
105
- enterprise: {
106
- comfortable: '105px',
107
- compact: '80px'
108
- },
109
- prisma: '150px'
110
- }));
111
- var IconContainer = external_styled_components_default().div.withConfig({
112
- displayName: "DateStyles__IconContainer",
113
- componentId: "kacgdc-1"
114
- })(["align-items:center;color:", ";display:flex;padding:", ";pointer-events:none;"], (0,themes_namespaceObject.pickVariant)('$disabled', {
115
- "false": themes_namespaceObject.variables.contentColorMuted,
116
- "true": themes_namespaceObject.variables.contentColorDisabled
117
- }), (0,themes_namespaceObject.pick)({
118
- comfortable: '0 8px',
119
- compact: '0 6px'
120
- }));
121
-
122
- ;// CONCATENATED MODULE: ./src/Date/Icon.tsx
123
- 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); }
124
-
125
-
126
-
127
- function CalendarIcon(props) {
128
- var _useSplunkTheme = (0,themes_namespaceObject.useSplunkTheme)(),
129
- density = _useSplunkTheme.density;
130
-
131
- var size = density === 'compact' ? '20px' : '24px';
132
- return /*#__PURE__*/external_react_default().createElement("svg", _extends({
133
- viewBox: "0 0 24 24",
134
- width: size,
135
- height: size
136
- }, props), /*#__PURE__*/external_react_default().createElement("path", {
137
- fill: "currentColor",
138
- fillRule: "evenodd",
139
- d: "M16.6001 2C17.1524 2 17.6001 2.44772 17.6001 3V4H19C20.1046 4 21 4.89543 21 6V8.5V9.5V19.5C21 19.7761 20.7761 20 20.5 20H3.5C3.22386 20 3 19.7761 3 19.5V9.5V8.5V6C3 4.89543 3.89543 4 5 4H6.6001V3C6.6001 2.44772 7.04781 2 7.6001 2C8.15238 2 8.6001 2.44772 8.6001 3V4H15.6001V3C15.6001 2.44772 16.0478 2 16.6001 2ZM6.6001 6C6.6001 6.55228 7.04781 7 7.6001 7C8.15238 7 8.6001 6.55228 8.6001 6H15.6001C15.6001 6.55228 16.0478 7 16.6001 7C17.1524 7 17.6001 6.55228 17.6001 6H19V8H5L5 6H6.6001ZM19 10H5V18H19V10Z"
140
- }));
141
- }
142
- ;// CONCATENATED MODULE: ./src/utils/updateReactRef.ts
143
- /**
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 n = t && t.__esModule ?
13
+ /******/ () => t["default"]
14
+ /******/ : () => t
15
+ /******/;
16
+ e.d(n, {
17
+ a: n
18
+ });
19
+ /******/ return n;
20
+ /******/ };
21
+ /******/ })();
22
+ /******/
23
+ /******/ /* webpack/runtime/define property getters */
24
+ /******/ (() => {
25
+ /******/ // define getter functions for harmony exports
26
+ /******/ e.d = (t, n) => {
27
+ /******/ for (var a in n) {
28
+ /******/ if (e.o(n, a) && !e.o(t, a)) {
29
+ /******/ Object.defineProperty(t, a, {
30
+ enumerable: true,
31
+ get: n[a]
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
+ DateWithoutTheme: () => /* reexport */ Y,
65
+ default: () => /* reexport */ Z
66
+ });
67
+ // CONCATENATED MODULE: external "react"
68
+ const n = require("react");
69
+ var a = e.n(n);
70
+ // CONCATENATED MODULE: external "prop-types"
71
+ const o = require("prop-types");
72
+ var r = e.n(o);
73
+ // CONCATENATED MODULE: external "lodash/has"
74
+ const l = require("lodash/has");
75
+ var i = e.n(l);
76
+ // CONCATENATED MODULE: external "lodash/omit"
77
+ const u = require("lodash/omit");
78
+ var s = e.n(u);
79
+ // CONCATENATED MODULE: external "moment"
80
+ const c = require("moment");
81
+ var p = e.n(c);
82
+ // CONCATENATED MODULE: external "@splunk/ui-utils/id"
83
+ const f = require("@splunk/ui-utils/id");
84
+ // CONCATENATED MODULE: external "@splunk/ui-utils/keyboard"
85
+ const d = require("@splunk/ui-utils/keyboard");
86
+ // CONCATENATED MODULE: external "@splunk/react-ui/Calendar"
87
+ const h = require("@splunk/react-ui/Calendar");
88
+ var v = e.n(h);
89
+ // CONCATENATED MODULE: external "@splunk/react-ui/Popover"
90
+ const y = require("@splunk/react-ui/Popover");
91
+ var m = e.n(y);
92
+ // CONCATENATED MODULE: external "@splunk/themes"
93
+ const b = require("@splunk/themes");
94
+ // CONCATENATED MODULE: external "styled-components"
95
+ const g = require("styled-components");
96
+ var C = e.n(g);
97
+ // CONCATENATED MODULE: external "@splunk/react-ui/Text"
98
+ const O = require("@splunk/react-ui/Text");
99
+ var x = e.n(O);
100
+ // CONCATENATED MODULE: ./src/Date/DateStyles.ts
101
+ var k = C()(x()).withConfig({
102
+ displayName: "DateStyles__StyledText",
103
+ componentId: "kacgdc-0"
104
+ })([ "cursor:", ";&[data-inline]{flex-basis:", ";width:", ";}" ], (0, b.pickVariant)("$disabled", {
105
+ false: "text",
106
+ true: "not-allowed"
107
+ }), (0, b.pick)({
108
+ enterprise: "105px",
109
+ prisma: "150px"
110
+ }), (0, b.pick)({
111
+ enterprise: {
112
+ comfortable: "105px",
113
+ compact: "80px"
114
+ },
115
+ prisma: "150px"
116
+ }));
117
+ var I = C().div.withConfig({
118
+ displayName: "DateStyles__IconContainer",
119
+ componentId: "kacgdc-1"
120
+ })([ "align-items:center;color:", ";display:flex;padding:", ";pointer-events:none;" ], (0,
121
+ b.pickVariant)("$disabled", {
122
+ false: b.variables.contentColorMuted,
123
+ true: b.variables.contentColorDisabled
124
+ }), (0, b.pick)({
125
+ comfortable: "0 8px",
126
+ compact: "0 6px"
127
+ }));
128
+ // CONCATENATED MODULE: ./src/Date/Icon.tsx
129
+ function T() {
130
+ T = Object.assign || function(e) {
131
+ for (var t = 1; t < arguments.length; t++) {
132
+ var n = arguments[t];
133
+ for (var a in n) {
134
+ if (Object.prototype.hasOwnProperty.call(n, a)) {
135
+ e[a] = n[a];
136
+ }
137
+ }
138
+ }
139
+ return e;
140
+ };
141
+ return T.apply(this, arguments);
142
+ }
143
+ function D(e) {
144
+ var t = (0, b.useSplunkTheme)(), n = t.density;
145
+ var o = n === "compact" ? "20px" : "24px";
146
+
147
+ return a().createElement("svg", T({
148
+ viewBox: "0 0 24 24",
149
+ width: o,
150
+ height: o
151
+ }, e), a().createElement("path", {
152
+ fill: "currentColor",
153
+ fillRule: "evenodd",
154
+ d: "M16.6001 2C17.1524 2 17.6001 2.44772 17.6001 3V4H19C20.1046 4 21 4.89543 21 6V8.5V9.5V19.5C21 19.7761 20.7761 20 20.5 20H3.5C3.22386 20 3 19.7761 3 19.5V9.5V8.5V6C3 4.89543 3.89543 4 5 4H6.6001V3C6.6001 2.44772 7.04781 2 7.6001 2C8.15238 2 8.6001 2.44772 8.6001 3V4H15.6001V3C15.6001 2.44772 16.0478 2 16.6001 2ZM6.6001 6C6.6001 6.55228 7.04781 7 7.6001 7C8.15238 7 8.6001 6.55228 8.6001 6H15.6001C15.6001 6.55228 16.0478 7 16.6001 7C17.1524 7 17.6001 6.55228 17.6001 6H19V8H5L5 6H6.6001ZM19 10H5V18H19V10Z"
155
+ }));
156
+ }
157
+ // CONCATENATED MODULE: ./src/utils/updateReactRef.ts
158
+ /**
144
159
  * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
145
160
  *
146
161
  * @param ref - The React callback or object ref. Can be `null` or `undefined`.
147
162
  * @param current - The new value of the ref.
148
163
  */
149
- function updateReactRef(ref, current) {
150
- if (ref) {
151
- if (typeof ref === 'function') {
152
- ref(current);
153
- } else {
154
- // the public signature of this util uses React.Ref<T> to mirror the way React types refs.
155
- // the intention here is to signal "we will take care of setting 'current', not you".
156
- ref.current = current; // eslint-disable-line no-param-reassign
164
+ function S(e, t) {
165
+ if (e) {
166
+ if (typeof e === "function") {
167
+ e(t);
168
+ } else {
169
+ // the public signature of this util uses React.Ref<T> to mirror the way React types refs.
170
+ // the intention here is to signal "we will take care of setting 'current', not you".
171
+ e.current = t;
172
+ // eslint-disable-line no-param-reassign
173
+ }
174
+ }
175
+ }
176
+ // CONCATENATED MODULE: ./src/Date/Date.tsx
177
+ function w(e) {
178
+ "@babel/helpers - typeof";
179
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
180
+ w = function e(t) {
181
+ return typeof t;
182
+ };
183
+ } else {
184
+ w = function e(t) {
185
+ return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
186
+ };
187
+ }
188
+ return w(e);
157
189
  }
158
- }
159
- }
160
-
161
-
162
- ;// CONCATENATED MODULE: ./src/Date/Date.tsx
163
- 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); }
164
-
165
- function Date_extends() { Date_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 Date_extends.apply(this, arguments); }
166
-
167
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
168
-
169
- 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); } }
170
-
171
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
172
-
173
- 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); }
174
-
175
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
176
-
177
- 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); }; }
178
-
179
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
180
-
181
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
182
-
183
- 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; } }
184
-
185
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
186
-
187
- 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; }
188
-
189
-
190
-
191
-
192
-
193
-
194
-
195
-
196
-
197
-
198
-
199
-
200
-
201
-
202
- var propTypes = {
203
- defaultValue: (external_prop_types_default()).string,
204
- describedBy: (external_prop_types_default()).string,
205
- disabled: (external_prop_types_default()).bool,
206
- elementRef: external_prop_types_default().oneOfType([(external_prop_types_default()).func, (external_prop_types_default()).object]),
207
- error: (external_prop_types_default()).bool,
208
- highlightToday: (external_prop_types_default()).bool,
209
- inline: (external_prop_types_default()).bool,
210
- inputId: (external_prop_types_default()).string,
211
- inputOnly: (external_prop_types_default()).bool,
212
- labelledBy: (external_prop_types_default()).string,
213
- locale: (external_prop_types_default()).string,
214
- name: (external_prop_types_default()).string,
215
- onBlur: (external_prop_types_default()).func,
216
- onChange: (external_prop_types_default()).func,
217
- onClick: (external_prop_types_default()).func,
218
- onFocus: (external_prop_types_default()).func,
219
- onKeyDown: (external_prop_types_default()).func,
220
-
221
- /** @private */
222
- splunkTheme: (external_prop_types_default()).object,
223
- value: (external_prop_types_default()).string
224
- };
225
- var defaultProps = {
226
- disabled: false,
227
- error: false,
228
- highlightToday: false,
229
- inline: true,
230
- inputOnly: false,
231
- locale: 'en_US'
232
- };
233
-
234
- var _Date = /*#__PURE__*/function (_Component) {
235
- _inherits(Date, _Component);
236
-
237
- var _super = _createSuper(Date);
238
-
239
- // @docs-props-type DatePropsBase
240
-
241
- /**
190
+ function V() {
191
+ V = Object.assign || function(e) {
192
+ for (var t = 1; t < arguments.length; t++) {
193
+ var n = arguments[t];
194
+ for (var a in n) {
195
+ if (Object.prototype.hasOwnProperty.call(n, a)) {
196
+ e[a] = n[a];
197
+ }
198
+ }
199
+ }
200
+ return e;
201
+ };
202
+ return V.apply(this, arguments);
203
+ }
204
+ function j(e, t) {
205
+ if (!(e instanceof t)) {
206
+ throw new TypeError("Cannot call a class as a function");
207
+ }
208
+ }
209
+ function F(e, t) {
210
+ for (var n = 0; n < t.length; n++) {
211
+ var a = t[n];
212
+ a.enumerable = a.enumerable || false;
213
+ a.configurable = true;
214
+ if ("value" in a) a.writable = true;
215
+ Object.defineProperty(e, a.key, a);
216
+ }
217
+ }
218
+ function M(e, t, n) {
219
+ if (t) F(e.prototype, t);
220
+ if (n) F(e, n);
221
+ return e;
222
+ }
223
+ function _(e, t) {
224
+ if (typeof t !== "function" && t !== null) {
225
+ throw new TypeError("Super expression must either be null or a function");
226
+ }
227
+ e.prototype = Object.create(t && t.prototype, {
228
+ constructor: {
229
+ value: e,
230
+ writable: true,
231
+ configurable: true
232
+ }
233
+ });
234
+ if (t) P(e, t);
235
+ }
236
+ function P(e, t) {
237
+ P = Object.setPrototypeOf || function e(t, n) {
238
+ t.__proto__ = n;
239
+ return t;
240
+ };
241
+ return P(e, t);
242
+ }
243
+ function q(e) {
244
+ var t = H();
245
+ return function n() {
246
+ var a = K(e), o;
247
+ if (t) {
248
+ var r = K(this).constructor;
249
+ o = Reflect.construct(a, arguments, r);
250
+ } else {
251
+ o = a.apply(this, arguments);
252
+ }
253
+ return E(this, o);
254
+ };
255
+ }
256
+ function E(e, t) {
257
+ if (t && (w(t) === "object" || typeof t === "function")) {
258
+ return t;
259
+ }
260
+ return R(e);
261
+ }
262
+ function R(e) {
263
+ if (e === void 0) {
264
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
265
+ }
266
+ return e;
267
+ }
268
+ function H() {
269
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
270
+ if (Reflect.construct.sham) return false;
271
+ if (typeof Proxy === "function") return true;
272
+ try {
273
+ Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
274
+ return true;
275
+ } catch (e) {
276
+ return false;
277
+ }
278
+ }
279
+ function K(e) {
280
+ K = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
281
+ return t.__proto__ || Object.getPrototypeOf(t);
282
+ };
283
+ return K(e);
284
+ }
285
+ function W(e, t, n) {
286
+ if (t in e) {
287
+ Object.defineProperty(e, t, {
288
+ value: n,
289
+ enumerable: true,
290
+ configurable: true,
291
+ writable: true
292
+ });
293
+ } else {
294
+ e[t] = n;
295
+ }
296
+ return e;
297
+ }
298
+ var A = {
299
+ defaultValue: r().string,
300
+ describedBy: r().string,
301
+ disabled: r().bool,
302
+ elementRef: r().oneOfType([ r().func, r().object ]),
303
+ error: r().bool,
304
+ highlightToday: r().bool,
305
+ inline: r().bool,
306
+ inputId: r().string,
307
+ inputOnly: r().bool,
308
+ labelledBy: r().string,
309
+ locale: r().string,
310
+ name: r().string,
311
+ onBlur: r().func,
312
+ onChange: r().func,
313
+ onClick: r().func,
314
+ onFocus: r().func,
315
+ onKeyDown: r().func,
316
+ /** @private */
317
+ splunkTheme: r().object,
318
+ value: r().string
319
+ };
320
+ var B = {
321
+ disabled: false,
322
+ error: false,
323
+ highlightToday: false,
324
+ inline: true,
325
+ inputOnly: false,
326
+ locale: "en_US"
327
+ };
328
+ var Y = function(e) {
329
+ _(n, e);
330
+ var t = q(n);
331
+ // @docs-props-type DatePropsBase
332
+ /**
242
333
  * This static value can be used to convert a moment date to a compatible string
243
334
  * to set the `value` prop.
244
335
  * ```
@@ -248,319 +339,248 @@ var _Date = /*#__PURE__*/function (_Component) {
248
339
  * @name momentFormat
249
340
  * @memberOf Date
250
341
  * @type string
251
- */
252
- function Date(props) {
253
- var _this;
254
-
255
- _classCallCheck(this, Date);
256
-
257
- _this = _super.call(this, props);
258
-
259
- _defineProperty(_assertThisInitialized(_this), "controlledExternally", void 0);
260
-
261
- _defineProperty(_assertThisInitialized(_this), "focusCalledInternally", false);
262
-
263
- _defineProperty(_assertThisInitialized(_this), "popoverId", void 0);
264
-
265
- _defineProperty(_assertThisInitialized(_this), "calendar", null);
266
-
267
- _defineProperty(_assertThisInitialized(_this), "openWithFocus", false);
268
-
269
- _defineProperty(_assertThisInitialized(_this), "applyTextChange", function (e) {
270
- var date = external_moment_default()(_this.state.tempTextInputDate, 'l', _this.props.locale);
271
-
272
- if (date.isValid()) {
273
- _this.handleDateChange(e, {
274
- value: date.format(_Date.momentFormat)
275
- }, 'textInput');
276
- } else {
277
- _this.setState({
278
- calendarOpen: false,
279
- tempTextInputDate: undefined
280
- });
281
- }
282
- });
283
-
284
- _defineProperty(_assertThisInitialized(_this), "handleDateChange", function (e, _ref, origin) {
285
- var value = _ref.value;
286
-
287
- if (origin !== 'textInput') {
288
- _this.focusCalledInternally = true;
289
-
290
- _this.focus();
291
- }
292
-
293
- if (_this.getValue() !== value) {
294
- var _this$props$onChange, _this$props;
295
-
296
- _this.setState({
297
- calendarOpen: false,
298
- tempTextInputDate: undefined,
299
- value: _this.isControlled() ? undefined : value
300
- });
301
-
302
- var name = _this.props.name;
303
- (_this$props$onChange = (_this$props = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props, e, {
304
- value: value,
305
- name: name
306
- });
307
- } else {
308
- _this.setState({
309
- calendarOpen: false
310
- });
311
- }
312
- });
313
-
314
- _defineProperty(_assertThisInitialized(_this), "handleFocus", function (e) {
315
- var _this$props$onFocus, _this$props2;
316
-
317
- if (_this.focusCalledInternally) {
318
- _this.focusCalledInternally = false;
319
- } else if (!_this.props.inputOnly) {
320
- _this.setState({
321
- calendarOpen: true
322
- });
323
- }
324
-
325
- (_this$props$onFocus = (_this$props2 = _this.props).onFocus) === null || _this$props$onFocus === void 0 ? void 0 : _this$props$onFocus.call(_this$props2, e);
326
- });
327
-
328
- _defineProperty(_assertThisInitialized(_this), "handleClick", function (e) {
329
- var _this$state$anchor, _this$props$onClick, _this$props3;
330
-
331
- if (document.activeElement !== _this.state.input && ((_this$state$anchor = _this.state.anchor) === null || _this$state$anchor === void 0 ? void 0 : _this$state$anchor.contains(e.target))) {
332
- _this.focus();
333
- }
334
-
335
- if (!_this.props.inputOnly && !_this.state.calendarOpen) {
336
- _this.setState({
337
- calendarOpen: true
338
- });
339
- }
340
-
341
- (_this$props$onClick = (_this$props3 = _this.props).onClick) === null || _this$props$onClick === void 0 ? void 0 : _this$props$onClick.call(_this$props3, e);
342
- });
343
-
344
- _defineProperty(_assertThisInitialized(_this), "handleInputChange", function (e, _ref2) {
345
- var value = _ref2.value;
346
-
347
- _this.setState({
348
- tempTextInputDate: value,
349
- calendarOpen: !_this.props.inputOnly
350
- });
351
- });
352
-
353
- _defineProperty(_assertThisInitialized(_this), "handleKeyDown", function (e) {
354
- var _this$props$onKeyDown, _this$props4;
355
-
356
- var eventKeyCode = (0,keyboard_namespaceObject.keycode)(e.nativeEvent);
357
-
358
- if (eventKeyCode === 'enter' || eventKeyCode === 'tab') {
359
- _this.applyTextChange(e);
360
- } else if (!_this.props.inputOnly && eventKeyCode === 'down') {
361
- e.preventDefault();
362
-
363
- if (!_this.state.calendarOpen) {
364
- _this.openWithFocus = true;
365
-
366
- _this.setState({
367
- calendarOpen: true
368
- });
369
- } else if (_this.calendar) {
370
- _this.calendar.focusActiveDay();
342
+ */ function n(e) {
343
+ var a;
344
+ j(this, n);
345
+ a = t.call(this, e);
346
+ W(R(a), "controlledExternally", void 0);
347
+ W(R(a), "focusCalledInternally", false);
348
+ W(R(a), "popoverId", void 0);
349
+ W(R(a), "calendar", null);
350
+ W(R(a), "openWithFocus", false);
351
+ W(R(a), "applyTextChange", (function(e) {
352
+ var t = p()(a.state.tempTextInputDate, "l", a.props.locale);
353
+ if (t.isValid()) {
354
+ a.handleDateChange(e, {
355
+ value: t.format(Y.momentFormat)
356
+ }, "textInput");
357
+ } else {
358
+ a.setState({
359
+ calendarOpen: false,
360
+ tempTextInputDate: undefined
361
+ });
362
+ }
363
+ }));
364
+ W(R(a), "handleDateChange", (function(e, t, n) {
365
+ var o = t.value;
366
+ if (n !== "textInput") {
367
+ a.focusCalledInternally = true;
368
+ a.focus();
369
+ }
370
+ if (a.getValue() !== o) {
371
+ var r, l;
372
+ a.setState({
373
+ calendarOpen: false,
374
+ tempTextInputDate: undefined,
375
+ value: a.isControlled() ? undefined : o
376
+ });
377
+ var i = a.props.name;
378
+ (r = (l = a.props).onChange) === null || r === void 0 ? void 0 : r.call(l, e, {
379
+ value: o,
380
+ name: i
381
+ });
382
+ } else {
383
+ a.setState({
384
+ calendarOpen: false
385
+ });
386
+ }
387
+ }));
388
+ W(R(a), "handleFocus", (function(e) {
389
+ var t, n;
390
+ if (a.focusCalledInternally) {
391
+ a.focusCalledInternally = false;
392
+ } else if (!a.props.inputOnly) {
393
+ a.setState({
394
+ calendarOpen: true
395
+ });
396
+ }
397
+ (t = (n = a.props).onFocus) === null || t === void 0 ? void 0 : t.call(n, e);
398
+ }));
399
+ W(R(a), "handleClick", (function(e) {
400
+ var t, n, o;
401
+ if (document.activeElement !== a.state.input && ((t = a.state.anchor) === null || t === void 0 ? void 0 : t.contains(e.target))) {
402
+ a.focus();
403
+ }
404
+ if (!a.props.inputOnly && !a.state.calendarOpen) {
405
+ a.setState({
406
+ calendarOpen: true
407
+ });
408
+ }
409
+ (n = (o = a.props).onClick) === null || n === void 0 ? void 0 : n.call(o, e);
410
+ }));
411
+ W(R(a), "handleInputChange", (function(e, t) {
412
+ var n = t.value;
413
+ a.setState({
414
+ tempTextInputDate: n,
415
+ calendarOpen: !a.props.inputOnly
416
+ });
417
+ }));
418
+ W(R(a), "handleKeyDown", (function(e) {
419
+ var t, n;
420
+ var o = (0, d.keycode)(e.nativeEvent);
421
+ if (o === "enter" || o === "tab") {
422
+ a.applyTextChange(e);
423
+ } else if (!a.props.inputOnly && o === "down") {
424
+ e.preventDefault();
425
+ if (!a.state.calendarOpen) {
426
+ a.openWithFocus = true;
427
+ a.setState({
428
+ calendarOpen: true
429
+ });
430
+ } else if (a.calendar) {
431
+ a.calendar.focusActiveDay();
432
+ }
433
+ } else if (o === "esc") {
434
+ a.setState({
435
+ calendarOpen: false,
436
+ tempTextInputDate: undefined
437
+ });
438
+ a.focus();
439
+ }
440
+ (t = (n = a.props).onKeyDown) === null || t === void 0 ? void 0 : t.call(n, e);
441
+ }));
442
+ W(R(a), "handleMount", (function(e) {
443
+ a.setState({
444
+ anchor: e
445
+ });
446
+ S(a.props.elementRef, e);
447
+ }));
448
+ W(R(a), "handleInputMount", (function(e) {
449
+ a.setState({
450
+ input: e
451
+ });
452
+ }));
453
+ W(R(a), "handleCalendarMount", (function(e) {
454
+ a.calendar = e;
455
+ }));
456
+ W(R(a), "handleRequestClose", (function(e) {
457
+ var t = e.event, n = e.reason;
458
+ if ((n === "clickAway" || n === "escapeKey") && t !== undefined && t.target !== a.state.anchor) {
459
+ a.applyTextChange(t);
460
+ if (n === "escapeKey") {
461
+ a.focusCalledInternally = true;
462
+ a.focus();
463
+ }
464
+ }
465
+ }));
466
+ a.controlledExternally = i()(e, "value");
467
+ var o = a.isControlled() ? e.value : e.defaultValue || p()().locale(e.locale).format(Y.momentFormat);
468
+ a.state = {
469
+ anchor: null,
470
+ calendarOpen: false,
471
+ input: null,
472
+ value: a.isControlled() ? undefined : o
473
+ };
474
+ a.popoverId = (0, f.createDOMID)("calendar");
475
+ if (false) {}
476
+ if (false) {}
477
+ return a;
371
478
  }
372
- } else if (eventKeyCode === 'esc') {
373
- _this.setState({
374
- calendarOpen: false,
375
- tempTextInputDate: undefined
376
- });
377
-
378
- _this.focus();
379
- }
380
-
381
- (_this$props$onKeyDown = (_this$props4 = _this.props).onKeyDown) === null || _this$props$onKeyDown === void 0 ? void 0 : _this$props$onKeyDown.call(_this$props4, e);
382
- });
383
-
384
- _defineProperty(_assertThisInitialized(_this), "handleMount", function (el) {
385
- _this.setState({
386
- anchor: el
387
- });
388
-
389
- updateReactRef(_this.props.elementRef, el);
390
- });
391
-
392
- _defineProperty(_assertThisInitialized(_this), "handleInputMount", function (el) {
393
- _this.setState({
394
- input: el
395
- });
396
- });
397
-
398
- _defineProperty(_assertThisInitialized(_this), "handleCalendarMount", function (el) {
399
- _this.calendar = el;
400
- });
401
-
402
- _defineProperty(_assertThisInitialized(_this), "handleRequestClose", function (_ref3) {
403
- var event = _ref3.event,
404
- reason = _ref3.reason;
405
-
406
- if ((reason === 'clickAway' || reason === 'escapeKey') && event !== undefined && event.target !== _this.state.anchor) {
407
- _this.applyTextChange(event);
408
-
409
- if (reason === 'escapeKey') {
410
- _this.focusCalledInternally = true;
411
-
412
- _this.focus();
413
- }
414
- }
415
- });
416
-
417
- _this.controlledExternally = has_default()(props, 'value');
418
- var dateString = _this.isControlled() ? props.value : props.defaultValue || external_moment_default()().locale(props.locale).format(_Date.momentFormat);
419
- _this.state = {
420
- anchor: null,
421
- calendarOpen: false,
422
- input: null,
423
- value: _this.isControlled() ? undefined : dateString
424
- };
425
- _this.popoverId = (0,id_namespaceObject.createDOMID)('calendar');
426
-
427
- if (false) {}
428
-
429
- if (false) {}
430
-
431
- return _this;
432
- }
433
-
434
- _createClass(Date, [{
435
- key: "componentDidUpdate",
436
- value: function componentDidUpdate(prevProps, prevState) {
437
- if (false) {}
438
-
439
- if (false) {}
440
-
441
- if (false) {}
442
- /**
479
+ M(n, [ {
480
+ key: "componentDidUpdate",
481
+ value: function e(t, n) {
482
+ if (false) {}
483
+ if (false) {}
484
+ if (false) {}
485
+ /**
443
486
  * If `openWithFocus` and `calendarOpen` are set the user is attempting to navigate to the dropdown, but it's closed.
444
487
  * On the first update following the state change set focus to the active day within the calendar.
445
- */
446
-
447
-
448
- if (this.openWithFocus && this.state.calendarOpen && prevState.calendarOpen !== this.state.calendarOpen) {
449
- var _this$calendar;
450
-
451
- this.openWithFocus = false;
452
- (_this$calendar = this.calendar) === null || _this$calendar === void 0 ? void 0 : _this$calendar.focusActiveDay();
453
- }
454
- }
455
- }, {
456
- key: "getValue",
457
- value: function getValue() {
458
- return this.isControlled() ? this.props.value : this.state.value;
459
- }
460
- }, {
461
- key: "getTextInputValue",
462
- value: function getTextInputValue() {
463
- return this.state.tempTextInputDate === undefined ? external_moment_default()(this.getValue(), _Date.momentFormat, this.props.locale).format('l') : this.state.tempTextInputDate;
464
- }
465
- }, {
466
- key: "isControlled",
467
- value: function isControlled() {
468
- return this.controlledExternally;
469
- }
470
- /**
488
+ */ if (this.openWithFocus && this.state.calendarOpen && n.calendarOpen !== this.state.calendarOpen) {
489
+ var a;
490
+ this.openWithFocus = false;
491
+ (a = this.calendar) === null || a === void 0 ? void 0 : a.focusActiveDay();
492
+ }
493
+ }
494
+ }, {
495
+ key: "getValue",
496
+ value: function e() {
497
+ return this.isControlled() ? this.props.value : this.state.value;
498
+ }
499
+ }, {
500
+ key: "getTextInputValue",
501
+ value: function e() {
502
+ return this.state.tempTextInputDate === undefined ? p()(this.getValue(), Y.momentFormat, this.props.locale).format("l") : this.state.tempTextInputDate;
503
+ }
504
+ }, {
505
+ key: "isControlled",
506
+ value: function e() {
507
+ return this.controlledExternally;
508
+ }
509
+ /**
471
510
  * Place focus on the input.
472
- */
473
-
474
- }, {
475
- key: "focus",
476
- value: function focus() {
477
- var _this$state$input;
478
-
479
- (_this$state$input = this.state.input) === null || _this$state$input === void 0 ? void 0 : _this$state$input.focus();
480
- }
481
- }, {
482
- key: "render",
483
- value: function render() {
484
- var _this$props5 = this.props,
485
- disabled = _this$props5.disabled,
486
- highlightToday = _this$props5.highlightToday,
487
- inputOnly = _this$props5.inputOnly,
488
- locale = _this$props5.locale,
489
- splunkTheme = _this$props5.splunkTheme;
490
- var isPrisma = splunkTheme.isPrisma;
491
- var currentValue = this.getValue();
492
- var startAdornment = isPrisma && !inputOnly && /*#__PURE__*/external_react_default().createElement(IconContainer, {
493
- "aria-hidden": true,
494
- $disabled: disabled
495
- }, /*#__PURE__*/external_react_default().createElement(CalendarIcon, null));
496
- var children;
497
- var ariaProps = {};
498
-
499
- if (!inputOnly) {
500
- ariaProps.role = 'combobox';
501
- ariaProps['aria-controls'] = this.state.calendarOpen ? this.popoverId : undefined;
502
- ariaProps['aria-expanded'] = disabled ? false : this.state.calendarOpen;
503
- ariaProps['aria-haspopup'] = true;
504
- children = /*#__PURE__*/external_react_default().createElement((Popover_default()), {
505
- anchor: this.state.anchor,
506
- id: this.popoverId,
507
- open: disabled ? false : this.state.calendarOpen,
508
- onRequestClose: this.handleRequestClose
509
- }, /*#__PURE__*/external_react_default().createElement((Calendar_default()), {
510
- ref: this.handleCalendarMount,
511
- highlightToday: highlightToday,
512
- locale: locale,
513
- onChange: this.handleDateChange,
514
- value: currentValue
515
- }));
516
- }
517
-
518
- return /*#__PURE__*/external_react_default().createElement(StyledText, Date_extends({
519
- autoCapitalize: "off",
520
- autoComplete: "off",
521
- autoCorrect: "off",
522
- spellCheck: false,
523
- "data-test": "date",
524
- "data-test-value": currentValue,
525
- "data-test-popover-id": this.popoverId,
526
- elementRef: this.handleMount,
527
- inputRef: this.handleInputMount,
528
- onChange: this.handleInputChange,
529
- onClick: this.handleClick,
530
- onFocus: this.handleFocus,
531
- onKeyDown: this.handleKeyDown,
532
- value: this.getTextInputValue(),
533
- startAdornment: startAdornment,
534
- $disabled: disabled
535
- }, ariaProps, omit_default()(this.props, 'className', 'defaultValue', 'elementRef', 'inputOnly', 'multiline', 'locale', 'onChange', 'onClick', 'onFocus', 'onKeyDown', 'onSelect', 'spellCheck', 'value')), children);
536
- }
537
- }]);
538
-
539
- return Date;
540
- }(external_react_namespaceObject.Component);
541
-
542
- _defineProperty(_Date, "propTypes", propTypes);
543
-
544
- _defineProperty(_Date, "defaultProps", defaultProps);
545
-
546
- _defineProperty(_Date, "momentFormat", 'YYYY-MM-DD');
547
-
548
- _defineProperty(_Date, "validateValue", function (value) {
549
- if (!external_moment_default()(value, _Date.momentFormat).isValid()) {
550
- // eslint-disable-next-line no-console
551
- console.error("Invalid date string value \"".concat(value, "\" provided to Moment."));
552
- }
553
- });
554
-
555
- var DateWithThemeBase = (0,themes_namespaceObject.withSplunkTheme)(_Date);
556
- var DateWithTheme = DateWithThemeBase;
557
- DateWithTheme.propTypes = _Date.propTypes;
558
- DateWithTheme.momentFormat = _Date.momentFormat;
559
- /* harmony default export */ const Date_Date = (DateWithTheme);
560
-
561
- ;// CONCATENATED MODULE: ./src/Date/index.ts
562
-
563
-
564
- module.exports = __webpack_exports__;
565
- /******/ })()
566
- ;
511
+ */ }, {
512
+ key: "focus",
513
+ value: function e() {
514
+ var t;
515
+ (t = this.state.input) === null || t === void 0 ? void 0 : t.focus();
516
+ }
517
+ }, {
518
+ key: "render",
519
+ value: function e() {
520
+ var t = this.props, n = t.disabled, o = t.highlightToday, r = t.inputOnly, l = t.locale, i = t.splunkTheme;
521
+ var u = i.isPrisma;
522
+ var c = this.getValue();
523
+ var p = u && !r && a().createElement(I, {
524
+ "aria-hidden": true,
525
+ $disabled: n
526
+ }, a().createElement(D, null));
527
+ var f;
528
+ var d = {};
529
+ if (!r) {
530
+ d.role = "combobox";
531
+ d["aria-controls"] = this.state.calendarOpen ? this.popoverId : undefined;
532
+ d["aria-expanded"] = n ? false : this.state.calendarOpen;
533
+ d["aria-haspopup"] = true;
534
+ f = a().createElement(m(), {
535
+ anchor: this.state.anchor,
536
+ id: this.popoverId,
537
+ open: n ? false : this.state.calendarOpen,
538
+ onRequestClose: this.handleRequestClose
539
+ }, a().createElement(v(), {
540
+ ref: this.handleCalendarMount,
541
+ highlightToday: o,
542
+ locale: l,
543
+ onChange: this.handleDateChange,
544
+ value: c
545
+ }));
546
+ }
547
+
548
+ return a().createElement(k, V({
549
+ autoCapitalize: "off",
550
+ autoComplete: "off",
551
+ autoCorrect: "off",
552
+ spellCheck: false,
553
+ "data-test": "date",
554
+ "data-test-value": c,
555
+ "data-test-popover-id": this.popoverId,
556
+ elementRef: this.handleMount,
557
+ inputRef: this.handleInputMount,
558
+ onChange: this.handleInputChange,
559
+ onClick: this.handleClick,
560
+ onFocus: this.handleFocus,
561
+ onKeyDown: this.handleKeyDown,
562
+ value: this.getTextInputValue(),
563
+ startAdornment: p,
564
+ $disabled: n
565
+ }, d, s()(this.props, "className", "defaultValue", "elementRef", "inputOnly", "multiline", "locale", "onChange", "onClick", "onFocus", "onKeyDown", "onSelect", "spellCheck", "value")), f);
566
+ }
567
+ } ]);
568
+ return n;
569
+ }(n.Component);
570
+ W(Y, "propTypes", A);
571
+ W(Y, "defaultProps", B);
572
+ W(Y, "momentFormat", "YYYY-MM-DD");
573
+ W(Y, "validateValue", (function(e) {
574
+ if (!p()(e, Y.momentFormat).isValid()) {
575
+ // eslint-disable-next-line no-console
576
+ console.error('Invalid date string value "'.concat(e, '" provided to Moment.'));
577
+ }
578
+ }));
579
+ var $ = (0, b.withSplunkTheme)(Y);
580
+ var N = $;
581
+ N.propTypes = Y.propTypes;
582
+ N.momentFormat = Y.momentFormat;
583
+ /* harmony default export */ const Z = N;
584
+ // CONCATENATED MODULE: ./src/Date/index.ts
585
+ module.exports = t;
586
+ /******/})();