@splunk/react-ui 4.40.0 → 4.42.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 (88) hide show
  1. package/ButtonGroup.js +1 -3
  2. package/CHANGELOG.md +43 -0
  3. package/Calendar.js +548 -744
  4. package/Date.js +158 -161
  5. package/Dropdown.js +33 -32
  6. package/FormRows.js +93 -97
  7. package/Layer.js +115 -97
  8. package/MIGRATION.mdx +24 -3
  9. package/Menu.js +10 -9
  10. package/MessageBar.js +5 -5
  11. package/Multiselect.js +1498 -1599
  12. package/Number.js +51 -48
  13. package/Popover.js +481 -479
  14. package/RadioBar.js +19 -15
  15. package/Resize.js +61 -61
  16. package/ResultsMenu.js +1208 -1028
  17. package/Scroll.js +482 -475
  18. package/Select.js +949 -1030
  19. package/Slider.js +346 -300
  20. package/SlidingPanels.js +166 -148
  21. package/TabBar.js +187 -172
  22. package/TabLayout.js +8 -8
  23. package/Table.js +1518 -1432
  24. package/Text.js +29 -17
  25. package/TextArea.js +37 -37
  26. package/Tooltip.js +300 -207
  27. package/TransitionOpen.js +44 -65
  28. package/package.json +4 -4
  29. package/types/src/ButtonGroup/ButtonGroup.d.ts +0 -4
  30. package/types/src/ButtonSimple/ButtonSimple.d.ts +1 -1
  31. package/types/src/Calendar/Calendar.d.ts +28 -30
  32. package/types/src/Calendar/MonthHeader.d.ts +12 -22
  33. package/types/src/Color/Color.d.ts +2 -2
  34. package/types/src/Date/Date.d.ts +18 -19
  35. package/types/src/Dropdown/Dropdown.d.ts +2 -1
  36. package/types/src/File/File.d.ts +1 -1
  37. package/types/src/FormRows/FormRows.d.ts +5 -60
  38. package/types/src/FormRows/Row.d.ts +1 -1
  39. package/types/src/Layer/Layer.d.ts +2 -1
  40. package/types/src/Link/Link.d.ts +5 -0
  41. package/types/src/Link/index.d.ts +1 -0
  42. package/types/src/Menu/Item.d.ts +1 -1
  43. package/types/src/Menu/Menu.d.ts +1 -1
  44. package/types/src/Multiselect/Option.d.ts +1 -1
  45. package/types/src/Number/Number.d.ts +10 -2
  46. package/types/src/Popover/Popover.d.ts +1 -4
  47. package/types/src/RadioBar/RadioBar.d.ts +2 -2
  48. package/types/src/Resize/Resize.d.ts +0 -11
  49. package/types/src/ResultsMenu/VirtualizedResultsMenu/VirtualizedResultsMenu.d.ts +1 -1
  50. package/types/src/ResultsMenu/VirtualizedResultsMenu/injectVirtualizedItem.d.ts +2 -0
  51. package/types/src/Scroll/Inner.d.ts +17 -19
  52. package/types/src/Search/Option.d.ts +1 -1
  53. package/types/src/Select/Option.d.ts +5 -1
  54. package/types/src/Select/OptionBase.d.ts +41 -23
  55. package/types/src/Select/SelectAllOption.d.ts +6 -2
  56. package/types/src/Select/SelectBase.d.ts +8 -34
  57. package/types/src/Slider/Slider.d.ts +7 -16
  58. package/types/src/SlidingPanels/SlidingPanels.d.ts +4 -3
  59. package/types/src/TabBar/TabBar.d.ts +10 -2
  60. package/types/src/TabBar/TabBarContext.d.ts +1 -0
  61. package/types/src/TabBar/docs/examples/IconsAbove.d.ts +2 -0
  62. package/types/src/TabBar/docs/examples/IconsLeft.d.ts +2 -0
  63. package/types/src/TabBar/docs/examples/VerticalIconsAbove.d.ts +2 -0
  64. package/types/src/TabBar/docs/examples/VerticalIconsLeft.d.ts +2 -0
  65. package/types/src/TabLayout/TabLayout.d.ts +4 -2
  66. package/types/src/Table/ExpandButton.d.ts +8 -0
  67. package/types/src/Table/HeadDropdownCell.d.ts +2 -0
  68. package/types/src/Table/HeadInner.d.ts +5 -1
  69. package/types/src/Table/Row.d.ts +8 -4
  70. package/types/src/Table/Table.d.ts +0 -2
  71. package/types/src/Table/docs/examples/Complex.d.ts +14 -3
  72. package/types/src/Text/Text.d.ts +2 -2
  73. package/types/src/TextArea/TextArea.d.ts +2 -2
  74. package/types/src/Tooltip/Tooltip.d.ts +38 -5
  75. package/types/src/Tooltip/docs/examples/CustomProps.d.ts +2 -0
  76. package/types/src/Tooltip/docs/examples/Toggletip.d.ts +2 -0
  77. package/types/src/Typography/Typography.d.ts +4 -2
  78. package/types/src/useControlled/useControlled.d.ts +5 -4
  79. package/useControlled.js +37 -15
  80. package/usePrevious.js +62 -30
  81. package/useRovingFocus.js +5 -4
  82. package/types/src/TabBar/docs/examples/IconsInline.d.ts +0 -2
  83. package/types/src/TabBar/docs/examples/IconsSmall.d.ts +0 -2
  84. package/types/src/TabBar/docs/examples/VerticalSmallIcons.d.ts +0 -2
  85. package/types/src/Table/docs/examples/prisma/Complex.d.ts +0 -48
  86. package/types/src/Table/icons/ExpansionRow.d.ts +0 -6
  87. package/types/src/Tooltip/docs/examples/CustomContent.d.ts +0 -2
  88. /package/types/src/Table/docs/examples/{prisma/RowActions.d.ts → RowActions.d.ts} +0 -0
package/Date.js CHANGED
@@ -61,15 +61,16 @@
61
61
  e.r(t);
62
62
  // EXPORTS
63
63
  e.d(t, {
64
- DateWithoutTheme: () => /* reexport */ N,
65
- default: () => /* reexport */ z
64
+ DateWithoutTheme: () => /* reexport */ U,
65
+ default: () => /* reexport */ G,
66
+ validateValue: () => /* reexport */ Z
66
67
  });
67
68
  // CONCATENATED MODULE: external "react"
68
69
  const n = require("react");
69
70
  var a = e.n(n);
70
71
  // CONCATENATED MODULE: external "prop-types"
71
- const o = require("prop-types");
72
- var r = e.n(o);
72
+ const r = require("prop-types");
73
+ var o = e.n(r);
73
74
  // CONCATENATED MODULE: external "lodash/has"
74
75
  const l = require("lodash/has");
75
76
  var i = e.n(l);
@@ -84,13 +85,13 @@
84
85
  // CONCATENATED MODULE: external "@splunk/ui-utils/keyboard"
85
86
  const d = require("@splunk/ui-utils/keyboard");
86
87
  // CONCATENATED MODULE: external "@splunk/react-ui/Calendar"
87
- const h = require("@splunk/react-ui/Calendar");
88
- var v = e.n(h);
88
+ const v = require("@splunk/react-ui/Calendar");
89
+ var h = e.n(v);
89
90
  // CONCATENATED MODULE: external "@splunk/react-ui/Popover"
90
91
  const y = require("@splunk/react-ui/Popover");
91
- var m = e.n(y);
92
+ var b = e.n(y);
92
93
  // CONCATENATED MODULE: external "@splunk/themes"
93
- const b = require("@splunk/themes");
94
+ const m = require("@splunk/themes");
94
95
  // CONCATENATED MODULE: external "styled-components"
95
96
  const g = require("styled-components");
96
97
  var C = e.n(g);
@@ -101,13 +102,13 @@
101
102
  var k = C()(x()).withConfig({
102
103
  displayName: "DateStyles__StyledText",
103
104
  componentId: "kacgdc-0"
104
- })([ "cursor:", ";&[data-inline]{flex-basis:", ";width:", ";}" ], (0, b.pickVariant)("$disabled", {
105
+ })([ "cursor:", ";&[data-inline]{flex-basis:", ";width:", ";}" ], (0, m.pickVariant)("$disabled", {
105
106
  false: "text",
106
107
  true: "not-allowed"
107
- }), (0, b.pick)({
108
+ }), (0, m.pick)({
108
109
  enterprise: "105px",
109
110
  prisma: "150px"
110
- }), (0, b.pick)({
111
+ }), (0, m.pick)({
111
112
  enterprise: {
112
113
  comfortable: "105px",
113
114
  compact: "80px"
@@ -118,10 +119,10 @@
118
119
  displayName: "DateStyles__IconContainer",
119
120
  componentId: "kacgdc-1"
120
121
  })([ "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)({
122
+ m.pickVariant)("$disabled", {
123
+ false: m.variables.contentColorMuted,
124
+ true: m.variables.contentColorDisabled
125
+ }), (0, m.pick)({
125
126
  comfortable: "0 8px",
126
127
  compact: "0 6px"
127
128
  }));
@@ -138,13 +139,13 @@
138
139
  }, T.apply(null, arguments);
139
140
  }
140
141
  function I(e) {
141
- var t = (0, b.useSplunkTheme)(), n = t.density;
142
- var o = n === "compact" ? "20px" : "24px";
142
+ var t = (0, m.useSplunkTheme)(), n = t.density;
143
+ var r = n === "compact" ? "20px" : "24px";
143
144
 
144
145
  return a().createElement("svg", T({
145
146
  viewBox: "0 0 24 24",
146
- width: o,
147
- height: o
147
+ width: r,
148
+ height: r
148
149
  }, e), a().createElement("path", {
149
150
  fill: "currentColor",
150
151
  fillRule: "evenodd",
@@ -200,12 +201,12 @@
200
201
  Object.defineProperty(e, W(a.key), a);
201
202
  }
202
203
  }
203
- function F(e, t, n) {
204
+ function R(e, t, n) {
204
205
  return t && P(e.prototype, t), n && P(e, n), Object.defineProperty(e, "prototype", {
205
206
  writable: !1
206
207
  }), e;
207
208
  }
208
- function M(e, t) {
209
+ function _(e, t) {
209
210
  if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
210
211
  e.prototype = Object.create(t && t.prototype, {
211
212
  constructor: {
@@ -215,30 +216,30 @@
215
216
  }
216
217
  }), Object.defineProperty(e, "prototype", {
217
218
  writable: !1
218
- }), t && _(e, t);
219
+ }), t && E(e, t);
219
220
  }
220
- function _(e, t) {
221
- return _ = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
221
+ function E(e, t) {
222
+ return E = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
222
223
  return e.__proto__ = t, e;
223
- }, _(e, t);
224
+ }, E(e, t);
224
225
  }
225
- function E(e) {
226
+ function q(e) {
226
227
  var t = H();
227
228
  return function() {
228
229
  var n, a = K(e);
229
230
  if (t) {
230
- var o = K(this).constructor;
231
- n = Reflect.construct(a, arguments, o);
231
+ var r = K(this).constructor;
232
+ n = Reflect.construct(a, arguments, r);
232
233
  } else n = a.apply(this, arguments);
233
- return q(this, n);
234
+ return M(this, n);
234
235
  };
235
236
  }
236
- function q(e, t) {
237
+ function M(e, t) {
237
238
  if (t && ("object" == D(t) || "function" == typeof t)) return t;
238
239
  if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
239
- return R(e);
240
+ return F(e);
240
241
  }
241
- function R(e) {
242
+ function F(e) {
242
243
  if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
243
244
  return e;
244
245
  }
@@ -280,26 +281,26 @@
280
281
  /** @public */
281
282
  /** @public */
282
283
  /** @public */ var Y = {
283
- defaultValue: r().string,
284
- describedBy: r().string,
285
- disabled: r().bool,
286
- elementRef: r().oneOfType([ r().func, r().object ]),
287
- error: r().bool,
288
- highlightToday: r().bool,
289
- inline: r().bool,
290
- inputId: r().string,
291
- inputOnly: r().bool,
292
- labelledBy: r().string,
293
- locale: r().string,
294
- name: r().string,
295
- onBlur: r().func,
296
- onChange: r().func,
297
- onClick: r().func,
298
- onFocus: r().func,
299
- onKeyDown: r().func,
284
+ defaultValue: o().string,
285
+ describedBy: o().string,
286
+ disabled: o().bool,
287
+ elementRef: o().oneOfType([ o().func, o().object ]),
288
+ error: o().bool,
289
+ highlightToday: o().bool,
290
+ inline: o().bool,
291
+ inputId: o().string,
292
+ inputOnly: o().bool,
293
+ labelledBy: o().string,
294
+ locale: o().string,
295
+ name: o().string,
296
+ onBlur: o().func,
297
+ onChange: o().func,
298
+ onClick: o().func,
299
+ onFocus: o().func,
300
+ onKeyDown: o().func,
300
301
  /** @private */
301
- splunkTheme: r().object,
302
- value: r().string
302
+ splunkTheme: o().object,
303
+ value: o().string
303
304
  };
304
305
  var $ = {
305
306
  disabled: false,
@@ -309,155 +310,159 @@
309
310
  inputOnly: false,
310
311
  locale: "en_US"
311
312
  };
312
- var N = function(e) {
313
- M(n, e);
314
- var t = E(n);
313
+ /**
314
+ * This static value can be used to convert a moment date to a compatible string
315
+ * to set the `value` prop.
316
+ * ```
317
+ * moment().format(Date.momentFormat);
318
+ * ```
319
+ * @public
320
+ * @name momentFormat
321
+ * @memberOf Date
322
+ * @type string
323
+ */ var N = "YYYY-MM-DD";
324
+ var Z = function e(t) {
325
+ if (!p()(t, N).isValid()) {
326
+ // eslint-disable-next-line no-console
327
+ console.error('Invalid date string value "'.concat(t, '" provided to Moment.'));
328
+ }
329
+ };
330
+ var U = function(e) {
331
+ _(n, e);
332
+ var t = q(n);
315
333
  // @docs-props-type DatePropsBase
316
- /**
317
- * This static value can be used to convert a moment date to a compatible string
318
- * to set the `value` prop.
319
- * ```
320
- * moment().format(Date.momentFormat);
321
- * ```
322
- * @public
323
- * @name momentFormat
324
- * @memberOf Date
325
- * @type string
326
- */ function n(e) {
327
- var a;
334
+ function n(e) {
335
+ var r;
328
336
  j(this, n);
329
- a = t.call(this, e);
330
- B(R(a), "controlledExternally", void 0);
331
- B(R(a), "focusCalledInternally", false);
332
- B(R(a), "popoverId", void 0);
333
- B(R(a), "calendar", null);
334
- B(R(a), "openWithFocus", false);
335
- B(R(a), "applyTextChange", (function(e) {
336
- var t = p()(a.state.tempTextInputDate, "l", a.props.locale);
337
+ r = t.call(this, e);
338
+ B(F(r), "controlledExternally", void 0);
339
+ B(F(r), "focusCalledInternally", false);
340
+ B(F(r), "popoverId", void 0);
341
+ B(F(r), "calendarRef", a().createRef());
342
+ B(F(r), "openWithFocus", false);
343
+ B(F(r), "applyTextChange", (function(e) {
344
+ var t = p()(r.state.tempTextInputDate, "l", r.props.locale);
337
345
  if (t.isValid()) {
338
- a.handleDateChange(e, {
339
- value: t.format(n.momentFormat)
346
+ r.handleDateChange(e, {
347
+ value: t.format(N)
340
348
  }, "textInput");
341
349
  } else {
342
- a.setState({
350
+ r.setState({
343
351
  calendarOpen: false,
344
352
  tempTextInputDate: undefined
345
353
  });
346
354
  }
347
355
  }));
348
- B(R(a), "handleDateChange", (function(e, t, n) {
349
- var o = t.value;
356
+ B(F(r), "handleDateChange", (function(e, t, n) {
357
+ var a = t.value;
350
358
  if (n !== "textInput") {
351
- a.focusCalledInternally = true;
352
- a.focus();
359
+ r.focusCalledInternally = true;
360
+ r.focus();
353
361
  }
354
- if (a.getValue() !== o) {
355
- var r, l;
356
- a.setState({
362
+ if (r.getValue() !== a) {
363
+ var o, l;
364
+ r.setState({
357
365
  calendarOpen: false,
358
366
  tempTextInputDate: undefined,
359
- value: a.isControlled() ? undefined : o
367
+ value: r.isControlled() ? undefined : a
360
368
  });
361
- var i = a.props.name;
362
- (r = (l = a.props).onChange) === null || r === void 0 ? void 0 : r.call(l, e, {
363
- value: o,
369
+ var i = r.props.name;
370
+ (o = (l = r.props).onChange) === null || o === void 0 ? void 0 : o.call(l, e, {
371
+ value: a,
364
372
  name: i
365
373
  });
366
374
  } else {
367
- a.setState({
375
+ r.setState({
368
376
  calendarOpen: false
369
377
  });
370
378
  }
371
379
  }));
372
- B(R(a), "handleFocus", (function(e, t) {
373
- var n, o;
374
- if (a.focusCalledInternally) {
375
- a.focusCalledInternally = false;
376
- } else if (!a.props.inputOnly) {
377
- a.setState({
380
+ B(F(r), "handleFocus", (function(e, t) {
381
+ var n, a;
382
+ if (r.focusCalledInternally) {
383
+ r.focusCalledInternally = false;
384
+ } else if (!r.props.inputOnly) {
385
+ r.setState({
378
386
  calendarOpen: true
379
387
  });
380
388
  }
381
- (n = (o = a.props).onFocus) === null || n === void 0 ? void 0 : n.call(o, e, t);
389
+ (n = (a = r.props).onFocus) === null || n === void 0 ? void 0 : n.call(a, e, t);
382
390
  }));
383
- B(R(a), "handleClick", (function(e) {
391
+ B(F(r), "handleClick", (function(e) {
384
392
  var t, n;
385
- if (!a.props.inputOnly && !a.state.calendarOpen) {
386
- a.setState({
393
+ if (!r.props.inputOnly && !r.state.calendarOpen) {
394
+ r.setState({
387
395
  calendarOpen: true
388
396
  });
389
397
  }
390
- (t = (n = a.props).onClick) === null || t === void 0 ? void 0 : t.call(n, e);
398
+ (t = (n = r.props).onClick) === null || t === void 0 ? void 0 : t.call(n, e);
391
399
  }));
392
- B(R(a), "handleInputChange", (function(e, t) {
400
+ B(F(r), "handleInputChange", (function(e, t) {
393
401
  var n = t.value;
394
- a.setState({
402
+ r.setState({
395
403
  tempTextInputDate: n,
396
- calendarOpen: !a.props.inputOnly
404
+ calendarOpen: !r.props.inputOnly
397
405
  });
398
406
  }));
399
- B(R(a), "handleKeyDown", (function(e) {
407
+ B(F(r), "handleKeyDown", (function(e) {
400
408
  var t, n;
401
- var o = (0, d.keycode)(e.nativeEvent);
402
- if (o === "enter" || o === "tab") {
403
- a.applyTextChange(e);
404
- } else if (!a.props.inputOnly && o === "down") {
409
+ var a = (0, d.keycode)(e.nativeEvent);
410
+ if (a === "enter" || a === "tab") {
411
+ r.applyTextChange(e);
412
+ } else if (!r.props.inputOnly && a === "down") {
405
413
  e.preventDefault();
406
- if (!a.state.calendarOpen) {
407
- a.openWithFocus = true;
408
- a.setState({
414
+ if (!r.state.calendarOpen) {
415
+ r.openWithFocus = true;
416
+ r.setState({
409
417
  calendarOpen: true
410
418
  });
411
- } else if (a.calendar) {
412
- a.calendar.focusActiveDay();
419
+ } else if (r.calendarRef) {
420
+ (0, v.focusActiveDay)(r.calendarRef);
413
421
  }
414
- } else if (o === "esc") {
415
- a.setState({
422
+ } else if (a === "esc") {
423
+ r.setState({
416
424
  calendarOpen: false,
417
425
  tempTextInputDate: undefined
418
426
  });
419
- a.focus();
427
+ r.focus();
420
428
  }
421
- (t = (n = a.props).onKeyDown) === null || t === void 0 ? void 0 : t.call(n, e);
429
+ (t = (n = r.props).onKeyDown) === null || t === void 0 ? void 0 : t.call(n, e);
422
430
  }));
423
- B(R(a), "handleMount", (function(e) {
424
- a.setState({
431
+ B(F(r), "handleMount", (function(e) {
432
+ r.setState({
425
433
  anchor: e
426
434
  });
427
- S(a.props.elementRef, e);
435
+ S(r.props.elementRef, e);
428
436
  }));
429
- B(R(a), "handleInputMount", (function(e) {
430
- a.setState({
437
+ B(F(r), "handleInputMount", (function(e) {
438
+ r.setState({
431
439
  input: e
432
440
  });
433
441
  }));
434
- B(R(a), "handleCalendarMount", (function(e) {
435
- a.calendar = e;
436
- }));
437
- B(R(a), "handleRequestClose", (function(e) {
442
+ B(F(r), "handleRequestClose", (function(e) {
438
443
  var t = e.event, n = e.reason;
439
- if ((n === "clickAway" || n === "escapeKey") && t !== undefined && t.target !== a.state.anchor) {
440
- a.applyTextChange(t);
444
+ if ((n === "clickAway" || n === "escapeKey") && t !== undefined && t.target !== r.state.anchor) {
445
+ r.applyTextChange(t);
441
446
  if (n === "escapeKey") {
442
- a.focusCalledInternally = true;
443
- a.focus();
447
+ r.focusCalledInternally = true;
448
+ r.focus();
444
449
  }
445
450
  }
446
451
  }));
447
- a.controlledExternally = i()(e, "value");
448
- var o = a.isControlled() ? e.value : e.defaultValue || p()().locale(e.locale).format(n.momentFormat);
449
- a.state = {
452
+ r.controlledExternally = i()(e, "value");
453
+ var o = r.isControlled() ? e.value : e.defaultValue || p()().locale(e.locale).format(N);
454
+ r.state = {
450
455
  anchor: null,
451
456
  calendarOpen: false,
452
457
  input: null,
453
- value: a.isControlled() ? undefined : o
458
+ value: r.isControlled() ? undefined : o
454
459
  };
455
- a.popoverId = (0, f.createDOMID)("calendar");
460
+ r.popoverId = (0, f.createDOMID)("calendar");
456
461
  if (false) {}
457
462
  if (false) {}
458
- return a;
463
+ return r;
459
464
  }
460
- F(n, [ {
465
+ R(n, [ {
461
466
  key: "componentDidUpdate",
462
467
  value: function e(t, n) {
463
468
  if (false) {}
@@ -467,9 +472,8 @@
467
472
  * If `openWithFocus` and `calendarOpen` are set the user is attempting to navigate to the dropdown, but it's closed.
468
473
  * On the first update following the state change set focus to the active day within the calendar.
469
474
  */ if (this.openWithFocus && this.state.calendarOpen && n.calendarOpen !== this.state.calendarOpen) {
470
- var a;
471
475
  this.openWithFocus = false;
472
- (a = this.calendar) === null || a === void 0 ? void 0 : a.focusActiveDay();
476
+ (0, v.focusActiveDay)(this.calendarRef);
473
477
  }
474
478
  }
475
479
  }, {
@@ -480,7 +484,7 @@
480
484
  }, {
481
485
  key: "getTextInputValue",
482
486
  value: function e() {
483
- return this.state.tempTextInputDate === undefined ? p()(this.getValue(), n.momentFormat, this.props.locale).format("l") : this.state.tempTextInputDate;
487
+ return this.state.tempTextInputDate === undefined ? p()(this.getValue(), N, this.props.locale).format("l") : this.state.tempTextInputDate;
484
488
  }
485
489
  }, {
486
490
  key: "isControlled",
@@ -498,28 +502,28 @@
498
502
  }, {
499
503
  key: "render",
500
504
  value: function e() {
501
- var t = this.props, n = t.disabled, o = t.highlightToday, r = t.inputOnly, l = t.locale, i = t.splunkTheme;
505
+ var t = this.props, n = t.disabled, r = t.highlightToday, o = t.inputOnly, l = t.locale, i = t.splunkTheme;
502
506
  var u = i.isPrisma;
503
507
  var c = this.getValue();
504
- var p = u && !r && a().createElement(w, {
508
+ var p = u && !o && a().createElement(w, {
505
509
  "aria-hidden": true,
506
510
  $disabled: n
507
511
  }, a().createElement(I, null));
508
512
  var f;
509
513
  var d = {};
510
- if (!r) {
514
+ if (!o) {
511
515
  d.role = "combobox";
512
516
  d["aria-controls"] = this.state.calendarOpen ? this.popoverId : undefined;
513
517
  d["aria-expanded"] = n ? false : this.state.calendarOpen;
514
518
  d["aria-haspopup"] = true;
515
- f = a().createElement(m(), {
519
+ f = a().createElement(b(), {
516
520
  anchor: this.state.anchor,
517
521
  id: this.popoverId,
518
522
  open: n ? false : this.state.calendarOpen,
519
523
  onRequestClose: this.handleRequestClose
520
- }, a().createElement(v(), {
521
- ref: this.handleCalendarMount,
522
- highlightToday: o,
524
+ }, a().createElement(h(), {
525
+ elementRef: this.calendarRef,
526
+ highlightToday: r,
523
527
  locale: l,
524
528
  onChange: this.handleDateChange,
525
529
  value: c
@@ -548,20 +552,13 @@
548
552
  } ]);
549
553
  return n;
550
554
  }(n.Component);
551
- B(N, "propTypes", Y);
552
- B(N, "defaultProps", $);
553
- B(N, "momentFormat", "YYYY-MM-DD");
554
- B(N, "validateValue", (function(e) {
555
- if (!p()(e, N.momentFormat).isValid()) {
556
- // eslint-disable-next-line no-console
557
- console.error('Invalid date string value "'.concat(e, '" provided to Moment.'));
558
- }
559
- }));
560
- var Z = (0, b.withSplunkTheme)(N);
561
- var U = Z;
562
- U.propTypes = N.propTypes;
563
- U.momentFormat = N.momentFormat;
564
- /* harmony default export */ const z = U;
555
+ B(U, "propTypes", Y);
556
+ B(U, "defaultProps", $);
557
+ var z = (0, m.withSplunkTheme)(U);
558
+ var L = z;
559
+ L.propTypes = U.propTypes;
560
+ L.momentFormat = N;
561
+ /* harmony default export */ const G = L;
565
562
  // only for styled components using Date
566
563
  // CONCATENATED MODULE: ./src/Date/index.ts
567
564
  module.exports = t;
package/Dropdown.js CHANGED
@@ -72,10 +72,10 @@
72
72
  var i = e.n(r);
73
73
  // CONCATENATED MODULE: external "lodash/has"
74
74
  const l = require("lodash/has");
75
- var s = e.n(l);
75
+ var a = e.n(l);
76
76
  // CONCATENATED MODULE: external "lodash/includes"
77
- const a = require("lodash/includes");
78
- var c = e.n(a);
77
+ const s = require("lodash/includes");
78
+ var c = e.n(s);
79
79
  // CONCATENATED MODULE: external "lodash/isEmpty"
80
80
  const p = require("lodash/isEmpty");
81
81
  // CONCATENATED MODULE: external "lodash/isFunction"
@@ -83,10 +83,10 @@
83
83
  var f = e.n(u);
84
84
  // CONCATENATED MODULE: external "lodash/keys"
85
85
  const d = require("lodash/keys");
86
- var g = e.n(d);
86
+ var v = e.n(d);
87
87
  // CONCATENATED MODULE: external "lodash/omit"
88
- const v = require("lodash/omit");
89
- var y = e.n(v);
88
+ const g = require("lodash/omit");
89
+ var y = e.n(g);
90
90
  // CONCATENATED MODULE: external "@splunk/ui-utils/id"
91
91
  const h = require("@splunk/ui-utils/id");
92
92
  // CONCATENATED MODULE: external "@splunk/ui-utils/keyboard"
@@ -339,16 +339,16 @@
339
339
  }));
340
340
  _(I(t), "handleRequestClose", (function(e) {
341
341
  var o = e.event, n = e.reason;
342
- var r = t.props, i = r.closeReasons, l = r.focusToggleReasons, s = r.onRequestClose;
342
+ var r = t.props, i = r.closeReasons, l = r.focusToggleReasons, a = r.onRequestClose;
343
343
  if (o && n === "clickAway") {
344
- var a = o.target;
344
+ var s = o.target;
345
345
  var p = t.props.inputId || t.props.toggle.props.id || t.toggleId;
346
- while (a) {
346
+ while (s) {
347
347
  // Ignore clicks on toggle.
348
- if (a.id === p) {
348
+ if (s.id === p) {
349
349
  return;
350
350
  }
351
- a = a.parentNode;
351
+ s = s.parentNode;
352
352
  }
353
353
  }
354
354
  if (t.isOpen() && c()(i, n)) {
@@ -360,7 +360,7 @@
360
360
  open: false
361
361
  });
362
362
  }
363
- s === null || s === void 0 ? void 0 : s(e);
363
+ a === null || a === void 0 ? void 0 : a(e);
364
364
  }
365
365
  }));
366
366
  _(I(t), "handleContentClick", (function(e) {
@@ -373,7 +373,7 @@
373
373
  anchor: null,
374
374
  open: false
375
375
  };
376
- t.controlledExternally = s()(e, "open");
376
+ t.controlledExternally = a()(e, "open");
377
377
  t.popoverId = (0, h.createDOMID)("popover");
378
378
  t.toggleId = (0, h.createDOMID)("toggle");
379
379
  return t;
@@ -382,7 +382,7 @@
382
382
  key: "componentDidUpdate",
383
383
  value: function e() {
384
384
  if (false) {}
385
- var o = R({}, y()(this.props, g()(r.propTypes), "value", "id"));
385
+ var o = R({}, y()(this.props, v()(r.propTypes), "value", "id"));
386
386
  if (false) {}
387
387
  }
388
388
  }, {
@@ -420,38 +420,39 @@
420
420
  }, {
421
421
  key: "render",
422
422
  value: function e() {
423
- var o = this.props, t = o.align, r = o.canCoverAnchor, i = o.children, l = o.closeReasons, s = o.defaultPlacement, a = o.elementRef, p = o.repositionMode, u = o.retainFocus, d = o.takeFocus;
423
+ var o;
424
+ var t = this.props, r = t.align, i = t.canCoverAnchor, l = t.children, a = t.closeReasons, s = t.defaultPlacement, p = t.elementRef, u = t.repositionMode, d = t.retainFocus, v = t.takeFocus;
424
425
  var g = this.state.anchor;
425
- var v = this.handleRequestClose, y = this.handleContentClick;
426
- var h = this.renderToggle();
426
+ var y = this.handleRequestClose, h = this.handleContentClick;
427
+ var b = this.renderToggle();
427
428
 
428
- return n().createElement(n().Fragment, null, h, n().createElement(m(), {
429
- align: t,
429
+ return n().createElement(n().Fragment, null, b, n().createElement(m(), {
430
+ align: r,
430
431
  open: !!g && this.isOpen(),
431
- autoCloseWhenOffScreen: c()(l, "offScreen"),
432
+ autoCloseWhenOffScreen: c()(a, "offScreen"),
432
433
  anchor: g,
433
- canCoverAnchor: r,
434
- elementRef: a,
435
- retainFocus: u,
434
+ canCoverAnchor: i,
435
+ elementRef: p,
436
+ retainFocus: d,
436
437
  defaultPlacement: s,
437
- onRequestClose: v,
438
- repositionMode: p,
438
+ onRequestClose: y,
439
+ repositionMode: u,
439
440
  id: this.popoverId,
440
- "aria-labelledby": this.props.inputId || this.props.toggle.props.id || this.toggleId,
441
- takeFocus: d
442
- }, f()(i) ?
441
+ "aria-labelledby": "".concat((o = this.props["aria-labelledby"]) !== null && o !== void 0 ? o : "", " ").concat(this.props.inputId || this.props.toggle.props.id || this.toggleId).trim(),
442
+ takeFocus: v
443
+ }, f()(l) ?
443
444
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
444
445
  function() {
445
446
 
446
447
  return n().createElement("div", {
447
- onClick: y
448
- }, i.apply(void 0, arguments));
448
+ onClick: h
449
+ }, l.apply(void 0, arguments));
449
450
  } :
450
451
 
451
452
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
452
453
  n().createElement("div", {
453
- onClick: y
454
- }, i)));
454
+ onClick: h
455
+ }, l)));
455
456
  }
456
457
  } ]);
457
458
  return r;