@splunk/react-ui 4.37.0 → 4.39.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/Accordion.js +131 -153
  2. package/Anchor.js +50 -58
  3. package/Animation.js +64 -59
  4. package/AnimationToggle.js +59 -61
  5. package/Box.js +59 -67
  6. package/Breadcrumbs.js +113 -127
  7. package/Button.js +208 -219
  8. package/ButtonGroup.js +41 -49
  9. package/ButtonSimple.js +264 -295
  10. package/CHANGELOG.md +50 -1
  11. package/Calendar.js +353 -414
  12. package/Card.js +183 -243
  13. package/CardLayout.js +86 -83
  14. package/Chip.js +104 -122
  15. package/Clickable.js +180 -198
  16. package/CloseButton.js +52 -60
  17. package/Code.js +24 -31
  18. package/CollapsiblePanel.js +172 -202
  19. package/Color.js +1107 -980
  20. package/ColumnLayout.js +72 -96
  21. package/ComboBox.js +267 -305
  22. package/Concertina.js +406 -454
  23. package/ControlGroup.js +165 -194
  24. package/Date.js +116 -131
  25. package/DefinitionList.js +125 -149
  26. package/Divider.js +81 -79
  27. package/Dropdown.js +226 -237
  28. package/DualListbox.js +150 -186
  29. package/EventListener.js +4 -1
  30. package/File.js +1032 -955
  31. package/FormRows.js +281 -334
  32. package/Heading.js +27 -35
  33. package/Image.js +101 -116
  34. package/JSONTree.js +301 -344
  35. package/Layer.js +118 -126
  36. package/Link.js +141 -159
  37. package/List.js +61 -77
  38. package/MIGRATION.mdx +92 -38
  39. package/Markdown.js +288 -347
  40. package/Menu.js +512 -530
  41. package/Message.js +173 -196
  42. package/MessageBar.js +58 -66
  43. package/Modal.js +241 -290
  44. package/ModalLayer.js +130 -148
  45. package/Monogram.js +138 -138
  46. package/Multiselect.js +1600 -1923
  47. package/Number.js +159 -178
  48. package/Paginator.js +296 -335
  49. package/Paragraph.js +24 -32
  50. package/Popover.js +448 -441
  51. package/Progress.js +65 -75
  52. package/RadioBar.js +301 -303
  53. package/RadioList.js +77 -119
  54. package/Resize.js +105 -127
  55. package/ResultsMenu.js +373 -385
  56. package/ScreenReaderContent.js +130 -94
  57. package/Scroll.js +209 -244
  58. package/Search.js +375 -384
  59. package/Select.js +1076 -1354
  60. package/SidePanel.js +122 -142
  61. package/Slider.js +192 -222
  62. package/SlidingPanels.js +238 -270
  63. package/SplitButton.js +222 -245
  64. package/StaticContent.js +68 -76
  65. package/StepBar.js +206 -205
  66. package/Switch.js +211 -236
  67. package/TabBar.js +222 -258
  68. package/TabLayout.js +114 -139
  69. package/Table.js +2017 -2180
  70. package/Text.js +401 -512
  71. package/TextArea.js +411 -441
  72. package/Tooltip.js +116 -132
  73. package/TransitionOpen.js +160 -178
  74. package/Tree.js +268 -287
  75. package/Typography.js +48 -52
  76. package/WaitSpinner.js +60 -68
  77. package/cypress/support/commands.ts +9 -0
  78. package/cypress/support/index.d.ts +6 -0
  79. package/cypress/tsconfig.cypress.json +1 -0
  80. package/docker-compose.yml +0 -1
  81. package/package.json +17 -17
  82. package/types/src/Button/Button.d.ts +20 -6
  83. package/types/src/ButtonSimple/ButtonSimple.d.ts +2 -2
  84. package/types/src/CollapsiblePanel/CollapsiblePanel.d.ts +1 -1
  85. package/types/src/Color/Color.d.ts +5 -2
  86. package/types/src/Color/Palette.d.ts +6 -2
  87. package/types/src/ComboBox/Option.d.ts +1 -1
  88. package/types/src/ControlGroup/ControlGroup.d.ts +1 -2
  89. package/types/src/Date/Date.d.ts +2 -3
  90. package/types/src/File/File.d.ts +2 -3
  91. package/types/src/File/Retry.d.ts +1 -2
  92. package/types/src/Link/Link.d.ts +3 -4
  93. package/types/src/Menu/Item.d.ts +24 -8
  94. package/types/src/Menu/Menu.d.ts +3 -3
  95. package/types/src/Menu/docs/examples/Adornments.d.ts +2 -0
  96. package/types/src/Menu/docs/examples/SelectableWithAdornments.d.ts +2 -0
  97. package/types/src/ModalLayer/ModalLayer.d.ts +1 -1
  98. package/types/src/Multiselect/Option.d.ts +2 -0
  99. package/types/src/Number/Number.d.ts +3 -3
  100. package/types/src/Popover/Popover.d.ts +3 -4
  101. package/types/src/RadioBar/RadioBar.d.ts +2 -2
  102. package/types/src/ResultsMenu/VirtualizedResultsMenu/VirtualizedResultsMenu.d.ts +1 -1
  103. package/types/src/ScrollContainerContext/ScrollContainerContext.d.ts +2 -2
  104. package/types/src/Search/Option.d.ts +16 -3
  105. package/types/src/Select/Option.d.ts +3 -1
  106. package/types/src/Select/OptionBase.d.ts +7 -5
  107. package/types/src/Select/Select.d.ts +2 -2
  108. package/types/src/Select/SelectAllOption.d.ts +4 -4
  109. package/types/src/Select/SelectBase.d.ts +0 -1
  110. package/types/src/SidePanel/SidePanel.d.ts +1 -1
  111. package/types/src/Slider/Slider.d.ts +2 -3
  112. package/types/src/Slider/docs/examples/Error.d.ts +2 -0
  113. package/types/src/SlidingPanels/SlidingPanels.d.ts +1 -1
  114. package/types/src/StepBar/Step.d.ts +1 -2
  115. package/types/src/TabBar/Tab.d.ts +1 -1
  116. package/types/src/TabBar/TabBar.d.ts +3 -1
  117. package/types/src/TabLayout/TabLayout.d.ts +2 -0
  118. package/types/src/Table/HeadDropdownCell.d.ts +2 -0
  119. package/types/src/Table/Table.d.ts +0 -1
  120. package/types/src/Table/docs/examples/StripeRows.d.ts +2 -0
  121. package/types/src/Text/IconOutlinedHide.d.ts +1 -2
  122. package/types/src/Text/IconOutlinedView.d.ts +1 -2
  123. package/types/src/Text/Text.d.ts +6 -4
  124. package/types/src/Text/docs/examples/Dimmed.d.ts +2 -0
  125. package/types/src/TextArea/TextArea.d.ts +2 -2
  126. package/types/src/Tooltip/Tooltip.d.ts +4 -4
  127. package/types/src/TransitionOpen/TransitionOpen.d.ts +1 -1
  128. package/useForceUpdate.js +30 -32
  129. package/useKeyPress.js +1 -1
  130. package/types/src/Button/docs/examples/Selected.d.ts +0 -2
  131. package/types/src/ButtonGroup/docs/examples/prisma/Basic.d.ts +0 -1
  132. package/types/src/File/docs/examples/prisma/Error.d.ts +0 -1
  133. package/types/src/Menu/docs/examples/Icons.d.ts +0 -2
  134. package/types/src/Menu/docs/examples/SelectableWithIcons.d.ts +0 -2
  135. package/types/src/Slider/docs/examples/prisma/Error.d.ts +0 -2
  136. package/types/src/TabBar/docs/examples/prisma/Context.d.ts +0 -2
  137. package/types/src/TabLayout/docs/examples/prisma/Context.d.ts +0 -2
  138. package/types/src/Table/docs/examples/prisma/Basic.d.ts +0 -2
  139. /package/types/src/Date/docs/examples/{prisma/WithoutCalendar.d.ts → WithoutCalendar.d.ts} +0 -0
  140. /package/types/src/Message/docs/examples/{prisma/Title.d.ts → Title.d.ts} +0 -0
  141. /package/types/src/StepBar/docs/examples/{prisma/Error.d.ts → Error.d.ts} +0 -0
  142. /package/types/src/TabBar/docs/examples/{prisma/Disabled.d.ts → Disabled.d.ts} +0 -0
package/Dropdown.js CHANGED
@@ -8,27 +8,27 @@
8
8
  /******/ /* webpack/runtime/compat get default export */
9
9
  /******/ (() => {
10
10
  /******/ // getDefaultExport function for compatibility with non-harmony modules
11
- /******/ e.n = t => {
12
- /******/ var o = t && t.__esModule ?
13
- /******/ () => t["default"]
14
- /******/ : () => t
11
+ /******/ e.n = o => {
12
+ /******/ var t = o && o.__esModule ?
13
+ /******/ () => o["default"]
14
+ /******/ : () => o
15
15
  /******/;
16
- e.d(o, {
17
- a: o
16
+ e.d(t, {
17
+ a: t
18
18
  });
19
- /******/ return o;
19
+ /******/ return t;
20
20
  /******/ };
21
21
  /******/ })();
22
22
  /******/
23
23
  /******/ /* webpack/runtime/define property getters */
24
24
  /******/ (() => {
25
25
  /******/ // define getter functions for harmony exports
26
- /******/ e.d = (t, o) => {
27
- /******/ for (var n in o) {
28
- /******/ if (e.o(o, n) && !e.o(t, n)) {
29
- /******/ Object.defineProperty(t, n, {
26
+ /******/ e.d = (o, t) => {
27
+ /******/ for (var n in t) {
28
+ /******/ if (e.o(t, n) && !e.o(o, n)) {
29
+ /******/ Object.defineProperty(o, n, {
30
30
  enumerable: true,
31
- get: o[n]
31
+ get: t[n]
32
32
  });
33
33
  /******/ }
34
34
  /******/ }
@@ -37,7 +37,7 @@
37
37
  /******/
38
38
  /******/ /* webpack/runtime/hasOwnProperty shorthand */
39
39
  /******/ (() => {
40
- /******/ e.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t)
40
+ /******/ e.o = (e, o) => Object.prototype.hasOwnProperty.call(e, o)
41
41
  /******/;
42
42
  })();
43
43
  /******/
@@ -56,37 +56,37 @@
56
56
  /******/ };
57
57
  /******/ })();
58
58
  /******/
59
- /************************************************************************/ var t = {};
59
+ /************************************************************************/ var o = {};
60
60
  // ESM COMPAT FLAG
61
- e.r(t);
61
+ e.r(o);
62
62
  // EXPORTS
63
- e.d(t, {
64
- default: () => /* reexport */ N,
65
- legacyRefMode: () => /* reexport */ W
63
+ e.d(o, {
64
+ default: () => /* reexport */ U,
65
+ legacyRefMode: () => /* reexport */ N
66
66
  });
67
67
  // CONCATENATED MODULE: external "react"
68
- const o = require("react");
69
- var n = e.n(o);
68
+ const t = require("react");
69
+ var n = e.n(t);
70
70
  // CONCATENATED MODULE: external "prop-types"
71
71
  const r = require("prop-types");
72
- var l = e.n(r);
72
+ var i = e.n(r);
73
73
  // CONCATENATED MODULE: external "lodash/has"
74
- const i = require("lodash/has");
75
- var s = e.n(i);
74
+ const l = require("lodash/has");
75
+ var s = e.n(l);
76
76
  // CONCATENATED MODULE: external "lodash/includes"
77
77
  const a = require("lodash/includes");
78
78
  var c = e.n(a);
79
79
  // CONCATENATED MODULE: external "lodash/isEmpty"
80
- const u = require("lodash/isEmpty");
80
+ const p = require("lodash/isEmpty");
81
81
  // CONCATENATED MODULE: external "lodash/isFunction"
82
- const p = require("lodash/isFunction");
83
- var f = e.n(p);
82
+ const u = require("lodash/isFunction");
83
+ var f = e.n(u);
84
84
  // CONCATENATED MODULE: external "lodash/keys"
85
85
  const d = require("lodash/keys");
86
86
  var g = e.n(d);
87
87
  // CONCATENATED MODULE: external "lodash/omit"
88
- const y = require("lodash/omit");
89
- var v = e.n(y);
88
+ const v = require("lodash/omit");
89
+ var y = e.n(v);
90
90
  // CONCATENATED MODULE: external "@splunk/ui-utils/id"
91
91
  const h = require("@splunk/ui-utils/id");
92
92
  // CONCATENATED MODULE: external "@splunk/ui-utils/keyboard"
@@ -101,177 +101,165 @@
101
101
  * @param ref - The React callback or object ref. Can be `null` or `undefined`.
102
102
  * @param current - The new value of the ref.
103
103
  */
104
- function C(e, t) {
104
+ function w(e, o) {
105
105
  if (e) {
106
106
  if (typeof e === "function") {
107
- e(t);
107
+ e(o);
108
108
  } else {
109
109
  // the public signature of this util uses React.Ref<T> to mirror the way React types refs.
110
110
  // the intention here is to signal "we will take care of setting 'current', not you".
111
- e.current = t;
111
+ e.current = o;
112
112
  // eslint-disable-line no-param-reassign
113
113
  }
114
114
  }
115
115
  }
116
116
  // CONCATENATED MODULE: ./src/Dropdown/Dropdown.tsx
117
- function k(e) {
117
+ function C(e) {
118
118
  "@babel/helpers - typeof";
119
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
120
- k = function e(t) {
121
- return typeof t;
122
- };
123
- } else {
124
- k = function e(t) {
125
- return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
126
- };
127
- }
128
- return k(e);
119
+ return C = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
120
+ return typeof e;
121
+ } : function(e) {
122
+ return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
123
+ }, C(e);
129
124
  }
130
- function R(e, t) {
131
- var o = Object.keys(e);
125
+ function k(e, o) {
126
+ var t = Object.keys(e);
132
127
  if (Object.getOwnPropertySymbols) {
133
128
  var n = Object.getOwnPropertySymbols(e);
134
- if (t) n = n.filter((function(t) {
135
- return Object.getOwnPropertyDescriptor(e, t).enumerable;
136
- }));
137
- o.push.apply(o, n);
129
+ o && (n = n.filter((function(o) {
130
+ return Object.getOwnPropertyDescriptor(e, o).enumerable;
131
+ }))), t.push.apply(t, n);
138
132
  }
139
- return o;
133
+ return t;
140
134
  }
141
- function w(e) {
142
- for (var t = 1; t < arguments.length; t++) {
143
- var o = arguments[t] != null ? arguments[t] : {};
144
- if (t % 2) {
145
- R(Object(o), true).forEach((function(t) {
146
- _(e, t, o[t]);
147
- }));
148
- } else if (Object.getOwnPropertyDescriptors) {
149
- Object.defineProperties(e, Object.getOwnPropertyDescriptors(o));
150
- } else {
151
- R(Object(o)).forEach((function(t) {
152
- Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(o, t));
153
- }));
154
- }
135
+ function R(e) {
136
+ for (var o = 1; o < arguments.length; o++) {
137
+ var t = null != arguments[o] ? arguments[o] : {};
138
+ o % 2 ? k(Object(t), !0).forEach((function(o) {
139
+ _(e, o, t[o]);
140
+ })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : k(Object(t)).forEach((function(o) {
141
+ Object.defineProperty(e, o, Object.getOwnPropertyDescriptor(t, o));
142
+ }));
155
143
  }
156
144
  return e;
157
145
  }
158
- function P(e, t) {
159
- if (!(e instanceof t)) {
160
- throw new TypeError("Cannot call a class as a function");
161
- }
146
+ function j(e, o) {
147
+ if (!(e instanceof o)) throw new TypeError("Cannot call a class as a function");
162
148
  }
163
- function j(e, t) {
164
- for (var o = 0; o < t.length; o++) {
165
- var n = t[o];
166
- n.enumerable = n.enumerable || false;
167
- n.configurable = true;
168
- if ("value" in n) n.writable = true;
169
- Object.defineProperty(e, n.key, n);
149
+ function P(e, o) {
150
+ for (var t = 0; t < o.length; t++) {
151
+ var n = o[t];
152
+ n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
153
+ Object.defineProperty(e, F(n.key), n);
170
154
  }
171
155
  }
172
- function q(e, t, o) {
173
- if (t) j(e.prototype, t);
174
- if (o) j(e, o);
175
- return e;
156
+ function S(e, o, t) {
157
+ return o && P(e.prototype, o), t && P(e, t), Object.defineProperty(e, "prototype", {
158
+ writable: !1
159
+ }), e;
176
160
  }
177
- function S(e, t) {
178
- if (typeof t !== "function" && t !== null) {
179
- throw new TypeError("Super expression must either be null or a function");
180
- }
181
- e.prototype = Object.create(t && t.prototype, {
161
+ function q(e, o) {
162
+ if ("function" != typeof o && null !== o) throw new TypeError("Super expression must either be null or a function");
163
+ e.prototype = Object.create(o && o.prototype, {
182
164
  constructor: {
183
165
  value: e,
184
- writable: true,
185
- configurable: true
166
+ writable: !0,
167
+ configurable: !0
186
168
  }
187
- });
188
- if (t) T(e, t);
169
+ }), Object.defineProperty(e, "prototype", {
170
+ writable: !1
171
+ }), o && T(e, o);
189
172
  }
190
- function T(e, t) {
191
- T = Object.setPrototypeOf || function e(t, o) {
192
- t.__proto__ = o;
193
- return t;
194
- };
195
- return T(e, t);
173
+ function T(e, o) {
174
+ return T = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, o) {
175
+ return e.__proto__ = o, e;
176
+ }, T(e, o);
196
177
  }
197
- function D(e) {
198
- var t = K();
199
- return function o() {
200
- var n = M(e), r;
201
- if (t) {
202
- var l = M(this).constructor;
203
- r = Reflect.construct(n, arguments, l);
204
- } else {
205
- r = n.apply(this, arguments);
206
- }
207
- return I(this, r);
178
+ function E(e) {
179
+ var o = K();
180
+ return function() {
181
+ var t, n = M(e);
182
+ if (o) {
183
+ var r = M(this).constructor;
184
+ t = Reflect.construct(n, arguments, r);
185
+ } else t = n.apply(this, arguments);
186
+ return D(this, t);
208
187
  };
209
188
  }
210
- function I(e, t) {
211
- if (t && (k(t) === "object" || typeof t === "function")) {
212
- return t;
213
- }
214
- return E(e);
189
+ function D(e, o) {
190
+ if (o && ("object" == C(o) || "function" == typeof o)) return o;
191
+ if (void 0 !== o) throw new TypeError("Derived constructors may only return object or undefined");
192
+ return I(e);
215
193
  }
216
- function E(e) {
217
- if (e === void 0) {
218
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
219
- }
194
+ function I(e) {
195
+ if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
220
196
  return e;
221
197
  }
222
198
  function K() {
223
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
224
- if (Reflect.construct.sham) return false;
225
- if (typeof Proxy === "function") return true;
226
199
  try {
227
- Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
228
- return true;
229
- } catch (e) {
230
- return false;
231
- }
200
+ var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
201
+ } catch (e) {}
202
+ return (K = function o() {
203
+ return !!e;
204
+ })();
232
205
  }
233
206
  function M(e) {
234
- M = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
235
- return t.__proto__ || Object.getPrototypeOf(t);
236
- };
237
- return M(e);
207
+ return M = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
208
+ return e.__proto__ || Object.getPrototypeOf(e);
209
+ }, M(e);
238
210
  }
239
- function _(e, t, o) {
240
- if (t in e) {
241
- Object.defineProperty(e, t, {
242
- value: o,
243
- enumerable: true,
244
- configurable: true,
245
- writable: true
246
- });
247
- } else {
248
- e[t] = o;
211
+ function _(e, o, t) {
212
+ return (o = F(o)) in e ? Object.defineProperty(e, o, {
213
+ value: t,
214
+ enumerable: !0,
215
+ configurable: !0,
216
+ writable: !0
217
+ }) : e[o] = t, e;
218
+ }
219
+ function F(e) {
220
+ var o = A(e, "string");
221
+ return "symbol" == C(o) ? o : o + "";
222
+ }
223
+ function A(e, o) {
224
+ if ("object" != C(e) || !e) return e;
225
+ var t = e[Symbol.toPrimitive];
226
+ if (void 0 !== t) {
227
+ var n = t.call(e, o || "default");
228
+ if ("object" != C(n)) return n;
229
+ throw new TypeError("@@toPrimitive must return a primitive value.");
249
230
  }
250
- return e;
231
+ return ("string" === o ? String : Number)(e);
251
232
  }
252
- /** @public */ var F = [ "clickAway", "contentClick", "escapeKey", "offScreen", "tabKey", "toggleClick" ];
253
- var A = {
254
- align: l().oneOf([ "center", "edge", "theme", "end" ]),
255
- canCoverAnchor: l().bool,
256
- children: l().oneOfType([ l().node, l().func ]),
257
- closeReasons: l().arrayOf(l().oneOf(F)),
258
- defaultPlacement: l().oneOf([ "above", "below", "left", "right", "vertical", "horizontal" ]),
259
- elementRef: l().oneOfType([ l().func, l().object ]),
260
- focusToggleReasons: l().arrayOf(l().oneOf(F)),
261
- inputId: l().string,
262
- onRequestClose: l().func,
263
- onRequestOpen: l().func,
264
- open: l().bool,
265
- openWithArrowKeys: l().bool,
266
- repositionMode: l().oneOf([ "none", "flip", "any" ]),
267
- retainFocus: l().bool,
268
- takeFocus: l().bool,
269
- toggle: l().element.isRequired
233
+ /** @public */
234
+ /** @public */
235
+ /** @public */
236
+ /** @public */
237
+ /** @public */
238
+ /** @public */
239
+ /** @public */
240
+ /** @public */ var x = [ "clickAway", "contentClick", "escapeKey", "offScreen", "tabKey", "toggleClick" ];
241
+ var W = {
242
+ align: i().oneOf([ "center", "edge", "theme", "end" ]),
243
+ canCoverAnchor: i().bool,
244
+ children: i().oneOfType([ i().node, i().func ]),
245
+ closeReasons: i().arrayOf(i().oneOf(x)),
246
+ defaultPlacement: i().oneOf([ "above", "below", "left", "right", "vertical", "horizontal" ]),
247
+ elementRef: i().oneOfType([ i().func, i().object ]),
248
+ focusToggleReasons: i().arrayOf(i().oneOf(x)),
249
+ inputId: i().string,
250
+ onRequestClose: i().func,
251
+ onRequestOpen: i().func,
252
+ open: i().bool,
253
+ openWithArrowKeys: i().bool,
254
+ repositionMode: i().oneOf([ "none", "flip", "any" ]),
255
+ retainFocus: i().bool,
256
+ takeFocus: i().bool,
257
+ toggle: i().element.isRequired
270
258
  };
271
- var x = {
259
+ var B = {
272
260
  align: "theme",
273
261
  canCoverAnchor: true,
274
- closeReasons: F,
262
+ closeReasons: x,
275
263
  defaultPlacement: "below",
276
264
  focusToggleReasons: [ "contentClick", "escapeKey", "tabKey", "toggleClick" ],
277
265
  repositionMode: "flip",
@@ -279,122 +267,122 @@
279
267
  openWithArrowKeys: false,
280
268
  takeFocus: true
281
269
  };
282
- var W = Symbol("Dropdown legacy ref mode marker");
270
+ var N = Symbol("Dropdown legacy ref mode marker");
283
271
  var z = function(e) {
284
- S(r, e);
285
- var t = D(r);
272
+ q(r, e);
273
+ var o = E(r);
286
274
  // @docs-props-type DropdownPropsBase
287
275
  /**
288
276
  * Enumeration of the possible reasons for closing the Select.
289
277
  * 'clickAway', 'escapeKey', and 'offScreen' are inherited from Popover, but repeated here for
290
278
  * docs extraction.
291
279
  */ function r(e) {
292
- var o;
293
- P(this, r);
294
- o = t.call(this, e);
295
- _(E(o), "controlledExternally", void 0);
296
- _(E(o), "popoverId", void 0);
297
- _(E(o), "toggleRef", null);
298
- _(E(o), "toggleId", void 0);
299
- _(E(o), "handleToggleMount", (function(e) {
300
- o.toggleRef = e;
301
- o.setState({
280
+ var t;
281
+ j(this, r);
282
+ t = o.call(this, e);
283
+ _(I(t), "controlledExternally", void 0);
284
+ _(I(t), "popoverId", void 0);
285
+ _(I(t), "toggleRef", null);
286
+ _(I(t), "toggleId", void 0);
287
+ _(I(t), "handleToggleMount", (function(e) {
288
+ t.toggleRef = e;
289
+ t.setState({
302
290
  anchor: e
303
291
  });
304
- if (o.props.toggle.type[W]) {
292
+ if (t.props.toggle.type[N]) {
305
293
  // TS: assume that legacy ref mode toggles support elementRef
306
- C(o.props.toggle.props.elementRef, e);
294
+ w(t.props.toggle.props.elementRef, e);
307
295
  } else {
308
296
  // TS: ref does not exist on React.ReactElement - technically, this is undocumented API
309
- C(o.props.toggle.ref, e);
297
+ w(t.props.toggle.ref, e);
310
298
  }
311
299
  }));
312
- _(E(o), "handleToggleClick", (function(e) {
313
- var t, n;
314
- (t = (n = o.props.toggle.props).onClick) === null || t === void 0 ? void 0 : t.call(n, e);
315
- if (o.isOpen()) {
316
- o.handleRequestClose({
300
+ _(I(t), "handleToggleClick", (function(e) {
301
+ var o, n;
302
+ (o = (n = t.props.toggle.props).onClick) === null || o === void 0 ? void 0 : o.call(n, e);
303
+ if (t.isOpen()) {
304
+ t.handleRequestClose({
317
305
  reason: "toggleClick",
318
306
  event: e
319
307
  });
320
308
  } else {
321
- var r, l;
322
- (r = (l = o.props).onRequestOpen) === null || r === void 0 ? void 0 : r.call(l, e, {
309
+ var r, i;
310
+ (r = (i = t.props).onRequestOpen) === null || r === void 0 ? void 0 : r.call(i, e, {
323
311
  reason: "toggleClick"
324
312
  });
325
- if (!o.isControlled()) {
326
- o.setState({
313
+ if (!t.isControlled()) {
314
+ t.setState({
327
315
  open: true
328
316
  });
329
317
  }
330
318
  }
331
319
  }));
332
- _(E(o), "handleToggleKeyDownOpen", (function(e) {
333
- var t, n;
334
- (t = (n = o.props.toggle.props).onKeyDown) === null || t === void 0 ? void 0 : t.call(n, e);
335
- if (!o.props.openWithArrowKeys) {
320
+ _(I(t), "handleToggleKeyDownOpen", (function(e) {
321
+ var o, n;
322
+ (o = (n = t.props.toggle.props).onKeyDown) === null || o === void 0 ? void 0 : o.call(n, e);
323
+ if (!t.props.openWithArrowKeys) {
336
324
  return;
337
325
  }
338
326
  var r = (0, b.keycode)(e.nativeEvent);
339
327
  if (r === "up" || r === "down") {
340
- var l, i;
328
+ var i, l;
341
329
  e.preventDefault();
342
- (l = (i = o.props).onRequestOpen) === null || l === void 0 ? void 0 : l.call(i, e, {
330
+ (i = (l = t.props).onRequestOpen) === null || i === void 0 ? void 0 : i.call(l, e, {
343
331
  reason: "toggleKeydown"
344
332
  });
345
- if (!o.isControlled()) {
346
- o.setState({
333
+ if (!t.isControlled()) {
334
+ t.setState({
347
335
  open: true
348
336
  });
349
337
  }
350
338
  }
351
339
  }));
352
- _(E(o), "handleRequestClose", (function(e) {
353
- var t = e.event, n = e.reason;
354
- var r = o.props, l = r.closeReasons, i = r.focusToggleReasons, s = r.onRequestClose;
355
- if (t && n === "clickAway") {
356
- var a = t.target;
357
- var u = o.props.inputId || o.props.toggle.props.id || o.toggleId;
340
+ _(I(t), "handleRequestClose", (function(e) {
341
+ var o = e.event, n = e.reason;
342
+ var r = t.props, i = r.closeReasons, l = r.focusToggleReasons, s = r.onRequestClose;
343
+ if (o && n === "clickAway") {
344
+ var a = o.target;
345
+ var p = t.props.inputId || t.props.toggle.props.id || t.toggleId;
358
346
  while (a) {
359
347
  // Ignore clicks on toggle.
360
- if (a.id === u) {
348
+ if (a.id === p) {
361
349
  return;
362
350
  }
363
351
  a = a.parentNode;
364
352
  }
365
353
  }
366
- if (o.isOpen() && c()(l, n)) {
367
- if (c()(i, n)) {
368
- o.focus();
354
+ if (t.isOpen() && c()(i, n)) {
355
+ if (c()(l, n)) {
356
+ t.focus();
369
357
  }
370
- if (!o.isControlled()) {
371
- o.setState({
358
+ if (!t.isControlled()) {
359
+ t.setState({
372
360
  open: false
373
361
  });
374
362
  }
375
363
  s === null || s === void 0 ? void 0 : s(e);
376
364
  }
377
365
  }));
378
- _(E(o), "handleContentClick", (function(e) {
379
- o.handleRequestClose({
366
+ _(I(t), "handleContentClick", (function(e) {
367
+ t.handleRequestClose({
380
368
  reason: "contentClick",
381
369
  event: e
382
370
  });
383
371
  }));
384
- o.state = {
372
+ t.state = {
385
373
  anchor: null,
386
374
  open: false
387
375
  };
388
- o.controlledExternally = s()(e, "open");
389
- o.popoverId = (0, h.createDOMID)("popover");
390
- o.toggleId = (0, h.createDOMID)("toggle");
391
- return o;
376
+ t.controlledExternally = s()(e, "open");
377
+ t.popoverId = (0, h.createDOMID)("popover");
378
+ t.toggleId = (0, h.createDOMID)("toggle");
379
+ return t;
392
380
  }
393
- q(r, [ {
381
+ S(r, [ {
394
382
  key: "componentDidUpdate",
395
383
  value: function e() {
396
384
  if (false) {}
397
- var t = w({}, v()(this.props, g()(r.propTypes), "value", "id"));
385
+ var o = R({}, y()(this.props, g()(r.propTypes), "value", "id"));
398
386
  if (false) {}
399
387
  }
400
388
  }, {
@@ -407,8 +395,8 @@
407
395
  */ }, {
408
396
  key: "focus",
409
397
  value: function e() {
410
- var t;
411
- (t = this.toggleRef) === null || t === void 0 ? void 0 : t.focus();
398
+ var o;
399
+ (o = this.toggleRef) === null || o === void 0 ? void 0 : o.focus();
412
400
  }
413
401
  }, {
414
402
  key: "isControlled",
@@ -418,59 +406,60 @@
418
406
  }, {
419
407
  key: "renderToggle",
420
408
  value: function e() {
421
- var t;
409
+ var o;
422
410
 
423
- return (0, o.cloneElement)(this.props.toggle, (t = {
411
+ return (0, t.cloneElement)(this.props.toggle, (o = {
424
412
  onClick: this.handleToggleClick,
425
413
  onKeyDown: this.handleToggleKeyDownOpen
426
- }, _(t, this.props.toggle.type[W] ? "elementRef" : "ref", this.handleToggleMount),
427
- _(t, "aria-controls", this.isOpen() ? this.popoverId : undefined), _(t, "aria-haspopup", this.props.toggle.props["aria-haspopup"] || true),
428
- _(t, "aria-expanded", this.isOpen()), _(t, "data-test", this.props.toggle.props["data-test"] || "dropdown"),
429
- _(t, "data-test-popover-id", this.popoverId), _(t, "id", this.props.inputId || this.props.toggle.props.id || this.toggleId),
430
- t));
414
+ }, _(o, this.props.toggle.type[N] ? "elementRef" : "ref", this.handleToggleMount),
415
+ _(o, "aria-controls", this.isOpen() ? this.popoverId : undefined), _(o, "aria-haspopup", this.props.toggle.props["aria-haspopup"] || true),
416
+ _(o, "aria-expanded", this.isOpen()), _(o, "data-test", this.props.toggle.props["data-test"] || "dropdown"),
417
+ _(o, "data-test-popover-id", this.popoverId), _(o, "id", this.props.inputId || this.props.toggle.props.id || this.toggleId),
418
+ o));
431
419
  }
432
420
  }, {
433
421
  key: "render",
434
422
  value: function e() {
435
- var t = this.props, o = t.align, r = t.canCoverAnchor, l = t.children, i = t.closeReasons, s = t.defaultPlacement, a = t.elementRef, u = t.repositionMode, p = t.retainFocus, d = t.takeFocus;
423
+ var o = this.props, t = o.align, r = o.canCoverAnchor, i = o.children, l = o.closeReasons, s = o.defaultPlacement, a = o.elementRef, p = o.repositionMode, u = o.retainFocus, d = o.takeFocus;
436
424
  var g = this.state.anchor;
437
- var y = this.handleRequestClose, v = this.handleContentClick;
425
+ var v = this.handleRequestClose, y = this.handleContentClick;
438
426
  var h = this.renderToggle();
439
427
 
440
428
  return n().createElement(n().Fragment, null, h, n().createElement(m(), {
441
- align: o,
429
+ align: t,
442
430
  open: !!g && this.isOpen(),
443
- autoCloseWhenOffScreen: c()(i, "offScreen"),
431
+ autoCloseWhenOffScreen: c()(l, "offScreen"),
444
432
  anchor: g,
445
433
  canCoverAnchor: r,
446
434
  elementRef: a,
447
- retainFocus: p,
435
+ retainFocus: u,
448
436
  defaultPlacement: s,
449
- onRequestClose: y,
450
- repositionMode: u,
437
+ onRequestClose: v,
438
+ repositionMode: p,
451
439
  id: this.popoverId,
452
440
  "aria-labelledby": this.props.inputId || this.props.toggle.props.id || this.toggleId,
453
441
  takeFocus: d
454
- }, f()(l) ? // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
442
+ }, f()(i) ?
443
+ // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
455
444
  function() {
456
445
 
457
446
  return n().createElement("div", {
458
- onClick: v
459
- }, l.apply(void 0, arguments));
447
+ onClick: y
448
+ }, i.apply(void 0, arguments));
460
449
  } :
461
450
 
462
451
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
463
452
  n().createElement("div", {
464
- onClick: v
465
- }, l)));
453
+ onClick: y
454
+ }, i)));
466
455
  }
467
456
  } ]);
468
457
  return r;
469
- }(o.Component);
470
- _(z, "possibleCloseReasons", F);
471
- _(z, "propTypes", A);
472
- _(z, "defaultProps", x);
473
- /* harmony default export */ const N = z;
458
+ }(t.Component);
459
+ _(z, "possibleCloseReasons", x);
460
+ _(z, "propTypes", W);
461
+ _(z, "defaultProps", B);
462
+ /* harmony default export */ const U = z;
474
463
  // CONCATENATED MODULE: ./src/Dropdown/index.ts
475
- module.exports = t;
464
+ module.exports = o;
476
465
  /******/})();