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