@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.
- package/ButtonGroup.js +1 -3
- package/CHANGELOG.md +43 -0
- package/Calendar.js +548 -744
- package/Date.js +158 -161
- package/Dropdown.js +33 -32
- package/FormRows.js +93 -97
- package/Layer.js +115 -97
- package/MIGRATION.mdx +24 -3
- package/Menu.js +10 -9
- package/MessageBar.js +5 -5
- package/Multiselect.js +1498 -1599
- package/Number.js +51 -48
- package/Popover.js +481 -479
- package/RadioBar.js +19 -15
- package/Resize.js +61 -61
- package/ResultsMenu.js +1208 -1028
- package/Scroll.js +482 -475
- package/Select.js +949 -1030
- package/Slider.js +346 -300
- package/SlidingPanels.js +166 -148
- package/TabBar.js +187 -172
- package/TabLayout.js +8 -8
- package/Table.js +1518 -1432
- package/Text.js +29 -17
- package/TextArea.js +37 -37
- package/Tooltip.js +300 -207
- package/TransitionOpen.js +44 -65
- package/package.json +4 -4
- package/types/src/ButtonGroup/ButtonGroup.d.ts +0 -4
- package/types/src/ButtonSimple/ButtonSimple.d.ts +1 -1
- package/types/src/Calendar/Calendar.d.ts +28 -30
- package/types/src/Calendar/MonthHeader.d.ts +12 -22
- package/types/src/Color/Color.d.ts +2 -2
- package/types/src/Date/Date.d.ts +18 -19
- package/types/src/Dropdown/Dropdown.d.ts +2 -1
- package/types/src/File/File.d.ts +1 -1
- package/types/src/FormRows/FormRows.d.ts +5 -60
- package/types/src/FormRows/Row.d.ts +1 -1
- package/types/src/Layer/Layer.d.ts +2 -1
- package/types/src/Link/Link.d.ts +5 -0
- package/types/src/Link/index.d.ts +1 -0
- package/types/src/Menu/Item.d.ts +1 -1
- package/types/src/Menu/Menu.d.ts +1 -1
- package/types/src/Multiselect/Option.d.ts +1 -1
- package/types/src/Number/Number.d.ts +10 -2
- package/types/src/Popover/Popover.d.ts +1 -4
- package/types/src/RadioBar/RadioBar.d.ts +2 -2
- package/types/src/Resize/Resize.d.ts +0 -11
- package/types/src/ResultsMenu/VirtualizedResultsMenu/VirtualizedResultsMenu.d.ts +1 -1
- package/types/src/ResultsMenu/VirtualizedResultsMenu/injectVirtualizedItem.d.ts +2 -0
- package/types/src/Scroll/Inner.d.ts +17 -19
- package/types/src/Search/Option.d.ts +1 -1
- package/types/src/Select/Option.d.ts +5 -1
- package/types/src/Select/OptionBase.d.ts +41 -23
- package/types/src/Select/SelectAllOption.d.ts +6 -2
- package/types/src/Select/SelectBase.d.ts +8 -34
- package/types/src/Slider/Slider.d.ts +7 -16
- package/types/src/SlidingPanels/SlidingPanels.d.ts +4 -3
- package/types/src/TabBar/TabBar.d.ts +10 -2
- package/types/src/TabBar/TabBarContext.d.ts +1 -0
- package/types/src/TabBar/docs/examples/IconsAbove.d.ts +2 -0
- package/types/src/TabBar/docs/examples/IconsLeft.d.ts +2 -0
- package/types/src/TabBar/docs/examples/VerticalIconsAbove.d.ts +2 -0
- package/types/src/TabBar/docs/examples/VerticalIconsLeft.d.ts +2 -0
- package/types/src/TabLayout/TabLayout.d.ts +4 -2
- package/types/src/Table/ExpandButton.d.ts +8 -0
- package/types/src/Table/HeadDropdownCell.d.ts +2 -0
- package/types/src/Table/HeadInner.d.ts +5 -1
- package/types/src/Table/Row.d.ts +8 -4
- package/types/src/Table/Table.d.ts +0 -2
- package/types/src/Table/docs/examples/Complex.d.ts +14 -3
- package/types/src/Text/Text.d.ts +2 -2
- package/types/src/TextArea/TextArea.d.ts +2 -2
- package/types/src/Tooltip/Tooltip.d.ts +38 -5
- package/types/src/Tooltip/docs/examples/CustomProps.d.ts +2 -0
- package/types/src/Tooltip/docs/examples/Toggletip.d.ts +2 -0
- package/types/src/Typography/Typography.d.ts +4 -2
- package/types/src/useControlled/useControlled.d.ts +5 -4
- package/useControlled.js +37 -15
- package/usePrevious.js +62 -30
- package/useRovingFocus.js +5 -4
- package/types/src/TabBar/docs/examples/IconsInline.d.ts +0 -2
- package/types/src/TabBar/docs/examples/IconsSmall.d.ts +0 -2
- package/types/src/TabBar/docs/examples/VerticalSmallIcons.d.ts +0 -2
- package/types/src/Table/docs/examples/prisma/Complex.d.ts +0 -48
- package/types/src/Table/icons/ExpansionRow.d.ts +0 -6
- package/types/src/Tooltip/docs/examples/CustomContent.d.ts +0 -2
- /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 =
|
|
12
|
-
/******/ var r =
|
|
13
|
-
/******/ () =>
|
|
14
|
-
/******/ : () =>
|
|
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 = (
|
|
27
|
-
/******/ for (var
|
|
28
|
-
/******/ if (e.o(r,
|
|
29
|
-
/******/ Object.defineProperty(
|
|
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[
|
|
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,
|
|
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
|
|
59
|
+
/************************************************************************/ var a = {};
|
|
60
60
|
// ESM COMPAT FLAG
|
|
61
|
-
e.r(
|
|
61
|
+
e.r(a);
|
|
62
62
|
// EXPORTS
|
|
63
|
-
e.d(
|
|
64
|
-
calendarActiveSelector: () => /* reexport */
|
|
65
|
-
default: () => /* reexport */
|
|
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
|
|
70
|
+
var t = e.n(r);
|
|
70
71
|
// CONCATENATED MODULE: external "prop-types"
|
|
71
|
-
const
|
|
72
|
-
var
|
|
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
|
|
81
|
-
var
|
|
75
|
+
const o = require("moment");
|
|
76
|
+
var i = e.n(o);
|
|
82
77
|
// CONCATENATED MODULE: external "@splunk/ui-utils/id"
|
|
83
|
-
const
|
|
78
|
+
const c = require("@splunk/ui-utils/id");
|
|
84
79
|
// CONCATENATED MODULE: external "lodash/times"
|
|
85
|
-
const
|
|
86
|
-
var
|
|
80
|
+
const u = require("lodash/times");
|
|
81
|
+
var s = e.n(u);
|
|
87
82
|
// CONCATENATED MODULE: external "@splunk/themes"
|
|
88
|
-
const
|
|
83
|
+
const d = require("@splunk/themes");
|
|
89
84
|
// CONCATENATED MODULE: external "@splunk/ui-utils/keyboard"
|
|
90
|
-
const
|
|
85
|
+
const v = require("@splunk/ui-utils/keyboard");
|
|
91
86
|
// CONCATENATED MODULE: external "@splunk/react-ui/ScreenReaderContent"
|
|
92
|
-
const
|
|
93
|
-
var
|
|
87
|
+
const f = require("@splunk/react-ui/ScreenReaderContent");
|
|
88
|
+
var p = e.n(f);
|
|
94
89
|
// CONCATENATED MODULE: external "styled-components"
|
|
95
|
-
const
|
|
96
|
-
var
|
|
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
|
|
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,
|
|
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
|
|
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
|
-
|
|
105
|
+
d.pick)({
|
|
111
106
|
enterprise: "1px solid transparent",
|
|
112
107
|
prisma: "none"
|
|
113
|
-
}), (0,
|
|
114
|
-
enterprise:
|
|
108
|
+
}), (0, d.pick)({
|
|
109
|
+
enterprise: d.variables.borderRadius,
|
|
115
110
|
prisma: "50%"
|
|
116
|
-
}), (0,
|
|
111
|
+
}), (0, d.pick)({
|
|
117
112
|
enterprise: {
|
|
118
|
-
light:
|
|
119
|
-
dark:
|
|
113
|
+
light: d.variables.gray45,
|
|
114
|
+
dark: d.variables.gray98
|
|
120
115
|
},
|
|
121
|
-
prisma:
|
|
122
|
-
}), (0,
|
|
116
|
+
prisma: d.variables.contentColorActive
|
|
117
|
+
}), (0, d.pick)({
|
|
123
118
|
enterprise: "2em",
|
|
124
119
|
prisma: "36px "
|
|
125
|
-
}), (0,
|
|
120
|
+
}), (0, d.pick)({
|
|
126
121
|
enterprise: "calc(2em - 2px)",
|
|
127
122
|
prisma: "36px"
|
|
128
123
|
}));
|
|
129
|
-
var
|
|
124
|
+
var b = h().td.withConfig({
|
|
130
125
|
displayName: "DayStyles__StyledCell",
|
|
131
126
|
componentId: "sc-1nryhyt-2"
|
|
132
|
-
})([ "", ";cursor:pointer;", ";", ";" ],
|
|
127
|
+
})([ "", ";cursor:pointer;", ";", ";" ], d.mixins.reset("table-cell"), (0, d.pickVariant)("$today", {
|
|
133
128
|
true: {
|
|
134
|
-
enterprise: (0,
|
|
135
|
-
|
|
136
|
-
light:
|
|
137
|
-
dark:
|
|
138
|
-
}), /* sc-sel */
|
|
139
|
-
prisma: (0,
|
|
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,
|
|
142
|
-
}), (0,
|
|
143
|
-
true: (0,
|
|
144
|
-
enterprise: (0,
|
|
145
|
-
prisma: (0,
|
|
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,
|
|
148
|
-
enterprise: (0,
|
|
149
|
-
prisma: (0,
|
|
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
|
|
154
|
-
return
|
|
155
|
-
for (var
|
|
156
|
-
var r = arguments[
|
|
157
|
-
for (var
|
|
158
|
-
({}).hasOwnProperty.call(r,
|
|
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
|
-
},
|
|
157
|
+
}, g.apply(null, arguments);
|
|
163
158
|
}
|
|
164
|
-
function
|
|
159
|
+
function M(e, a) {
|
|
165
160
|
if (null == e) return {};
|
|
166
|
-
var r,
|
|
161
|
+
var r, t, n = D(e, a);
|
|
167
162
|
if (Object.getOwnPropertySymbols) {
|
|
168
|
-
var
|
|
169
|
-
for (
|
|
170
|
-
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
|
|
168
|
+
return n;
|
|
174
169
|
}
|
|
175
|
-
function
|
|
170
|
+
function D(e, a) {
|
|
176
171
|
if (null == e) return {};
|
|
177
172
|
var r = {};
|
|
178
|
-
for (var
|
|
179
|
-
if ({}.hasOwnProperty.call(e,
|
|
180
|
-
if (
|
|
181
|
-
r[
|
|
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
|
|
187
|
-
active:
|
|
188
|
-
locale:
|
|
189
|
-
onClick:
|
|
190
|
-
onKeydown:
|
|
191
|
-
selected:
|
|
192
|
-
today:
|
|
193
|
-
value:
|
|
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
|
|
196
|
-
var
|
|
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
|
-
|
|
194
|
+
c === null || c === void 0 ? void 0 : c(e, {
|
|
200
195
|
value: p
|
|
201
196
|
});
|
|
202
|
-
}), [
|
|
203
|
-
var
|
|
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
|
|
204
|
+
var k = p && i()(p, "YYYY-MM-DD", o).format("D");
|
|
210
205
|
|
|
211
|
-
return
|
|
212
|
-
tabIndex:
|
|
213
|
-
"aria-selected":
|
|
214
|
-
"data-test-day":
|
|
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":
|
|
217
|
-
"data-is-today":
|
|
211
|
+
"data-active-day": n,
|
|
212
|
+
"data-is-today": f,
|
|
218
213
|
onClick: h,
|
|
219
|
-
onKeyDown:
|
|
220
|
-
$today:
|
|
221
|
-
$selected:
|
|
222
|
-
}, y),
|
|
214
|
+
onKeyDown: D,
|
|
215
|
+
$today: f,
|
|
216
|
+
$selected: d
|
|
217
|
+
}, y), t().createElement(m, null, t().createElement(Y, null, k)));
|
|
223
218
|
}
|
|
224
|
-
|
|
225
|
-
/* harmony default export */ const
|
|
219
|
+
w.propTypes = k;
|
|
220
|
+
/* harmony default export */ const C = w;
|
|
226
221
|
// CONCATENATED MODULE: ./src/Calendar/DateTableStyles.ts
|
|
227
|
-
var
|
|
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:", ";" ],
|
|
231
|
-
|
|
225
|
+
})([ "", ";table-layout:fixed;border-spacing:", ";width:", ";margin:", ";" ], d.mixins.reset("table"), (0,
|
|
226
|
+
d.pick)({
|
|
232
227
|
enterprise: "3px",
|
|
233
|
-
prisma:
|
|
234
|
-
}), (0,
|
|
228
|
+
prisma: d.variables.spacingSmall
|
|
229
|
+
}), (0, d.pick)({
|
|
235
230
|
enterprise: "100%",
|
|
236
231
|
prisma: "calc(100% + 16px)"
|
|
237
|
-
}), (0,
|
|
232
|
+
}), (0, d.pick)({
|
|
238
233
|
enterprise: "0",
|
|
239
234
|
prisma: "-8px"
|
|
240
235
|
}));
|
|
241
|
-
var
|
|
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:", ";" ],
|
|
245
|
-
|
|
239
|
+
})([ "", ";text-align:center;padding-bottom:", ";color:", ";font-size:", ";" ], d.mixins.reset("table-cell"), (0,
|
|
240
|
+
d.pick)({
|
|
246
241
|
enterprise: "2px",
|
|
247
|
-
prisma:
|
|
248
|
-
}),
|
|
249
|
-
enterprise:
|
|
250
|
-
prisma:
|
|
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
|
|
255
|
-
for (var
|
|
256
|
-
var r = arguments[
|
|
257
|
-
for (var
|
|
258
|
-
({}).hasOwnProperty.call(r,
|
|
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
|
-
},
|
|
257
|
+
}, x.apply(null, arguments);
|
|
263
258
|
}
|
|
264
|
-
function E(e,
|
|
259
|
+
function E(e, a) {
|
|
265
260
|
if (null == e) return {};
|
|
266
|
-
var r,
|
|
261
|
+
var r, t, n = I(e, a);
|
|
267
262
|
if (Object.getOwnPropertySymbols) {
|
|
268
|
-
var
|
|
269
|
-
for (
|
|
270
|
-
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
|
|
268
|
+
return n;
|
|
274
269
|
}
|
|
275
|
-
function I(e,
|
|
270
|
+
function I(e, a) {
|
|
276
271
|
if (null == e) return {};
|
|
277
272
|
var r = {};
|
|
278
|
-
for (var
|
|
279
|
-
if ({}.hasOwnProperty.call(e,
|
|
280
|
-
if (
|
|
281
|
-
r[
|
|
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
|
|
287
|
-
displayValue:
|
|
288
|
-
highlightToday:
|
|
289
|
-
labelledBy:
|
|
290
|
-
locale:
|
|
291
|
-
onChange:
|
|
292
|
-
onInternalChange:
|
|
293
|
-
selectedValue:
|
|
294
|
-
todayValue:
|
|
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
|
|
297
|
-
return
|
|
291
|
+
function j(e) {
|
|
292
|
+
return s()(e, (function(e) {
|
|
298
293
|
|
|
299
|
-
return
|
|
294
|
+
return t().createElement("td", {
|
|
300
295
|
key: "".concat(e)
|
|
301
296
|
});
|
|
302
297
|
}));
|
|
303
298
|
}
|
|
304
|
-
function
|
|
305
|
-
var
|
|
306
|
-
var
|
|
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 (
|
|
309
|
-
var y =
|
|
310
|
-
var h = y ===
|
|
311
|
-
var
|
|
312
|
-
var m = y ===
|
|
313
|
-
p.push(
|
|
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:
|
|
316
|
-
onClick:
|
|
317
|
-
onKeyDown:
|
|
310
|
+
locale: l,
|
|
311
|
+
onClick: o,
|
|
312
|
+
onKeyDown: c,
|
|
318
313
|
active: u ? m : h,
|
|
319
|
-
today:
|
|
314
|
+
today: n && h,
|
|
320
315
|
value: y,
|
|
321
|
-
selected:
|
|
316
|
+
selected: Y
|
|
322
317
|
}));
|
|
323
|
-
|
|
318
|
+
f.add(1, "day");
|
|
324
319
|
}
|
|
325
320
|
return p;
|
|
326
321
|
}
|
|
327
|
-
function
|
|
328
|
-
return e.reduce((function(e,
|
|
329
|
-
var
|
|
330
|
-
e[
|
|
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
|
-
}),
|
|
327
|
+
}), s()(7, (function() {
|
|
333
328
|
return [];
|
|
334
|
-
}))).map((function(e,
|
|
329
|
+
}))).map((function(e, a) {
|
|
335
330
|
|
|
336
331
|
// eslint-disable-next-line react/no-array-index-key
|
|
337
|
-
return
|
|
338
|
-
key: "$week-".concat(
|
|
332
|
+
return t().createElement("tr", {
|
|
333
|
+
key: "$week-".concat(a)
|
|
339
334
|
}, e);
|
|
340
335
|
}));
|
|
341
336
|
}
|
|
342
|
-
function
|
|
337
|
+
function P(e, a) {
|
|
343
338
|
|
|
344
|
-
return
|
|
345
|
-
var
|
|
346
|
-
var
|
|
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
|
|
349
|
-
key:
|
|
350
|
-
},
|
|
343
|
+
return t().createElement(O, {
|
|
344
|
+
key: n
|
|
345
|
+
}, t().createElement(p(), null, l), t().createElement("span", {
|
|
351
346
|
"aria-hidden": true
|
|
352
|
-
},
|
|
347
|
+
}, n));
|
|
353
348
|
}))));
|
|
354
349
|
}
|
|
355
|
-
function
|
|
356
|
-
var
|
|
357
|
-
var
|
|
358
|
-
var m =
|
|
359
|
-
var
|
|
360
|
-
var g =
|
|
361
|
-
var M =
|
|
362
|
-
var D =
|
|
363
|
-
var k = function e(
|
|
364
|
-
|
|
365
|
-
u === null || u === void 0 ? void 0 : u(
|
|
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(
|
|
368
|
-
var
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
value:
|
|
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
|
|
375
|
-
var
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
value:
|
|
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
|
|
382
|
-
var
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
value:
|
|
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
|
|
389
|
-
var
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
value:
|
|
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
|
|
396
|
-
var
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
value:
|
|
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
|
|
403
|
-
var
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
value:
|
|
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
|
|
410
|
-
var
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
value:
|
|
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
|
|
417
|
-
var
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
value:
|
|
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
|
|
424
|
-
var
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
value:
|
|
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
|
|
431
|
-
var
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
value:
|
|
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
|
|
438
|
-
var
|
|
439
|
-
switch (
|
|
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(
|
|
437
|
+
k(a, r);
|
|
443
438
|
break;
|
|
444
439
|
|
|
445
440
|
case "up":
|
|
446
|
-
|
|
441
|
+
O(a, r);
|
|
447
442
|
break;
|
|
448
443
|
|
|
449
444
|
case "down":
|
|
450
|
-
|
|
445
|
+
I(a, r);
|
|
451
446
|
break;
|
|
452
447
|
|
|
453
448
|
case "left":
|
|
454
|
-
w(
|
|
449
|
+
w(a, r);
|
|
455
450
|
break;
|
|
456
451
|
|
|
457
452
|
case "right":
|
|
458
|
-
|
|
453
|
+
C(a, r);
|
|
459
454
|
break;
|
|
460
455
|
|
|
461
456
|
case "page up":
|
|
462
|
-
if (
|
|
463
|
-
|
|
457
|
+
if (a.shiftKey) {
|
|
458
|
+
B(a, r);
|
|
464
459
|
} else {
|
|
465
|
-
|
|
460
|
+
_(a, r);
|
|
466
461
|
}
|
|
467
462
|
break;
|
|
468
463
|
|
|
469
464
|
case "page down":
|
|
470
|
-
if (
|
|
471
|
-
|
|
465
|
+
if (a.shiftKey) {
|
|
466
|
+
R(a, r);
|
|
472
467
|
} else {
|
|
473
|
-
|
|
468
|
+
V(a, r);
|
|
474
469
|
}
|
|
475
470
|
break;
|
|
476
471
|
|
|
477
472
|
case "home":
|
|
478
|
-
|
|
473
|
+
z(a, r);
|
|
479
474
|
break;
|
|
480
475
|
|
|
481
476
|
case "end":
|
|
482
|
-
|
|
477
|
+
A(a, r);
|
|
483
478
|
break;
|
|
484
479
|
|
|
485
480
|
default:
|
|
486
481
|
// do nothing
|
|
487
482
|
}
|
|
488
483
|
};
|
|
489
|
-
var
|
|
490
|
-
displayValue:
|
|
484
|
+
var K = j(M.format("e")).concat(q({
|
|
485
|
+
displayValue: a,
|
|
491
486
|
endDate: D,
|
|
492
|
-
highlightToday:
|
|
493
|
-
locale:
|
|
487
|
+
highlightToday: n,
|
|
488
|
+
locale: c,
|
|
494
489
|
onChange: u,
|
|
495
|
-
onKeyDown:
|
|
490
|
+
onKeyDown: N,
|
|
496
491
|
selectedDate: g,
|
|
497
|
-
selectedValue:
|
|
492
|
+
selectedValue: f,
|
|
498
493
|
startDate: M,
|
|
499
|
-
todayValue:
|
|
500
|
-
})).concat(
|
|
494
|
+
todayValue: p
|
|
495
|
+
})).concat(j(6 - D.format("e")));
|
|
501
496
|
|
|
502
|
-
return
|
|
497
|
+
return t().createElement(S, x({
|
|
503
498
|
role: "grid",
|
|
504
|
-
"aria-labelledby":
|
|
505
|
-
},
|
|
499
|
+
"aria-labelledby": l
|
|
500
|
+
}, y), P(c, m), t().createElement("tbody", null, T(K)));
|
|
506
501
|
}
|
|
507
|
-
|
|
508
|
-
/* harmony default export */ const
|
|
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
|
|
511
|
-
var
|
|
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
|
|
514
|
-
var
|
|
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
|
|
515
|
+
var U = e.n($);
|
|
518
516
|
// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/ChevronRight"
|
|
519
|
-
const
|
|
520
|
-
var
|
|
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
|
|
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
|
|
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;" ],
|
|
531
|
-
var
|
|
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
|
-
|
|
533
|
+
d.pick)({
|
|
536
534
|
enterprise: "capitalize",
|
|
537
535
|
prisma: "uppercase"
|
|
538
|
-
}), (0,
|
|
539
|
-
prisma: (0,
|
|
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
|
|
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,
|
|
546
|
+
var r, t, n = ae(e, a);
|
|
553
547
|
if (Object.getOwnPropertySymbols) {
|
|
554
|
-
var
|
|
555
|
-
for (
|
|
556
|
-
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
|
|
553
|
+
return n;
|
|
560
554
|
}
|
|
561
|
-
function
|
|
555
|
+
function ae(e, a) {
|
|
562
556
|
if (null == e) return {};
|
|
563
557
|
var r = {};
|
|
564
|
-
for (var
|
|
565
|
-
if ({}.hasOwnProperty.call(e,
|
|
566
|
-
if (
|
|
567
|
-
r[
|
|
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
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
782
|
-
|
|
783
|
-
|
|
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
|
|
786
|
-
var
|
|
657
|
+
const ce = require("@splunk/react-ui/Box");
|
|
658
|
+
var ue = e.n(ce);
|
|
787
659
|
// CONCATENATED MODULE: ./src/Calendar/CalendarStyles.ts
|
|
788
|
-
var
|
|
660
|
+
var se = h()(ue()).withConfig({
|
|
789
661
|
displayName: "CalendarStyles__StyledBox",
|
|
790
662
|
componentId: "sc-18925wt-0"
|
|
791
|
-
})([ "width:", ";padding:", ";" ], (0,
|
|
663
|
+
})([ "width:", ";padding:", ";" ], (0, d.pick)({
|
|
792
664
|
enterprise: "220px",
|
|
793
665
|
prisma: "332px"
|
|
794
|
-
}), (0,
|
|
666
|
+
}), (0, d.pick)({
|
|
795
667
|
enterprise: "8px",
|
|
796
|
-
prisma:
|
|
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
|
|
677
|
+
function de(e, a) {
|
|
806
678
|
if (e) {
|
|
807
679
|
if (typeof e === "function") {
|
|
808
|
-
e(
|
|
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 =
|
|
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
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
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
|
-
},
|
|
699
|
+
}, ve.apply(null, arguments);
|
|
836
700
|
}
|
|
837
|
-
function
|
|
838
|
-
|
|
701
|
+
function fe(e, a) {
|
|
702
|
+
return me(e) || Ye(e, a) || ye(e, a) || pe();
|
|
839
703
|
}
|
|
840
|
-
function
|
|
841
|
-
|
|
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
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
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
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
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
|
-
|
|
861
|
-
|
|
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
|
|
903
|
-
|
|
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
|
|
911
|
-
|
|
912
|
-
|
|
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
|
|
915
|
-
if (
|
|
916
|
-
var r =
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
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
|
|
766
|
+
return r;
|
|
923
767
|
}
|
|
924
|
-
var
|
|
925
|
-
var
|
|
926
|
-
describedBy:
|
|
927
|
-
highlightToday:
|
|
928
|
-
labelledBy:
|
|
929
|
-
locale:
|
|
930
|
-
|
|
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:
|
|
933
|
-
value:
|
|
934
|
-
elementRef:
|
|
777
|
+
required: l().bool,
|
|
778
|
+
value: l().string,
|
|
779
|
+
elementRef: l().oneOfType([ l().func, l().object ])
|
|
935
780
|
};
|
|
936
|
-
var
|
|
937
|
-
locale
|
|
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
|
|
941
|
-
|
|
942
|
-
|
|
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
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
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
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
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
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
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 =
|
|
870
|
+
module.exports = a;
|
|
1067
871
|
/******/})();
|