@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/Popover.js
CHANGED
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
e.r(t);
|
|
62
62
|
// EXPORTS
|
|
63
63
|
e.d(t, {
|
|
64
|
-
PopoverContext: () => /* reexport */
|
|
65
|
-
default: () => /* reexport */
|
|
64
|
+
PopoverContext: () => /* reexport */ z,
|
|
65
|
+
default: () => /* reexport */ ft
|
|
66
66
|
});
|
|
67
67
|
// CONCATENATED MODULE: external "react"
|
|
68
68
|
const r = require("react");
|
|
@@ -76,11 +76,11 @@
|
|
|
76
76
|
const l = require("lodash/clamp");
|
|
77
77
|
var c = e.n(l);
|
|
78
78
|
// CONCATENATED MODULE: external "lodash/defer"
|
|
79
|
-
const
|
|
80
|
-
var
|
|
79
|
+
const u = require("lodash/defer");
|
|
80
|
+
var f = e.n(u);
|
|
81
81
|
// CONCATENATED MODULE: external "lodash/every"
|
|
82
|
-
const
|
|
83
|
-
var p = e.n(
|
|
82
|
+
const s = require("lodash/every");
|
|
83
|
+
var p = e.n(s);
|
|
84
84
|
// CONCATENATED MODULE: external "lodash/has"
|
|
85
85
|
const h = require("lodash/has");
|
|
86
86
|
var d = e.n(h);
|
|
@@ -106,12 +106,12 @@
|
|
|
106
106
|
const k = require("lodash/throttle");
|
|
107
107
|
var x = e.n(k);
|
|
108
108
|
// CONCATENATED MODULE: external "@splunk/themes"
|
|
109
|
-
const
|
|
109
|
+
const T = require("@splunk/themes");
|
|
110
110
|
// CONCATENATED MODULE: external "@splunk/react-ui/Animation"
|
|
111
|
-
const
|
|
111
|
+
const A = require("@splunk/react-ui/Animation");
|
|
112
112
|
// CONCATENATED MODULE: external "@splunk/react-ui/EventListener"
|
|
113
|
-
const
|
|
114
|
-
var
|
|
113
|
+
const W = require("@splunk/react-ui/EventListener");
|
|
114
|
+
var q = e.n(W);
|
|
115
115
|
// CONCATENATED MODULE: external "@splunk/react-ui/Layer"
|
|
116
116
|
const M = require("@splunk/react-ui/Layer");
|
|
117
117
|
var R = e.n(M);
|
|
@@ -119,17 +119,17 @@
|
|
|
119
119
|
const H = require("@splunk/react-ui/ScrollContainerContext");
|
|
120
120
|
var _ = e.n(H);
|
|
121
121
|
// CONCATENATED MODULE: external "@splunk/ui-utils/focus"
|
|
122
|
-
const
|
|
122
|
+
const D = require("@splunk/ui-utils/focus");
|
|
123
123
|
// CONCATENATED MODULE: ./src/Popover/getPlacement.ts
|
|
124
|
-
function
|
|
124
|
+
function I(e) {
|
|
125
125
|
"@babel/helpers - typeof";
|
|
126
|
-
return
|
|
126
|
+
return I = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
127
127
|
return typeof e;
|
|
128
128
|
} : function(e) {
|
|
129
129
|
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
130
|
-
},
|
|
130
|
+
}, I(e);
|
|
131
131
|
}
|
|
132
|
-
function
|
|
132
|
+
function L(e, t) {
|
|
133
133
|
var r = Object.keys(e);
|
|
134
134
|
if (Object.getOwnPropertySymbols) {
|
|
135
135
|
var n = Object.getOwnPropertySymbols(e);
|
|
@@ -139,18 +139,18 @@
|
|
|
139
139
|
}
|
|
140
140
|
return r;
|
|
141
141
|
}
|
|
142
|
-
function
|
|
142
|
+
function F(e) {
|
|
143
143
|
for (var t = 1; t < arguments.length; t++) {
|
|
144
144
|
var r = null != arguments[t] ? arguments[t] : {};
|
|
145
|
-
t % 2 ?
|
|
146
|
-
|
|
147
|
-
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) :
|
|
145
|
+
t % 2 ? L(Object(r), !0).forEach((function(t) {
|
|
146
|
+
N(e, t, r[t]);
|
|
147
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : L(Object(r)).forEach((function(t) {
|
|
148
148
|
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(r, t));
|
|
149
149
|
}));
|
|
150
150
|
}
|
|
151
151
|
return e;
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function N(e, t, r) {
|
|
154
154
|
return (t = $(t)) in e ? Object.defineProperty(e, t, {
|
|
155
155
|
value: r,
|
|
156
156
|
enumerable: !0,
|
|
@@ -159,20 +159,20 @@
|
|
|
159
159
|
}) : e[t] = r, e;
|
|
160
160
|
}
|
|
161
161
|
function $(e) {
|
|
162
|
-
var t =
|
|
163
|
-
return "symbol" ==
|
|
162
|
+
var t = V(e, "string");
|
|
163
|
+
return "symbol" == I(t) ? t : t + "";
|
|
164
164
|
}
|
|
165
|
-
function
|
|
166
|
-
if ("object" !=
|
|
165
|
+
function V(e, t) {
|
|
166
|
+
if ("object" != I(e) || !e) return e;
|
|
167
167
|
var r = e[Symbol.toPrimitive];
|
|
168
168
|
if (void 0 !== r) {
|
|
169
169
|
var n = r.call(e, t || "default");
|
|
170
|
-
if ("object" !=
|
|
170
|
+
if ("object" != I(n)) return n;
|
|
171
171
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
172
172
|
}
|
|
173
173
|
return ("string" === t ? String : Number)(e);
|
|
174
174
|
}
|
|
175
|
-
function
|
|
175
|
+
function B(e) {
|
|
176
176
|
var t = e.align, r = e.anchorPos, n = e.outerContainerEl, o = e.padding, a = e.placement;
|
|
177
177
|
switch (a) {
|
|
178
178
|
case "above":
|
|
@@ -211,21 +211,21 @@
|
|
|
211
211
|
throw new Error("".concat(a, " is not a valid placement value. Valid options are: 'above', 'below', 'left', or 'right'"));
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
|
-
function
|
|
215
|
-
var t = e.align, r = e.anchorPos, n = e.scrollContainerPos, o = e.canCoverAnchor, a = e.defaultPlacement, i = e.outerContainerEl, l = e.padding, c = e.repositionMode,
|
|
216
|
-
var
|
|
214
|
+
function U(e) {
|
|
215
|
+
var t = e.align, r = e.anchorPos, n = e.scrollContainerPos, o = e.canCoverAnchor, a = e.defaultPlacement, i = e.outerContainerEl, l = e.padding, c = e.repositionMode, u = e.windowHeight, f = e.windowWidth;
|
|
216
|
+
var s = c === "flip";
|
|
217
217
|
var p = c === "any";
|
|
218
|
-
var h =
|
|
218
|
+
var h = s || p;
|
|
219
219
|
var d = e.placement || a;
|
|
220
220
|
// Translate vertical/horizontal to above/below/left/right
|
|
221
221
|
if (a === "vertical") {
|
|
222
|
-
d = r.top >
|
|
222
|
+
d = r.top > u - r.bottom ? "above" : "below";
|
|
223
223
|
} else if (a === "horizontal") {
|
|
224
|
-
d = r.left >
|
|
224
|
+
d = r.left > f - r.right ? "left" : "right";
|
|
225
225
|
}
|
|
226
226
|
var v = d;
|
|
227
227
|
// Initialize the result variables. These will be mutated as needed and returned.
|
|
228
|
-
var m =
|
|
228
|
+
var m = B({
|
|
229
229
|
align: t,
|
|
230
230
|
anchorPos: r,
|
|
231
231
|
outerContainerEl: i,
|
|
@@ -233,34 +233,34 @@
|
|
|
233
233
|
placement: v
|
|
234
234
|
}), b = m.top, y = m.left;
|
|
235
235
|
var g = "auto";
|
|
236
|
-
var w =
|
|
237
|
-
var S =
|
|
236
|
+
var w = f;
|
|
237
|
+
var S = u;
|
|
238
238
|
var O = v;
|
|
239
239
|
// Boolean convenience variables to simplify positioning logic.
|
|
240
240
|
var P = r.top - i.offsetHeight > 0;
|
|
241
|
-
var E = r.bottom + i.offsetHeight <
|
|
241
|
+
var E = r.bottom + i.offsetHeight < u;
|
|
242
242
|
var C = r.left - i.offsetWidth > 0;
|
|
243
|
-
var j = r.right + i.offsetWidth <
|
|
244
|
-
var k = r.top * .7 >
|
|
245
|
-
var x = (t === "edge" ? r.left + i.offsetWidth - l : r.middle + i.offsetWidth / 2) >
|
|
246
|
-
var
|
|
247
|
-
var
|
|
248
|
-
var
|
|
243
|
+
var j = r.right + i.offsetWidth < f;
|
|
244
|
+
var k = r.top * .7 > u - r.bottom;
|
|
245
|
+
var x = (t === "edge" ? r.left + i.offsetWidth - l : r.middle + i.offsetWidth / 2) > f;
|
|
246
|
+
var T = (t === "edge" ? r.left - l : r.middle - i.offsetWidth / 2) < 0;
|
|
247
|
+
var A = (t === "edge" ? r.top - l : r.top - i.offsetHeight / 2) < 0;
|
|
248
|
+
var W = (t === "edge" ? r.top + i.offsetHeight - l : r.bottom + i.offsetHeight / 2) > u;
|
|
249
249
|
// Handle each of the four placement options individually.
|
|
250
250
|
if (O === "above") {
|
|
251
251
|
if (!P && h) {
|
|
252
252
|
if (E) {
|
|
253
|
-
return
|
|
253
|
+
return U(F(F({}, e), {}, {
|
|
254
254
|
placement: "below"
|
|
255
255
|
}));
|
|
256
256
|
}
|
|
257
257
|
if (p && j) {
|
|
258
|
-
return
|
|
258
|
+
return U(F(F({}, e), {}, {
|
|
259
259
|
placement: "right"
|
|
260
260
|
}));
|
|
261
261
|
}
|
|
262
262
|
if (p && C) {
|
|
263
|
-
return
|
|
263
|
+
return U(F(F({}, e), {}, {
|
|
264
264
|
placement: "left"
|
|
265
265
|
}));
|
|
266
266
|
}
|
|
@@ -270,15 +270,15 @@
|
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
272
|
if (O !== "misaligned") {
|
|
273
|
-
g =
|
|
273
|
+
g = u - b - i.offsetHeight;
|
|
274
274
|
if (n) {
|
|
275
|
-
g = Math.min(g,
|
|
275
|
+
g = Math.min(g, u - n.top);
|
|
276
276
|
}
|
|
277
277
|
b = "auto";
|
|
278
278
|
}
|
|
279
279
|
if (x) {
|
|
280
|
-
y = Math.max(
|
|
281
|
-
} else if (
|
|
280
|
+
y = Math.max(f - i.offsetWidth, 0);
|
|
281
|
+
} else if (T) {
|
|
282
282
|
y = 0;
|
|
283
283
|
}
|
|
284
284
|
if (!o) {
|
|
@@ -288,17 +288,17 @@
|
|
|
288
288
|
if (O === "below") {
|
|
289
289
|
if (!E && h) {
|
|
290
290
|
if (P && k) {
|
|
291
|
-
return
|
|
291
|
+
return U(F(F({}, e), {}, {
|
|
292
292
|
placement: "above"
|
|
293
293
|
}));
|
|
294
294
|
}
|
|
295
295
|
if (p && j) {
|
|
296
|
-
return
|
|
296
|
+
return U(F(F({}, e), {}, {
|
|
297
297
|
placement: "right"
|
|
298
298
|
}));
|
|
299
299
|
}
|
|
300
300
|
if (p && C) {
|
|
301
|
-
return
|
|
301
|
+
return U(F(F({}, e), {}, {
|
|
302
302
|
placement: "left"
|
|
303
303
|
}));
|
|
304
304
|
}
|
|
@@ -311,28 +311,28 @@
|
|
|
311
311
|
b = Math.min(b, n.bottom);
|
|
312
312
|
}
|
|
313
313
|
if (x) {
|
|
314
|
-
y = Math.max(
|
|
315
|
-
} else if (
|
|
314
|
+
y = Math.max(f - i.offsetWidth, 0);
|
|
315
|
+
} else if (T) {
|
|
316
316
|
y = 0;
|
|
317
317
|
}
|
|
318
318
|
if (!o) {
|
|
319
|
-
S =
|
|
319
|
+
S = u - r.bottom;
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
322
|
if (O === "left") {
|
|
323
323
|
if (!C && h) {
|
|
324
324
|
if (j) {
|
|
325
|
-
return
|
|
325
|
+
return U(F(F({}, e), {}, {
|
|
326
326
|
placement: "right"
|
|
327
327
|
}));
|
|
328
328
|
}
|
|
329
329
|
if (p && E) {
|
|
330
|
-
return
|
|
330
|
+
return U(F(F({}, e), {}, {
|
|
331
331
|
placement: "below"
|
|
332
332
|
}));
|
|
333
333
|
}
|
|
334
334
|
if (p && P) {
|
|
335
|
-
return
|
|
335
|
+
return U(F(F({}, e), {}, {
|
|
336
336
|
placement: "above"
|
|
337
337
|
}));
|
|
338
338
|
}
|
|
@@ -341,10 +341,10 @@
|
|
|
341
341
|
b = 0;
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
|
-
if (
|
|
344
|
+
if (A) {
|
|
345
345
|
b = 0;
|
|
346
|
-
} else if (
|
|
347
|
-
b = Math.max(
|
|
346
|
+
} else if (W) {
|
|
347
|
+
b = Math.max(u - i.offsetHeight, 0);
|
|
348
348
|
}
|
|
349
349
|
if (!o) {
|
|
350
350
|
w = r.left;
|
|
@@ -353,17 +353,17 @@
|
|
|
353
353
|
if (O === "right") {
|
|
354
354
|
if (!j && h) {
|
|
355
355
|
if (C) {
|
|
356
|
-
return
|
|
356
|
+
return U(F(F({}, e), {}, {
|
|
357
357
|
placement: "left"
|
|
358
358
|
}));
|
|
359
359
|
}
|
|
360
360
|
if (p && E) {
|
|
361
|
-
return
|
|
361
|
+
return U(F(F({}, e), {}, {
|
|
362
362
|
placement: "below"
|
|
363
363
|
}));
|
|
364
364
|
}
|
|
365
365
|
if (p && P) {
|
|
366
|
-
return
|
|
366
|
+
return U(F(F({}, e), {}, {
|
|
367
367
|
placement: "above"
|
|
368
368
|
}));
|
|
369
369
|
}
|
|
@@ -372,13 +372,13 @@
|
|
|
372
372
|
b = 0;
|
|
373
373
|
}
|
|
374
374
|
}
|
|
375
|
-
if (
|
|
375
|
+
if (A) {
|
|
376
376
|
b = 0;
|
|
377
|
-
} else if (
|
|
378
|
-
b = Math.max(
|
|
377
|
+
} else if (W) {
|
|
378
|
+
b = Math.max(u - i.offsetHeight, 0);
|
|
379
379
|
}
|
|
380
380
|
if (!o) {
|
|
381
|
-
w =
|
|
381
|
+
w = f - r.left;
|
|
382
382
|
}
|
|
383
383
|
}
|
|
384
384
|
return {
|
|
@@ -393,25 +393,25 @@
|
|
|
393
393
|
};
|
|
394
394
|
}
|
|
395
395
|
// CONCATENATED MODULE: ./src/Popover/PopoverContext.tsx
|
|
396
|
-
var
|
|
396
|
+
var z = (0, r.createContext)({});
|
|
397
397
|
// CONCATENATED MODULE: external "react-spring"
|
|
398
398
|
const K = require("react-spring");
|
|
399
399
|
// CONCATENATED MODULE: external "styled-components"
|
|
400
400
|
const X = require("styled-components");
|
|
401
401
|
var Y = e.n(X);
|
|
402
402
|
// CONCATENATED MODULE: ./src/Popover/PopoverStyles.ts
|
|
403
|
-
var G = (0,
|
|
403
|
+
var G = (0, T.pick)({
|
|
404
404
|
enterprise: "8px",
|
|
405
405
|
prisma: 0
|
|
406
406
|
});
|
|
407
407
|
var J = Y()(K.animated.div).withConfig({
|
|
408
408
|
displayName: "PopoverStyles__Styled",
|
|
409
409
|
componentId: "sc-1nahsvw-0"
|
|
410
|
-
})([ "position:fixed;z-index:", ";left:-300%;top:-300%;" ],
|
|
410
|
+
})([ "position:fixed;z-index:", ";left:-300%;top:-300%;" ], T.variables.zindexPopover);
|
|
411
411
|
var Q = Y().div.withConfig({
|
|
412
412
|
displayName: "PopoverStyles__StyledBox",
|
|
413
413
|
componentId: "sc-1nahsvw-1"
|
|
414
|
-
})([ "", ";", ";", ";" ],
|
|
414
|
+
})([ "", ";", ";", ";" ], T.mixins.reset("block"), (function(e) {
|
|
415
415
|
var t = e.$open;
|
|
416
416
|
return !t && (0, X.css)([ "pointer-events:none;" ]);
|
|
417
417
|
}), (function(e) {
|
|
@@ -421,36 +421,36 @@
|
|
|
421
421
|
var Z = Y().div.withConfig({
|
|
422
422
|
displayName: "PopoverStyles__StyledContent",
|
|
423
423
|
componentId: "sc-1nahsvw-2"
|
|
424
|
-
})([ "border-radius:", ";background-color:", ";color:", ";", "" ],
|
|
425
|
-
|
|
426
|
-
normal:
|
|
424
|
+
})([ "border-radius:", ";background-color:", ";color:", ";", "" ], T.variables.borderRadius, (0,
|
|
425
|
+
T.pickVariant)("$appearance", {
|
|
426
|
+
normal: T.variables.backgroundColorPopup,
|
|
427
427
|
inverted: {
|
|
428
428
|
enterprise: {
|
|
429
|
-
light:
|
|
430
|
-
dark:
|
|
429
|
+
light: T.variables.gray20,
|
|
430
|
+
dark: T.variables.white
|
|
431
431
|
},
|
|
432
432
|
// These hex codes are the inverted values of variables.backgroundColorPopup which are not exposed as tokens
|
|
433
433
|
prisma: {
|
|
434
434
|
light: "#27292e",
|
|
435
|
-
dark:
|
|
435
|
+
dark: T.variables.white
|
|
436
436
|
}
|
|
437
437
|
}
|
|
438
|
-
}), (0,
|
|
439
|
-
normal:
|
|
438
|
+
}), (0, T.pickVariant)("$appearance", {
|
|
439
|
+
normal: T.variables.contentColorDefault,
|
|
440
440
|
inverted: {
|
|
441
441
|
enterprise: {
|
|
442
|
-
light:
|
|
443
|
-
dark:
|
|
442
|
+
light: T.variables.white,
|
|
443
|
+
dark: T.variables.gray30
|
|
444
444
|
},
|
|
445
|
-
prisma:
|
|
445
|
+
prisma: T.variables.contentColorInverted
|
|
446
446
|
}
|
|
447
|
-
}), (0,
|
|
448
|
-
normal: (0, X.css)([ "", ";" ], (0,
|
|
447
|
+
}), (0, T.pickVariant)("$appearance", {
|
|
448
|
+
normal: (0, X.css)([ "", ";" ], (0, T.pick)({
|
|
449
449
|
enterprise: {
|
|
450
|
-
light: (0, X.css)([ "box-shadow:0 2px 2px ", ";border:", ";" ],
|
|
451
|
-
dark: (0, X.css)([ "box-shadow:0 1px 2px #000;border:", ";" ],
|
|
450
|
+
light: (0, X.css)([ "box-shadow:0 2px 2px ", ";border:", ";" ], T.mixins.colorWithAlpha(T.variables.gray20, .1), T.variables.border),
|
|
451
|
+
dark: (0, X.css)([ "box-shadow:0 1px 2px #000;border:", ";" ], T.variables.border)
|
|
452
452
|
},
|
|
453
|
-
prisma: (0, X.css)([ "box-shadow:", ";" ],
|
|
453
|
+
prisma: (0, X.css)([ "box-shadow:", ";" ], T.variables.overlayShadow)
|
|
454
454
|
}))
|
|
455
455
|
}));
|
|
456
456
|
// Enterprise Only
|
|
@@ -458,50 +458,46 @@
|
|
|
458
458
|
displayName: "PopoverStyles__StyledArrow",
|
|
459
459
|
componentId: "sc-1nahsvw-3"
|
|
460
460
|
})([ "width:0;height:0;border-left:", " solid transparent;border-right:", " solid transparent;position:absolute;border-bottom-width:", ";border-bottom-style:solid;", "" ], G, G, G, (0,
|
|
461
|
-
|
|
461
|
+
T.pickVariant)("$appearance", {
|
|
462
462
|
normal: (0, X.css)([ "border-bottom-color:", ";&::before{content:'';display:block;width:0;height:0;border-left:", " solid transparent;border-right:", " solid transparent;border-bottom:", " solid ", ";position:absolute;top:1px;left:0;margin-left:-", ";}" ], (0,
|
|
463
|
-
|
|
464
|
-
light:
|
|
465
|
-
dark:
|
|
466
|
-
}), G, G, G,
|
|
467
|
-
inverted: (0, X.css)([ "border-bottom-color:", ";" ], (0,
|
|
468
|
-
light:
|
|
469
|
-
dark:
|
|
463
|
+
T.pick)({
|
|
464
|
+
light: T.variables.borderColor,
|
|
465
|
+
dark: T.variables.black
|
|
466
|
+
}), G, G, G, T.variables.backgroundColor, G),
|
|
467
|
+
inverted: (0, X.css)([ "border-bottom-color:", ";" ], (0, T.pick)({
|
|
468
|
+
light: T.variables.gray20,
|
|
469
|
+
dark: T.variables.white
|
|
470
470
|
}))
|
|
471
471
|
}));
|
|
472
|
-
var te = Y().
|
|
473
|
-
displayName: "PopoverStyles__StyledLowerRightCorner",
|
|
474
|
-
componentId: "sc-1nahsvw-4"
|
|
475
|
-
})([ "position:fixed;right:0;bottom:0;" ]);
|
|
476
|
-
var re = Y().svg.withConfig({
|
|
472
|
+
var te = Y().svg.withConfig({
|
|
477
473
|
displayName: "PopoverStyles__StyledHitArea",
|
|
478
|
-
componentId: "sc-1nahsvw-
|
|
474
|
+
componentId: "sc-1nahsvw-4"
|
|
479
475
|
})([ "position:fixed;pointer-events:none;path{pointer-events:auto;stroke-width:0;stroke:transparent;fill:transparent;}" ]);
|
|
480
476
|
// CONCATENATED MODULE: ./src/Popover/PopoverHitArea.tsx
|
|
481
|
-
function
|
|
482
|
-
return
|
|
477
|
+
function re(e, t) {
|
|
478
|
+
return le(e) || ie(e, t) || oe(e, t) || ne();
|
|
483
479
|
}
|
|
484
|
-
function
|
|
480
|
+
function ne() {
|
|
485
481
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
486
482
|
}
|
|
487
|
-
function
|
|
483
|
+
function oe(e, t) {
|
|
488
484
|
if (e) {
|
|
489
|
-
if ("string" == typeof e) return
|
|
485
|
+
if ("string" == typeof e) return ae(e, t);
|
|
490
486
|
var r = {}.toString.call(e).slice(8, -1);
|
|
491
|
-
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) ?
|
|
487
|
+
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) ? ae(e, t) : void 0;
|
|
492
488
|
}
|
|
493
489
|
}
|
|
494
|
-
function
|
|
490
|
+
function ae(e, t) {
|
|
495
491
|
(null == t || t > e.length) && (t = e.length);
|
|
496
492
|
for (var r = 0, n = Array(t); r < t; r++) {
|
|
497
493
|
n[r] = e[r];
|
|
498
494
|
}
|
|
499
495
|
return n;
|
|
500
496
|
}
|
|
501
|
-
function
|
|
497
|
+
function ie(e, t) {
|
|
502
498
|
var r = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
|
|
503
499
|
if (null != r) {
|
|
504
|
-
var n, o, a, i, l = [], c = !0,
|
|
500
|
+
var n, o, a, i, l = [], c = !0, u = !1;
|
|
505
501
|
try {
|
|
506
502
|
if (a = (r = r.call(e)).next, 0 === t) {
|
|
507
503
|
if (Object(r) !== r) return;
|
|
@@ -509,21 +505,21 @@
|
|
|
509
505
|
} else for (;!(c = (n = a.call(r)).done) && (l.push(n.value), l.length !== t); c = !0) {
|
|
510
506
|
}
|
|
511
507
|
} catch (e) {
|
|
512
|
-
|
|
508
|
+
u = !0, o = e;
|
|
513
509
|
} finally {
|
|
514
510
|
try {
|
|
515
511
|
if (!c && null != r["return"] && (i = r["return"](), Object(i) !== i)) return;
|
|
516
512
|
} finally {
|
|
517
|
-
if (
|
|
513
|
+
if (u) throw o;
|
|
518
514
|
}
|
|
519
515
|
}
|
|
520
516
|
return l;
|
|
521
517
|
}
|
|
522
518
|
}
|
|
523
|
-
function
|
|
519
|
+
function le(e) {
|
|
524
520
|
if (Array.isArray(e)) return e;
|
|
525
521
|
}
|
|
526
|
-
var
|
|
522
|
+
var ce = {
|
|
527
523
|
anchorRect: a().object,
|
|
528
524
|
popoverEl: a().object,
|
|
529
525
|
popoverPlacement: a().oneOf([ "above", "below", "left", "right", "misaligned" ])
|
|
@@ -540,13 +536,13 @@
|
|
|
540
536
|
l = 0;
|
|
541
537
|
c = r.height;
|
|
542
538
|
}
|
|
543
|
-
var
|
|
544
|
-
var
|
|
545
|
-
var
|
|
539
|
+
var u = "0 ".concat(l);
|
|
540
|
+
var f = "".concat(a.width, " ").concat(l);
|
|
541
|
+
var s = "".concat(i, " ").concat(l);
|
|
546
542
|
var p = "".concat(i, " ").concat(c);
|
|
547
543
|
var h = "".concat(i + r.width, " ").concat(l);
|
|
548
544
|
var d = "".concat(i + r.width, " ").concat(c);
|
|
549
|
-
var v = "\n M ".concat(
|
|
545
|
+
var v = "\n M ".concat(u, "\n S ").concat(s, " , ").concat(p, "\n L ").concat(s, "\n L ").concat(h, "\n L ").concat(d, "\n S ").concat(h, " , ").concat(f, "\n ");
|
|
550
546
|
return {
|
|
551
547
|
hitAreaPath: v,
|
|
552
548
|
hitAreaStyle: {
|
|
@@ -590,34 +586,34 @@
|
|
|
590
586
|
};
|
|
591
587
|
var fe = n().forwardRef((function(e, t) {
|
|
592
588
|
var o = e.anchorRect, a = e.popoverEl, i = e.popoverPlacement;
|
|
593
|
-
var l = (0, r.useState)(null), c =
|
|
594
|
-
var
|
|
589
|
+
var l = (0, r.useState)(null), c = re(l, 2), u = c[0], f = c[1];
|
|
590
|
+
var s = (0, r.useState)({}), p = re(s, 2), h = p[0], d = p[1];
|
|
595
591
|
(0, r.useEffect)((function() {
|
|
596
592
|
var e = ue({
|
|
597
593
|
anchorRect: o,
|
|
598
594
|
popoverEl: a,
|
|
599
595
|
popoverPlacement: i
|
|
600
596
|
}), t = e.hitAreaPath, r = e.hitAreaStyle;
|
|
601
|
-
|
|
597
|
+
f(t);
|
|
602
598
|
d(r);
|
|
603
599
|
}), [ o, a, i ]);
|
|
604
|
-
if (
|
|
600
|
+
if (u != null) {
|
|
605
601
|
|
|
606
|
-
return n().createElement(
|
|
602
|
+
return n().createElement(te, {
|
|
607
603
|
"data-test": "popover-hit-area",
|
|
608
604
|
style: h
|
|
609
605
|
}, n().createElement("path", {
|
|
610
|
-
d:
|
|
606
|
+
d: u,
|
|
611
607
|
ref: t
|
|
612
608
|
}));
|
|
613
609
|
}
|
|
614
610
|
return null;
|
|
615
611
|
}));
|
|
616
|
-
fe.propTypes =
|
|
617
|
-
/* harmony default export */ const
|
|
612
|
+
fe.propTypes = ce;
|
|
613
|
+
/* harmony default export */ const se = fe;
|
|
618
614
|
// CONCATENATED MODULE: ./src/utils/ssrDocument.ts
|
|
619
615
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
620
|
-
var
|
|
616
|
+
var pe = {
|
|
621
617
|
body: {
|
|
622
618
|
appendChild: function e() {
|
|
623
619
|
return [];
|
|
@@ -671,14 +667,14 @@
|
|
|
671
667
|
search: ""
|
|
672
668
|
}
|
|
673
669
|
};
|
|
674
|
-
function
|
|
675
|
-
var e = typeof document !== "undefined" ? document :
|
|
670
|
+
function he() {
|
|
671
|
+
var e = typeof document !== "undefined" ? document : pe;
|
|
676
672
|
return e;
|
|
677
673
|
}
|
|
678
674
|
// CONCATENATED MODULE: ./src/utils/ssrWindow.ts
|
|
679
675
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
680
|
-
var
|
|
681
|
-
document:
|
|
676
|
+
var de = {
|
|
677
|
+
document: pe,
|
|
682
678
|
navigator: {
|
|
683
679
|
userAgent: ""
|
|
684
680
|
},
|
|
@@ -732,20 +728,20 @@
|
|
|
732
728
|
clearTimeout(t);
|
|
733
729
|
}
|
|
734
730
|
};
|
|
735
|
-
function
|
|
736
|
-
var e = typeof window !== "undefined" ? window :
|
|
731
|
+
function ve() {
|
|
732
|
+
var e = typeof window !== "undefined" ? window : de;
|
|
737
733
|
return e;
|
|
738
734
|
}
|
|
739
735
|
// CONCATENATED MODULE: ./src/utils/getBoundingClientRect.ts
|
|
740
|
-
function
|
|
736
|
+
function me(e) {
|
|
741
737
|
"@babel/helpers - typeof";
|
|
742
|
-
return
|
|
738
|
+
return me = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
743
739
|
return typeof e;
|
|
744
740
|
} : function(e) {
|
|
745
741
|
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
746
|
-
},
|
|
742
|
+
}, me(e);
|
|
747
743
|
}
|
|
748
|
-
function
|
|
744
|
+
function be(e, t) {
|
|
749
745
|
var r = Object.keys(e);
|
|
750
746
|
if (Object.getOwnPropertySymbols) {
|
|
751
747
|
var n = Object.getOwnPropertySymbols(e);
|
|
@@ -755,46 +751,46 @@
|
|
|
755
751
|
}
|
|
756
752
|
return r;
|
|
757
753
|
}
|
|
758
|
-
function
|
|
754
|
+
function ye(e) {
|
|
759
755
|
for (var t = 1; t < arguments.length; t++) {
|
|
760
756
|
var r = null != arguments[t] ? arguments[t] : {};
|
|
761
|
-
t % 2 ?
|
|
762
|
-
|
|
763
|
-
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) :
|
|
757
|
+
t % 2 ? be(Object(r), !0).forEach((function(t) {
|
|
758
|
+
ge(e, t, r[t]);
|
|
759
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : be(Object(r)).forEach((function(t) {
|
|
764
760
|
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(r, t));
|
|
765
761
|
}));
|
|
766
762
|
}
|
|
767
763
|
return e;
|
|
768
764
|
}
|
|
769
|
-
function
|
|
770
|
-
return (t =
|
|
765
|
+
function ge(e, t, r) {
|
|
766
|
+
return (t = we(t)) in e ? Object.defineProperty(e, t, {
|
|
771
767
|
value: r,
|
|
772
768
|
enumerable: !0,
|
|
773
769
|
configurable: !0,
|
|
774
770
|
writable: !0
|
|
775
771
|
}) : e[t] = r, e;
|
|
776
772
|
}
|
|
777
|
-
function
|
|
778
|
-
var t =
|
|
779
|
-
return "symbol" ==
|
|
773
|
+
function we(e) {
|
|
774
|
+
var t = Se(e, "string");
|
|
775
|
+
return "symbol" == me(t) ? t : t + "";
|
|
780
776
|
}
|
|
781
|
-
function
|
|
782
|
-
if ("object" !=
|
|
777
|
+
function Se(e, t) {
|
|
778
|
+
if ("object" != me(e) || !e) return e;
|
|
783
779
|
var r = e[Symbol.toPrimitive];
|
|
784
780
|
if (void 0 !== r) {
|
|
785
781
|
var n = r.call(e, t || "default");
|
|
786
|
-
if ("object" !=
|
|
782
|
+
if ("object" != me(n)) return n;
|
|
787
783
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
788
784
|
}
|
|
789
785
|
return ("string" === t ? String : Number)(e);
|
|
790
786
|
}
|
|
791
787
|
// Checks if browser is Safari
|
|
792
|
-
function
|
|
788
|
+
function Oe() {
|
|
793
789
|
return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
794
790
|
}
|
|
795
791
|
// Formats return value to DOMRect
|
|
796
|
-
function
|
|
797
|
-
return
|
|
792
|
+
function Pe(e) {
|
|
793
|
+
return ye(ye({}, e), {}, {
|
|
798
794
|
top: e.y,
|
|
799
795
|
left: e.x,
|
|
800
796
|
right: e.x + e.width,
|
|
@@ -808,20 +804,20 @@
|
|
|
808
804
|
* @param {boolean} offsets - Use when position of element relative to the layout viewport offsets are needed for Safari.
|
|
809
805
|
* @returns {Omit<DOMRect, 'toJSON'>}
|
|
810
806
|
* @public
|
|
811
|
-
*/ function
|
|
807
|
+
*/ function Ee(e, t) {
|
|
812
808
|
var r, n;
|
|
813
809
|
var o = e.getBoundingClientRect();
|
|
814
|
-
var a =
|
|
810
|
+
var a = Oe();
|
|
815
811
|
if (!t || !a) {
|
|
816
812
|
return o;
|
|
817
813
|
}
|
|
818
|
-
var i =
|
|
814
|
+
var i = ve();
|
|
819
815
|
var l = o.left + (((r = i.visualViewport) === null || r === void 0 ? void 0 : r.offsetLeft) || 0);
|
|
820
816
|
var c = o.top + (((n = i.visualViewport) === null || n === void 0 ? void 0 : n.offsetTop) || 0);
|
|
821
|
-
var
|
|
822
|
-
return
|
|
823
|
-
width:
|
|
824
|
-
height:
|
|
817
|
+
var u = o.width, f = o.height;
|
|
818
|
+
return Pe({
|
|
819
|
+
width: u,
|
|
820
|
+
height: f,
|
|
825
821
|
x: l,
|
|
826
822
|
y: c
|
|
827
823
|
});
|
|
@@ -833,7 +829,7 @@
|
|
|
833
829
|
* @param ref - The React callback or object ref. Can be `null` or `undefined`.
|
|
834
830
|
* @param current - The new value of the ref.
|
|
835
831
|
*/
|
|
836
|
-
function
|
|
832
|
+
function Ce(e, t) {
|
|
837
833
|
if (e) {
|
|
838
834
|
if (typeof e === "function") {
|
|
839
835
|
e(t);
|
|
@@ -846,16 +842,16 @@
|
|
|
846
842
|
}
|
|
847
843
|
}
|
|
848
844
|
// CONCATENATED MODULE: ./src/Popover/Popover.tsx
|
|
849
|
-
function
|
|
845
|
+
function je(e) {
|
|
850
846
|
"@babel/helpers - typeof";
|
|
851
|
-
return
|
|
847
|
+
return je = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
852
848
|
return typeof e;
|
|
853
849
|
} : function(e) {
|
|
854
850
|
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
855
|
-
},
|
|
851
|
+
}, je(e);
|
|
856
852
|
}
|
|
857
|
-
function
|
|
858
|
-
return
|
|
853
|
+
function ke() {
|
|
854
|
+
return ke = Object.assign ? Object.assign.bind() : function(e) {
|
|
859
855
|
for (var t = 1; t < arguments.length; t++) {
|
|
860
856
|
var r = arguments[t];
|
|
861
857
|
for (var n in r) {
|
|
@@ -863,21 +859,21 @@
|
|
|
863
859
|
}
|
|
864
860
|
}
|
|
865
861
|
return e;
|
|
866
|
-
},
|
|
862
|
+
}, ke.apply(null, arguments);
|
|
867
863
|
}
|
|
868
|
-
function
|
|
869
|
-
return We(e) ||
|
|
864
|
+
function xe(e) {
|
|
865
|
+
return We(e) || Ae(e) || _e(e) || Te();
|
|
870
866
|
}
|
|
871
867
|
function Te() {
|
|
872
868
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
873
869
|
}
|
|
874
|
-
function
|
|
870
|
+
function Ae(e) {
|
|
875
871
|
if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"]) return Array.from(e);
|
|
876
872
|
}
|
|
877
873
|
function We(e) {
|
|
878
874
|
if (Array.isArray(e)) return De(e);
|
|
879
875
|
}
|
|
880
|
-
function
|
|
876
|
+
function qe(e, t) {
|
|
881
877
|
var r = Object.keys(e);
|
|
882
878
|
if (Object.getOwnPropertySymbols) {
|
|
883
879
|
var n = Object.getOwnPropertySymbols(e);
|
|
@@ -887,24 +883,24 @@
|
|
|
887
883
|
}
|
|
888
884
|
return r;
|
|
889
885
|
}
|
|
890
|
-
function
|
|
886
|
+
function Me(e) {
|
|
891
887
|
for (var t = 1; t < arguments.length; t++) {
|
|
892
888
|
var r = null != arguments[t] ? arguments[t] : {};
|
|
893
|
-
t % 2 ?
|
|
894
|
-
|
|
895
|
-
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) :
|
|
889
|
+
t % 2 ? qe(Object(r), !0).forEach((function(t) {
|
|
890
|
+
Ge(e, t, r[t]);
|
|
891
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : qe(Object(r)).forEach((function(t) {
|
|
896
892
|
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(r, t));
|
|
897
893
|
}));
|
|
898
894
|
}
|
|
899
895
|
return e;
|
|
900
896
|
}
|
|
901
|
-
function
|
|
902
|
-
return
|
|
897
|
+
function Re(e, t) {
|
|
898
|
+
return Le(e) || Ie(e, t) || _e(e, t) || He();
|
|
903
899
|
}
|
|
904
|
-
function
|
|
900
|
+
function He() {
|
|
905
901
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
906
902
|
}
|
|
907
|
-
function
|
|
903
|
+
function _e(e, t) {
|
|
908
904
|
if (e) {
|
|
909
905
|
if ("string" == typeof e) return De(e, t);
|
|
910
906
|
var r = {}.toString.call(e).slice(8, -1);
|
|
@@ -921,7 +917,7 @@
|
|
|
921
917
|
function Ie(e, t) {
|
|
922
918
|
var r = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
|
|
923
919
|
if (null != r) {
|
|
924
|
-
var n, o, a, i, l = [], c = !0,
|
|
920
|
+
var n, o, a, i, l = [], c = !0, u = !1;
|
|
925
921
|
try {
|
|
926
922
|
if (a = (r = r.call(e)).next, 0 === t) {
|
|
927
923
|
if (Object(r) !== r) return;
|
|
@@ -929,32 +925,32 @@
|
|
|
929
925
|
} else for (;!(c = (n = a.call(r)).done) && (l.push(n.value), l.length !== t); c = !0) {
|
|
930
926
|
}
|
|
931
927
|
} catch (e) {
|
|
932
|
-
|
|
928
|
+
u = !0, o = e;
|
|
933
929
|
} finally {
|
|
934
930
|
try {
|
|
935
931
|
if (!c && null != r["return"] && (i = r["return"](), Object(i) !== i)) return;
|
|
936
932
|
} finally {
|
|
937
|
-
if (
|
|
933
|
+
if (u) throw o;
|
|
938
934
|
}
|
|
939
935
|
}
|
|
940
936
|
return l;
|
|
941
937
|
}
|
|
942
938
|
}
|
|
943
|
-
function
|
|
939
|
+
function Le(e) {
|
|
944
940
|
if (Array.isArray(e)) return e;
|
|
945
941
|
}
|
|
946
942
|
function Fe(e, t) {
|
|
947
943
|
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
948
944
|
}
|
|
949
|
-
function
|
|
945
|
+
function Ne(e, t) {
|
|
950
946
|
for (var r = 0; r < t.length; r++) {
|
|
951
947
|
var n = t[r];
|
|
952
948
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
|
|
953
|
-
Object.defineProperty(e,
|
|
949
|
+
Object.defineProperty(e, Je(n.key), n);
|
|
954
950
|
}
|
|
955
951
|
}
|
|
956
|
-
function
|
|
957
|
-
return t &&
|
|
952
|
+
function $e(e, t, r) {
|
|
953
|
+
return t && Ne(e.prototype, t), r && Ne(e, r), Object.defineProperty(e, "prototype", {
|
|
958
954
|
writable: !1
|
|
959
955
|
}), e;
|
|
960
956
|
}
|
|
@@ -976,56 +972,56 @@
|
|
|
976
972
|
}, Be(e, t);
|
|
977
973
|
}
|
|
978
974
|
function Ue(e) {
|
|
979
|
-
var t =
|
|
975
|
+
var t = Xe();
|
|
980
976
|
return function() {
|
|
981
|
-
var r, n =
|
|
977
|
+
var r, n = Ye(e);
|
|
982
978
|
if (t) {
|
|
983
|
-
var o =
|
|
979
|
+
var o = Ye(this).constructor;
|
|
984
980
|
r = Reflect.construct(n, arguments, o);
|
|
985
981
|
} else r = n.apply(this, arguments);
|
|
986
|
-
return
|
|
982
|
+
return ze(this, r);
|
|
987
983
|
};
|
|
988
984
|
}
|
|
989
|
-
function
|
|
990
|
-
if (t && ("object" ==
|
|
985
|
+
function ze(e, t) {
|
|
986
|
+
if (t && ("object" == je(t) || "function" == typeof t)) return t;
|
|
991
987
|
if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
|
|
992
|
-
return
|
|
988
|
+
return Ke(e);
|
|
993
989
|
}
|
|
994
|
-
function
|
|
990
|
+
function Ke(e) {
|
|
995
991
|
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
996
992
|
return e;
|
|
997
993
|
}
|
|
998
|
-
function
|
|
994
|
+
function Xe() {
|
|
999
995
|
try {
|
|
1000
996
|
var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
|
|
1001
997
|
} catch (e) {}
|
|
1002
|
-
return (
|
|
998
|
+
return (Xe = function t() {
|
|
1003
999
|
return !!e;
|
|
1004
1000
|
})();
|
|
1005
1001
|
}
|
|
1006
|
-
function
|
|
1007
|
-
return
|
|
1002
|
+
function Ye(e) {
|
|
1003
|
+
return Ye = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
|
|
1008
1004
|
return e.__proto__ || Object.getPrototypeOf(e);
|
|
1009
|
-
},
|
|
1005
|
+
}, Ye(e);
|
|
1010
1006
|
}
|
|
1011
|
-
function
|
|
1012
|
-
return (t =
|
|
1007
|
+
function Ge(e, t, r) {
|
|
1008
|
+
return (t = Je(t)) in e ? Object.defineProperty(e, t, {
|
|
1013
1009
|
value: r,
|
|
1014
1010
|
enumerable: !0,
|
|
1015
1011
|
configurable: !0,
|
|
1016
1012
|
writable: !0
|
|
1017
1013
|
}) : e[t] = r, e;
|
|
1018
1014
|
}
|
|
1019
|
-
function
|
|
1020
|
-
var t =
|
|
1021
|
-
return "symbol" ==
|
|
1015
|
+
function Je(e) {
|
|
1016
|
+
var t = Qe(e, "string");
|
|
1017
|
+
return "symbol" == je(t) ? t : t + "";
|
|
1022
1018
|
}
|
|
1023
|
-
function
|
|
1024
|
-
if ("object" !=
|
|
1019
|
+
function Qe(e, t) {
|
|
1020
|
+
if ("object" != je(e) || !e) return e;
|
|
1025
1021
|
var r = e[Symbol.toPrimitive];
|
|
1026
1022
|
if (void 0 !== r) {
|
|
1027
1023
|
var n = r.call(e, t || "default");
|
|
1028
|
-
if ("object" !=
|
|
1024
|
+
if ("object" != je(n)) return n;
|
|
1029
1025
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1030
1026
|
}
|
|
1031
1027
|
return ("string" === t ? String : Number)(e);
|
|
@@ -1034,8 +1030,8 @@
|
|
|
1034
1030
|
/** @public */
|
|
1035
1031
|
/** @public */
|
|
1036
1032
|
/** @public */
|
|
1037
|
-
/** @public */ var
|
|
1038
|
-
var
|
|
1033
|
+
/** @public */ var Ze = [ "clickAway", "escapeKey", "offScreen", "tabKey" ];
|
|
1034
|
+
var et = {
|
|
1039
1035
|
align: a().oneOf([ "center", "edge", "theme", "end" ]),
|
|
1040
1036
|
anchor: a().object,
|
|
1041
1037
|
animation: a().bool,
|
|
@@ -1044,7 +1040,7 @@
|
|
|
1044
1040
|
autoCloseWhenOffScreen: a().bool,
|
|
1045
1041
|
canCoverAnchor: a().bool,
|
|
1046
1042
|
children: a().oneOfType([ a().node, a().func ]),
|
|
1047
|
-
closeReasons: a().arrayOf(a().oneOf(
|
|
1043
|
+
closeReasons: a().arrayOf(a().oneOf(Ze)),
|
|
1048
1044
|
defaultPlacement: a().oneOf([ "above", "below", "left", "right", "vertical", "horizontal" ]),
|
|
1049
1045
|
elementRef: a().oneOfType([ a().func, a().object ]),
|
|
1050
1046
|
id: a().string,
|
|
@@ -1061,20 +1057,24 @@
|
|
|
1061
1057
|
takeFocus: a().bool,
|
|
1062
1058
|
splunkTheme: a().object
|
|
1063
1059
|
};
|
|
1064
|
-
var
|
|
1060
|
+
var tt = {
|
|
1065
1061
|
align: "theme",
|
|
1066
1062
|
animation: true,
|
|
1067
1063
|
animationConfig: {},
|
|
1068
1064
|
appearance: "normal",
|
|
1069
1065
|
autoCloseWhenOffScreen: true,
|
|
1070
1066
|
canCoverAnchor: false,
|
|
1071
|
-
closeReasons:
|
|
1067
|
+
closeReasons: Ze,
|
|
1072
1068
|
defaultPlacement: "below",
|
|
1073
1069
|
open: false,
|
|
1074
1070
|
repositionMode: "flip",
|
|
1075
1071
|
retainFocus: true,
|
|
1076
1072
|
takeFocus: false
|
|
1077
1073
|
};
|
|
1074
|
+
var rt = {
|
|
1075
|
+
passive: false,
|
|
1076
|
+
capture: true
|
|
1077
|
+
};
|
|
1078
1078
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
1079
1079
|
function nt(e, t) {
|
|
1080
1080
|
var r = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
@@ -1086,76 +1086,105 @@
|
|
|
1086
1086
|
}));
|
|
1087
1087
|
}
|
|
1088
1088
|
function ot(e) {
|
|
1089
|
+
var t = e.anchorPos, r = e.arrowHeight, n = e.placement, o = e.outerContainerStyle, a = e.outerContainerEl;
|
|
1090
|
+
if (n === "misaligned") {
|
|
1091
|
+
return [ {
|
|
1092
|
+
display: "none"
|
|
1093
|
+
} ];
|
|
1094
|
+
}
|
|
1095
|
+
var i = {
|
|
1096
|
+
display: "block"
|
|
1097
|
+
};
|
|
1098
|
+
var l = a.offsetHeight / 2 - 22;
|
|
1099
|
+
var u = -(a.offsetHeight / 2 - 15);
|
|
1100
|
+
var f = t.center - (o.top + a.offsetHeight / 2) - r / 2;
|
|
1101
|
+
var s = c()(f, u, l);
|
|
1102
|
+
var p = t.middle - (o.left + a.offsetWidth / 2) - r;
|
|
1103
|
+
var h = {
|
|
1104
|
+
left: {
|
|
1105
|
+
translateX: r / 2,
|
|
1106
|
+
translateY: s,
|
|
1107
|
+
rotate: 90
|
|
1108
|
+
},
|
|
1109
|
+
right: {
|
|
1110
|
+
translateX: -r / 2,
|
|
1111
|
+
translateY: s,
|
|
1112
|
+
rotate: -90
|
|
1113
|
+
},
|
|
1114
|
+
above: {
|
|
1115
|
+
translateX: p,
|
|
1116
|
+
translateY: 0,
|
|
1117
|
+
rotate: 180
|
|
1118
|
+
},
|
|
1119
|
+
below: {
|
|
1120
|
+
translateX: p,
|
|
1121
|
+
translateY: 0,
|
|
1122
|
+
rotate: 0
|
|
1123
|
+
}
|
|
1124
|
+
};
|
|
1125
|
+
var d = h[n];
|
|
1126
|
+
i.transform = "translate(".concat(d.translateX, "px, ").concat(d.translateY, "px) rotate(").concat(d.rotate, "deg)");
|
|
1127
|
+
// set new positions
|
|
1128
|
+
var v = {
|
|
1129
|
+
left: "right",
|
|
1130
|
+
right: "left",
|
|
1131
|
+
above: "bottom",
|
|
1132
|
+
below: "top"
|
|
1133
|
+
};
|
|
1134
|
+
i[v[n]] = "1px";
|
|
1135
|
+
var m = {
|
|
1136
|
+
left: "top",
|
|
1137
|
+
right: "top",
|
|
1138
|
+
above: "left",
|
|
1139
|
+
below: "left"
|
|
1140
|
+
};
|
|
1141
|
+
i[m[n]] = "50%";
|
|
1142
|
+
return [ i, d ];
|
|
1143
|
+
}
|
|
1144
|
+
function at(e) {
|
|
1145
|
+
var t = e.anchorEl, r = e.offsets, n = r === void 0 ? false : r, o = e.pointTo;
|
|
1146
|
+
var a = Ee(t, n);
|
|
1147
|
+
var i = {
|
|
1148
|
+
// these are rounded to avoid causing visual regressions
|
|
1149
|
+
// they were previously clientWidth and clientHeight which were already rounded
|
|
1150
|
+
width: Math.round(a.width),
|
|
1151
|
+
height: Math.round(a.height)
|
|
1152
|
+
};
|
|
1153
|
+
var l = o && d()(o, "x");
|
|
1154
|
+
var c = o && d()(o, "y");
|
|
1155
|
+
i.left = l ? a.left + ((o === null || o === void 0 ? void 0 : o.x) || 0) : a.left;
|
|
1156
|
+
i.top = c ? a.top + ((o === null || o === void 0 ? void 0 : o.y) || 0) : a.top;
|
|
1157
|
+
i.right = l ? i.left + i.width : a.left + i.width || a.right;
|
|
1158
|
+
i.bottom = c ? i.top + i.height : a.top + i.height || a.bottom;
|
|
1159
|
+
i.middle = l ? i.left : a.left + (i.right - a.left) / 2;
|
|
1160
|
+
i.center = c ? i.top : a.top + (i.bottom - a.top) / 2;
|
|
1161
|
+
return i;
|
|
1162
|
+
}
|
|
1163
|
+
function it(e) {
|
|
1089
1164
|
return e !== window && e !== window.document;
|
|
1090
1165
|
}
|
|
1166
|
+
function lt(e, t) {
|
|
1167
|
+
var r = ve();
|
|
1168
|
+
if (e.top < 0 || e.top > r.innerHeight || e.left < 0 || e.left > r.innerWidth) {
|
|
1169
|
+
return true;
|
|
1170
|
+
}
|
|
1171
|
+
if (t) {
|
|
1172
|
+
if (e.height + e.top < t.top || e.top > t.bottom || e.width + e.left < t.left || e.left > t.right) {
|
|
1173
|
+
return true;
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
return false;
|
|
1177
|
+
}
|
|
1091
1178
|
/**
|
|
1092
1179
|
* `Popover` is used to create layovers such as dropdowns, contextual menus, or tooltips. Use
|
|
1093
1180
|
* this only when the other components don't provide sufficient functionality or control. A controlled
|
|
1094
1181
|
* `Dropdown` covers use cases where you might consider using `Popover` directly.
|
|
1095
|
-
*/ var
|
|
1182
|
+
*/ var ct = function(e) {
|
|
1096
1183
|
Ve(r, e);
|
|
1097
1184
|
var t = Ue(r);
|
|
1098
|
-
|
|
1099
|
-
key: "getArrowStyle",
|
|
1100
|
-
// @docs-props-type PopoverPropsBase
|
|
1101
|
-
value: function e(t) {
|
|
1102
|
-
var r = t.anchorPos, n = t.arrowHeight, o = t.placement, a = t.outerContainerStyle, i = t.outerContainerEl;
|
|
1103
|
-
if (o === "misaligned") {
|
|
1104
|
-
return [ {
|
|
1105
|
-
display: "none"
|
|
1106
|
-
} ];
|
|
1107
|
-
}
|
|
1108
|
-
var l = {
|
|
1109
|
-
display: "block"
|
|
1110
|
-
};
|
|
1111
|
-
var s = i.offsetHeight / 2 - 22;
|
|
1112
|
-
var u = -(i.offsetHeight / 2 - 15);
|
|
1113
|
-
var f = r.center - (a.top + i.offsetHeight / 2) - n / 2;
|
|
1114
|
-
var p = c()(f, u, s);
|
|
1115
|
-
var h = r.middle - (a.left + i.offsetWidth / 2) - n;
|
|
1116
|
-
var d = {
|
|
1117
|
-
left: {
|
|
1118
|
-
translateX: n / 2,
|
|
1119
|
-
translateY: p,
|
|
1120
|
-
rotate: 90
|
|
1121
|
-
},
|
|
1122
|
-
right: {
|
|
1123
|
-
translateX: -n / 2,
|
|
1124
|
-
translateY: p,
|
|
1125
|
-
rotate: -90
|
|
1126
|
-
},
|
|
1127
|
-
above: {
|
|
1128
|
-
translateX: h,
|
|
1129
|
-
translateY: 0,
|
|
1130
|
-
rotate: 180
|
|
1131
|
-
},
|
|
1132
|
-
below: {
|
|
1133
|
-
translateX: h,
|
|
1134
|
-
translateY: 0,
|
|
1135
|
-
rotate: 0
|
|
1136
|
-
}
|
|
1137
|
-
};
|
|
1138
|
-
var v = d[o];
|
|
1139
|
-
l.transform = "translate(".concat(v.translateX, "px, ").concat(v.translateY, "px) rotate(").concat(v.rotate, "deg)");
|
|
1140
|
-
// set new positions
|
|
1141
|
-
var m = {
|
|
1142
|
-
left: "right",
|
|
1143
|
-
right: "left",
|
|
1144
|
-
above: "bottom",
|
|
1145
|
-
below: "top"
|
|
1146
|
-
};
|
|
1147
|
-
l[m[o]] = "1px";
|
|
1148
|
-
var b = {
|
|
1149
|
-
left: "top",
|
|
1150
|
-
right: "top",
|
|
1151
|
-
above: "left",
|
|
1152
|
-
below: "left"
|
|
1153
|
-
};
|
|
1154
|
-
l[b[o]] = "50%";
|
|
1155
|
-
return [ l, v ];
|
|
1156
|
-
}
|
|
1157
|
-
}, {
|
|
1185
|
+
$e(r, null, [ {
|
|
1158
1186
|
key: "getDerivedStateFromProps",
|
|
1187
|
+
// @docs-props-type PopoverPropsBase
|
|
1159
1188
|
value: function e(t, r) {
|
|
1160
1189
|
if (t.open !== r.prevOpen) {
|
|
1161
1190
|
return {
|
|
@@ -1167,87 +1196,78 @@
|
|
|
1167
1196
|
}
|
|
1168
1197
|
} ]);
|
|
1169
1198
|
function r(e) {
|
|
1170
|
-
var
|
|
1199
|
+
var n;
|
|
1171
1200
|
Fe(this, r);
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
height: e.offsetHeight
|
|
1186
|
-
};
|
|
1187
|
-
var a = o.props.pointTo;
|
|
1188
|
-
var i = a && d()(a, "x");
|
|
1189
|
-
var l = a && d()(a, "y");
|
|
1190
|
-
n.left = i ? r.left + ((a === null || a === void 0 ? void 0 : a.x) || 0) : r.left;
|
|
1191
|
-
n.top = l ? r.top + ((a === null || a === void 0 ? void 0 : a.y) || 0) : r.top;
|
|
1192
|
-
n.right = i ? n.left + n.width : r.left + n.width || r.right;
|
|
1193
|
-
n.bottom = l ? n.top + n.height : r.top + n.height || r.bottom;
|
|
1194
|
-
n.middle = i ? n.left : r.left + (n.right - r.left) / 2;
|
|
1195
|
-
n.center = l ? n.top : r.top + (n.bottom - r.top) / 2;
|
|
1196
|
-
return n;
|
|
1197
|
-
}));
|
|
1198
|
-
Je(Xe(o), "setPlacement", (function(e) {
|
|
1199
|
-
var t = me();
|
|
1200
|
-
o.setState((function(n) {
|
|
1201
|
-
var a;
|
|
1202
|
-
var i = o.props, l = i.align, c = i.anchor, s = i.autoCloseWhenOffScreen, u = i.canCoverAnchor, f = i.defaultPlacement, p = i.open, h = i.repositionMode, d = i.splunkTheme;
|
|
1203
|
-
var v = o.context || t;
|
|
1201
|
+
n = t.call(this, e);
|
|
1202
|
+
Ge(Ke(n), "outerContainerEl", null);
|
|
1203
|
+
Ge(Ke(n), "innerContainerEl", null);
|
|
1204
|
+
Ge(Ke(n), "arrow", null);
|
|
1205
|
+
Ge(Ke(n), "handleScroll", void 0);
|
|
1206
|
+
Ge(Ke(n), "handleWindowScroll", void 0);
|
|
1207
|
+
Ge(Ke(n), "allowAnimationUpdates", true);
|
|
1208
|
+
Ge(Ke(n), "setPlacement", (function(e) {
|
|
1209
|
+
var t = ve();
|
|
1210
|
+
n.setState((function(r) {
|
|
1211
|
+
var o;
|
|
1212
|
+
var a = n.props, i = a.align, l = a.anchor, c = a.autoCloseWhenOffScreen, u = a.canCoverAnchor, f = a.defaultPlacement, s = a.open, p = a.pointTo, h = a.repositionMode, d = a.splunkTheme;
|
|
1213
|
+
var v = n.context || t;
|
|
1204
1214
|
var m = d.isPrisma;
|
|
1205
1215
|
// If these conditions are not met, we cannot set the popover.
|
|
1206
|
-
if (!
|
|
1216
|
+
if (!s || !n.outerContainerEl || !l || !r.anchorEl) {
|
|
1207
1217
|
if (false) {}
|
|
1208
1218
|
return null;
|
|
1209
1219
|
}
|
|
1210
|
-
var b =
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1220
|
+
var b = at({
|
|
1221
|
+
anchorEl: r.anchorEl,
|
|
1222
|
+
pointTo: p
|
|
1223
|
+
});
|
|
1224
|
+
var y = at({
|
|
1225
|
+
anchorEl: r.anchorEl,
|
|
1226
|
+
offsets: true,
|
|
1227
|
+
pointTo: p
|
|
1228
|
+
});
|
|
1229
|
+
var g = it(v) ? at({
|
|
1230
|
+
anchorEl: v,
|
|
1231
|
+
pointTo: p
|
|
1232
|
+
}) : undefined;
|
|
1233
|
+
if (e && c) {
|
|
1234
|
+
if (n.autoCloseWhenOffScreen(b, g)) {
|
|
1215
1235
|
return null;
|
|
1216
1236
|
}
|
|
1217
1237
|
}
|
|
1218
1238
|
var w = m ? 0 : 8;
|
|
1219
1239
|
var S = 8;
|
|
1220
1240
|
var O = m ? "edge" : "center";
|
|
1221
|
-
var P =
|
|
1222
|
-
align:
|
|
1241
|
+
var P = U({
|
|
1242
|
+
align: i === "theme" ? O : i,
|
|
1223
1243
|
anchorPos: y,
|
|
1224
1244
|
scrollContainerPos: g,
|
|
1225
1245
|
canCoverAnchor: u,
|
|
1226
1246
|
defaultPlacement: f,
|
|
1227
1247
|
repositionMode: h,
|
|
1228
|
-
outerContainerEl:
|
|
1248
|
+
outerContainerEl: n.outerContainerEl,
|
|
1229
1249
|
padding: S,
|
|
1230
|
-
windowWidth:
|
|
1231
|
-
windowHeight:
|
|
1250
|
+
windowWidth: t.innerWidth,
|
|
1251
|
+
windowHeight: t.innerHeight
|
|
1232
1252
|
}), E = P.placement, C = P.outerContainerStyle, k = P.maxHeight, x = P.maxWidth;
|
|
1233
|
-
var
|
|
1253
|
+
var T = n.arrow ? ot({
|
|
1234
1254
|
anchorPos: y,
|
|
1235
1255
|
arrowHeight: w,
|
|
1236
1256
|
outerContainerStyle: C,
|
|
1237
1257
|
placement: E,
|
|
1238
|
-
outerContainerEl:
|
|
1239
|
-
}) : [],
|
|
1240
|
-
var M =
|
|
1241
|
-
var R = nt(y,
|
|
1242
|
-
var H = nt(j()(
|
|
1258
|
+
outerContainerEl: n.outerContainerEl
|
|
1259
|
+
}) : [], A = Re(T, 2), W = A[0], q = A[1];
|
|
1260
|
+
var M = n.props.appearance !== "none" && !m;
|
|
1261
|
+
var R = nt(y, r.anchorPos) && nt(C, r.outerContainerStyle) && E === r.placement && k === r.maxHeight && x === r.maxWidth;
|
|
1262
|
+
var H = nt(j()(W, "transform"), j()(r.arrowStyle, "transform")) && nt(q !== null && q !== void 0 ? q : {}, (o = r.arrowStyleTransformMeta) !== null && o !== void 0 ? o : {});
|
|
1243
1263
|
// If none of the position data has changed, do not set state.
|
|
1244
1264
|
if (R && (!M || M && H)) {
|
|
1245
1265
|
return null;
|
|
1246
1266
|
}
|
|
1247
1267
|
return {
|
|
1248
1268
|
anchorPos: y,
|
|
1249
|
-
arrowStyle:
|
|
1250
|
-
arrowStyleTransformMeta:
|
|
1269
|
+
arrowStyle: W,
|
|
1270
|
+
arrowStyleTransformMeta: q,
|
|
1251
1271
|
outerContainerStyle: C,
|
|
1252
1272
|
placement: E,
|
|
1253
1273
|
maxHeight: k,
|
|
@@ -1255,43 +1275,50 @@
|
|
|
1255
1275
|
};
|
|
1256
1276
|
}));
|
|
1257
1277
|
}));
|
|
1258
|
-
|
|
1259
|
-
|
|
1278
|
+
Ge(Ke(n), "handleArrowMount", (function(e) {
|
|
1279
|
+
n.arrow = e;
|
|
1280
|
+
}));
|
|
1281
|
+
Ge(Ke(n), "handleNewAnchor", (function(e) {
|
|
1282
|
+
var t = n.props.pointTo;
|
|
1283
|
+
var r;
|
|
1260
1284
|
if (e && !(e instanceof HTMLElement)) {
|
|
1261
1285
|
if (false) {}
|
|
1262
|
-
|
|
1286
|
+
r = (0, i.findDOMNode)(e);
|
|
1263
1287
|
// eslint-disable-line react/no-find-dom-node
|
|
1264
1288
|
} else {
|
|
1265
|
-
|
|
1289
|
+
r = e !== null && e !== void 0 ? e : undefined;
|
|
1266
1290
|
}
|
|
1267
|
-
var
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1291
|
+
var o = r ? at({
|
|
1292
|
+
anchorEl: r,
|
|
1293
|
+
pointTo: t
|
|
1294
|
+
}) : undefined;
|
|
1295
|
+
n.setState({
|
|
1296
|
+
anchorEl: r,
|
|
1297
|
+
anchorPos: o
|
|
1271
1298
|
});
|
|
1272
1299
|
// eslint-disable-line react/no-unused-state
|
|
1273
1300
|
}));
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
if (e &&
|
|
1277
|
-
|
|
1301
|
+
Ge(Ke(n), "handleInnerContainerMount", (function(e) {
|
|
1302
|
+
n.innerContainerEl = e;
|
|
1303
|
+
if (e && n.props.takeFocus) {
|
|
1304
|
+
f()(D.takeFocus, e);
|
|
1278
1305
|
}
|
|
1279
|
-
|
|
1306
|
+
Ce(n.props.elementRef, e);
|
|
1280
1307
|
}));
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1308
|
+
Ge(Ke(n), "handleOuterContainerMount", (function(e) {
|
|
1309
|
+
n.outerContainerEl = e;
|
|
1310
|
+
Ce(n.props.outerRef, e);
|
|
1284
1311
|
}));
|
|
1285
|
-
|
|
1286
|
-
if (
|
|
1287
|
-
if (
|
|
1288
|
-
(0,
|
|
1289
|
-
} else if ((0,
|
|
1290
|
-
var t = (0,
|
|
1312
|
+
Ge(Ke(n), "handleTab", (function(e) {
|
|
1313
|
+
if (n.innerContainerEl) {
|
|
1314
|
+
if (n.props.retainFocus) {
|
|
1315
|
+
(0, D.handleTab)(n.innerContainerEl, e);
|
|
1316
|
+
} else if ((0, D.isTabKey)(e)) {
|
|
1317
|
+
var t = (0, D.getSortedTabbableElements)(n.innerContainerEl);
|
|
1291
1318
|
if (t.length > 0) {
|
|
1292
1319
|
var r = e.shiftKey ? t[0] : t[t.length - 1];
|
|
1293
1320
|
if (r === e.target) {
|
|
1294
|
-
|
|
1321
|
+
n.handleRequestClose({
|
|
1295
1322
|
event: e,
|
|
1296
1323
|
reason: "tabKey"
|
|
1297
1324
|
});
|
|
@@ -1300,101 +1327,30 @@
|
|
|
1300
1327
|
}
|
|
1301
1328
|
}
|
|
1302
1329
|
}));
|
|
1303
|
-
|
|
1304
|
-
if (
|
|
1305
|
-
|
|
1330
|
+
Ge(Ke(n), "handleRequestClose", (function(e) {
|
|
1331
|
+
if (n.props.open) {
|
|
1332
|
+
n.requestClose(e);
|
|
1306
1333
|
}
|
|
1307
1334
|
}));
|
|
1308
|
-
|
|
1309
|
-
if (
|
|
1310
|
-
|
|
1335
|
+
Ge(Ke(n), "handleAnimationEnd", (function() {
|
|
1336
|
+
if (n.allowAnimationUpdates) {
|
|
1337
|
+
n.setState({
|
|
1311
1338
|
animating: false
|
|
1312
1339
|
});
|
|
1313
1340
|
}
|
|
1314
1341
|
}));
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
var b = f.isPrisma;
|
|
1319
|
-
var y = o.state, g = y.maxHeight, S = y.maxWidth;
|
|
1320
|
-
// eslint-disable-line prefer-const
|
|
1321
|
-
// Accommodate the arrow in the maxHeight and maxWidth.
|
|
1322
|
-
if (i !== "none") {
|
|
1323
|
-
if (w()(g)) {
|
|
1324
|
-
g -= 20;
|
|
1325
|
-
}
|
|
1326
|
-
if (w()(S)) {
|
|
1327
|
-
S -= 20;
|
|
1328
|
-
}
|
|
1329
|
-
}
|
|
1330
|
-
var P = {
|
|
1331
|
-
anchorHeight: h ? h.height : null,
|
|
1332
|
-
anchorWidth: h ? h.width : null,
|
|
1333
|
-
placement: m || null,
|
|
1334
|
-
maxHeight: g || null,
|
|
1335
|
-
maxWidth: S || null
|
|
1336
|
-
};
|
|
1337
|
-
var C = t ? {
|
|
1338
|
-
opacity: s ? 1 : 0
|
|
1339
|
-
} : {
|
|
1340
|
-
opacity: 1
|
|
1341
|
-
};
|
|
1342
|
-
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
1343
|
-
return n().createElement(T.Spring, {
|
|
1344
|
-
from: {
|
|
1345
|
-
opacity: t ? 0 : 1
|
|
1346
|
-
},
|
|
1347
|
-
to: C,
|
|
1348
|
-
config: Re({
|
|
1349
|
-
tension: 300,
|
|
1350
|
-
friction: 20,
|
|
1351
|
-
clamp: true
|
|
1352
|
-
}, a),
|
|
1353
|
-
onRest: o.handleAnimationEnd
|
|
1354
|
-
}, (function(e) {
|
|
1355
|
-
|
|
1356
|
-
return n().createElement(J, {
|
|
1357
|
-
"data-test": "outer-popover",
|
|
1358
|
-
style: Re(Re({}, v), e),
|
|
1359
|
-
ref: o.handleOuterContainerMount
|
|
1360
|
-
}, (s || o.state.animating) && n().createElement(Q, xe({
|
|
1361
|
-
$appearance: i,
|
|
1362
|
-
$open: s,
|
|
1363
|
-
"data-test": "popover",
|
|
1364
|
-
ref: o.handleInnerContainerMount,
|
|
1365
|
-
id: c,
|
|
1366
|
-
onKeyDown: o.handleTab
|
|
1367
|
-
}, j()(o.props, [ "anchor" ].concat(Ae(E()(r.propTypes))))), n().createElement(U.Provider, {
|
|
1368
|
-
value: {
|
|
1369
|
-
retainFocus: u
|
|
1370
|
-
}
|
|
1371
|
-
}, n().createElement(n().Fragment, null, i === "none" && l, i !== "none" && !b && n().createElement(ee, {
|
|
1372
|
-
$appearance: i,
|
|
1373
|
-
ref: function e(t) {
|
|
1374
|
-
o.arrow = t;
|
|
1375
|
-
},
|
|
1376
|
-
style: d
|
|
1377
|
-
}), i !== "none" && n().createElement(Z, {
|
|
1378
|
-
$appearance: i
|
|
1379
|
-
}, O()(l) ? l(P) : l)))), n().createElement(te, {
|
|
1380
|
-
ref: function e(t) {
|
|
1381
|
-
o.windowSizeMeasurementEl = t;
|
|
1382
|
-
}
|
|
1383
|
-
}));
|
|
1384
|
-
}));
|
|
1385
|
-
/* eslint-enable jsx-a11y/no-static-element-interactions */ }));
|
|
1386
|
-
o.handleScroll = x()(o.setPlacement.bind(Xe(o), true), 0);
|
|
1387
|
-
o.handleWindowScroll = x()(o.setPlacement.bind(Xe(o), true), 0);
|
|
1388
|
-
o.setPlacement = x()(o.setPlacement, 0, {
|
|
1342
|
+
n.handleScroll = x()(n.setPlacement.bind(Ke(n), true), 0);
|
|
1343
|
+
n.handleWindowScroll = x()(n.setPlacement.bind(Ke(n), true), 0);
|
|
1344
|
+
n.setPlacement = x()(n.setPlacement, 0, {
|
|
1389
1345
|
leading: false
|
|
1390
1346
|
});
|
|
1391
|
-
|
|
1347
|
+
n.state = {
|
|
1392
1348
|
animating: false,
|
|
1393
1349
|
prevOpen: e.open
|
|
1394
1350
|
};
|
|
1395
|
-
return
|
|
1351
|
+
return n;
|
|
1396
1352
|
}
|
|
1397
|
-
|
|
1353
|
+
$e(r, [ {
|
|
1398
1354
|
key: "componentDidMount",
|
|
1399
1355
|
value: function e() {
|
|
1400
1356
|
this.handleNewAnchor(this.props.anchor);
|
|
@@ -1414,7 +1370,7 @@
|
|
|
1414
1370
|
// this prevents bugs like #4 in SUI-2054 where popover contents re-rendering due to animation
|
|
1415
1371
|
// causes the popover contents to receive focus even though the popover closing
|
|
1416
1372
|
if (!t.open && this.props.open && this.props.takeFocus) {
|
|
1417
|
-
(0,
|
|
1373
|
+
(0, D.takeFocus)(this.innerContainerEl);
|
|
1418
1374
|
}
|
|
1419
1375
|
}
|
|
1420
1376
|
}
|
|
@@ -1429,22 +1385,13 @@
|
|
|
1429
1385
|
}, {
|
|
1430
1386
|
key: "autoCloseWhenOffScreen",
|
|
1431
1387
|
value: function e(t, r) {
|
|
1432
|
-
var n =
|
|
1433
|
-
if (
|
|
1388
|
+
var n = lt(t, r);
|
|
1389
|
+
if (n) {
|
|
1434
1390
|
this.requestClose({
|
|
1435
1391
|
reason: "offScreen"
|
|
1436
1392
|
});
|
|
1437
|
-
return true;
|
|
1438
1393
|
}
|
|
1439
|
-
|
|
1440
|
-
if (t.height + t.top < r.top || t.top > r.bottom || t.width + t.left < r.left || t.left > r.right) {
|
|
1441
|
-
this.requestClose({
|
|
1442
|
-
reason: "offScreen"
|
|
1443
|
-
});
|
|
1444
|
-
return true;
|
|
1445
|
-
}
|
|
1446
|
-
}
|
|
1447
|
-
return false;
|
|
1394
|
+
return n;
|
|
1448
1395
|
}
|
|
1449
1396
|
}, {
|
|
1450
1397
|
key: "requestClose",
|
|
@@ -1457,60 +1404,115 @@
|
|
|
1457
1404
|
}, {
|
|
1458
1405
|
key: "render",
|
|
1459
1406
|
value: function e() {
|
|
1460
|
-
var t =
|
|
1461
|
-
var
|
|
1462
|
-
var
|
|
1463
|
-
var
|
|
1464
|
-
var
|
|
1465
|
-
//
|
|
1407
|
+
var t = this;
|
|
1408
|
+
var o = this.props, a = o.animation, i = o.animationConfig, l = o.appearance, c = o.children, u = o.closeReasons, f = o.hitAreaRef, s = o.id, p = o.open, h = o.retainFocus, d = o.splunkTheme;
|
|
1409
|
+
var v = this.state, m = v.anchorPos, b = v.animating, g = v.arrowStyle, S = v.outerContainerStyle, P = v.placement;
|
|
1410
|
+
var C = d.isPrisma;
|
|
1411
|
+
var k = this.state, x = k.maxHeight, T = k.maxWidth;
|
|
1412
|
+
// eslint-disable-line prefer-const
|
|
1413
|
+
// Accommodate the arrow in the maxHeight and maxWidth.
|
|
1414
|
+
if (l !== "none") {
|
|
1415
|
+
if (w()(x)) {
|
|
1416
|
+
x -= 20;
|
|
1417
|
+
}
|
|
1418
|
+
if (w()(T)) {
|
|
1419
|
+
T -= 20;
|
|
1420
|
+
}
|
|
1421
|
+
}
|
|
1422
|
+
var W = {
|
|
1423
|
+
anchorHeight: m ? m.height : null,
|
|
1424
|
+
anchorWidth: m ? m.width : null,
|
|
1425
|
+
placement: P || null,
|
|
1426
|
+
maxHeight: x || null,
|
|
1427
|
+
maxWidth: T || null
|
|
1428
|
+
};
|
|
1429
|
+
var M = a ? {
|
|
1430
|
+
opacity: p ? 1 : 0
|
|
1431
|
+
} : {
|
|
1432
|
+
opacity: 1
|
|
1433
|
+
};
|
|
1434
|
+
var H = ve();
|
|
1435
|
+
var _ = p || b;
|
|
1436
|
+
var D = this.context || H;
|
|
1437
|
+
var I = D !== H;
|
|
1438
|
+
// EventListeners only need to be rendered when open,
|
|
1466
1439
|
// otherwise leads to negative performance impacts
|
|
1467
|
-
var
|
|
1468
|
-
target:
|
|
1440
|
+
var L = _ ? [ I && n().createElement(q(), {
|
|
1441
|
+
target: D,
|
|
1469
1442
|
eventType: "scroll",
|
|
1470
1443
|
listener: this.handleScroll,
|
|
1471
|
-
options:
|
|
1472
|
-
passive: false,
|
|
1473
|
-
capture: true
|
|
1474
|
-
},
|
|
1444
|
+
options: rt,
|
|
1475
1445
|
key: "eventListener"
|
|
1476
|
-
}), n().createElement(
|
|
1477
|
-
target:
|
|
1446
|
+
}), n().createElement(q(), {
|
|
1447
|
+
target: H,
|
|
1478
1448
|
eventType: "resize",
|
|
1479
1449
|
listener: this.setPlacement,
|
|
1480
1450
|
key: "eventListenerOnWindowResize"
|
|
1481
|
-
}), n().createElement(
|
|
1482
|
-
target:
|
|
1451
|
+
}), n().createElement(q(), {
|
|
1452
|
+
target: H,
|
|
1483
1453
|
eventType: "scroll",
|
|
1484
1454
|
listener: this.handleWindowScroll,
|
|
1485
|
-
options:
|
|
1486
|
-
passive: false,
|
|
1487
|
-
capture: true
|
|
1488
|
-
},
|
|
1455
|
+
options: rt,
|
|
1489
1456
|
key: "eventListenerOnWindowScroll"
|
|
1490
1457
|
}) ] : [];
|
|
1491
|
-
return [].concat(
|
|
1492
|
-
closeReasons: y()(
|
|
1458
|
+
return [].concat(L, [ n().createElement(R(), {
|
|
1459
|
+
closeReasons: y()(u.filter((function(e) {
|
|
1493
1460
|
return e !== "offScreen";
|
|
1494
1461
|
})), R().possibleCloseReasons),
|
|
1495
|
-
open:
|
|
1462
|
+
open: _,
|
|
1496
1463
|
onRequestClose: this.handleRequestClose,
|
|
1497
1464
|
key: "Layer"
|
|
1498
|
-
},
|
|
1499
|
-
anchorRect:
|
|
1465
|
+
}, _ && this.innerContainerEl && f && n().createElement(se, {
|
|
1466
|
+
anchorRect: m,
|
|
1500
1467
|
popoverEl: this.innerContainerEl,
|
|
1501
|
-
popoverPlacement:
|
|
1502
|
-
ref:
|
|
1503
|
-
}),
|
|
1468
|
+
popoverPlacement: P,
|
|
1469
|
+
ref: f
|
|
1470
|
+
}), _ && n().createElement(A.Spring, {
|
|
1471
|
+
from: {
|
|
1472
|
+
opacity: a ? 0 : 1
|
|
1473
|
+
},
|
|
1474
|
+
to: M,
|
|
1475
|
+
config: Me({
|
|
1476
|
+
tension: 300,
|
|
1477
|
+
friction: 20,
|
|
1478
|
+
clamp: true
|
|
1479
|
+
}, i),
|
|
1480
|
+
onRest: this.handleAnimationEnd
|
|
1481
|
+
}, (function(e) {
|
|
1482
|
+
|
|
1483
|
+
return n().createElement(J, {
|
|
1484
|
+
"data-test": "outer-popover",
|
|
1485
|
+
style: Me(Me({}, S), e),
|
|
1486
|
+
ref: t.handleOuterContainerMount
|
|
1487
|
+
}, n().createElement(Q, ke({
|
|
1488
|
+
$appearance: l,
|
|
1489
|
+
$open: p,
|
|
1490
|
+
"data-test": "popover",
|
|
1491
|
+
ref: t.handleInnerContainerMount,
|
|
1492
|
+
id: s,
|
|
1493
|
+
onKeyDown: t.handleTab
|
|
1494
|
+
}, j()(t.props, [ "anchor" ].concat(xe(E()(r.propTypes))))), n().createElement(z.Provider, {
|
|
1495
|
+
value: {
|
|
1496
|
+
retainFocus: h
|
|
1497
|
+
}
|
|
1498
|
+
}, n().createElement(n().Fragment, null, l === "none" && c, l !== "none" && !C && n().createElement(ee, {
|
|
1499
|
+
$appearance: l,
|
|
1500
|
+
ref: t.handleArrowMount,
|
|
1501
|
+
style: g
|
|
1502
|
+
}), l !== "none" && n().createElement(Z, {
|
|
1503
|
+
$appearance: l
|
|
1504
|
+
}, O()(c) ? c(W) : c)))));
|
|
1505
|
+
}))) ]);
|
|
1504
1506
|
}
|
|
1505
1507
|
} ]);
|
|
1506
1508
|
return r;
|
|
1507
1509
|
}(r.Component);
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
var
|
|
1512
|
-
|
|
1513
|
-
/* harmony default export */ const
|
|
1510
|
+
Ge(ct, "contextType", _());
|
|
1511
|
+
Ge(ct, "defaultProps", tt);
|
|
1512
|
+
Ge(ct, "propTypes", et);
|
|
1513
|
+
var ut = (0, T.withSplunkTheme)(ct);
|
|
1514
|
+
ut.propTypes = ct.propTypes;
|
|
1515
|
+
/* harmony default export */ const ft = ut;
|
|
1514
1516
|
// CONCATENATED MODULE: ./src/Popover/index.ts
|
|
1515
1517
|
module.exports = t;
|
|
1516
1518
|
/******/})();
|