@splunk/react-ui 4.20.0 → 4.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Accordion.js +114 -230
- package/Anchor.js +74 -150
- package/Animation.js +52 -124
- package/AnimationToggle.js +86 -146
- package/Box.js +77 -153
- package/Breadcrumbs.js +105 -197
- package/Button.js +168 -316
- package/ButtonGroup.js +84 -168
- package/ButtonSimple.js +224 -324
- package/CHANGELOG.md +21 -0
- package/Calendar.js +264 -462
- package/Card.js +223 -371
- package/CardLayout.js +87 -163
- package/Chip.js +199 -323
- package/Clickable.js +128 -246
- package/CloseButton.js +92 -200
- package/Code.js +162 -250
- package/CollapsiblePanel.js +214 -370
- package/Color.js +267 -495
- package/ColumnLayout.js +152 -254
- package/ComboBox.js +197 -371
- package/Concertina.js +214 -374
- package/ControlGroup.js +164 -288
- package/Date.js +154 -304
- package/DefinitionList.js +104 -180
- package/Divider.js +80 -156
- package/Dropdown.js +121 -263
- package/DualListbox.js +408 -601
- package/EventListener.js +70 -138
- package/File.js +343 -547
- package/FormRows.js +232 -414
- package/Heading.js +94 -164
- package/Image.js +167 -323
- package/JSONTree.js +166 -314
- package/Layer.js +221 -388
- package/Link.js +133 -239
- package/List.js +85 -161
- package/Markdown.js +230 -354
- package/Menu.js +489 -760
- package/Message.js +248 -437
- package/MessageBar.js +220 -408
- package/Modal.js +201 -365
- package/ModalLayer.js +96 -196
- package/Monogram.js +112 -204
- package/Multiselect.js +1135 -1761
- package/Number.js +178 -334
- package/Paginator.js +170 -336
- package/Paragraph.js +77 -153
- package/Popover.js +370 -620
- package/Progress.js +139 -255
- package/RadioBar.js +156 -280
- package/RadioList.js +182 -282
- package/Resize.js +173 -307
- package/ResultsMenu.js +161 -303
- package/ScreenReaderContent.js +75 -151
- package/Scroll.js +125 -267
- package/ScrollContainerContext.js +129 -201
- package/Search.js +188 -354
- package/Select.js +1028 -1430
- package/SidePanel.js +106 -214
- package/Slider.js +198 -348
- package/SlidingPanels.js +138 -280
- package/SplitButton.js +141 -273
- package/StaticContent.js +84 -168
- package/StepBar.js +138 -246
- package/Switch.js +261 -385
- package/TabBar.js +261 -398
- package/TabLayout.js +122 -238
- package/Table.js +943 -1448
- package/Text.js +335 -549
- package/TextArea.js +315 -537
- package/Tooltip.js +152 -292
- package/TransitionOpen.js +118 -242
- package/Typography.js +81 -157
- package/WaitSpinner.js +117 -209
- package/package.json +14 -15
- package/stubs-splunkui.d.ts +4 -1
- package/types/src/ComboBox/Option.d.ts +1 -1
- package/types/src/Concertina/Concertina.d.ts +4 -0
- package/types/src/Link/Link.d.ts +7 -3
- package/types/src/Link/docs/examples/NewWindow.d.ts +2 -0
- package/types/src/Markdown/Markdown.d.ts +1 -1
- package/types/src/Markdown/renderers/MarkdownHeading.d.ts +1 -1
- package/types/src/Menu/Item.d.ts +1 -1
- package/types/src/Menu/Menu.d.ts +1 -0
- package/types/src/MessageBar/docs/examples/WithActions.d.ts +2 -0
- package/types/src/Multiselect/Option.d.ts +1 -1
- package/types/src/Search/Option.d.ts +1 -1
- package/types/src/Select/Option.d.ts +1 -1
- package/types/src/Select/OptionBase.d.ts +1 -1
- package/types/src/fixtures/FetchOptions.d.ts +2 -8
- package/useForceUpdate.js +46 -110
- package/useKeyPress.js +50 -107
- package/usePrevious.js +47 -111
- package/useRovingFocus.js +53 -133
- package/types/src/Link/docs/examples/NewTab.d.ts +0 -2
- /package/types/src/Table/docs/examples/{DockedHeader.d.ts → DockedHeaderScrollbar.d.ts} +0 -0
- /package/types/src/Table/docs/examples/prisma/{DockedHeader.d.ts → DockedHeaderScrollbar.d.ts} +0 -0
package/Search.js
CHANGED
|
@@ -1,227 +1,101 @@
|
|
|
1
|
-
|
|
2
|
-
/******/
|
|
3
|
-
/******/ // The
|
|
4
|
-
/******/ var
|
|
5
|
-
/******/
|
|
6
|
-
|
|
7
|
-
/******/
|
|
8
|
-
/******/
|
|
9
|
-
/******/ //
|
|
10
|
-
/******/
|
|
11
|
-
/******/
|
|
12
|
-
/******/
|
|
13
|
-
/******/
|
|
14
|
-
/******/
|
|
15
|
-
/******/
|
|
16
|
-
/******/
|
|
17
|
-
/******/
|
|
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
|
+
/******/ }
|
|
18
28
|
/******/ };
|
|
19
|
-
/******/
|
|
20
|
-
/******/
|
|
21
|
-
/******/
|
|
22
|
-
/******/
|
|
23
|
-
/******/
|
|
24
|
-
/******/
|
|
25
|
-
/******/
|
|
26
|
-
/******/
|
|
27
|
-
/******/
|
|
28
|
-
/******/
|
|
29
|
-
/******/
|
|
30
|
-
/******/
|
|
31
|
-
/******/
|
|
32
|
-
/******/
|
|
33
|
-
/******/
|
|
34
|
-
/******/
|
|
35
|
-
/******/
|
|
36
|
-
/******/
|
|
37
|
-
/******/ // define getter function for harmony exports
|
|
38
|
-
/******/ __webpack_require__.d = function(exports, name, getter) {
|
|
39
|
-
/******/ if(!__webpack_require__.o(exports, name)) {
|
|
40
|
-
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
|
41
|
-
/******/ }
|
|
42
|
-
/******/ };
|
|
43
|
-
/******/
|
|
44
|
-
/******/ // define __esModule on exports
|
|
45
|
-
/******/ __webpack_require__.r = function(exports) {
|
|
46
|
-
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
47
|
-
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
48
|
-
/******/ }
|
|
49
|
-
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
50
|
-
/******/ };
|
|
51
|
-
/******/
|
|
52
|
-
/******/ // create a fake namespace object
|
|
53
|
-
/******/ // mode & 1: value is a module id, require it
|
|
54
|
-
/******/ // mode & 2: merge all properties of value into the ns
|
|
55
|
-
/******/ // mode & 4: return value when already ns object
|
|
56
|
-
/******/ // mode & 8|1: behave like require
|
|
57
|
-
/******/ __webpack_require__.t = function(value, mode) {
|
|
58
|
-
/******/ if(mode & 1) value = __webpack_require__(value);
|
|
59
|
-
/******/ if(mode & 8) return value;
|
|
60
|
-
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
|
61
|
-
/******/ var ns = Object.create(null);
|
|
62
|
-
/******/ __webpack_require__.r(ns);
|
|
63
|
-
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
|
64
|
-
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
|
65
|
-
/******/ return ns;
|
|
66
|
-
/******/ };
|
|
67
|
-
/******/
|
|
68
|
-
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
69
|
-
/******/ __webpack_require__.n = function(module) {
|
|
70
|
-
/******/ var getter = module && module.__esModule ?
|
|
71
|
-
/******/ function getDefault() { return module['default']; } :
|
|
72
|
-
/******/ function getModuleExports() { return module; };
|
|
73
|
-
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
74
|
-
/******/ return getter;
|
|
75
|
-
/******/ };
|
|
76
|
-
/******/
|
|
77
|
-
/******/ // Object.prototype.hasOwnProperty.call
|
|
78
|
-
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
79
|
-
/******/
|
|
80
|
-
/******/ // __webpack_public_path__
|
|
81
|
-
/******/ __webpack_require__.p = "";
|
|
82
|
-
/******/
|
|
83
|
-
/******/
|
|
84
|
-
/******/ // Load entry module and return exports
|
|
85
|
-
/******/ return __webpack_require__(__webpack_require__.s = 232);
|
|
86
|
-
/******/ })
|
|
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
|
+
/******/
|
|
87
47
|
/************************************************************************/
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
/***/ 1:
|
|
91
|
-
/***/ (function(module, exports) {
|
|
92
|
-
|
|
93
|
-
module.exports = require("prop-types");
|
|
94
|
-
|
|
95
|
-
/***/ }),
|
|
96
|
-
|
|
97
|
-
/***/ 10:
|
|
98
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
99
|
-
|
|
100
|
-
"use strict";
|
|
101
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return updateReactRef; });
|
|
102
|
-
/**
|
|
103
|
-
* Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
|
|
104
|
-
*
|
|
105
|
-
* @param ref - The React callback or object ref. Can be `null` or `undefined`.
|
|
106
|
-
* @param current - The new value of the ref.
|
|
107
|
-
*/
|
|
108
|
-
function updateReactRef(ref, current) {
|
|
109
|
-
if (ref) {
|
|
110
|
-
if (typeof ref === 'function') {
|
|
111
|
-
ref(current);
|
|
112
|
-
} else {
|
|
113
|
-
// the public signature of this util uses React.Ref<T> to mirror the way React types refs.
|
|
114
|
-
// the intention here is to signal "we will take care of setting 'current', not you".
|
|
115
|
-
ref.current = current; // eslint-disable-line no-param-reassign
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
/***/ }),
|
|
123
|
-
|
|
124
|
-
/***/ 11:
|
|
125
|
-
/***/ (function(module, exports) {
|
|
126
|
-
|
|
127
|
-
module.exports = require("lodash/has");
|
|
128
|
-
|
|
129
|
-
/***/ }),
|
|
130
|
-
|
|
131
|
-
/***/ 13:
|
|
132
|
-
/***/ (function(module, exports) {
|
|
133
|
-
|
|
134
|
-
module.exports = require("@splunk/react-ui/Menu");
|
|
135
|
-
|
|
136
|
-
/***/ }),
|
|
137
|
-
|
|
138
|
-
/***/ 155:
|
|
139
|
-
/***/ (function(module, exports) {
|
|
140
|
-
|
|
141
|
-
module.exports = require("@splunk/react-ui/usePrevious");
|
|
142
|
-
|
|
143
|
-
/***/ }),
|
|
144
|
-
|
|
145
|
-
/***/ 2:
|
|
146
|
-
/***/ (function(module, exports) {
|
|
147
|
-
|
|
148
|
-
module.exports = require("react");
|
|
149
|
-
|
|
150
|
-
/***/ }),
|
|
151
|
-
|
|
152
|
-
/***/ 21:
|
|
153
|
-
/***/ (function(module, exports) {
|
|
154
|
-
|
|
155
|
-
module.exports = require("@splunk/react-ui/Popover");
|
|
156
|
-
|
|
157
|
-
/***/ }),
|
|
158
|
-
|
|
159
|
-
/***/ 232:
|
|
160
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
161
|
-
|
|
162
|
-
"use strict";
|
|
48
|
+
var __webpack_exports__ = {};
|
|
163
49
|
// ESM COMPAT FLAG
|
|
164
50
|
__webpack_require__.r(__webpack_exports__);
|
|
165
51
|
|
|
166
52
|
// EXPORTS
|
|
167
|
-
__webpack_require__.d(__webpack_exports__,
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
var extend_default = /*#__PURE__*/__webpack_require__.n(
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
var
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
var Popover_ = __webpack_require__(21);
|
|
214
|
-
var Popover_default = /*#__PURE__*/__webpack_require__.n(Popover_);
|
|
215
|
-
|
|
216
|
-
// EXTERNAL MODULE: external "@splunk/react-ui/ResultsMenu"
|
|
217
|
-
var ResultsMenu_ = __webpack_require__(47);
|
|
218
|
-
var ResultsMenu_default = /*#__PURE__*/__webpack_require__.n(ResultsMenu_);
|
|
219
|
-
|
|
220
|
-
// EXTERNAL MODULE: external "@splunk/react-ui/Text"
|
|
221
|
-
var Text_ = __webpack_require__(32);
|
|
222
|
-
var Text_default = /*#__PURE__*/__webpack_require__.n(Text_);
|
|
223
|
-
|
|
224
|
-
// CONCATENATED MODULE: ./src/Search/Option.tsx
|
|
53
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
54
|
+
Divider: () => (/* reexport */ Menu_namespaceObject.Divider),
|
|
55
|
+
Heading: () => (/* reexport */ Menu_namespaceObject.Heading),
|
|
56
|
+
Option: () => (/* reexport */ Search_Option),
|
|
57
|
+
"default": () => (/* reexport */ Search_Search)
|
|
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 "@splunk/ui-utils/id"
|
|
79
|
+
const id_namespaceObject = require("@splunk/ui-utils/id");
|
|
80
|
+
;// CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
|
|
81
|
+
const i18n_namespaceObject = require("@splunk/ui-utils/i18n");
|
|
82
|
+
;// CONCATENATED MODULE: external "@splunk/ui-utils/keyboard"
|
|
83
|
+
const keyboard_namespaceObject = require("@splunk/ui-utils/keyboard");
|
|
84
|
+
;// CONCATENATED MODULE: external "@splunk/react-ui/Menu"
|
|
85
|
+
const Menu_namespaceObject = require("@splunk/react-ui/Menu");
|
|
86
|
+
;// CONCATENATED MODULE: external "@splunk/react-ui/usePrevious"
|
|
87
|
+
const usePrevious_namespaceObject = require("@splunk/react-ui/usePrevious");
|
|
88
|
+
var usePrevious_default = /*#__PURE__*/__webpack_require__.n(usePrevious_namespaceObject);
|
|
89
|
+
;// CONCATENATED MODULE: external "@splunk/react-ui/Popover"
|
|
90
|
+
const Popover_namespaceObject = require("@splunk/react-ui/Popover");
|
|
91
|
+
var Popover_default = /*#__PURE__*/__webpack_require__.n(Popover_namespaceObject);
|
|
92
|
+
;// CONCATENATED MODULE: external "@splunk/react-ui/ResultsMenu"
|
|
93
|
+
const ResultsMenu_namespaceObject = require("@splunk/react-ui/ResultsMenu");
|
|
94
|
+
var ResultsMenu_default = /*#__PURE__*/__webpack_require__.n(ResultsMenu_namespaceObject);
|
|
95
|
+
;// CONCATENATED MODULE: external "@splunk/react-ui/Text"
|
|
96
|
+
const Text_namespaceObject = require("@splunk/react-ui/Text");
|
|
97
|
+
var Text_default = /*#__PURE__*/__webpack_require__.n(Text_namespaceObject);
|
|
98
|
+
;// CONCATENATED MODULE: ./src/Search/Option.tsx
|
|
225
99
|
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); }
|
|
226
100
|
|
|
227
101
|
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); }
|
|
@@ -257,17 +131,17 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
257
131
|
|
|
258
132
|
var propTypes = {
|
|
259
133
|
/** @private */
|
|
260
|
-
active: external_prop_types_default.
|
|
261
|
-
description: external_prop_types_default.
|
|
262
|
-
descriptionPosition: external_prop_types_default.
|
|
263
|
-
disabled: external_prop_types_default.
|
|
264
|
-
icon: external_prop_types_default.
|
|
265
|
-
label: external_prop_types_default.
|
|
134
|
+
active: (external_prop_types_default()).bool,
|
|
135
|
+
description: (external_prop_types_default()).string,
|
|
136
|
+
descriptionPosition: external_prop_types_default().oneOf(['right', 'bottom']),
|
|
137
|
+
disabled: (external_prop_types_default()).bool,
|
|
138
|
+
icon: (external_prop_types_default()).node,
|
|
139
|
+
label: (external_prop_types_default()).string,
|
|
266
140
|
|
|
267
141
|
/** @private */
|
|
268
|
-
onClick: external_prop_types_default.
|
|
269
|
-
truncate: external_prop_types_default.
|
|
270
|
-
value: external_prop_types_default.
|
|
142
|
+
onClick: (external_prop_types_default()).func,
|
|
143
|
+
truncate: (external_prop_types_default()).bool,
|
|
144
|
+
value: (external_prop_types_default()).string.isRequired
|
|
271
145
|
};
|
|
272
146
|
var defaultProps = {
|
|
273
147
|
active: false,
|
|
@@ -281,7 +155,7 @@ var defaultProps = {
|
|
|
281
155
|
* [PureComponent](https://reactjs.org/docs/react-api.html#reactpurecomponent)
|
|
282
156
|
* so any elements passed to it must also be pure.
|
|
283
157
|
*/
|
|
284
|
-
var
|
|
158
|
+
var Option = /*#__PURE__*/function (_PureComponent) {
|
|
285
159
|
_inherits(Option, _PureComponent);
|
|
286
160
|
|
|
287
161
|
var _super = _createSuper(Option);
|
|
@@ -334,7 +208,7 @@ var Option_Option = /*#__PURE__*/function (_PureComponent) {
|
|
|
334
208
|
otherProps = _objectWithoutProperties(_this$props2, ["value", "label"]);
|
|
335
209
|
|
|
336
210
|
var displayLabel = label === undefined ? value : label;
|
|
337
|
-
return /*#__PURE__*/external_react_default.
|
|
211
|
+
return /*#__PURE__*/external_react_default().createElement(Menu_namespaceObject.Item, _extends({
|
|
338
212
|
ref: function ref(c) {
|
|
339
213
|
_this2.item = c;
|
|
340
214
|
},
|
|
@@ -349,19 +223,36 @@ var Option_Option = /*#__PURE__*/function (_PureComponent) {
|
|
|
349
223
|
}]);
|
|
350
224
|
|
|
351
225
|
return Option;
|
|
352
|
-
}(
|
|
226
|
+
}(external_react_namespaceObject.PureComponent);
|
|
227
|
+
|
|
228
|
+
_defineProperty(Option, "propTypes", propTypes);
|
|
353
229
|
|
|
354
|
-
_defineProperty(
|
|
230
|
+
_defineProperty(Option, "defaultProps", defaultProps);
|
|
355
231
|
|
|
356
|
-
_defineProperty(
|
|
232
|
+
_defineProperty(Option, "type", Menu_namespaceObject.Item);
|
|
357
233
|
|
|
358
|
-
|
|
234
|
+
/* harmony default export */ const Search_Option = (Option);
|
|
235
|
+
;// CONCATENATED MODULE: ./src/utils/updateReactRef.ts
|
|
236
|
+
/**
|
|
237
|
+
* Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
|
|
238
|
+
*
|
|
239
|
+
* @param ref - The React callback or object ref. Can be `null` or `undefined`.
|
|
240
|
+
* @param current - The new value of the ref.
|
|
241
|
+
*/
|
|
242
|
+
function updateReactRef(ref, current) {
|
|
243
|
+
if (ref) {
|
|
244
|
+
if (typeof ref === 'function') {
|
|
245
|
+
ref(current);
|
|
246
|
+
} else {
|
|
247
|
+
// the public signature of this util uses React.Ref<T> to mirror the way React types refs.
|
|
248
|
+
// the intention here is to signal "we will take care of setting 'current', not you".
|
|
249
|
+
ref.current = current; // eslint-disable-line no-param-reassign
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
359
253
|
|
|
360
|
-
/* harmony default export */ var Search_Option = (Option_Option);
|
|
361
|
-
// EXTERNAL MODULE: ./src/utils/updateReactRef.ts
|
|
362
|
-
var updateReactRef = __webpack_require__(10);
|
|
363
254
|
|
|
364
|
-
|
|
255
|
+
;// CONCATENATED MODULE: ./src/Search/Search.tsx
|
|
365
256
|
function Search_extends() { Search_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 Search_extends.apply(this, arguments); }
|
|
366
257
|
|
|
367
258
|
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; }
|
|
@@ -403,31 +294,31 @@ function Search_objectWithoutPropertiesLoose(source, excluded) { if (source == n
|
|
|
403
294
|
|
|
404
295
|
|
|
405
296
|
var Search_propTypes = {
|
|
406
|
-
animateLoading: external_prop_types_default.
|
|
407
|
-
children: external_prop_types_default.
|
|
408
|
-
defaultPlacement: external_prop_types_default.
|
|
409
|
-
defaultValue: external_prop_types_default.
|
|
410
|
-
describedBy: external_prop_types_default.
|
|
411
|
-
disabled: external_prop_types_default.
|
|
412
|
-
elementRef: external_prop_types_default.
|
|
413
|
-
error: external_prop_types_default.
|
|
414
|
-
footerMessage: external_prop_types_default.
|
|
415
|
-
inline: external_prop_types_default.
|
|
416
|
-
inputRef: external_prop_types_default.
|
|
417
|
-
isLoadingOptions: external_prop_types_default.
|
|
418
|
-
labelledBy: external_prop_types_default.
|
|
419
|
-
loadingMessage: external_prop_types_default.
|
|
420
|
-
menuStyle: external_prop_types_default.
|
|
421
|
-
name: external_prop_types_default.
|
|
422
|
-
noOptionsMessage: external_prop_types_default.
|
|
423
|
-
onChange: external_prop_types_default.
|
|
424
|
-
onClose: external_prop_types_default.
|
|
425
|
-
onFocus: external_prop_types_default.
|
|
426
|
-
onKeyDown: external_prop_types_default.
|
|
427
|
-
onOpen: external_prop_types_default.
|
|
428
|
-
onScroll: external_prop_types_default.
|
|
429
|
-
placeholder: external_prop_types_default.
|
|
430
|
-
value: external_prop_types_default.
|
|
297
|
+
animateLoading: (external_prop_types_default()).bool,
|
|
298
|
+
children: (external_prop_types_default()).node,
|
|
299
|
+
defaultPlacement: external_prop_types_default().oneOf(['above', 'below', 'vertical']),
|
|
300
|
+
defaultValue: (external_prop_types_default()).string,
|
|
301
|
+
describedBy: (external_prop_types_default()).string,
|
|
302
|
+
disabled: (external_prop_types_default()).bool,
|
|
303
|
+
elementRef: external_prop_types_default().oneOfType([(external_prop_types_default()).func, (external_prop_types_default()).object]),
|
|
304
|
+
error: (external_prop_types_default()).bool,
|
|
305
|
+
footerMessage: (external_prop_types_default()).node,
|
|
306
|
+
inline: (external_prop_types_default()).bool,
|
|
307
|
+
inputRef: external_prop_types_default().oneOfType([(external_prop_types_default()).func, (external_prop_types_default()).object]),
|
|
308
|
+
isLoadingOptions: (external_prop_types_default()).bool,
|
|
309
|
+
labelledBy: (external_prop_types_default()).string,
|
|
310
|
+
loadingMessage: (external_prop_types_default()).node,
|
|
311
|
+
menuStyle: (external_prop_types_default()).object,
|
|
312
|
+
name: (external_prop_types_default()).string,
|
|
313
|
+
noOptionsMessage: (external_prop_types_default()).node,
|
|
314
|
+
onChange: (external_prop_types_default()).func,
|
|
315
|
+
onClose: (external_prop_types_default()).func,
|
|
316
|
+
onFocus: (external_prop_types_default()).func,
|
|
317
|
+
onKeyDown: (external_prop_types_default()).func,
|
|
318
|
+
onOpen: (external_prop_types_default()).func,
|
|
319
|
+
onScroll: (external_prop_types_default()).func,
|
|
320
|
+
placeholder: (external_prop_types_default()).string,
|
|
321
|
+
value: (external_prop_types_default()).string
|
|
431
322
|
};
|
|
432
323
|
|
|
433
324
|
function containsEvent(el, _ref) {
|
|
@@ -473,28 +364,28 @@ function Search(_ref2) {
|
|
|
473
364
|
onKeyDown = _ref2.onKeyDown,
|
|
474
365
|
onOpen = _ref2.onOpen,
|
|
475
366
|
_ref2$placeholder = _ref2.placeholder,
|
|
476
|
-
placeholder = _ref2$placeholder === void 0 ?
|
|
367
|
+
placeholder = _ref2$placeholder === void 0 ? (0,i18n_namespaceObject._)('Search...') : _ref2$placeholder,
|
|
477
368
|
propValue = _ref2.value,
|
|
478
369
|
otherProps = Search_objectWithoutProperties(_ref2, ["animateLoading", "children", "defaultPlacement", "defaultValue", "describedBy", "disabled", "elementRef", "error", "footerMessage", "inline", "inputRef", "isLoadingOptions", "labelledBy", "loadingMessage", "menuStyle", "name", "noOptionsMessage", "onChange", "onClose", "onFocus", "onKeyDown", "onOpen", "placeholder", "value"]);
|
|
479
370
|
|
|
480
371
|
// @docs-props-type SearchPropsBase
|
|
481
372
|
// state
|
|
482
|
-
var _useState =
|
|
373
|
+
var _useState = (0,external_react_namespaceObject.useState)(0),
|
|
483
374
|
_useState2 = _slicedToArray(_useState, 2),
|
|
484
375
|
activeIndex = _useState2[0],
|
|
485
376
|
setActiveIndex = _useState2[1];
|
|
486
377
|
|
|
487
|
-
var _useState3 =
|
|
378
|
+
var _useState3 = (0,external_react_namespaceObject.useState)(false),
|
|
488
379
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
489
380
|
isOpen = _useState4[0],
|
|
490
381
|
setIsOpen = _useState4[1];
|
|
491
382
|
|
|
492
|
-
var _useState5 =
|
|
383
|
+
var _useState5 = (0,external_react_namespaceObject.useState)(undefined),
|
|
493
384
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
494
385
|
typedValue = _useState6[0],
|
|
495
386
|
setTypedValue = _useState6[1];
|
|
496
387
|
|
|
497
|
-
var _useState7 =
|
|
388
|
+
var _useState7 = (0,external_react_namespaceObject.useState)(defaultValue || ''),
|
|
498
389
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
499
390
|
value = _useState8[0],
|
|
500
391
|
setValue = _useState8[1]; // previous state
|
|
@@ -502,24 +393,24 @@ function Search(_ref2) {
|
|
|
502
393
|
|
|
503
394
|
var previousActiveIndexState = usePrevious_default()(activeIndex); // refs
|
|
504
395
|
|
|
505
|
-
var anchorRef =
|
|
506
|
-
var textRef =
|
|
507
|
-
var controlledExternally =
|
|
508
|
-
var focusCalledInternally =
|
|
509
|
-
var options =
|
|
510
|
-
var popoverId =
|
|
511
|
-
var previousActiveIndex =
|
|
512
|
-
var activeItemId =
|
|
513
|
-
var activeValue =
|
|
396
|
+
var anchorRef = (0,external_react_namespaceObject.useRef)(null);
|
|
397
|
+
var textRef = (0,external_react_namespaceObject.useRef)(null);
|
|
398
|
+
var controlledExternally = (0,external_react_namespaceObject.useRef)(propValue !== undefined && propValue !== null);
|
|
399
|
+
var focusCalledInternally = (0,external_react_namespaceObject.useRef)(false);
|
|
400
|
+
var options = (0,external_react_namespaceObject.useRef)([]);
|
|
401
|
+
var popoverId = (0,external_react_namespaceObject.useRef)((0,id_namespaceObject.createDOMID)('popover'));
|
|
402
|
+
var previousActiveIndex = (0,external_react_namespaceObject.useRef)(previousActiveIndexState);
|
|
403
|
+
var activeItemId = (0,external_react_namespaceObject.useRef)((0,id_namespaceObject.createDOMID)('active-item'));
|
|
404
|
+
var activeValue = (0,external_react_namespaceObject.useRef)(undefined);
|
|
514
405
|
|
|
515
406
|
var handleAnchorRef = function handleAnchorRef(el) {
|
|
516
|
-
|
|
517
|
-
|
|
407
|
+
updateReactRef(anchorRef, el);
|
|
408
|
+
updateReactRef(elementRef, el);
|
|
518
409
|
};
|
|
519
410
|
|
|
520
411
|
var handleInputRef = function handleInputRef(el) {
|
|
521
|
-
|
|
522
|
-
|
|
412
|
+
updateReactRef(textRef, el);
|
|
413
|
+
updateReactRef(inputRef, el);
|
|
523
414
|
};
|
|
524
415
|
|
|
525
416
|
var getValue = function getValue() {
|
|
@@ -528,7 +419,7 @@ function Search(_ref2) {
|
|
|
528
419
|
|
|
529
420
|
var getDisplayValue = function getDisplayValue() {
|
|
530
421
|
var currentValue = getValue();
|
|
531
|
-
var initialOptions =
|
|
422
|
+
var initialOptions = external_react_namespaceObject.Children.toArray(children).filter(external_react_namespaceObject.isValidElement);
|
|
532
423
|
var optionForValue = !typedValue && initialOptions.find(function (option) {
|
|
533
424
|
return option.props.label !== undefined && option.props.value === currentValue;
|
|
534
425
|
});
|
|
@@ -600,7 +491,7 @@ function Search(_ref2) {
|
|
|
600
491
|
var handleInputKeyDown = function handleInputKeyDown(e) {
|
|
601
492
|
var numOptions = options.current.length;
|
|
602
493
|
var activeOption = activeValue.current;
|
|
603
|
-
var eventKeyCode =
|
|
494
|
+
var eventKeyCode = (0,keyboard_namespaceObject.keycode)(e.nativeEvent);
|
|
604
495
|
|
|
605
496
|
if (isOpen) {
|
|
606
497
|
switch (eventKeyCode) {
|
|
@@ -630,7 +521,7 @@ function Search(_ref2) {
|
|
|
630
521
|
default: // do nothing
|
|
631
522
|
|
|
632
523
|
}
|
|
633
|
-
} else if (
|
|
524
|
+
} else if ((0,keyboard_namespaceObject.addsCharacter)(e.nativeEvent) !== false || // Safari 9.0 returns undefined
|
|
634
525
|
eventKeyCode === 'enter' || eventKeyCode === 'backspace' || eventKeyCode === 'down' || eventKeyCode === 'up') {
|
|
635
526
|
requestOpen();
|
|
636
527
|
}
|
|
@@ -668,7 +559,7 @@ function Search(_ref2) {
|
|
|
668
559
|
var renderMenu = function renderMenu(_ref5) {
|
|
669
560
|
var anchorWidth = _ref5.anchorWidth,
|
|
670
561
|
maxHeight = _ref5.maxHeight;
|
|
671
|
-
var initialOptions =
|
|
562
|
+
var initialOptions = external_react_namespaceObject.Children.toArray(children).filter(external_react_namespaceObject.isValidElement); // Highlight Active
|
|
672
563
|
|
|
673
564
|
activeValue.current = undefined; // Only update the menu options if they are valid and the drodown is open.
|
|
674
565
|
// This is necessary to handle the outro animation of the dropdown.
|
|
@@ -682,7 +573,7 @@ function Search(_ref2) {
|
|
|
682
573
|
|
|
683
574
|
if (index === activeIndex) {
|
|
684
575
|
activeValue.current = option.props.value;
|
|
685
|
-
return /*#__PURE__*/
|
|
576
|
+
return /*#__PURE__*/(0,external_react_namespaceObject.cloneElement)(option, {
|
|
686
577
|
ref: handleActiveOptionMount,
|
|
687
578
|
id: activeItemId.current,
|
|
688
579
|
onClick: handleSelectOption,
|
|
@@ -690,13 +581,13 @@ function Search(_ref2) {
|
|
|
690
581
|
});
|
|
691
582
|
}
|
|
692
583
|
|
|
693
|
-
return /*#__PURE__*/
|
|
584
|
+
return /*#__PURE__*/(0,external_react_namespaceObject.cloneElement)(option, {
|
|
694
585
|
onClick: handleSelectOption
|
|
695
586
|
});
|
|
696
587
|
});
|
|
697
588
|
}
|
|
698
589
|
|
|
699
|
-
return /*#__PURE__*/external_react_default.
|
|
590
|
+
return /*#__PURE__*/external_react_default().createElement((ResultsMenu_default()), Search_extends({
|
|
700
591
|
style: extend_default()({
|
|
701
592
|
overflow: 'auto',
|
|
702
593
|
width: Math.max(anchorWidth !== null && anchorWidth !== void 0 ? anchorWidth : 0, 200)
|
|
@@ -723,10 +614,10 @@ function Search(_ref2) {
|
|
|
723
614
|
};
|
|
724
615
|
|
|
725
616
|
if (!(labelledBy === null || labelledBy === void 0 ? void 0 : labelledBy.length)) {
|
|
726
|
-
ariaProps['aria-label'] =
|
|
617
|
+
ariaProps['aria-label'] = (0,i18n_namespaceObject._)('Value input');
|
|
727
618
|
}
|
|
728
619
|
|
|
729
|
-
return /*#__PURE__*/external_react_default.
|
|
620
|
+
return /*#__PURE__*/external_react_default().createElement((Text_default()), Search_extends({
|
|
730
621
|
"data-test": "search"
|
|
731
622
|
}, omit_default()(otherProps, 'className', 'onScroll'), {
|
|
732
623
|
appearance: "search",
|
|
@@ -752,7 +643,7 @@ function Search(_ref2) {
|
|
|
752
643
|
placeholder: placeholder,
|
|
753
644
|
spellCheck: false,
|
|
754
645
|
value: currentDisplayValue
|
|
755
|
-
}, ariaProps), /*#__PURE__*/external_react_default.
|
|
646
|
+
}, ariaProps), /*#__PURE__*/external_react_default().createElement((Popover_default()), {
|
|
756
647
|
anchor: function () {
|
|
757
648
|
return anchorRef.current;
|
|
758
649
|
}(),
|
|
@@ -768,70 +659,13 @@ function Search(_ref2) {
|
|
|
768
659
|
|
|
769
660
|
Search.propTypes = Search_propTypes;
|
|
770
661
|
Search.Option = Search_Option;
|
|
771
|
-
Search.Divider =
|
|
772
|
-
Search.Heading =
|
|
773
|
-
/* harmony default export */
|
|
774
|
-
|
|
775
|
-
// CONCATENATED MODULE: ./src/Search/index.ts
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
/***/ }),
|
|
780
|
-
|
|
781
|
-
/***/ 32:
|
|
782
|
-
/***/ (function(module, exports) {
|
|
783
|
-
|
|
784
|
-
module.exports = require("@splunk/react-ui/Text");
|
|
785
|
-
|
|
786
|
-
/***/ }),
|
|
787
|
-
|
|
788
|
-
/***/ 4:
|
|
789
|
-
/***/ (function(module, exports) {
|
|
790
|
-
|
|
791
|
-
module.exports = require("@splunk/ui-utils/i18n");
|
|
792
|
-
|
|
793
|
-
/***/ }),
|
|
794
|
-
|
|
795
|
-
/***/ 44:
|
|
796
|
-
/***/ (function(module, exports) {
|
|
797
|
-
|
|
798
|
-
module.exports = require("lodash/pick");
|
|
799
|
-
|
|
800
|
-
/***/ }),
|
|
801
|
-
|
|
802
|
-
/***/ 47:
|
|
803
|
-
/***/ (function(module, exports) {
|
|
804
|
-
|
|
805
|
-
module.exports = require("@splunk/react-ui/ResultsMenu");
|
|
806
|
-
|
|
807
|
-
/***/ }),
|
|
808
|
-
|
|
809
|
-
/***/ 5:
|
|
810
|
-
/***/ (function(module, exports) {
|
|
811
|
-
|
|
812
|
-
module.exports = require("lodash/omit");
|
|
813
|
-
|
|
814
|
-
/***/ }),
|
|
815
|
-
|
|
816
|
-
/***/ 52:
|
|
817
|
-
/***/ (function(module, exports) {
|
|
818
|
-
|
|
819
|
-
module.exports = require("lodash/extend");
|
|
820
|
-
|
|
821
|
-
/***/ }),
|
|
822
|
-
|
|
823
|
-
/***/ 7:
|
|
824
|
-
/***/ (function(module, exports) {
|
|
825
|
-
|
|
826
|
-
module.exports = require("@splunk/ui-utils/keyboard");
|
|
827
|
-
|
|
828
|
-
/***/ }),
|
|
829
|
-
|
|
830
|
-
/***/ 8:
|
|
831
|
-
/***/ (function(module, exports) {
|
|
662
|
+
Search.Divider = Menu_namespaceObject.Divider;
|
|
663
|
+
Search.Heading = Menu_namespaceObject.Heading;
|
|
664
|
+
/* harmony default export */ const Search_Search = (Search);
|
|
832
665
|
|
|
833
|
-
|
|
666
|
+
;// CONCATENATED MODULE: ./src/Search/index.ts
|
|
834
667
|
|
|
835
|
-
/***/ })
|
|
836
668
|
|
|
837
|
-
|
|
669
|
+
module.exports = __webpack_exports__;
|
|
670
|
+
/******/ })()
|
|
671
|
+
;
|