@splunk/react-ui 4.21.0 → 4.22.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 (92) hide show
  1. package/Accordion.js +425 -325
  2. package/Anchor.js +147 -117
  3. package/Animation.js +142 -94
  4. package/AnimationToggle.js +197 -193
  5. package/Box.js +145 -118
  6. package/Breadcrumbs.js +288 -206
  7. package/Button.js +488 -465
  8. package/ButtonGroup.js +160 -128
  9. package/ButtonSimple.js +543 -462
  10. package/CHANGELOG.md +24 -3
  11. package/Calendar.js +1111 -1001
  12. package/Card.js +771 -598
  13. package/CardLayout.js +205 -147
  14. package/Chip.js +509 -488
  15. package/Clickable.js +414 -352
  16. package/CloseButton.js +165 -142
  17. package/Code.js +1807 -2084
  18. package/CollapsiblePanel.js +586 -519
  19. package/Color.js +1068 -1068
  20. package/ColumnLayout.js +402 -363
  21. package/ComboBox.js +903 -794
  22. package/Concertina.js +997 -802
  23. package/ControlGroup.js +687 -594
  24. package/Date.js +567 -547
  25. package/DefinitionList.js +308 -234
  26. package/Divider.js +149 -118
  27. package/Dropdown.js +459 -416
  28. package/DualListbox.js +1479 -1541
  29. package/EventListener.js +94 -97
  30. package/File.js +1051 -969
  31. package/FormRows.js +883 -696
  32. package/Heading.js +216 -193
  33. package/Image.js +446 -402
  34. package/JSONTree.js +690 -551
  35. package/Layer.js +437 -410
  36. package/Link.js +336 -255
  37. package/List.js +213 -161
  38. package/Markdown.js +509 -487
  39. package/Menu.js +1104 -1056
  40. package/Message.js +475 -441
  41. package/MessageBar.js +387 -373
  42. package/Modal.js +810 -634
  43. package/ModalLayer.js +326 -243
  44. package/Monogram.js +308 -276
  45. package/Multiselect.js +3564 -3364
  46. package/Number.js +729 -687
  47. package/Paginator.js +510 -449
  48. package/Paragraph.js +145 -112
  49. package/Popover.js +1459 -1432
  50. package/Progress.js +301 -246
  51. package/RadioBar.js +634 -527
  52. package/RadioList.js +483 -444
  53. package/Resize.js +530 -489
  54. package/ResultsMenu.js +479 -455
  55. package/ScreenReaderContent.js +142 -111
  56. package/Scroll.js +595 -456
  57. package/ScrollContainerContext.js +197 -206
  58. package/Search.js +756 -650
  59. package/Select.js +2446 -2345
  60. package/SidePanel.js +390 -284
  61. package/Slider.js +680 -676
  62. package/SlidingPanels.js +639 -503
  63. package/SplitButton.js +464 -367
  64. package/StaticContent.js +161 -133
  65. package/StepBar.js +386 -358
  66. package/Switch.js +710 -640
  67. package/TabBar.js +741 -680
  68. package/TabLayout.js +406 -322
  69. package/Table.js +4974 -4616
  70. package/Text.js +1170 -1138
  71. package/TextArea.js +1102 -1090
  72. package/Tooltip.js +624 -581
  73. package/TransitionOpen.js +489 -422
  74. package/Typography.js +176 -153
  75. package/WaitSpinner.js +230 -206
  76. package/package.json +7 -7
  77. package/types/src/Color/Color.d.ts +0 -1
  78. package/types/src/JSONTree/JSONTreeContext.d.ts +7 -0
  79. package/types/src/JSONTree/TreeNode.d.ts +5 -0
  80. package/types/src/RadioBar/RadioBar.d.ts +1 -0
  81. package/types/src/ResultsMenu/ResultsMenu.d.ts +0 -2
  82. package/types/src/Select/docs/examples/Icons.d.ts +1 -9
  83. package/types/src/Slider/Slider.d.ts +1 -0
  84. package/types/src/TabBar/Tab.d.ts +10 -1
  85. package/types/src/TabBar/TabBar.d.ts +4 -2
  86. package/types/src/Table/Head.d.ts +7 -3
  87. package/types/src/Table/Table.d.ts +3 -2
  88. package/types/src/Table/TableContext.d.ts +2 -0
  89. package/useForceUpdate.js +112 -82
  90. package/useKeyPress.js +74 -71
  91. package/usePrevious.js +65 -65
  92. package/useRovingFocus.js +122 -138
package/ComboBox.js CHANGED
@@ -1,816 +1,925 @@
1
- /******/ (() => { // webpackBootstrap
2
- /******/ "use strict";
3
- /******/ // The require scope
4
- /******/ var __webpack_require__ = {};
5
- /******/
6
- /************************************************************************/
7
- /******/ /* webpack/runtime/compat get default export */
8
- /******/ (() => {
9
- /******/ // getDefaultExport function for compatibility with non-harmony modules
10
- /******/ __webpack_require__.n = (module) => {
11
- /******/ var getter = module && module.__esModule ?
12
- /******/ () => (module['default']) :
13
- /******/ () => (module);
14
- /******/ __webpack_require__.d(getter, { a: getter });
15
- /******/ return getter;
16
- /******/ };
17
- /******/ })();
18
- /******/
19
- /******/ /* webpack/runtime/define property getters */
20
- /******/ (() => {
21
- /******/ // define getter functions for harmony exports
22
- /******/ __webpack_require__.d = (exports, definition) => {
23
- /******/ for(var key in definition) {
24
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
25
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
26
- /******/ }
27
- /******/ }
28
- /******/ };
29
- /******/ })();
30
- /******/
31
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
32
- /******/ (() => {
33
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
34
- /******/ })();
35
- /******/
36
- /******/ /* webpack/runtime/make namespace object */
37
- /******/ (() => {
38
- /******/ // define __esModule on exports
39
- /******/ __webpack_require__.r = (exports) => {
40
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
41
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
42
- /******/ }
43
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
44
- /******/ };
45
- /******/ })();
46
- /******/
47
- /************************************************************************/
48
- var __webpack_exports__ = {};
49
- // ESM COMPAT FLAG
50
- __webpack_require__.r(__webpack_exports__);
51
-
52
- // EXPORTS
53
- __webpack_require__.d(__webpack_exports__, {
54
- Divider: () => (/* reexport */ Menu_namespaceObject.Divider),
55
- Heading: () => (/* reexport */ Menu_namespaceObject.Heading),
56
- Option: () => (/* reexport */ ComboBox_Option),
57
- "default": () => (/* reexport */ ComboBox_ComboBox)
58
- });
59
-
60
- ;// CONCATENATED MODULE: external "react"
61
- const external_react_namespaceObject = require("react");
62
- var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_namespaceObject);
63
- ;// CONCATENATED MODULE: external "prop-types"
64
- const external_prop_types_namespaceObject = require("prop-types");
65
- var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_namespaceObject);
66
- ;// CONCATENATED MODULE: external "lodash/extend"
67
- const extend_namespaceObject = require("lodash/extend");
68
- var extend_default = /*#__PURE__*/__webpack_require__.n(extend_namespaceObject);
69
- ;// CONCATENATED MODULE: external "lodash/has"
70
- const has_namespaceObject = require("lodash/has");
71
- var has_default = /*#__PURE__*/__webpack_require__.n(has_namespaceObject);
72
- ;// CONCATENATED MODULE: external "lodash/omit"
73
- const omit_namespaceObject = require("lodash/omit");
74
- var omit_default = /*#__PURE__*/__webpack_require__.n(omit_namespaceObject);
75
- ;// CONCATENATED MODULE: external "lodash/pick"
76
- const pick_namespaceObject = require("lodash/pick");
77
- var pick_default = /*#__PURE__*/__webpack_require__.n(pick_namespaceObject);
78
- ;// CONCATENATED MODULE: external "lodash/some"
79
- const some_namespaceObject = require("lodash/some");
80
- var some_default = /*#__PURE__*/__webpack_require__.n(some_namespaceObject);
81
- ;// CONCATENATED MODULE: external "@splunk/ui-utils/filter"
82
- const filter_namespaceObject = require("@splunk/ui-utils/filter");
83
- ;// CONCATENATED MODULE: external "@splunk/ui-utils/id"
84
- const id_namespaceObject = require("@splunk/ui-utils/id");
85
- ;// CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
86
- const i18n_namespaceObject = require("@splunk/ui-utils/i18n");
87
- ;// CONCATENATED MODULE: external "@splunk/ui-utils/keyboard"
88
- const keyboard_namespaceObject = require("@splunk/ui-utils/keyboard");
89
- ;// CONCATENATED MODULE: external "@splunk/react-ui/Menu"
90
- const Menu_namespaceObject = require("@splunk/react-ui/Menu");
91
- ;// CONCATENATED MODULE: external "@splunk/react-ui/Popover"
92
- const Popover_namespaceObject = require("@splunk/react-ui/Popover");
93
- var Popover_default = /*#__PURE__*/__webpack_require__.n(Popover_namespaceObject);
94
- ;// CONCATENATED MODULE: external "@splunk/react-ui/ResultsMenu"
95
- const ResultsMenu_namespaceObject = require("@splunk/react-ui/ResultsMenu");
96
- var ResultsMenu_default = /*#__PURE__*/__webpack_require__.n(ResultsMenu_namespaceObject);
97
- ;// CONCATENATED MODULE: external "@splunk/react-ui/Text"
98
- const Text_namespaceObject = require("@splunk/react-ui/Text");
99
- var Text_default = /*#__PURE__*/__webpack_require__.n(Text_namespaceObject);
100
- ;// CONCATENATED MODULE: ./src/ComboBox/Option.tsx
101
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
102
-
103
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
104
-
105
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
106
-
107
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
108
-
109
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
110
-
111
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
112
-
113
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
114
-
115
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
116
-
117
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
118
-
119
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
120
-
121
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
122
-
123
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
124
-
125
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
126
-
127
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
128
-
129
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
130
-
131
-
132
-
133
-
134
- var propTypes = {
135
- /** @private */
136
- active: (external_prop_types_default()).bool,
137
- description: (external_prop_types_default()).string,
138
- descriptionPosition: external_prop_types_default().oneOf(['right', 'bottom']),
139
- disabled: (external_prop_types_default()).bool,
140
- icon: (external_prop_types_default()).node,
141
- label: (external_prop_types_default()).string,
142
- matchRanges: external_prop_types_default().arrayOf(external_prop_types_default().shape({
143
- start: (external_prop_types_default()).number.isRequired,
144
- end: (external_prop_types_default()).number.isRequired
145
- })),
146
-
147
- /** @private */
148
- onClick: (external_prop_types_default()).func,
149
- truncate: (external_prop_types_default()).bool,
150
- value: (external_prop_types_default()).string.isRequired
151
- };
152
- var defaultProps = {
153
- active: false,
154
- descriptionPosition: 'bottom',
155
- disabled: false,
156
- truncate: false
157
- };
158
-
159
- /**
160
- * An option within a `ComboBox`. This inherits from
161
- * [PureComponent](https://reactjs.org/docs/react-api.html#reactpurecomponent)
162
- * so any elements passed to it must also be pure.
163
- */
164
- var Option = /*#__PURE__*/function (_PureComponent) {
165
- _inherits(Option, _PureComponent);
166
-
167
- var _super = _createSuper(Option);
168
-
169
- function Option() {
170
- var _this;
171
-
172
- _classCallCheck(this, Option);
173
-
174
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
175
- args[_key] = arguments[_key];
1
+ /******/ (() => {
2
+ // webpackBootstrap
3
+ /******/ "use strict";
4
+ /******/ // The require scope
5
+ /******/ var e = {};
6
+ /******/
7
+ /************************************************************************/
8
+ /******/ /* webpack/runtime/compat get default export */
9
+ /******/ (() => {
10
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
11
+ /******/ e.n = t => {
12
+ /******/ var n = t && t.__esModule ?
13
+ /******/ () => t["default"]
14
+ /******/ : () => t
15
+ /******/;
16
+ e.d(n, {
17
+ a: n
18
+ });
19
+ /******/ return n;
20
+ /******/ };
21
+ /******/ })();
22
+ /******/
23
+ /******/ /* webpack/runtime/define property getters */
24
+ /******/ (() => {
25
+ /******/ // define getter functions for harmony exports
26
+ /******/ e.d = (t, n) => {
27
+ /******/ for (var o in n) {
28
+ /******/ if (e.o(n, o) && !e.o(t, o)) {
29
+ /******/ Object.defineProperty(t, o, {
30
+ enumerable: true,
31
+ get: n[o]
32
+ });
33
+ /******/ }
34
+ /******/ }
35
+ /******/ };
36
+ /******/ })();
37
+ /******/
38
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
39
+ /******/ (() => {
40
+ /******/ e.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t)
41
+ /******/;
42
+ })();
43
+ /******/
44
+ /******/ /* webpack/runtime/make namespace object */
45
+ /******/ (() => {
46
+ /******/ // define __esModule on exports
47
+ /******/ e.r = e => {
48
+ /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
49
+ /******/ Object.defineProperty(e, Symbol.toStringTag, {
50
+ value: "Module"
51
+ });
52
+ /******/ }
53
+ /******/ Object.defineProperty(e, "__esModule", {
54
+ value: true
55
+ });
56
+ /******/ };
57
+ /******/ })();
58
+ /******/
59
+ /************************************************************************/ var t = {};
60
+ // ESM COMPAT FLAG
61
+ e.r(t);
62
+ // EXPORTS
63
+ e.d(t, {
64
+ Divider: () => /* reexport */ I.Divider,
65
+ Heading: () => /* reexport */ I.Heading,
66
+ Option: () => /* reexport */ X,
67
+ default: () => /* reexport */ he
68
+ });
69
+ // CONCATENATED MODULE: external "react"
70
+ const n = require("react");
71
+ var o = e.n(n);
72
+ // CONCATENATED MODULE: external "prop-types"
73
+ const r = require("prop-types");
74
+ var i = e.n(r);
75
+ // CONCATENATED MODULE: external "lodash/extend"
76
+ const a = require("lodash/extend");
77
+ var l = e.n(a);
78
+ // CONCATENATED MODULE: external "lodash/has"
79
+ const u = require("lodash/has");
80
+ var c = e.n(u);
81
+ // CONCATENATED MODULE: external "lodash/memoize"
82
+ const s = require("lodash/memoize");
83
+ var f = e.n(s);
84
+ // CONCATENATED MODULE: external "lodash/omit"
85
+ const p = require("lodash/omit");
86
+ var d = e.n(p);
87
+ // CONCATENATED MODULE: external "lodash/pick"
88
+ const v = require("lodash/pick");
89
+ var h = e.n(v);
90
+ // CONCATENATED MODULE: external "lodash/some"
91
+ const y = require("lodash/some");
92
+ var b = e.n(y);
93
+ // CONCATENATED MODULE: external "@splunk/ui-utils/filter"
94
+ const m = require("@splunk/ui-utils/filter");
95
+ // CONCATENATED MODULE: external "@splunk/ui-utils/id"
96
+ const g = require("@splunk/ui-utils/id");
97
+ // CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
98
+ const O = require("@splunk/ui-utils/i18n");
99
+ // CONCATENATED MODULE: external "@splunk/ui-utils/keyboard"
100
+ const S = require("@splunk/ui-utils/keyboard");
101
+ // CONCATENATED MODULE: external "@splunk/react-ui/Menu"
102
+ const I = require("@splunk/react-ui/Menu");
103
+ // CONCATENATED MODULE: external "@splunk/react-ui/Popover"
104
+ const C = require("@splunk/react-ui/Popover");
105
+ var w = e.n(C);
106
+ // CONCATENATED MODULE: external "@splunk/react-ui/ResultsMenu"
107
+ const k = require("@splunk/react-ui/ResultsMenu");
108
+ var P = e.n(k);
109
+ // CONCATENATED MODULE: external "@splunk/react-ui/Text"
110
+ const j = require("@splunk/react-ui/Text");
111
+ var x = e.n(j);
112
+ // CONCATENATED MODULE: ./src/ComboBox/Option.tsx
113
+ function R(e) {
114
+ "@babel/helpers - typeof";
115
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
116
+ R = function e(t) {
117
+ return typeof t;
118
+ };
119
+ } else {
120
+ R = function e(t) {
121
+ return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
122
+ };
123
+ }
124
+ return R(e);
176
125
  }
177
-
178
- _this = _super.call.apply(_super, [this].concat(args));
179
-
180
- _defineProperty(_assertThisInitialized(_this), "item", null);
181
-
182
- _defineProperty(_assertThisInitialized(_this), "handleClick", function (e) {
183
- var _this$props = _this.props,
184
- disabled = _this$props.disabled,
185
- onClick = _this$props.onClick,
186
- value = _this$props.value;
187
-
188
- if (!disabled) {
189
- onClick === null || onClick === void 0 ? void 0 : onClick(e, {
190
- value: value
126
+ function M() {
127
+ M = Object.assign || function(e) {
128
+ for (var t = 1; t < arguments.length; t++) {
129
+ var n = arguments[t];
130
+ for (var o in n) {
131
+ if (Object.prototype.hasOwnProperty.call(n, o)) {
132
+ e[o] = n[o];
133
+ }
134
+ }
135
+ }
136
+ return e;
137
+ };
138
+ return M.apply(this, arguments);
139
+ }
140
+ function V(e, t) {
141
+ if (e == null) return {};
142
+ var n = D(e, t);
143
+ var o, r;
144
+ if (Object.getOwnPropertySymbols) {
145
+ var i = Object.getOwnPropertySymbols(e);
146
+ for (r = 0; r < i.length; r++) {
147
+ o = i[r];
148
+ if (t.indexOf(o) >= 0) continue;
149
+ if (!Object.prototype.propertyIsEnumerable.call(e, o)) continue;
150
+ n[o] = e[o];
151
+ }
152
+ }
153
+ return n;
154
+ }
155
+ function D(e, t) {
156
+ if (e == null) return {};
157
+ var n = {};
158
+ var o = Object.keys(e);
159
+ var r, i;
160
+ for (i = 0; i < o.length; i++) {
161
+ r = o[i];
162
+ if (t.indexOf(r) >= 0) continue;
163
+ n[r] = e[r];
164
+ }
165
+ return n;
166
+ }
167
+ function E(e, t) {
168
+ if (!(e instanceof t)) {
169
+ throw new TypeError("Cannot call a class as a function");
170
+ }
171
+ }
172
+ function _(e, t) {
173
+ for (var n = 0; n < t.length; n++) {
174
+ var o = t[n];
175
+ o.enumerable = o.enumerable || false;
176
+ o.configurable = true;
177
+ if ("value" in o) o.writable = true;
178
+ Object.defineProperty(e, o.key, o);
179
+ }
180
+ }
181
+ function q(e, t, n) {
182
+ if (t) _(e.prototype, t);
183
+ if (n) _(e, n);
184
+ return e;
185
+ }
186
+ function A(e, t) {
187
+ if (typeof t !== "function" && t !== null) {
188
+ throw new TypeError("Super expression must either be null or a function");
189
+ }
190
+ e.prototype = Object.create(t && t.prototype, {
191
+ constructor: {
192
+ value: e,
193
+ writable: true,
194
+ configurable: true
195
+ }
191
196
  });
192
- }
193
- });
194
-
195
- return _this;
196
- }
197
-
198
- _createClass(Option, [{
199
- key: "scrollIntoViewIfNeeded",
200
- value: function scrollIntoViewIfNeeded() {
201
- var _this$item;
202
-
203
- (_this$item = this.item) === null || _this$item === void 0 ? void 0 : _this$item.scrollIntoViewIfNeeded();
197
+ if (t) B(e, t);
204
198
  }
205
- }, {
206
- key: "render",
207
- value: function render() {
208
- var _this2 = this;
209
-
210
- // eslint-disable-next-line no-unused-vars
211
- var _this$props2 = this.props,
212
- value = _this$props2.value,
213
- label = _this$props2.label,
214
- otherProps = _objectWithoutProperties(_this$props2, ["value", "label"]);
215
-
216
- var displayLabel = label === undefined ? value : label;
217
- return /*#__PURE__*/external_react_default().createElement(Menu_namespaceObject.Item, _extends({
218
- ref: function ref(c) {
219
- _this2.item = c;
220
- },
221
- "data-test": "option",
222
- "data-test-value": value
223
- }, otherProps, {
224
- onClick: this.handleClick,
225
- role: "option",
226
- "aria-selected": false
227
- }), displayLabel);
228
- }
229
- }]);
230
-
231
- return Option;
232
- }(external_react_namespaceObject.PureComponent);
233
-
234
- _defineProperty(Option, "propTypes", propTypes);
235
-
236
- _defineProperty(Option, "defaultProps", defaultProps);
237
-
238
- /* harmony default export */ const ComboBox_Option = (Option);
239
- ;// CONCATENATED MODULE: ./src/utils/updateReactRef.ts
240
- /**
199
+ function B(e, t) {
200
+ B = Object.setPrototypeOf || function e(t, n) {
201
+ t.__proto__ = n;
202
+ return t;
203
+ };
204
+ return B(e, t);
205
+ }
206
+ function T(e) {
207
+ var t = H();
208
+ return function n() {
209
+ var o = K(e), r;
210
+ if (t) {
211
+ var i = K(this).constructor;
212
+ r = Reflect.construct(o, arguments, i);
213
+ } else {
214
+ r = o.apply(this, arguments);
215
+ }
216
+ return L(this, r);
217
+ };
218
+ }
219
+ function L(e, t) {
220
+ if (t && (R(t) === "object" || typeof t === "function")) {
221
+ return t;
222
+ }
223
+ return F(e);
224
+ }
225
+ function F(e) {
226
+ if (e === void 0) {
227
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
228
+ }
229
+ return e;
230
+ }
231
+ function H() {
232
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
233
+ if (Reflect.construct.sham) return false;
234
+ if (typeof Proxy === "function") return true;
235
+ try {
236
+ Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
237
+ return true;
238
+ } catch (e) {
239
+ return false;
240
+ }
241
+ }
242
+ function K(e) {
243
+ K = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
244
+ return t.__proto__ || Object.getPrototypeOf(t);
245
+ };
246
+ return K(e);
247
+ }
248
+ function N(e, t, n) {
249
+ if (t in e) {
250
+ Object.defineProperty(e, t, {
251
+ value: n,
252
+ enumerable: true,
253
+ configurable: true,
254
+ writable: true
255
+ });
256
+ } else {
257
+ e[t] = n;
258
+ }
259
+ return e;
260
+ }
261
+ var z = {
262
+ /** @private */
263
+ active: i().bool,
264
+ description: i().string,
265
+ descriptionPosition: i().oneOf([ "right", "bottom" ]),
266
+ disabled: i().bool,
267
+ icon: i().node,
268
+ label: i().string,
269
+ matchRanges: i().arrayOf(i().shape({
270
+ start: i().number.isRequired,
271
+ end: i().number.isRequired
272
+ })),
273
+ /** @private */
274
+ onClick: i().func,
275
+ truncate: i().bool,
276
+ value: i().string.isRequired
277
+ };
278
+ var W = {
279
+ active: false,
280
+ descriptionPosition: "bottom",
281
+ disabled: false,
282
+ truncate: false
283
+ };
284
+ /**
285
+ * An option within a `ComboBox`. This inherits from
286
+ * [PureComponent](https://reactjs.org/docs/react-api.html#reactpurecomponent)
287
+ * so any elements passed to it must also be pure.
288
+ */ var U = function(e) {
289
+ A(n, e);
290
+ var t = T(n);
291
+ function n() {
292
+ var e;
293
+ E(this, n);
294
+ for (var o = arguments.length, r = new Array(o), i = 0; i < o; i++) {
295
+ r[i] = arguments[i];
296
+ }
297
+ e = t.call.apply(t, [ this ].concat(r));
298
+ N(F(e), "item", null);
299
+ N(F(e), "handleClick", (function(t) {
300
+ var n = e.props, o = n.disabled, r = n.onClick, i = n.value;
301
+ if (!o) {
302
+ r === null || r === void 0 ? void 0 : r(t, {
303
+ value: i
304
+ });
305
+ }
306
+ }));
307
+ return e;
308
+ }
309
+ q(n, [ {
310
+ key: "scrollIntoViewIfNeeded",
311
+ value: function e() {
312
+ var t;
313
+ (t = this.item) === null || t === void 0 ? void 0 : t.scrollIntoViewIfNeeded();
314
+ }
315
+ }, {
316
+ key: "render",
317
+ value: function e() {
318
+ var t = this;
319
+ // eslint-disable-next-line no-unused-vars
320
+ var n = this.props, r = n.value, i = n.label, a = V(n, [ "value", "label" ]);
321
+ var l = i === undefined ? r : i;
322
+
323
+ return o().createElement(I.Item, M({
324
+ ref: function e(n) {
325
+ t.item = n;
326
+ },
327
+ "data-test": "option",
328
+ "data-test-value": r
329
+ }, a, {
330
+ onClick: this.handleClick,
331
+ role: "option",
332
+ "aria-selected": false
333
+ }), l);
334
+ }
335
+ } ]);
336
+ return n;
337
+ }(n.PureComponent);
338
+ N(U, "propTypes", z);
339
+ N(U, "defaultProps", W);
340
+ /* harmony default export */ const X = U;
341
+ // CONCATENATED MODULE: ./src/utils/updateReactRef.ts
342
+ /**
241
343
  * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
242
344
  *
243
345
  * @param ref - The React callback or object ref. Can be `null` or `undefined`.
244
346
  * @param current - The new value of the ref.
245
347
  */
246
- function updateReactRef(ref, current) {
247
- if (ref) {
248
- if (typeof ref === 'function') {
249
- ref(current);
250
- } else {
251
- // the public signature of this util uses React.Ref<T> to mirror the way React types refs.
252
- // the intention here is to signal "we will take care of setting 'current', not you".
253
- ref.current = current; // eslint-disable-line no-param-reassign
254
- }
255
- }
256
- }
257
-
258
-
259
- ;// CONCATENATED MODULE: ./src/ComboBox/ComboBox.tsx
260
- function ComboBox_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ComboBox_typeof = function _typeof(obj) { return typeof obj; }; } else { ComboBox_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ComboBox_typeof(obj); }
261
-
262
- function ComboBox_extends() { ComboBox_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return ComboBox_extends.apply(this, arguments); }
263
-
264
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
265
-
266
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { ComboBox_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
267
-
268
- function ComboBox_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
269
-
270
- function ComboBox_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
271
-
272
- function ComboBox_createClass(Constructor, protoProps, staticProps) { if (protoProps) ComboBox_defineProperties(Constructor.prototype, protoProps); if (staticProps) ComboBox_defineProperties(Constructor, staticProps); return Constructor; }
273
-
274
- function ComboBox_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) ComboBox_setPrototypeOf(subClass, superClass); }
275
-
276
- function ComboBox_setPrototypeOf(o, p) { ComboBox_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ComboBox_setPrototypeOf(o, p); }
277
-
278
- function ComboBox_createSuper(Derived) { var hasNativeReflectConstruct = ComboBox_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ComboBox_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ComboBox_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ComboBox_possibleConstructorReturn(this, result); }; }
279
-
280
- function ComboBox_possibleConstructorReturn(self, call) { if (call && (ComboBox_typeof(call) === "object" || typeof call === "function")) { return call; } return ComboBox_assertThisInitialized(self); }
281
-
282
- function ComboBox_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
283
-
284
- function ComboBox_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
285
-
286
- function ComboBox_getPrototypeOf(o) { ComboBox_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ComboBox_getPrototypeOf(o); }
287
-
288
- function ComboBox_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
289
-
290
-
291
-
292
-
293
-
294
-
295
-
296
-
297
-
298
-
299
-
300
-
301
-
302
-
303
-
304
-
305
-
306
-
307
- var ComboBox_propTypes = {
308
- animateLoading: (external_prop_types_default()).bool,
309
- append: (external_prop_types_default()).bool,
310
- children: (external_prop_types_default()).node,
311
- controlledFilter: (external_prop_types_default()).bool,
312
- defaultPlacement: external_prop_types_default().oneOf(['above', 'below', 'vertical']),
313
- defaultValue: (external_prop_types_default()).string,
314
- describedBy: (external_prop_types_default()).string,
315
- disabled: (external_prop_types_default()).bool,
316
- elementRef: external_prop_types_default().oneOfType([(external_prop_types_default()).func, (external_prop_types_default()).object]),
317
- error: (external_prop_types_default()).bool,
318
- footerMessage: (external_prop_types_default()).node,
319
- inline: (external_prop_types_default()).bool,
320
- inputRef: external_prop_types_default().oneOfType([(external_prop_types_default()).func, (external_prop_types_default()).object]),
321
- isLoadingOptions: (external_prop_types_default()).bool,
322
- labelledBy: (external_prop_types_default()).string,
323
- loadingMessage: (external_prop_types_default()).node,
324
- menuStyle: (external_prop_types_default()).object,
325
- name: (external_prop_types_default()).string,
326
- noOptionsMessage: (external_prop_types_default()).node,
327
- onChange: (external_prop_types_default()).func,
328
- onClose: (external_prop_types_default()).func,
329
- onFocus: (external_prop_types_default()).func,
330
- onKeyDown: (external_prop_types_default()).func,
331
- onOpen: (external_prop_types_default()).func,
332
- onScroll: (external_prop_types_default()).func,
333
- onScrollBottom: (external_prop_types_default()).func,
334
- placeholder: (external_prop_types_default()).string,
335
- prepend: (external_prop_types_default()).bool,
336
- size: external_prop_types_default().oneOf(['small', 'medium', 'large']),
337
- value: (external_prop_types_default()).string
338
- };
339
- var ComboBox_defaultProps = {
340
- animateLoading: false,
341
- controlledFilter: false,
342
- defaultPlacement: 'vertical',
343
- disabled: false,
344
- error: false,
345
- inline: false,
346
- isLoadingOptions: false,
347
- menuStyle: {},
348
- placeholder: (0,i18n_namespaceObject._)('Select...'),
349
- size: 'medium'
350
- };
351
-
352
- function containsEvent(el, _ref) {
353
- var clientX = _ref.clientX,
354
- clientY = _ref.clientY;
355
-
356
- var _el$getBoundingClient = el.getBoundingClientRect(),
357
- top = _el$getBoundingClient.top,
358
- left = _el$getBoundingClient.left,
359
- bottom = _el$getBoundingClient.bottom,
360
- right = _el$getBoundingClient.right;
361
-
362
- return clientX > left && clientX < right && clientY > top && clientY < bottom;
363
- }
364
-
365
- /**
366
- * `ComboBox` allows the user to select a predefined string or enter a new value. Unlike `Select`
367
- * and `Multiselect`, `Option` value must always be a string and `Option` does not have a label
368
- * property.
369
- */
370
- var ComboBox = /*#__PURE__*/function (_Component) {
371
- ComboBox_inherits(ComboBox, _Component);
372
-
373
- var _super = ComboBox_createSuper(ComboBox);
374
-
375
- // @docs-props-type ComboBoxPropsBase
376
- function ComboBox(props) {
377
- var _this;
378
-
379
- ComboBox_classCallCheck(this, ComboBox);
380
-
381
- _this = _super.call(this, props);
382
-
383
- ComboBox_defineProperty(ComboBox_assertThisInitialized(_this), "activeItemId", void 0);
384
-
385
- ComboBox_defineProperty(ComboBox_assertThisInitialized(_this), "activeValue", void 0);
386
-
387
- ComboBox_defineProperty(ComboBox_assertThisInitialized(_this), "availableOptionCount", 0);
388
-
389
- ComboBox_defineProperty(ComboBox_assertThisInitialized(_this), "controlledExternally", void 0);
390
-
391
- ComboBox_defineProperty(ComboBox_assertThisInitialized(_this), "focusCalledInternally", false);
392
-
393
- ComboBox_defineProperty(ComboBox_assertThisInitialized(_this), "options", void 0);
394
-
395
- ComboBox_defineProperty(ComboBox_assertThisInitialized(_this), "popoverId", void 0);
396
-
397
- ComboBox_defineProperty(ComboBox_assertThisInitialized(_this), "previousActiveIndex", null);
398
-
399
- ComboBox_defineProperty(ComboBox_assertThisInitialized(_this), "textInput", null);
400
-
401
- ComboBox_defineProperty(ComboBox_assertThisInitialized(_this), "handleInputMount", function (el) {
402
- _this.textInput = el;
403
- updateReactRef(_this.props.inputRef, el);
404
- });
405
-
406
- ComboBox_defineProperty(ComboBox_assertThisInitialized(_this), "handleAnchorMount", function (el) {
407
- _this.setState({
408
- anchor: el
409
- });
410
-
411
- updateReactRef(_this.props.elementRef, el);
412
- });
413
-
414
- ComboBox_defineProperty(ComboBox_assertThisInitialized(_this), "handleActiveOptionMount", function (c) {
415
- if (_this.previousActiveIndex !== _this.state.activeIndex) {
416
- c === null || c === void 0 ? void 0 : c.scrollIntoViewIfNeeded();
417
- }
418
- });
419
-
420
- ComboBox_defineProperty(ComboBox_assertThisInitialized(_this), "handleInputFocus", function (e) {
421
- var _this$props$onFocus, _this$props;
422
-
423
- /* SUI-930 On IE 11 this handler is essentially deferred after calling
424
- * this.textInput.focus(). this.focusCalledInternally enables the focus event to be ignored
425
- * when the menu closes. */
426
- if (_this.focusCalledInternally) {
427
- _this.focusCalledInternally = false;
428
- } else {
429
- _this.open();
430
- }
431
-
432
- (_this$props$onFocus = (_this$props = _this.props).onFocus) === null || _this$props$onFocus === void 0 ? void 0 : _this$props$onFocus.call(_this$props, e);
433
- });
434
-
435
- ComboBox_defineProperty(ComboBox_assertThisInitialized(_this), "handleChange", function (e, _ref2) {
436
- var _this$props$onChange, _this$props2;
437
-
438
- var value = _ref2.value,
439
- selectedOption = _ref2.selectedOption;
440
- var name = _this.props.name;
441
- var typedValue = selectedOption ? undefined : value;
442
-
443
- if (_this.isControlled()) {
444
- _this.setState({
445
- activeIndex: 0,
446
- typedValue: typedValue
447
- });
448
- } else {
449
- _this.setState({
450
- value: value,
451
- activeIndex: 0,
452
- typedValue: typedValue
453
- });
454
- }
455
-
456
- (_this$props$onChange = (_this$props2 = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props2, e, {
457
- value: value,
458
- name: name
459
- });
460
- });
461
-
462
- ComboBox_defineProperty(ComboBox_assertThisInitialized(_this), "handleSelectOption", function (e, data) {
463
- _this.handleChange(e, _objectSpread(_objectSpread({}, data), {}, {
464
- selectedOption: true
465
- }));
466
-
467
- _this.focusCalledInternally = true;
468
-
469
- _this.focus();
470
-
471
- _this.close();
472
- });
473
-
474
- ComboBox_defineProperty(ComboBox_assertThisInitialized(_this), "handleInputKeyDown", function (e) {
475
- var _this$props3 = _this.props,
476
- children = _this$props3.children,
477
- onKeyDown = _this$props3.onKeyDown,
478
- onScrollBottom = _this$props3.onScrollBottom;
479
- var numOptions = _this.availableOptionCount;
480
- var activeOption = _this.activeValue;
481
- var eventKeyCode = (0,keyboard_namespaceObject.keycode)(e.nativeEvent);
482
-
483
- if (_this.state.open) {
484
- switch (eventKeyCode) {
485
- case 'enter':
486
- {
487
- if (activeOption) {
488
- _this.handleSelectOption(e, {
489
- value: activeOption
490
- });
491
- }
492
-
493
- break;
494
- }
495
-
496
- case 'tab':
497
- _this.close();
498
-
499
- break;
500
-
501
- case 'down':
502
- _this.setState(function (state) {
503
- return {
504
- activeIndex: Math.min(state.activeIndex + 1, numOptions - 1)
505
- };
506
- });
507
-
508
- if (children && onScrollBottom) {
509
- var beforeLastChild = external_react_namespaceObject.Children.count(children) - 2;
510
-
511
- if (_this.state.activeIndex === beforeLastChild) {
512
- _this.handleScrollBottom(e);
513
- }
348
+ function Y(e, t) {
349
+ if (e) {
350
+ if (typeof e === "function") {
351
+ e(t);
352
+ } else {
353
+ // the public signature of this util uses React.Ref<T> to mirror the way React types refs.
354
+ // the intention here is to signal "we will take care of setting 'current', not you".
355
+ e.current = t;
356
+ // eslint-disable-line no-param-reassign
357
+ }
358
+ }
359
+ }
360
+ // CONCATENATED MODULE: ./src/ComboBox/ComboBox.tsx
361
+ function G(e) {
362
+ "@babel/helpers - typeof";
363
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
364
+ G = function e(t) {
365
+ return typeof t;
366
+ };
367
+ } else {
368
+ G = function e(t) {
369
+ return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
370
+ };
371
+ }
372
+ return G(e);
373
+ }
374
+ function J() {
375
+ J = Object.assign || function(e) {
376
+ for (var t = 1; t < arguments.length; t++) {
377
+ var n = arguments[t];
378
+ for (var o in n) {
379
+ if (Object.prototype.hasOwnProperty.call(n, o)) {
380
+ e[o] = n[o];
381
+ }
382
+ }
514
383
  }
515
-
516
- break;
517
-
518
- case 'up':
519
- _this.setState(function (state) {
520
- return {
521
- activeIndex: Math.max(state.activeIndex - 1, 0)
522
- };
523
- });
524
-
525
- break;
526
-
527
- default: // do nothing
528
-
384
+ return e;
385
+ };
386
+ return J.apply(this, arguments);
387
+ }
388
+ function Q(e, t) {
389
+ var n = Object.keys(e);
390
+ if (Object.getOwnPropertySymbols) {
391
+ var o = Object.getOwnPropertySymbols(e);
392
+ if (t) o = o.filter((function(t) {
393
+ return Object.getOwnPropertyDescriptor(e, t).enumerable;
394
+ }));
395
+ n.push.apply(n, o);
529
396
  }
530
- } else if ((0,keyboard_namespaceObject.addsCharacter)(e.nativeEvent) !== false || // Safari 9.0 returns undefined
531
- eventKeyCode === 'enter' || eventKeyCode === 'backspace' || eventKeyCode === 'down' || eventKeyCode === 'up') {
532
- _this.open();
533
- }
534
-
535
- onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
536
- });
537
-
538
- ComboBox_defineProperty(ComboBox_assertThisInitialized(_this), "handleInputClick", function () {
539
- if (!_this.state.open && !_this.props.disabled) {
540
- _this.open();
541
- }
542
- });
543
-
544
- ComboBox_defineProperty(ComboBox_assertThisInitialized(_this), "handleRequestClose", function (_ref3) {
545
- var event = _ref3.event,
546
- reason = _ref3.reason;
547
- var shouldClose = reason === 'offScreen' || reason === 'escapeKey' || reason === 'clickAway' && _this.state.anchor && !containsEvent(_this.state.anchor, event);
548
-
549
- if (shouldClose) {
550
- _this.close();
551
- }
552
- });
553
-
554
- ComboBox_defineProperty(ComboBox_assertThisInitialized(_this), "handleScrollBottom", function (e) {
555
- if (_this.state.open && !_this.props.isLoadingOptions) {
556
- var _this$props$onScrollB, _this$props4;
557
-
558
- (_this$props$onScrollB = (_this$props4 = _this.props).onScrollBottom) === null || _this$props$onScrollB === void 0 ? void 0 : _this$props$onScrollB.call(_this$props4, e);
559
- }
560
- });
561
-
562
- ComboBox_defineProperty(ComboBox_assertThisInitialized(_this), "renderMenu", function (_ref4) {
563
- var anchorWidth = _ref4.anchorWidth,
564
- maxHeight = _ref4.maxHeight;
565
- var _this$props5 = _this.props,
566
- children = _this$props5.children,
567
- controlledFilter = _this$props5.controlledFilter,
568
- isLoadingOptions = _this$props5.isLoadingOptions,
569
- menuStyle = _this$props5.menuStyle,
570
- onScrollBottom = _this$props5.onScrollBottom;
571
- var _this$state = _this.state,
572
- activeIndex = _this$state.activeIndex,
573
- typedValue = _this$state.typedValue;
574
-
575
- var value = _this.getValue();
576
-
577
- var initialOptions = external_react_namespaceObject.Children.toArray(children).filter(external_react_namespaceObject.isValidElement);
578
- var hasExactMatch = some_default()(initialOptions, function (option) {
579
- if (option.type === Menu_namespaceObject.Heading) {
580
- return false;
397
+ return n;
398
+ }
399
+ function Z(e) {
400
+ for (var t = 1; t < arguments.length; t++) {
401
+ var n = arguments[t] != null ? arguments[t] : {};
402
+ if (t % 2) {
403
+ Q(Object(n), true).forEach((function(t) {
404
+ ce(e, t, n[t]);
405
+ }));
406
+ } else if (Object.getOwnPropertyDescriptors) {
407
+ Object.defineProperties(e, Object.getOwnPropertyDescriptors(n));
408
+ } else {
409
+ Q(Object(n)).forEach((function(t) {
410
+ Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
411
+ }));
412
+ }
581
413
  }
582
-
583
- if (option.props.label === undefined) {
584
- return option.props.value === value;
414
+ return e;
415
+ }
416
+ function $(e, t) {
417
+ if (!(e instanceof t)) {
418
+ throw new TypeError("Cannot call a class as a function");
585
419
  }
586
-
587
- if (option.props.label !== undefined && typedValue !== undefined) {
588
- return option.props.label === value;
420
+ }
421
+ function ee(e, t) {
422
+ for (var n = 0; n < t.length; n++) {
423
+ var o = t[n];
424
+ o.enumerable = o.enumerable || false;
425
+ o.configurable = true;
426
+ if ("value" in o) o.writable = true;
427
+ Object.defineProperty(e, o.key, o);
589
428
  }
590
-
591
- return option.props.value === value;
592
- });
593
-
594
- if (!hasExactMatch && value) {
595
- initialOptions.unshift( /*#__PURE__*/external_react_default().createElement(ComboBox_Option, {
596
- description: (0,i18n_namespaceObject._)('(New value)'),
597
- descriptionPosition: "right",
598
- key: "currentValueOption",
599
- value: value,
600
- "data-test-current-value-option": value
601
- }));
602
- } // Highlight Active
603
-
604
-
605
- _this.availableOptionCount = 0;
606
- _this.activeValue = undefined;
607
- var keywords = (0,filter_namespaceObject.stringToKeywords)(typedValue ? value : _this.getDisplayValue());
608
- _this.options = (controlledFilter ? initialOptions : initialOptions.filter(function (option) {
609
- if (option.props.label !== undefined) {
610
- return (0,filter_namespaceObject.testPhrase)(option.props.label, keywords);
429
+ }
430
+ function te(e, t, n) {
431
+ if (t) ee(e.prototype, t);
432
+ if (n) ee(e, n);
433
+ return e;
434
+ }
435
+ function ne(e, t) {
436
+ if (typeof t !== "function" && t !== null) {
437
+ throw new TypeError("Super expression must either be null or a function");
611
438
  }
612
-
613
- if (option.props.value !== undefined) {
614
- return (0,filter_namespaceObject.testPhrase)(option.props.value, keywords);
439
+ e.prototype = Object.create(t && t.prototype, {
440
+ constructor: {
441
+ value: e,
442
+ writable: true,
443
+ configurable: true
444
+ }
445
+ });
446
+ if (t) oe(e, t);
447
+ }
448
+ function oe(e, t) {
449
+ oe = Object.setPrototypeOf || function e(t, n) {
450
+ t.__proto__ = n;
451
+ return t;
452
+ };
453
+ return oe(e, t);
454
+ }
455
+ function re(e) {
456
+ var t = le();
457
+ return function n() {
458
+ var o = ue(e), r;
459
+ if (t) {
460
+ var i = ue(this).constructor;
461
+ r = Reflect.construct(o, arguments, i);
462
+ } else {
463
+ r = o.apply(this, arguments);
464
+ }
465
+ return ie(this, r);
466
+ };
467
+ }
468
+ function ie(e, t) {
469
+ if (t && (G(t) === "object" || typeof t === "function")) {
470
+ return t;
615
471
  }
616
-
617
- return true; // Keep all headers and non-interactive options
618
- })).map(function (option, index) {
619
- if (!has_default()(option.props, 'active')) {
620
- // ignore Headings and Dividers
621
- return option;
472
+ return ae(e);
473
+ }
474
+ function ae(e) {
475
+ if (e === void 0) {
476
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
622
477
  }
623
-
624
- var active = _this.availableOptionCount === activeIndex;
625
- _this.availableOptionCount += 1;
626
- var matchRangePhrase = option.props.label !== undefined ? option.props.label : option.props.value;
627
- var matchRangesProp = option.props.matchRanges;
628
- var matchRanges = !controlledFilter && value && (hasExactMatch || index > 0) ? (0,filter_namespaceObject.keywordLocations)(matchRangePhrase, keywords) || undefined // keywordLocations can return false, matchRanges must be an array or undefined
629
- : undefined;
630
-
631
- if (active) {
632
- _this.activeValue = option.props.value;
633
- return /*#__PURE__*/(0,external_react_namespaceObject.cloneElement)(option, {
634
- ref: _this.handleActiveOptionMount,
635
- id: _this.activeItemId,
636
- onClick: _this.handleSelectOption,
637
- matchRanges: matchRangesProp || matchRanges,
638
- active: true
639
- });
478
+ return e;
479
+ }
480
+ function le() {
481
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
482
+ if (Reflect.construct.sham) return false;
483
+ if (typeof Proxy === "function") return true;
484
+ try {
485
+ Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
486
+ return true;
487
+ } catch (e) {
488
+ return false;
640
489
  }
641
-
642
- return /*#__PURE__*/(0,external_react_namespaceObject.cloneElement)(option, {
643
- onClick: _this.handleSelectOption,
644
- matchRanges: matchRangesProp || matchRanges
645
- });
646
- });
647
- return /*#__PURE__*/external_react_default().createElement((ResultsMenu_default()), ComboBox_extends({
648
- style: extend_default()({
649
- overflow: 'auto',
650
- width: Math.max(anchorWidth !== null && anchorWidth !== void 0 ? anchorWidth : 0, 200)
651
- }, menuStyle),
652
- controlledExternally: true,
653
- maxHeight: maxHeight !== null && maxHeight !== void 0 ? maxHeight : undefined,
654
- onScrollBottom: onScrollBottom ? _this.handleScrollBottom : undefined,
655
- isLoading: isLoadingOptions
656
- }, pick_default()(_this.props, 'className', 'noOptionsMessage', 'footerMessage', 'animateLoading', 'loadingMessage', 'onScroll')), _this.options);
657
- });
658
-
659
- _this.state = {
660
- activeIndex: 0,
661
- anchor: null,
662
- typedValue: undefined,
663
- open: false,
664
- value: props.defaultValue || ''
665
- };
666
- _this.controlledExternally = has_default()(props, 'value');
667
- _this.popoverId = (0,id_namespaceObject.createDOMID)('popover');
668
- _this.activeItemId = (0,id_namespaceObject.createDOMID)('active-item');
669
-
670
- if (false) {}
671
-
672
- if (false) {}
673
-
674
- return _this;
675
- }
676
-
677
- ComboBox_createClass(ComboBox, [{
678
- key: "componentDidUpdate",
679
- value: function componentDidUpdate(prevProps, prevState) {
680
- if (false) {}
681
-
682
- this.previousActiveIndex = prevState.activeIndex;
683
- }
684
- }, {
685
- key: "getValue",
686
- value: function getValue() {
687
- return this.isControlled() ? this.props.value : this.state.value;
688
- }
689
- }, {
690
- key: "getDisplayValue",
691
- value: function getDisplayValue() {
692
- var value = this.getValue();
693
- var typedValue = this.state.typedValue;
694
- var initialOptions = external_react_namespaceObject.Children.toArray(this.props.children).filter(external_react_namespaceObject.isValidElement);
695
- var optionForValue = !typedValue && initialOptions.find(function (option) {
696
- return option.props.label !== undefined && option.props.value === value;
697
- });
698
-
699
- if (optionForValue) {
700
- return optionForValue === null || optionForValue === void 0 ? void 0 : optionForValue.props.label;
701
- }
702
-
703
- return value;
704
490
  }
705
- }, {
706
- key: "open",
707
- value: function open() {
708
- var _this2 = this;
709
-
710
- this.setState({
711
- open: true,
712
- activeIndex: 0
713
- }, function () {
714
- var _this2$props$onOpen, _this2$props;
715
-
716
- (_this2$props$onOpen = (_this2$props = _this2.props).onOpen) === null || _this2$props$onOpen === void 0 ? void 0 : _this2$props$onOpen.call(_this2$props);
717
- });
491
+ function ue(e) {
492
+ ue = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
493
+ return t.__proto__ || Object.getPrototypeOf(t);
494
+ };
495
+ return ue(e);
718
496
  }
719
- }, {
720
- key: "close",
721
- value: function close() {
722
- var _this3 = this;
723
-
724
- this.setState({
725
- open: false
726
- }, function () {
727
- var _this3$props$onClose, _this3$props;
728
-
729
- _this3.previousActiveIndex = null;
730
- (_this3$props$onClose = (_this3$props = _this3.props).onClose) === null || _this3$props$onClose === void 0 ? void 0 : _this3$props$onClose.call(_this3$props);
731
- });
497
+ function ce(e, t, n) {
498
+ if (t in e) {
499
+ Object.defineProperty(e, t, {
500
+ value: n,
501
+ enumerable: true,
502
+ configurable: true,
503
+ writable: true
504
+ });
505
+ } else {
506
+ e[t] = n;
507
+ }
508
+ return e;
732
509
  }
510
+ var se = {
511
+ animateLoading: i().bool,
512
+ append: i().bool,
513
+ children: i().node,
514
+ controlledFilter: i().bool,
515
+ defaultPlacement: i().oneOf([ "above", "below", "vertical" ]),
516
+ defaultValue: i().string,
517
+ describedBy: i().string,
518
+ disabled: i().bool,
519
+ elementRef: i().oneOfType([ i().func, i().object ]),
520
+ error: i().bool,
521
+ footerMessage: i().node,
522
+ inline: i().bool,
523
+ inputRef: i().oneOfType([ i().func, i().object ]),
524
+ isLoadingOptions: i().bool,
525
+ labelledBy: i().string,
526
+ loadingMessage: i().node,
527
+ menuStyle: i().object,
528
+ name: i().string,
529
+ noOptionsMessage: i().node,
530
+ onChange: i().func,
531
+ onClose: i().func,
532
+ onFocus: i().func,
533
+ onKeyDown: i().func,
534
+ onOpen: i().func,
535
+ onScroll: i().func,
536
+ onScrollBottom: i().func,
537
+ placeholder: i().string,
538
+ prepend: i().bool,
539
+ size: i().oneOf([ "small", "medium", "large" ]),
540
+ value: i().string
541
+ };
542
+ var fe = {
543
+ animateLoading: false,
544
+ controlledFilter: false,
545
+ defaultPlacement: "vertical",
546
+ disabled: false,
547
+ error: false,
548
+ inline: false,
549
+ isLoadingOptions: false,
550
+ menuStyle: {},
551
+ placeholder: (0, O._)("Select..."),
552
+ size: "medium"
553
+ };
554
+ function pe(e, t) {
555
+ var n = t.clientX, o = t.clientY;
556
+ var r = e.getBoundingClientRect(), i = r.top, a = r.left, l = r.bottom, u = r.right;
557
+ return n > a && n < u && o > i && o < l;
558
+ }
559
+ var de = f()((function(e) {
560
+ var t = e.anchorWidth, n = e.maxHeight, o = e.menuStyle;
561
+ return l()({
562
+ maxHeight: n,
563
+ overflow: "auto",
564
+ width: Math.max(t !== null && t !== void 0 ? t : 0, 200)
565
+ }, o);
566
+ }));
733
567
  /**
568
+ * `ComboBox` allows the user to select a predefined string or enter a new value. Unlike `Select`
569
+ * and `Multiselect`, `Option` value must always be a string and `Option` does not have a label
570
+ * property.
571
+ */ var ve = function(e) {
572
+ ne(r, e);
573
+ var t = re(r);
574
+ // @docs-props-type ComboBoxPropsBase
575
+ function r(e) {
576
+ var i;
577
+ $(this, r);
578
+ i = t.call(this, e);
579
+ ce(ae(i), "activeItemId", void 0);
580
+ ce(ae(i), "activeValue", void 0);
581
+ ce(ae(i), "availableOptionCount", 0);
582
+ ce(ae(i), "controlledExternally", void 0);
583
+ ce(ae(i), "focusCalledInternally", false);
584
+ ce(ae(i), "options", void 0);
585
+ ce(ae(i), "popoverId", void 0);
586
+ ce(ae(i), "previousActiveIndex", null);
587
+ ce(ae(i), "textInput", null);
588
+ ce(ae(i), "handleInputMount", (function(e) {
589
+ i.textInput = e;
590
+ Y(i.props.inputRef, e);
591
+ }));
592
+ ce(ae(i), "handleAnchorMount", (function(e) {
593
+ i.setState({
594
+ anchor: e
595
+ });
596
+ Y(i.props.elementRef, e);
597
+ }));
598
+ ce(ae(i), "handleActiveOptionMount", (function(e) {
599
+ if (i.previousActiveIndex !== i.state.activeIndex) {
600
+ e === null || e === void 0 ? void 0 : e.scrollIntoViewIfNeeded();
601
+ }
602
+ }));
603
+ ce(ae(i), "handleInputFocus", (function(e) {
604
+ var t, n;
605
+ /* SUI-930 On IE 11 this handler is essentially deferred after calling
606
+ * this.textInput.focus(). this.focusCalledInternally enables the focus event to be ignored
607
+ * when the menu closes. */ if (i.focusCalledInternally) {
608
+ i.focusCalledInternally = false;
609
+ } else {
610
+ i.open();
611
+ }
612
+ (t = (n = i.props).onFocus) === null || t === void 0 ? void 0 : t.call(n, e);
613
+ }));
614
+ ce(ae(i), "handleChange", (function(e, t) {
615
+ var n, o;
616
+ var r = t.value, a = t.selectedOption;
617
+ var l = i.props.name;
618
+ var u = a ? undefined : r;
619
+ if (i.isControlled()) {
620
+ i.setState({
621
+ activeIndex: 0,
622
+ typedValue: u
623
+ });
624
+ } else {
625
+ i.setState({
626
+ value: r,
627
+ activeIndex: 0,
628
+ typedValue: u
629
+ });
630
+ }
631
+ (n = (o = i.props).onChange) === null || n === void 0 ? void 0 : n.call(o, e, {
632
+ value: r,
633
+ name: l
634
+ });
635
+ }));
636
+ ce(ae(i), "handleSelectOption", (function(e, t) {
637
+ i.handleChange(e, Z(Z({}, t), {}, {
638
+ selectedOption: true
639
+ }));
640
+ i.focusCalledInternally = true;
641
+ i.focus();
642
+ i.close();
643
+ }));
644
+ ce(ae(i), "handleInputKeyDown", (function(e) {
645
+ var t = i.props, o = t.children, r = t.onKeyDown, a = t.onScrollBottom;
646
+ var l = i.availableOptionCount;
647
+ var u = i.activeValue;
648
+ var c = (0, S.keycode)(e.nativeEvent);
649
+ if (i.state.open) {
650
+ switch (c) {
651
+ case "enter":
652
+ {
653
+ if (u) {
654
+ i.handleSelectOption(e, {
655
+ value: u
656
+ });
657
+ }
658
+ break;
659
+ }
660
+
661
+ case "tab":
662
+ i.close();
663
+ break;
664
+
665
+ case "down":
666
+ i.setState((function(e) {
667
+ return {
668
+ activeIndex: Math.min(e.activeIndex + 1, l - 1)
669
+ };
670
+ }));
671
+ if (o && a) {
672
+ var s = n.Children.count(o) - 2;
673
+ if (i.state.activeIndex === s) {
674
+ i.handleScrollBottom(e);
675
+ }
676
+ }
677
+ break;
678
+
679
+ case "up":
680
+ i.setState((function(e) {
681
+ return {
682
+ activeIndex: Math.max(e.activeIndex - 1, 0)
683
+ };
684
+ }));
685
+ break;
686
+
687
+ default:
688
+ // do nothing
689
+ }
690
+ } else if ((0, S.addsCharacter)(e.nativeEvent) !== false || // Safari 9.0 returns undefined
691
+ c === "enter" || c === "backspace" || c === "down" || c === "up") {
692
+ i.open();
693
+ }
694
+ r === null || r === void 0 ? void 0 : r(e);
695
+ }));
696
+ ce(ae(i), "handleInputClick", (function() {
697
+ if (!i.state.open && !i.props.disabled) {
698
+ i.open();
699
+ }
700
+ }));
701
+ ce(ae(i), "handleRequestClose", (function(e) {
702
+ var t = e.event, n = e.reason;
703
+ var o = n === "offScreen" || n === "escapeKey" || n === "clickAway" && i.state.anchor && !pe(i.state.anchor, t);
704
+ if (o) {
705
+ i.close();
706
+ }
707
+ }));
708
+ ce(ae(i), "handleScrollBottom", (function(e) {
709
+ if (i.state.open && !i.props.isLoadingOptions) {
710
+ var t, n;
711
+ (t = (n = i.props).onScrollBottom) === null || t === void 0 ? void 0 : t.call(n, e);
712
+ }
713
+ }));
714
+ ce(ae(i), "renderMenu", (function(e) {
715
+ var t = e.anchorWidth, r = e.maxHeight;
716
+ var a = i.props, l = a.children, u = a.controlledFilter, s = a.isLoadingOptions, f = a.menuStyle, p = a.onScrollBottom;
717
+ var d = i.state, v = d.activeIndex, y = d.typedValue;
718
+ var g = i.getValue();
719
+ var S = n.Children.toArray(l).filter(n.isValidElement);
720
+ var C = b()(S, (function(e) {
721
+ if (e.type === I.Heading) {
722
+ return false;
723
+ }
724
+ if (e.props.label === undefined) {
725
+ return e.props.value === g;
726
+ }
727
+ if (e.props.label !== undefined && y !== undefined) {
728
+ return e.props.label === g;
729
+ }
730
+ return e.props.value === g;
731
+ }));
732
+ if (!C && g) {
733
+ S.unshift( o().createElement(X, {
734
+ description: (0, O._)("(New value)"),
735
+ descriptionPosition: "right",
736
+ key: "currentValueOption",
737
+ value: g,
738
+ "data-test-current-value-option": g
739
+ }));
740
+ }
741
+ // Highlight Active
742
+ i.availableOptionCount = 0;
743
+ i.activeValue = undefined;
744
+ var w = (0, m.stringToKeywords)(y ? g : i.getDisplayValue());
745
+ i.options = (u ? S : S.filter((function(e) {
746
+ if (e.props.label !== undefined) {
747
+ return (0, m.testPhrase)(e.props.label, w);
748
+ }
749
+ if (e.props.value !== undefined) {
750
+ return (0, m.testPhrase)(e.props.value, w);
751
+ }
752
+ return true;
753
+ // Keep all headers and non-interactive options
754
+ }))).map((function(e, t) {
755
+ if (!c()(e.props, "active")) {
756
+ // ignore Headings and Dividers
757
+ return e;
758
+ }
759
+ var o = i.availableOptionCount === v;
760
+ i.availableOptionCount += 1;
761
+ var r = e.props.label !== undefined ? e.props.label : e.props.value;
762
+ var a = e.props.matchRanges;
763
+ var l = !u && g && (C || t > 0) ? (0, m.keywordLocations)(r, w) || undefined : undefined;
764
+ if (o) {
765
+ i.activeValue = e.props.value;
766
+
767
+ return (0, n.cloneElement)(e, {
768
+ ref: i.handleActiveOptionMount,
769
+ id: i.activeItemId,
770
+ onClick: i.handleSelectOption,
771
+ matchRanges: a || l,
772
+ active: true
773
+ });
774
+ }
775
+
776
+ return (0, n.cloneElement)(e, {
777
+ onClick: i.handleSelectOption,
778
+ matchRanges: a || l
779
+ });
780
+ }));
781
+ var k = de({
782
+ anchorWidth: t,
783
+ maxHeight: r,
784
+ menuStyle: f
785
+ });
786
+
787
+ return o().createElement(P(), J({
788
+ style: k,
789
+ controlledExternally: true,
790
+ onScrollBottom: p ? i.handleScrollBottom : undefined,
791
+ isLoading: s
792
+ }, h()(i.props, "className", "noOptionsMessage", "footerMessage", "animateLoading", "loadingMessage", "onScroll")), i.options);
793
+ }));
794
+ i.state = {
795
+ activeIndex: 0,
796
+ anchor: null,
797
+ typedValue: undefined,
798
+ open: false,
799
+ value: e.defaultValue || ""
800
+ };
801
+ i.controlledExternally = c()(e, "value");
802
+ i.popoverId = (0, g.createDOMID)("popover");
803
+ i.activeItemId = (0, g.createDOMID)("active-item");
804
+ if (false) {}
805
+ if (false) {}
806
+ return i;
807
+ }
808
+ te(r, [ {
809
+ key: "componentDidUpdate",
810
+ value: function e(t, n) {
811
+ if (false) {}
812
+ this.previousActiveIndex = n.activeIndex;
813
+ }
814
+ }, {
815
+ key: "getValue",
816
+ value: function e() {
817
+ return this.isControlled() ? this.props.value : this.state.value;
818
+ }
819
+ }, {
820
+ key: "getDisplayValue",
821
+ value: function e() {
822
+ var t = this.getValue();
823
+ var o = this.state.typedValue;
824
+ var r = n.Children.toArray(this.props.children).filter(n.isValidElement);
825
+ var i = !o && r.find((function(e) {
826
+ return e.props.label !== undefined && e.props.value === t;
827
+ }));
828
+ if (i) {
829
+ return i === null || i === void 0 ? void 0 : i.props.label;
830
+ }
831
+ return t;
832
+ }
833
+ }, {
834
+ key: "open",
835
+ value: function e() {
836
+ var t = this;
837
+ this.setState({
838
+ open: true,
839
+ activeIndex: 0
840
+ }, (function() {
841
+ var e, n;
842
+ (e = (n = t.props).onOpen) === null || e === void 0 ? void 0 : e.call(n);
843
+ }));
844
+ }
845
+ }, {
846
+ key: "close",
847
+ value: function e() {
848
+ var t = this;
849
+ this.setState({
850
+ open: false
851
+ }, (function() {
852
+ var e, n;
853
+ t.previousActiveIndex = null;
854
+ (e = (n = t.props).onClose) === null || e === void 0 ? void 0 : e.call(n);
855
+ }));
856
+ }
857
+ /**
734
858
  * Focus the `ComboBox`.
735
- */
736
-
737
- }, {
738
- key: "focus",
739
- value: function focus() {
740
- var _this$textInput;
741
-
742
- (_this$textInput = this.textInput) === null || _this$textInput === void 0 ? void 0 : _this$textInput.focus();
743
- }
744
- }, {
745
- key: "isControlled",
746
- value: function isControlled() {
747
- return this.controlledExternally;
748
- }
749
- }, {
750
- key: "render",
751
- value: function render() {
752
- var defaultPlacement = this.props.defaultPlacement;
753
- var _this$state2 = this.state,
754
- anchor = _this$state2.anchor,
755
- open = _this$state2.open;
756
- var currentValue = this.getValue();
757
- var currentDisplayValue = this.getDisplayValue();
758
- return /*#__PURE__*/external_react_default().createElement((Text_default()), ComboBox_extends({
759
- autoCapitalize: "off",
760
- autoComplete: "off",
761
- autoCorrect: "off",
762
- spellCheck: false,
763
- canClear: true,
764
- "data-test": "combo-box"
765
- }, omit_default()(this.props, 'animateLoading', 'className', 'controlledFilter', 'defaultValue', 'footerMessage', 'isLoadingOptions', 'loadingMessage', 'menuStyle', 'noOptionsMessage', 'onClose', 'onOpen', 'onScroll', 'onScrollBottom', 'spellCheck'), {
766
- "data-test-popover-id": this.popoverId,
767
- "data-test-label": currentDisplayValue,
768
- "data-test-value": currentValue,
769
- "data-test-open": open && !!anchor,
770
- onFocus: this.handleInputFocus,
771
- onClick: this.handleInputClick,
772
- onChange: this.handleChange,
773
- onKeyDown: this.handleInputKeyDown,
774
- inputRef: this.handleInputMount,
775
- elementRef: this.handleAnchorMount,
776
- role: "combobox",
777
- value: currentDisplayValue,
778
- "aria-activedescendant": this.activeItemId,
779
- "aria-expanded": open,
780
- "aria-haspopup": true,
781
- "aria-label": (0,i18n_namespaceObject._)('Value input'),
782
- "aria-controls": open ? this.popoverId : undefined
783
- }), /*#__PURE__*/external_react_default().createElement((Popover_default()), {
784
- anchor: anchor,
785
- autoCloseWhenOffScreen: true,
786
- canCoverAnchor: false,
787
- defaultPlacement: defaultPlacement,
788
- id: this.popoverId,
789
- onRequestClose: this.handleRequestClose,
790
- open: open && !!anchor,
791
- repositionMode: "flip"
792
- }, this.renderMenu));
793
- }
794
- }]);
795
-
796
- return ComboBox;
797
- }(external_react_namespaceObject.Component);
798
-
799
- ComboBox_defineProperty(ComboBox, "propTypes", ComboBox_propTypes);
800
-
801
- ComboBox_defineProperty(ComboBox, "defaultProps", ComboBox_defaultProps);
802
-
803
- ComboBox_defineProperty(ComboBox, "Option", ComboBox_Option);
804
-
805
- ComboBox_defineProperty(ComboBox, "Divider", Menu_namespaceObject.Divider);
806
-
807
- ComboBox_defineProperty(ComboBox, "Heading", Menu_namespaceObject.Heading);
808
-
809
- /* harmony default export */ const ComboBox_ComboBox = (ComboBox);
810
-
811
- ;// CONCATENATED MODULE: ./src/ComboBox/index.ts
812
-
813
-
814
- module.exports = __webpack_exports__;
815
- /******/ })()
816
- ;
859
+ */ }, {
860
+ key: "focus",
861
+ value: function e() {
862
+ var t;
863
+ (t = this.textInput) === null || t === void 0 ? void 0 : t.focus();
864
+ }
865
+ }, {
866
+ key: "isControlled",
867
+ value: function e() {
868
+ return this.controlledExternally;
869
+ }
870
+ }, {
871
+ key: "render",
872
+ value: function e() {
873
+ var t = this.props.defaultPlacement;
874
+ var n = this.state, r = n.anchor, i = n.open;
875
+ var a = this.getValue();
876
+ var l = this.getDisplayValue();
877
+
878
+ return o().createElement(x(), J({
879
+ autoCapitalize: "off",
880
+ autoComplete: "off",
881
+ autoCorrect: "off",
882
+ spellCheck: false,
883
+ canClear: true,
884
+ "data-test": "combo-box"
885
+ }, d()(this.props, "animateLoading", "className", "controlledFilter", "defaultValue", "footerMessage", "isLoadingOptions", "loadingMessage", "menuStyle", "noOptionsMessage", "onClose", "onOpen", "onScroll", "onScrollBottom", "spellCheck"), {
886
+ "data-test-popover-id": this.popoverId,
887
+ "data-test-label": l,
888
+ "data-test-value": a,
889
+ "data-test-open": i && !!r,
890
+ onFocus: this.handleInputFocus,
891
+ onClick: this.handleInputClick,
892
+ onChange: this.handleChange,
893
+ onKeyDown: this.handleInputKeyDown,
894
+ inputRef: this.handleInputMount,
895
+ elementRef: this.handleAnchorMount,
896
+ role: "combobox",
897
+ value: l,
898
+ "aria-activedescendant": this.activeItemId,
899
+ "aria-expanded": i,
900
+ "aria-haspopup": true,
901
+ "aria-label": (0, O._)("Value input"),
902
+ "aria-controls": i ? this.popoverId : undefined
903
+ }), o().createElement(w(), {
904
+ anchor: r,
905
+ autoCloseWhenOffScreen: true,
906
+ canCoverAnchor: false,
907
+ defaultPlacement: t,
908
+ id: this.popoverId,
909
+ onRequestClose: this.handleRequestClose,
910
+ open: i && !!r,
911
+ repositionMode: "flip"
912
+ }, this.renderMenu));
913
+ }
914
+ } ]);
915
+ return r;
916
+ }(n.Component);
917
+ ce(ve, "propTypes", se);
918
+ ce(ve, "defaultProps", fe);
919
+ ce(ve, "Option", X);
920
+ ce(ve, "Divider", I.Divider);
921
+ ce(ve, "Heading", I.Heading);
922
+ /* harmony default export */ const he = ve;
923
+ // CONCATENATED MODULE: ./src/ComboBox/index.ts
924
+ module.exports = t;
925
+ /******/})();