@splunk/react-ui 4.44.1 → 4.46.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/ResultsMenu.js CHANGED
@@ -13,10 +13,10 @@
13
13
  var o = r.n(n);
14
14
  // EXTERNAL MODULE: external "prop-types"
15
15
  var i = r(23);
16
- var a = r.n(i);
16
+ var l = r.n(i);
17
17
  // EXTERNAL MODULE: external "styled-components"
18
- var l = r(232);
19
- var u = r.n(l);
18
+ var a = r(232);
19
+ var u = r.n(a);
20
20
  // EXTERNAL MODULE: external "@splunk/themes"
21
21
  var c = r(3563);
22
22
  // CONCATENATED MODULE: ./src/ScreenReaderContent/ScreenReaderContentStyles.ts
@@ -59,8 +59,8 @@
59
59
  return r;
60
60
  }
61
61
  var p = {
62
- children: a().node.isRequired,
63
- elementRef: a().oneOfType([ a().func, a().object ])
62
+ children: l().node.isRequired,
63
+ elementRef: l().oneOfType([ l().func, l().object ])
64
64
  };
65
65
  /**
66
66
  * The screen reader text is used to wrap content that
@@ -180,7 +180,7 @@
180
180
  r.r(n);
181
181
  // EXPORTS
182
182
  r.d(n, {
183
- VirtualizedResultsMenu: () => /* reexport */ Fe,
183
+ VirtualizedResultsMenu: () => /* reexport */ ze,
184
184
  default: () => /* reexport */ X
185
185
  });
186
186
  // EXTERNAL MODULE: external "react"
@@ -190,8 +190,8 @@
190
190
  var o = r(23);
191
191
  var i = r.n(o);
192
192
  // CONCATENATED MODULE: external "lodash/keys"
193
- const a = require("lodash/keys");
194
- var l = r.n(a);
193
+ const l = require("lodash/keys");
194
+ var a = r.n(l);
195
195
  // CONCATENATED MODULE: external "lodash/memoize"
196
196
  const u = require("lodash/memoize");
197
197
  var c = r.n(u);
@@ -561,10 +561,10 @@
561
561
  }, {
562
562
  key: "render",
563
563
  value: function r() {
564
- var n = this.props, i = n.animateLoading, a = n.children, u = n.childrenStart, c = n.focusMode, s = n.isLoading, d = n.loadingMessage, v = n.noOptionsMessage, m = n.onScrollBottom, y = n.placement, b = n.style, h = n.tabIndex, g = n.menuId, S = n["aria-multiselectable"];
565
- var O = f()(this.props, l()(o.propTypes));
564
+ var n = this.props, i = n.animateLoading, l = n.children, u = n.childrenStart, c = n.focusMode, s = n.isLoading, d = n.loadingMessage, v = n.noOptionsMessage, m = n.onScrollBottom, y = n.placement, b = n.style, h = n.tabIndex, g = n.menuId, S = n["aria-multiselectable"];
565
+ var O = f()(this.props, a()(o.propTypes));
566
566
  // Assumption: that you cannot be filtered if you are a result
567
- var P = e.Children.toArray(a).filter(e.isValidElement).some((function(e) {
567
+ var P = e.Children.toArray(l).filter(e.isValidElement).some((function(e) {
568
568
  var t = e.type;
569
569
  return !(t.as === "Divider" && t.filterFirst || (t.as === "Divider" || t.as === "Heading") && (t.filterLast || t.filterConsecutive));
570
570
  }));
@@ -596,7 +596,7 @@
596
596
  }, A && t().createElement(x, {
597
597
  "data-test": "no-results-message",
598
598
  disabled: true
599
- }, v), a, m && !R &&
599
+ }, v), l, m && !R &&
600
600
 
601
601
  // Bottom spacer fills in the space of new items being loaded by using the minimum possible height x menuItems.
602
602
  t().createElement("div", {
@@ -687,7 +687,7 @@
687
687
  };
688
688
  // CONCATENATED MODULE: ./src/ResultsMenu/VirtualizedResultsMenu/VirtualizedItem.ts
689
689
  function re(e, t) {
690
- return le(e) || ae(e, t) || oe(e, t) || ne();
690
+ return ae(e) || le(e, t) || oe(e, t) || ne();
691
691
  }
692
692
  function ne() {
693
693
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
@@ -706,29 +706,29 @@
706
706
  }
707
707
  return n;
708
708
  }
709
- function ae(e, t) {
709
+ function le(e, t) {
710
710
  var r = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
711
711
  if (null != r) {
712
- var n, o, i, a, l = [], u = !0, c = !1;
712
+ var n, o, i, l, a = [], u = !0, c = !1;
713
713
  try {
714
714
  if (i = (r = r.call(e)).next, 0 === t) {
715
715
  if (Object(r) !== r) return;
716
716
  u = !1;
717
- } else for (;!(u = (n = i.call(r)).done) && (l.push(n.value), l.length !== t); u = !0) {
717
+ } else for (;!(u = (n = i.call(r)).done) && (a.push(n.value), a.length !== t); u = !0) {
718
718
  }
719
719
  } catch (e) {
720
720
  c = !0, o = e;
721
721
  } finally {
722
722
  try {
723
- if (!u && null != r["return"] && (a = r["return"](), Object(a) !== a)) return;
723
+ if (!u && null != r["return"] && (l = r["return"](), Object(l) !== l)) return;
724
724
  } finally {
725
725
  if (c) throw o;
726
726
  }
727
727
  }
728
- return l;
728
+ return a;
729
729
  }
730
730
  }
731
- function le(e) {
731
+ function ae(e) {
732
732
  if (Array.isArray(e)) return e;
733
733
  }
734
734
  // This wrapper should only be used with Menu.Item/derivatives thereof, so omitting Heading/Divider is fine
@@ -739,7 +739,7 @@
739
739
  };
740
740
  /** @private Used by `VirtualizedResultsMenu` */ var ce = t().forwardRef((function(t, r) {
741
741
  var n = t.children, o = t.onMount, i = t.onUnmount;
742
- var a = (0, e.useState)(), l = re(a, 2), u = l[0], c = l[1];
742
+ var l = (0, e.useState)(), a = re(l, 2), u = a[0], c = a[1];
743
743
  (0, e.useEffect)((function() {
744
744
  if (u) {
745
745
  o(u);
@@ -797,13 +797,13 @@
797
797
  * - If `trackFirstElement` the **FIRST** non-divider/heading item will also be replaced.
798
798
  * - If `trackLastElement` the **LAST** non-divider/heading item will also be replaced.
799
799
  */ var fe = function e(r, n, o) {
800
- var i = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}, a = i.trackFirstElement, l = i.trackLastElement;
800
+ var i = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}, l = i.trackFirstElement, a = i.trackLastElement;
801
801
  if (!Array.isArray(r)) {
802
802
  return [];
803
803
  }
804
804
  var u = se(r, Math.floor(r.length / 2));
805
- var c = a && se(r, 0);
806
- var s = l && se(r, r.length - 1);
805
+ var c = l && se(r, 0);
806
+ var s = a && se(r, r.length - 1);
807
807
  return r.map((function(e, r) {
808
808
  if (r === u || r === c || r === s) {
809
809
 
@@ -871,23 +871,23 @@
871
871
  function Oe(e, t) {
872
872
  var r = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
873
873
  if (null != r) {
874
- var n, o, i, a, l = [], u = !0, c = !1;
874
+ var n, o, i, l, a = [], u = !0, c = !1;
875
875
  try {
876
876
  if (i = (r = r.call(e)).next, 0 === t) {
877
877
  if (Object(r) !== r) return;
878
878
  u = !1;
879
- } else for (;!(u = (n = i.call(r)).done) && (l.push(n.value), l.length !== t); u = !0) {
879
+ } else for (;!(u = (n = i.call(r)).done) && (a.push(n.value), a.length !== t); u = !0) {
880
880
  }
881
881
  } catch (e) {
882
882
  c = !0, o = e;
883
883
  } finally {
884
884
  try {
885
- if (!u && null != r["return"] && (a = r["return"](), Object(a) !== a)) return;
885
+ if (!u && null != r["return"] && (l = r["return"](), Object(l) !== l)) return;
886
886
  } finally {
887
887
  if (c) throw o;
888
888
  }
889
889
  }
890
- return l;
890
+ return a;
891
891
  }
892
892
  }
893
893
  function we(e) {
@@ -982,7 +982,7 @@
982
982
  * @throws in `__DEV__` when `virtualization` is less than or equal to 1 (`virtualization` must be ≥ 2)
983
983
  * @throws in `__DEV__` when `virtualization` is changed during the lifecycle of the `VirtualizedResultsMenu` component
984
984
  */ function Ae(r) {
985
- var n = r.virtualization, o = n === void 0 ? 2 : n, i = r.elementRef, a = r.children, l = r.focusMode, u = l === void 0 ? "normal" : l, c = Me(r, [ "virtualization", "elementRef", "children", "focusMode" ]);
985
+ var n = r.virtualization, o = n === void 0 ? 2 : n, i = r.elementRef, l = r.children, a = r.focusMode, u = a === void 0 ? "normal" : a, c = Me(r, [ "virtualization", "elementRef", "children", "focusMode" ]);
986
986
  // @docs-props-type VirtualizedResultsMenuPropsBase
987
987
  var s = (0, e.useRef)(o);
988
988
  // If a user tries to set virtualization to a value smaller than the number of options
@@ -993,14 +993,14 @@
993
993
  // element after the next render
994
994
  var m = (0, e.useRef)(false);
995
995
  var y = (0, e.useRef)(false);
996
- var b = (0, e.useRef)(a);
996
+ var b = (0, e.useRef)(l);
997
997
  // this code makes the "home" and "end" keys work by injecting
998
998
  // an elementRef callback function into the first and last item
999
999
  // that will attempt to focus the first/last item if appropriate
1000
1000
  // we need to do this because if we call focus() right after changePane()
1001
1001
  // the new pane won't be in the DOM yet, so the wrong element will end up focused
1002
1002
  (0, e.useMemo)((function() {
1003
- var t = e.Children.toArray(a);
1003
+ var t = e.Children.toArray(l);
1004
1004
  var r = se(t, 0);
1005
1005
  var n = se(t, t.length - 1);
1006
1006
  b.current = t.map((function(t, o) {
@@ -1026,7 +1026,7 @@
1026
1026
  }
1027
1027
  return i;
1028
1028
  }));
1029
- }), [ a ]);
1029
+ }), [ l ]);
1030
1030
  var h = b.current;
1031
1031
  (0, e.useEffect)((function() {
1032
1032
  if (false) {}
@@ -1129,17 +1129,17 @@
1129
1129
  if (false) {}
1130
1130
  return;
1131
1131
  }
1132
- var a = false;
1132
+ var l = false;
1133
1133
  t.forEach((function(e) {
1134
- if (a || !e.isIntersecting) {
1134
+ if (l || !e.isIntersecting) {
1135
1135
  // don't process if the pane changed or the entry isn't intersecting
1136
1136
  return;
1137
1137
  }
1138
1138
  if (k.current.includes(e.target)) {
1139
- a = true;
1139
+ l = true;
1140
1140
  _(n - 1);
1141
1141
  } else if (j.current.includes(e.target)) {
1142
- a = true;
1142
+ l = true;
1143
1143
  _(n + 1);
1144
1144
  }
1145
1145
  }));
@@ -1162,8 +1162,8 @@
1162
1162
  var i = (0, Q.getSortedTabbableElements)(t, {
1163
1163
  ignoreTabIndex: true
1164
1164
  });
1165
- var a = i[0];
1166
- a === null || a === void 0 ? void 0 : (o = a.focus) === null || o === void 0 ? void 0 : o.call(a);
1165
+ var l = i[0];
1166
+ l === null || l === void 0 ? void 0 : (o = l.focus) === null || o === void 0 ? void 0 : o.call(l);
1167
1167
  } else {
1168
1168
  // if it's not rendered, set up focusing it after the next render
1169
1169
  m.current = true;
@@ -1172,9 +1172,9 @@
1172
1172
  }
1173
1173
  return;
1174
1174
  }
1175
- var l = O.current.length - 1;
1175
+ var a = O.current.length - 1;
1176
1176
  if (r === "end") {
1177
- var u = w.current === l;
1177
+ var u = w.current === a;
1178
1178
  if (u) {
1179
1179
  var c;
1180
1180
  // if the last pane is already rendered, find the first element and focus it
@@ -1187,7 +1187,7 @@
1187
1187
  // if it's not rendered, set up focusing it after the next render
1188
1188
  y.current = true;
1189
1189
  // then call changePane() to trigger the render
1190
- _(l);
1190
+ _(a);
1191
1191
  }
1192
1192
  return;
1193
1193
  }
@@ -1301,9 +1301,11 @@
1301
1301
  var e = typeof document !== "undefined" ? document : _e;
1302
1302
  return e;
1303
1303
  }
1304
+ var Be = Le();
1305
+ /* harmony default export */ const qe = /* unused pure expression or super */ null && Be;
1304
1306
  // CONCATENATED MODULE: ./src/utils/ssrWindow.ts
1305
1307
  /* eslint-disable @typescript-eslint/no-empty-function */
1306
- var Be = {
1308
+ var Ne = {
1307
1309
  document: _e,
1308
1310
  navigator: {
1309
1311
  userAgent: ""
@@ -1358,14 +1360,16 @@
1358
1360
  clearTimeout(t);
1359
1361
  }
1360
1362
  };
1361
- function qe() {
1362
- var e = typeof window !== "undefined" ? window : Be;
1363
+ function Fe() {
1364
+ var e = typeof window !== "undefined" ? window : Ne;
1363
1365
  return e;
1364
1366
  }
1367
+ var He = Fe();
1368
+ /* harmony default export */ const De = /* unused pure expression or super */ null && He;
1365
1369
  // CONCATENATED MODULE: ./src/ResultsMenu/VirtualizedResultsMenu/index.ts
1366
1370
  // In environments without IntersectionObserver support this should just export ResultsMenu
1367
- var Ne = "IntersectionObserver" in qe() ? Ae : X;
1368
- /* harmony default export */ const Fe = Ne;
1371
+ var Ue = "IntersectionObserver" in Fe() ? Ae : X;
1372
+ /* harmony default export */ const ze = Ue;
1369
1373
  }) // CONCATENATED MODULE: ./src/ResultsMenu/index.ts
1370
1374
  ();
1371
1375
  module.exports = n;
@@ -61,9 +61,9 @@
61
61
  e.r(t);
62
62
  // EXPORTS
63
63
  e.d(t, {
64
- ScrollContainerContext: () => /* reexport */ a,
65
- ScrollContainerProvider: () => /* reexport */ f,
66
- default: () => /* reexport */ l
64
+ ScrollContainerContext: () => /* reexport */ s,
65
+ ScrollContainerProvider: () => /* reexport */ m,
66
+ default: () => /* reexport */ v
67
67
  });
68
68
  // CONCATENATED MODULE: external "react"
69
69
  const n = require("react");
@@ -128,9 +128,11 @@
128
128
  var e = typeof document !== "undefined" ? document : o;
129
129
  return e;
130
130
  }
131
+ var i = u();
132
+ /* harmony default export */ const c = /* unused pure expression or super */ null && i;
131
133
  // CONCATENATED MODULE: ./src/utils/ssrWindow.ts
132
134
  /* eslint-disable @typescript-eslint/no-empty-function */
133
- var i = {
135
+ var a = {
134
136
  document: o,
135
137
  navigator: {
136
138
  userAgent: ""
@@ -185,10 +187,12 @@
185
187
  clearTimeout(t);
186
188
  }
187
189
  };
188
- function c() {
189
- var e = typeof window !== "undefined" ? window : i;
190
+ function f() {
191
+ var e = typeof window !== "undefined" ? window : a;
190
192
  return e;
191
193
  }
194
+ var l = f();
195
+ /* harmony default export */ const d = /* unused pure expression or super */ null && l;
192
196
  // CONCATENATED MODULE: ./src/ScrollContainerContext/ScrollContainerContext.tsx
193
197
  /**
194
198
  * A React context used to manage a custom scroll container for child elements
@@ -197,12 +201,12 @@
197
201
  * of `null` and `undefined`.
198
202
  * @public
199
203
  */
200
- var a = r().createContext(c());
204
+ var s = r().createContext(f());
201
205
  /**
202
206
  * `ScrollContainerProvider` is an alias of `ScrollContainerContext.Provider`.
203
207
  * @public
204
- */ var f = a.Provider;
205
- /* harmony default export */ const l = a;
208
+ */ var m = s.Provider;
209
+ /* harmony default export */ const v = s;
206
210
  // CONCATENATED MODULE: ./src/ScrollContainerContext/index.ts
207
211
  module.exports = t;
208
212
  /******/})();