@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/Select.js
CHANGED
|
@@ -1,284 +1,198 @@
|
|
|
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 = 233);
|
|
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
|
-
|
|
91
|
-
/***/ (function(module, exports) {
|
|
92
|
-
|
|
93
|
-
module.exports = require("@splunk/themes");
|
|
94
|
-
|
|
95
|
-
/***/ }),
|
|
96
|
-
|
|
97
|
-
/***/ 1:
|
|
98
|
-
/***/ (function(module, exports) {
|
|
99
|
-
|
|
100
|
-
module.exports = require("prop-types");
|
|
101
|
-
|
|
102
|
-
/***/ }),
|
|
103
|
-
|
|
104
|
-
/***/ 105:
|
|
105
|
-
/***/ (function(module, exports) {
|
|
106
|
-
|
|
107
|
-
module.exports = require("lodash/forEachRight");
|
|
108
|
-
|
|
109
|
-
/***/ }),
|
|
110
|
-
|
|
111
|
-
/***/ 106:
|
|
112
|
-
/***/ (function(module, exports) {
|
|
113
|
-
|
|
114
|
-
module.exports = require("lodash/uniq");
|
|
115
|
-
|
|
116
|
-
/***/ }),
|
|
117
|
-
|
|
118
|
-
/***/ 11:
|
|
119
|
-
/***/ (function(module, exports) {
|
|
120
|
-
|
|
121
|
-
module.exports = require("lodash/has");
|
|
122
|
-
|
|
123
|
-
/***/ }),
|
|
124
|
-
|
|
125
|
-
/***/ 12:
|
|
126
|
-
/***/ (function(module, exports) {
|
|
127
|
-
|
|
128
|
-
module.exports = require("@splunk/react-ui/Clickable");
|
|
129
|
-
|
|
130
|
-
/***/ }),
|
|
131
|
-
|
|
132
|
-
/***/ 13:
|
|
133
|
-
/***/ (function(module, exports) {
|
|
134
|
-
|
|
135
|
-
module.exports = require("@splunk/react-ui/Menu");
|
|
136
|
-
|
|
137
|
-
/***/ }),
|
|
138
|
-
|
|
139
|
-
/***/ 15:
|
|
140
|
-
/***/ (function(module, exports) {
|
|
141
|
-
|
|
142
|
-
module.exports = require("lodash/includes");
|
|
143
|
-
|
|
144
|
-
/***/ }),
|
|
145
|
-
|
|
146
|
-
/***/ 17:
|
|
147
|
-
/***/ (function(module, exports) {
|
|
148
|
-
|
|
149
|
-
module.exports = require("@splunk/react-ui/Button");
|
|
150
|
-
|
|
151
|
-
/***/ }),
|
|
152
|
-
|
|
153
|
-
/***/ 18:
|
|
154
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
155
|
-
|
|
156
|
-
"use strict";
|
|
157
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getWindow; });
|
|
158
|
-
/* unused harmony export ssrWindow */
|
|
159
|
-
/* harmony import */ var _ssrDocument__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28);
|
|
160
|
-
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
48
|
+
var __webpack_exports__ = {};
|
|
49
|
+
// ESM COMPAT FLAG
|
|
50
|
+
__webpack_require__.r(__webpack_exports__);
|
|
161
51
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
host: '',
|
|
170
|
-
hostname: '',
|
|
171
|
-
href: '',
|
|
172
|
-
origin: '',
|
|
173
|
-
pathname: '',
|
|
174
|
-
protocol: '',
|
|
175
|
-
search: ''
|
|
176
|
-
},
|
|
177
|
-
history: {
|
|
178
|
-
replaceState: function replaceState() {},
|
|
179
|
-
pushState: function pushState() {},
|
|
180
|
-
go: function go() {},
|
|
181
|
-
back: function back() {}
|
|
182
|
-
},
|
|
183
|
-
CustomEvent: function CustomEvent() {
|
|
184
|
-
return this;
|
|
185
|
-
},
|
|
186
|
-
addEventListener: function addEventListener() {},
|
|
187
|
-
removeEventListener: function removeEventListener() {},
|
|
188
|
-
getComputedStyle: function getComputedStyle() {
|
|
189
|
-
return {
|
|
190
|
-
getPropertyValue: function getPropertyValue() {
|
|
191
|
-
return '';
|
|
192
|
-
}
|
|
193
|
-
};
|
|
194
|
-
},
|
|
195
|
-
Image: function Image() {},
|
|
196
|
-
Date: function Date() {},
|
|
197
|
-
screen: {},
|
|
198
|
-
setTimeout: function setTimeout() {},
|
|
199
|
-
clearTimeout: function clearTimeout() {},
|
|
200
|
-
matchMedia: function matchMedia() {
|
|
201
|
-
return {};
|
|
202
|
-
},
|
|
203
|
-
requestAnimationFrame: function requestAnimationFrame(callback) {
|
|
204
|
-
if (typeof setTimeout === 'undefined') {
|
|
205
|
-
callback();
|
|
206
|
-
return null;
|
|
207
|
-
}
|
|
52
|
+
// EXPORTS
|
|
53
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
54
|
+
Divider: () => (/* reexport */ Menu_namespaceObject.Divider),
|
|
55
|
+
Heading: () => (/* reexport */ Menu_namespaceObject.Heading),
|
|
56
|
+
Option: () => (/* reexport */ Select_Option),
|
|
57
|
+
"default": () => (/* reexport */ Select_Select)
|
|
58
|
+
});
|
|
208
59
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
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/has"
|
|
67
|
+
const has_namespaceObject = require("lodash/has");
|
|
68
|
+
var has_default = /*#__PURE__*/__webpack_require__.n(has_namespaceObject);
|
|
69
|
+
;// CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
|
|
70
|
+
const i18n_namespaceObject = require("@splunk/ui-utils/i18n");
|
|
71
|
+
;// CONCATENATED MODULE: external "lodash/castArray"
|
|
72
|
+
const castArray_namespaceObject = require("lodash/castArray");
|
|
73
|
+
var castArray_default = /*#__PURE__*/__webpack_require__.n(castArray_namespaceObject);
|
|
74
|
+
;// CONCATENATED MODULE: external "lodash/find"
|
|
75
|
+
const find_namespaceObject = require("lodash/find");
|
|
76
|
+
var find_default = /*#__PURE__*/__webpack_require__.n(find_namespaceObject);
|
|
77
|
+
;// CONCATENATED MODULE: external "lodash/forEachRight"
|
|
78
|
+
const forEachRight_namespaceObject = require("lodash/forEachRight");
|
|
79
|
+
var forEachRight_default = /*#__PURE__*/__webpack_require__.n(forEachRight_namespaceObject);
|
|
80
|
+
;// CONCATENATED MODULE: external "lodash/includes"
|
|
81
|
+
const includes_namespaceObject = require("lodash/includes");
|
|
82
|
+
var includes_default = /*#__PURE__*/__webpack_require__.n(includes_namespaceObject);
|
|
83
|
+
;// CONCATENATED MODULE: external "lodash/isUndefined"
|
|
84
|
+
const isUndefined_namespaceObject = require("lodash/isUndefined");
|
|
85
|
+
var isUndefined_default = /*#__PURE__*/__webpack_require__.n(isUndefined_namespaceObject);
|
|
86
|
+
;// CONCATENATED MODULE: external "lodash/keys"
|
|
87
|
+
const keys_namespaceObject = require("lodash/keys");
|
|
88
|
+
var keys_default = /*#__PURE__*/__webpack_require__.n(keys_namespaceObject);
|
|
89
|
+
;// CONCATENATED MODULE: external "lodash/memoize"
|
|
90
|
+
const memoize_namespaceObject = require("lodash/memoize");
|
|
91
|
+
var memoize_default = /*#__PURE__*/__webpack_require__.n(memoize_namespaceObject);
|
|
92
|
+
;// CONCATENATED MODULE: external "lodash/omit"
|
|
93
|
+
const omit_namespaceObject = require("lodash/omit");
|
|
94
|
+
var omit_default = /*#__PURE__*/__webpack_require__.n(omit_namespaceObject);
|
|
95
|
+
;// CONCATENATED MODULE: external "lodash/pick"
|
|
96
|
+
const pick_namespaceObject = require("lodash/pick");
|
|
97
|
+
var pick_default = /*#__PURE__*/__webpack_require__.n(pick_namespaceObject);
|
|
98
|
+
;// CONCATENATED MODULE: external "lodash/uniq"
|
|
99
|
+
const uniq_namespaceObject = require("lodash/uniq");
|
|
100
|
+
var uniq_default = /*#__PURE__*/__webpack_require__.n(uniq_namespaceObject);
|
|
101
|
+
;// CONCATENATED MODULE: external "lodash/without"
|
|
102
|
+
const without_namespaceObject = require("lodash/without");
|
|
103
|
+
var without_default = /*#__PURE__*/__webpack_require__.n(without_namespaceObject);
|
|
104
|
+
;// CONCATENATED MODULE: external "@splunk/ui-utils/id"
|
|
105
|
+
const id_namespaceObject = require("@splunk/ui-utils/id");
|
|
106
|
+
;// CONCATENATED MODULE: external "@splunk/react-ui/Menu"
|
|
107
|
+
const Menu_namespaceObject = require("@splunk/react-ui/Menu");
|
|
108
|
+
;// CONCATENATED MODULE: external "@splunk/react-ui/Dropdown"
|
|
109
|
+
const Dropdown_namespaceObject = require("@splunk/react-ui/Dropdown");
|
|
110
|
+
var Dropdown_default = /*#__PURE__*/__webpack_require__.n(Dropdown_namespaceObject);
|
|
111
|
+
;// CONCATENATED MODULE: external "@splunk/ui-utils/keyboard"
|
|
112
|
+
const keyboard_namespaceObject = require("@splunk/ui-utils/keyboard");
|
|
113
|
+
;// CONCATENATED MODULE: external "@splunk/ui-utils/filter"
|
|
114
|
+
const filter_namespaceObject = require("@splunk/ui-utils/filter");
|
|
115
|
+
;// CONCATENATED MODULE: external "@splunk/react-ui/Link"
|
|
116
|
+
const Link_namespaceObject = require("@splunk/react-ui/Link");
|
|
117
|
+
var Link_default = /*#__PURE__*/__webpack_require__.n(Link_namespaceObject);
|
|
118
|
+
;// CONCATENATED MODULE: external "@splunk/react-ui/ResultsMenu"
|
|
119
|
+
const ResultsMenu_namespaceObject = require("@splunk/react-ui/ResultsMenu");
|
|
120
|
+
var ResultsMenu_default = /*#__PURE__*/__webpack_require__.n(ResultsMenu_namespaceObject);
|
|
121
|
+
;// CONCATENATED MODULE: external "@splunk/react-ui/Text"
|
|
122
|
+
const Text_namespaceObject = require("@splunk/react-ui/Text");
|
|
123
|
+
var Text_default = /*#__PURE__*/__webpack_require__.n(Text_namespaceObject);
|
|
124
|
+
;// CONCATENATED MODULE: external "@splunk/react-icons/CaretSmallDown"
|
|
125
|
+
const CaretSmallDown_namespaceObject = require("@splunk/react-icons/CaretSmallDown");
|
|
126
|
+
var CaretSmallDown_default = /*#__PURE__*/__webpack_require__.n(CaretSmallDown_namespaceObject);
|
|
127
|
+
;// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/Caret"
|
|
128
|
+
const Caret_namespaceObject = require("@splunk/react-icons/enterprise/Caret");
|
|
129
|
+
var Caret_default = /*#__PURE__*/__webpack_require__.n(Caret_namespaceObject);
|
|
130
|
+
;// CONCATENATED MODULE: external "@splunk/themes"
|
|
131
|
+
const themes_namespaceObject = require("@splunk/themes");
|
|
132
|
+
;// CONCATENATED MODULE: ./src/Select/icons/CaretSmallDown.tsx
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
var CaretSmallDownIcon = function CaretSmallDownIcon() {
|
|
139
|
+
var _useSplunkTheme = (0,themes_namespaceObject.useSplunkTheme)(),
|
|
140
|
+
isEnterprise = _useSplunkTheme.isEnterprise;
|
|
215
141
|
|
|
216
|
-
|
|
217
|
-
|
|
142
|
+
var familyCaretSmallDownIcon = isEnterprise ? /*#__PURE__*/external_react_default().createElement((Caret_default()), {
|
|
143
|
+
screenReaderText: null,
|
|
144
|
+
hideDefaultTooltip: true,
|
|
145
|
+
size: 0.5
|
|
146
|
+
}) : /*#__PURE__*/external_react_default().createElement((CaretSmallDown_default()), null);
|
|
147
|
+
return familyCaretSmallDownIcon;
|
|
218
148
|
};
|
|
219
149
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
/***/ 2:
|
|
230
|
-
/***/ (function(module, exports) {
|
|
231
|
-
|
|
232
|
-
module.exports = require("react");
|
|
150
|
+
/* harmony default export */ const CaretSmallDown = (CaretSmallDownIcon);
|
|
151
|
+
;// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/Search"
|
|
152
|
+
const Search_namespaceObject = require("@splunk/react-icons/enterprise/Search");
|
|
153
|
+
var Search_default = /*#__PURE__*/__webpack_require__.n(Search_namespaceObject);
|
|
154
|
+
;// CONCATENATED MODULE: external "@splunk/react-icons/Magnifier"
|
|
155
|
+
const Magnifier_namespaceObject = require("@splunk/react-icons/Magnifier");
|
|
156
|
+
var Magnifier_default = /*#__PURE__*/__webpack_require__.n(Magnifier_namespaceObject);
|
|
157
|
+
;// CONCATENATED MODULE: ./src/Select/icons/Search.tsx
|
|
233
158
|
|
|
234
|
-
/***/ }),
|
|
235
159
|
|
|
236
|
-
/***/ 22:
|
|
237
|
-
/***/ (function(module, exports) {
|
|
238
|
-
|
|
239
|
-
module.exports = require("@splunk/react-ui/Dropdown");
|
|
240
|
-
|
|
241
|
-
/***/ }),
|
|
242
|
-
|
|
243
|
-
/***/ 233:
|
|
244
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
245
|
-
|
|
246
|
-
"use strict";
|
|
247
|
-
// ESM COMPAT FLAG
|
|
248
|
-
__webpack_require__.r(__webpack_exports__);
|
|
249
|
-
|
|
250
|
-
// EXPORTS
|
|
251
|
-
__webpack_require__.d(__webpack_exports__, "default", function() { return /* reexport */ src_Select_Select; });
|
|
252
|
-
__webpack_require__.d(__webpack_exports__, "Divider", function() { return /* reexport */ SelectBase["a" /* Divider */]; });
|
|
253
|
-
__webpack_require__.d(__webpack_exports__, "Heading", function() { return /* reexport */ SelectBase["b" /* Heading */]; });
|
|
254
|
-
__webpack_require__.d(__webpack_exports__, "Option", function() { return /* reexport */ Select_Option; });
|
|
255
160
|
|
|
256
|
-
// EXTERNAL MODULE: external "react"
|
|
257
|
-
var external_react_ = __webpack_require__(2);
|
|
258
|
-
var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
|
|
259
161
|
|
|
260
|
-
// EXTERNAL MODULE: external "prop-types"
|
|
261
|
-
var external_prop_types_ = __webpack_require__(1);
|
|
262
|
-
var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
|
|
263
162
|
|
|
264
|
-
// EXTERNAL MODULE: external "lodash/has"
|
|
265
|
-
var has_ = __webpack_require__(11);
|
|
266
|
-
var has_default = /*#__PURE__*/__webpack_require__.n(has_);
|
|
267
163
|
|
|
268
|
-
|
|
269
|
-
var
|
|
164
|
+
var Search = function Search() {
|
|
165
|
+
var _useSplunkTheme = (0,themes_namespaceObject.useSplunkTheme)(),
|
|
166
|
+
isEnterprise = _useSplunkTheme.isEnterprise,
|
|
167
|
+
isCompact = _useSplunkTheme.isCompact;
|
|
270
168
|
|
|
271
|
-
|
|
272
|
-
var SelectBase = __webpack_require__(62);
|
|
169
|
+
var screenReaderText = (0,i18n_namespaceObject._)('Search');
|
|
273
170
|
|
|
274
|
-
|
|
275
|
-
var
|
|
171
|
+
var prismaSize = isCompact ? '20px' : '24px';
|
|
172
|
+
var familyIcon = isEnterprise ? /*#__PURE__*/external_react_default().createElement((Search_default()), {
|
|
173
|
+
role: "presentation",
|
|
174
|
+
size: "16px",
|
|
175
|
+
screenReaderText: screenReaderText,
|
|
176
|
+
hideDefaultTooltip: true
|
|
177
|
+
}) : /*#__PURE__*/external_react_default().createElement((Magnifier_default()), {
|
|
178
|
+
role: "presentation",
|
|
179
|
+
"aria-label": screenReaderText,
|
|
180
|
+
width: prismaSize,
|
|
181
|
+
height: prismaSize
|
|
182
|
+
});
|
|
183
|
+
return familyIcon;
|
|
184
|
+
};
|
|
276
185
|
|
|
277
|
-
|
|
186
|
+
/* harmony default export */ const icons_Search = (Search);
|
|
187
|
+
;// CONCATENATED MODULE: ./src/Select/OptionBase.tsx
|
|
278
188
|
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); }
|
|
279
189
|
|
|
280
190
|
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); }
|
|
281
191
|
|
|
192
|
+
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; }
|
|
193
|
+
|
|
194
|
+
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; }
|
|
195
|
+
|
|
282
196
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
283
197
|
|
|
284
198
|
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); } }
|
|
@@ -306,42 +220,46 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
306
220
|
|
|
307
221
|
var propTypes = {
|
|
308
222
|
/** @private */
|
|
309
|
-
active: external_prop_types_default.
|
|
310
|
-
children: external_prop_types_default.
|
|
311
|
-
description: external_prop_types_default.
|
|
312
|
-
descriptionPosition: external_prop_types_default.
|
|
313
|
-
disabled: external_prop_types_default.
|
|
314
|
-
hidden: external_prop_types_default.
|
|
315
|
-
icon: external_prop_types_default.
|
|
316
|
-
label: external_prop_types_default.
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
223
|
+
active: (external_prop_types_default()).bool,
|
|
224
|
+
children: (external_prop_types_default()).node,
|
|
225
|
+
description: (external_prop_types_default()).string,
|
|
226
|
+
descriptionPosition: external_prop_types_default().oneOf(['right', 'bottom']),
|
|
227
|
+
disabled: (external_prop_types_default()).bool,
|
|
228
|
+
hidden: (external_prop_types_default()).bool,
|
|
229
|
+
icon: (external_prop_types_default()).node,
|
|
230
|
+
label: (external_prop_types_default()).string.isRequired,
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* @private Passed down from <BaseSelect>
|
|
234
|
+
*/
|
|
235
|
+
multiple: (external_prop_types_default()).bool,
|
|
236
|
+
matchRanges: external_prop_types_default().arrayOf(external_prop_types_default().shape({
|
|
237
|
+
start: (external_prop_types_default()).number.isRequired,
|
|
238
|
+
end: (external_prop_types_default()).number.isRequired
|
|
320
239
|
})),
|
|
321
240
|
|
|
322
241
|
/** @private */
|
|
323
|
-
onClick: external_prop_types_default.
|
|
242
|
+
onClick: (external_prop_types_default()).func,
|
|
324
243
|
|
|
325
244
|
/** @private */
|
|
326
|
-
selected: external_prop_types_default.
|
|
327
|
-
truncate: external_prop_types_default.
|
|
328
|
-
value: external_prop_types_default.
|
|
245
|
+
selected: (external_prop_types_default()).bool,
|
|
246
|
+
truncate: (external_prop_types_default()).bool,
|
|
247
|
+
value: external_prop_types_default().oneOfType([(external_prop_types_default()).string, (external_prop_types_default()).number, (external_prop_types_default()).bool]).isRequired
|
|
329
248
|
};
|
|
330
249
|
var defaultProps = {
|
|
331
|
-
active: false,
|
|
332
250
|
descriptionPosition: 'bottom',
|
|
333
251
|
disabled: false,
|
|
334
|
-
|
|
252
|
+
multiple: false,
|
|
335
253
|
selected: false,
|
|
336
254
|
truncate: false
|
|
337
255
|
};
|
|
338
256
|
|
|
339
257
|
/**
|
|
340
|
-
* An option within a `
|
|
258
|
+
* An option within a `Multiselect`. This inherits from
|
|
341
259
|
* [PureComponent](https://reactjs.org/docs/react-api.html#reactpurecomponent)
|
|
342
260
|
* so any elements passed to it must also be pure.
|
|
343
261
|
*/
|
|
344
|
-
var
|
|
262
|
+
var Option = /*#__PURE__*/function (_PureComponent) {
|
|
345
263
|
_inherits(Option, _PureComponent);
|
|
346
264
|
|
|
347
265
|
var _super = _createSuper(Option);
|
|
@@ -359,6 +277,19 @@ var Option_Option = /*#__PURE__*/function (_PureComponent) {
|
|
|
359
277
|
|
|
360
278
|
_defineProperty(_assertThisInitialized(_this), "c", null);
|
|
361
279
|
|
|
280
|
+
_defineProperty(_assertThisInitialized(_this), "handleClick", function (e) {
|
|
281
|
+
var _this$props = _this.props,
|
|
282
|
+
onClick = _this$props.onClick,
|
|
283
|
+
value = _this$props.value,
|
|
284
|
+
disabled = _this$props.disabled;
|
|
285
|
+
|
|
286
|
+
if (!disabled) {
|
|
287
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(e, {
|
|
288
|
+
value: value
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
|
|
362
293
|
_defineProperty(_assertThisInitialized(_this), "handleMount", function (c) {
|
|
363
294
|
_this.c = c;
|
|
364
295
|
});
|
|
@@ -387,279 +318,99 @@ var Option_Option = /*#__PURE__*/function (_PureComponent) {
|
|
|
387
318
|
}, {
|
|
388
319
|
key: "render",
|
|
389
320
|
value: function render() {
|
|
390
|
-
|
|
391
|
-
|
|
321
|
+
var _this$props2 = this.props,
|
|
322
|
+
value = _this$props2.value,
|
|
323
|
+
children = _this$props2.children,
|
|
324
|
+
label = _this$props2.label,
|
|
325
|
+
multiple = _this$props2.multiple,
|
|
326
|
+
otherProps = _objectWithoutProperties(_this$props2, ["value", "children", "label", "multiple"]);
|
|
327
|
+
|
|
328
|
+
return /*#__PURE__*/external_react_default().createElement(Menu_namespaceObject.Item, _extends({
|
|
329
|
+
"aria-selected": this.props.selected,
|
|
330
|
+
"data-test-value": value,
|
|
331
|
+
"data-test": "option",
|
|
392
332
|
ref: this.handleMount
|
|
393
|
-
}
|
|
333
|
+
}, otherProps, {
|
|
334
|
+
selectable: true,
|
|
335
|
+
selectableAppearance: multiple ? 'checkbox' : undefined,
|
|
336
|
+
onClick: this.handleClick,
|
|
337
|
+
role: "option",
|
|
338
|
+
value: value.toString()
|
|
339
|
+
}), children || label);
|
|
394
340
|
}
|
|
395
341
|
}]);
|
|
396
342
|
|
|
397
343
|
return Option;
|
|
398
|
-
}(
|
|
399
|
-
|
|
400
|
-
_defineProperty(Option_Option, "propTypes", propTypes);
|
|
401
|
-
|
|
402
|
-
_defineProperty(Option_Option, "defaultProps", defaultProps);
|
|
403
|
-
|
|
404
|
-
/* harmony default export */ var Select_Option = (Option_Option);
|
|
405
|
-
// CONCATENATED MODULE: ./src/Select/Select.tsx
|
|
406
|
-
function Select_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Select_typeof = function _typeof(obj) { return typeof obj; }; } else { Select_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Select_typeof(obj); }
|
|
407
|
-
|
|
408
|
-
function Select_extends() { Select_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 Select_extends.apply(this, arguments); }
|
|
409
|
-
|
|
410
|
-
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; }
|
|
411
|
-
|
|
412
|
-
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; }
|
|
413
|
-
|
|
414
|
-
function Select_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
415
|
-
|
|
416
|
-
function Select_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); } }
|
|
417
|
-
|
|
418
|
-
function Select_createClass(Constructor, protoProps, staticProps) { if (protoProps) Select_defineProperties(Constructor.prototype, protoProps); if (staticProps) Select_defineProperties(Constructor, staticProps); return Constructor; }
|
|
419
|
-
|
|
420
|
-
function Select_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) Select_setPrototypeOf(subClass, superClass); }
|
|
421
|
-
|
|
422
|
-
function Select_setPrototypeOf(o, p) { Select_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Select_setPrototypeOf(o, p); }
|
|
423
|
-
|
|
424
|
-
function Select_createSuper(Derived) { var hasNativeReflectConstruct = Select_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Select_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Select_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Select_possibleConstructorReturn(this, result); }; }
|
|
425
|
-
|
|
426
|
-
function Select_possibleConstructorReturn(self, call) { if (call && (Select_typeof(call) === "object" || typeof call === "function")) { return call; } return Select_assertThisInitialized(self); }
|
|
427
|
-
|
|
428
|
-
function Select_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
429
|
-
|
|
430
|
-
function Select_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; } }
|
|
431
|
-
|
|
432
|
-
function Select_getPrototypeOf(o) { Select_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Select_getPrototypeOf(o); }
|
|
433
|
-
|
|
434
|
-
function Select_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; }
|
|
435
|
-
|
|
436
|
-
/* eslint-disable max-classes-per-file */
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
/** @public */
|
|
444
|
-
|
|
445
|
-
var Select_propTypes = {
|
|
446
|
-
allowKeyMatching: external_prop_types_default.a.bool,
|
|
447
|
-
animateLoading: external_prop_types_default.a.bool,
|
|
448
|
-
appearance: external_prop_types_default.a.oneOf(['default', 'link', 'primary', 'pill', 'toggle', 'flat']),
|
|
449
|
-
append: external_prop_types_default.a.bool,
|
|
450
|
-
children: external_prop_types_default.a.node,
|
|
451
|
-
defaultPlacement: external_prop_types_default.a.oneOf(['above', 'below', 'vertical']),
|
|
452
|
-
defaultValue: external_prop_types_default.a.oneOfType([external_prop_types_default.a.string, external_prop_types_default.a.number, external_prop_types_default.a.bool]),
|
|
453
|
-
describedBy: external_prop_types_default.a.string,
|
|
454
|
-
disabled: external_prop_types_default.a.bool,
|
|
455
|
-
elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]),
|
|
456
|
-
error: external_prop_types_default.a.bool,
|
|
457
|
-
filter: external_prop_types_default.a.oneOf([false, true, 'controlled']),
|
|
458
|
-
footerMessage: external_prop_types_default.a.node,
|
|
459
|
-
inline: external_prop_types_default.a.bool,
|
|
460
|
-
inputId: external_prop_types_default.a.string,
|
|
461
|
-
inputRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]),
|
|
462
|
-
isLoadingOptions: external_prop_types_default.a.bool,
|
|
463
|
-
labelledBy: external_prop_types_default.a.string,
|
|
464
|
-
labelText: external_prop_types_default.a.string,
|
|
465
|
-
loadingMessage: external_prop_types_default.a.node,
|
|
466
|
-
menuStyle: external_prop_types_default.a.object,
|
|
467
|
-
name: external_prop_types_default.a.string,
|
|
468
|
-
noOptionsMessage: external_prop_types_default.a.node,
|
|
469
|
-
onChange: external_prop_types_default.a.func,
|
|
470
|
-
onClose: external_prop_types_default.a.func,
|
|
471
|
-
onFilterChange: external_prop_types_default.a.func,
|
|
472
|
-
onOpen: external_prop_types_default.a.func,
|
|
473
|
-
onScroll: external_prop_types_default.a.func,
|
|
474
|
-
onScrollBottom: external_prop_types_default.a.func,
|
|
475
|
-
placeholder: external_prop_types_default.a.string,
|
|
476
|
-
prefixLabel: external_prop_types_default.a.string,
|
|
477
|
-
prepend: external_prop_types_default.a.bool,
|
|
478
|
-
suffixLabel: external_prop_types_default.a.string,
|
|
479
|
-
value: external_prop_types_default.a.oneOfType([external_prop_types_default.a.string, external_prop_types_default.a.number, external_prop_types_default.a.bool])
|
|
480
|
-
};
|
|
481
|
-
var Select_defaultProps = {
|
|
482
|
-
allowKeyMatching: true,
|
|
483
|
-
animateLoading: false,
|
|
484
|
-
appearance: 'toggle',
|
|
485
|
-
append: false,
|
|
486
|
-
children: [],
|
|
487
|
-
defaultPlacement: 'vertical',
|
|
488
|
-
disabled: false,
|
|
489
|
-
error: false,
|
|
490
|
-
filter: false,
|
|
491
|
-
inline: true,
|
|
492
|
-
isLoadingOptions: false,
|
|
493
|
-
menuStyle: {},
|
|
494
|
-
noOptionsMessage: Object(i18n_["_"])('No matches'),
|
|
495
|
-
placeholder: Object(i18n_["_"])('Select...'),
|
|
496
|
-
prepend: false
|
|
497
|
-
};
|
|
344
|
+
}(external_react_namespaceObject.PureComponent);
|
|
498
345
|
|
|
499
|
-
|
|
500
|
-
Select_inherits(Select, _Component);
|
|
346
|
+
_defineProperty(Option, "propTypes", propTypes);
|
|
501
347
|
|
|
502
|
-
|
|
348
|
+
_defineProperty(Option, "defaultProps", defaultProps);
|
|
503
349
|
|
|
504
|
-
|
|
505
|
-
function Select(props) {
|
|
506
|
-
var _this;
|
|
350
|
+
_defineProperty(Option, "type", Menu_namespaceObject.Item);
|
|
507
351
|
|
|
508
|
-
|
|
352
|
+
/* harmony default export */ const OptionBase = (Option);
|
|
353
|
+
;// CONCATENATED MODULE: external "styled-components"
|
|
354
|
+
const external_styled_components_namespaceObject = require("styled-components");
|
|
355
|
+
var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_namespaceObject);
|
|
356
|
+
;// CONCATENATED MODULE: external "@splunk/react-ui/Clickable"
|
|
357
|
+
const Clickable_namespaceObject = require("@splunk/react-ui/Clickable");
|
|
358
|
+
var Clickable_default = /*#__PURE__*/__webpack_require__.n(Clickable_namespaceObject);
|
|
359
|
+
;// CONCATENATED MODULE: external "@splunk/react-ui/Switch"
|
|
360
|
+
const Switch_namespaceObject = require("@splunk/react-ui/Switch");
|
|
361
|
+
var Switch_default = /*#__PURE__*/__webpack_require__.n(Switch_namespaceObject);
|
|
362
|
+
;// CONCATENATED MODULE: ./src/Menu/ItemStyles.ts
|
|
509
363
|
|
|
510
|
-
_this = _super.call(this, props);
|
|
511
|
-
var state = {}; // wrap defaultValue in an array once to avoid failing <SelectBase>'s defaultValues comparison check
|
|
512
|
-
// using "has" to make sure that pre-4.3 behavior is preserved if a user explicitly passes "null" or "undefined"
|
|
513
364
|
|
|
514
|
-
if (has_default()(props, 'defaultValue')) {
|
|
515
|
-
if (props.defaultValue != null) {
|
|
516
|
-
state.defaultValues = [props.defaultValue];
|
|
517
|
-
} else {
|
|
518
|
-
state.defaultValues = [];
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
365
|
|
|
522
|
-
_this.state = state;
|
|
523
|
-
return _this;
|
|
524
|
-
}
|
|
525
366
|
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
}
|
|
531
|
-
}, {
|
|
532
|
-
key: "render",
|
|
533
|
-
value: function render() {
|
|
534
|
-
var _this$props = this.props,
|
|
535
|
-
defaultValue = _this$props.defaultValue,
|
|
536
|
-
_onChange = _this$props.onChange,
|
|
537
|
-
value = _this$props.value,
|
|
538
|
-
otherProps = _objectWithoutProperties(_this$props, ["defaultValue", "onChange", "value"]);
|
|
539
|
-
|
|
540
|
-
var convertedProps = {
|
|
541
|
-
onChange: function onChange(e, _ref) {
|
|
542
|
-
var name = _ref.name,
|
|
543
|
-
values = _ref.values;
|
|
544
|
-
_onChange === null || _onChange === void 0 ? void 0 : _onChange(e, {
|
|
545
|
-
name: name,
|
|
546
|
-
value: values[0]
|
|
547
|
-
});
|
|
548
|
-
}
|
|
549
|
-
}; // using "has" as opposed to a null check to match SelectBase
|
|
550
|
-
|
|
551
|
-
if (has_default()(this.props, 'value')) {
|
|
552
|
-
if (value != null) {
|
|
553
|
-
convertedProps.values = [value];
|
|
554
|
-
} else {
|
|
555
|
-
convertedProps.values = [];
|
|
556
|
-
}
|
|
557
|
-
} else if (this.state.defaultValues != null) {
|
|
558
|
-
// using defaultValues from state in order to avoid wrapping defaultValue here
|
|
559
|
-
convertedProps.defaultValues = this.state.defaultValues;
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
return /*#__PURE__*/external_react_default.a.createElement(SelectBase["c" /* default */], Select_extends({}, otherProps, convertedProps, {
|
|
563
|
-
multiple: false
|
|
564
|
-
}));
|
|
565
|
-
}
|
|
566
|
-
}]);
|
|
567
|
-
|
|
568
|
-
return Select;
|
|
569
|
-
}(external_react_["Component"]);
|
|
570
|
-
|
|
571
|
-
Select_defineProperty(Select_Select, "propTypes", Select_propTypes);
|
|
572
|
-
|
|
573
|
-
Select_defineProperty(Select_Select, "defaultProps", Select_defaultProps);
|
|
574
|
-
|
|
575
|
-
Select_defineProperty(Select_Select, "Option", Select_Option);
|
|
576
|
-
|
|
577
|
-
Select_defineProperty(Select_Select, "Heading", SelectBase["b" /* Heading */]);
|
|
578
|
-
|
|
579
|
-
Select_defineProperty(Select_Select, "Divider", SelectBase["a" /* Divider */]);
|
|
580
|
-
|
|
581
|
-
/* harmony default export */ var src_Select_Select = (Select_Select);
|
|
582
|
-
|
|
583
|
-
// CONCATENATED MODULE: ./src/Select/index.ts
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
/***/ }),
|
|
588
|
-
|
|
589
|
-
/***/ 25:
|
|
590
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
591
|
-
|
|
592
|
-
"use strict";
|
|
593
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return StyledClickable; });
|
|
594
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return StyledInnerWrapper; });
|
|
595
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return StyledItemDescriptionBottom; });
|
|
596
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return StyledItemDescriptionRight; });
|
|
597
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return StyledItemIcon; });
|
|
598
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return StyledItemSelectedIcon; });
|
|
599
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return StyledLabel; });
|
|
600
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return StyledMatch; });
|
|
601
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return StyledSubmenu; });
|
|
602
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return StyledSwitch; });
|
|
603
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return StyledTitleAndDescriptionWrapper; });
|
|
604
|
-
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
|
|
605
|
-
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_0__);
|
|
606
|
-
/* harmony import */ var _splunk_react_ui_Clickable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12);
|
|
607
|
-
/* harmony import */ var _splunk_react_ui_Clickable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_react_ui_Clickable__WEBPACK_IMPORTED_MODULE_1__);
|
|
608
|
-
/* harmony import */ var _splunk_react_ui_Switch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(39);
|
|
609
|
-
/* harmony import */ var _splunk_react_ui_Switch__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_splunk_react_ui_Switch__WEBPACK_IMPORTED_MODULE_2__);
|
|
610
|
-
/* harmony import */ var _splunk_themes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(0);
|
|
611
|
-
/* harmony import */ var _splunk_themes__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_splunk_themes__WEBPACK_IMPORTED_MODULE_3__);
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
var itemDescription = Object(styled_components__WEBPACK_IMPORTED_MODULE_0__["css"])(["color:", ";font-size:", ";line-height:", ";overflow:inherit;white-space:inherit;text-overflow:inherit;"], Object(_splunk_themes__WEBPACK_IMPORTED_MODULE_3__["pick"])({
|
|
617
|
-
prisma: _splunk_themes__WEBPACK_IMPORTED_MODULE_3__["variables"].contentColorDefault,
|
|
618
|
-
enterprise: _splunk_themes__WEBPACK_IMPORTED_MODULE_3__["variables"].textGray
|
|
619
|
-
}), _splunk_themes__WEBPACK_IMPORTED_MODULE_3__["variables"].fontSizeSmall, Object(_splunk_themes__WEBPACK_IMPORTED_MODULE_3__["pick"])({
|
|
367
|
+
var itemDescription = (0,external_styled_components_namespaceObject.css)(["color:", ";font-size:", ";line-height:", ";overflow:inherit;white-space:inherit;text-overflow:inherit;"], (0,themes_namespaceObject.pick)({
|
|
368
|
+
prisma: themes_namespaceObject.variables.contentColorDefault,
|
|
369
|
+
enterprise: themes_namespaceObject.variables.textGray
|
|
370
|
+
}), themes_namespaceObject.variables.fontSizeSmall, (0,themes_namespaceObject.pick)({
|
|
620
371
|
prisma: '16px'
|
|
621
372
|
}));
|
|
622
|
-
var StyledItemDescriptionBottom =
|
|
373
|
+
var StyledItemDescriptionBottom = external_styled_components_default().span.withConfig({
|
|
623
374
|
displayName: "ItemStyles__StyledItemDescriptionBottom",
|
|
624
375
|
componentId: "sc-4kc053-0"
|
|
625
376
|
})(["", ";display:block;"], itemDescription);
|
|
626
|
-
var StyledItemDescriptionRight =
|
|
377
|
+
var StyledItemDescriptionRight = external_styled_components_default().span.withConfig({
|
|
627
378
|
displayName: "ItemStyles__StyledItemDescriptionRight",
|
|
628
379
|
componentId: "sc-4kc053-1"
|
|
629
|
-
})(["", ";float:right;padding-left:", ";max-width:50%;text-align:right;box-sizing:border-box;"], itemDescription,
|
|
630
|
-
var StyledItemSelectedIcon =
|
|
380
|
+
})(["", ";float:right;padding-left:", ";max-width:50%;text-align:right;box-sizing:border-box;"], itemDescription, themes_namespaceObject.variables.spacing);
|
|
381
|
+
var StyledItemSelectedIcon = external_styled_components_default().div.withConfig({
|
|
631
382
|
displayName: "ItemStyles__StyledItemSelectedIcon",
|
|
632
383
|
componentId: "sc-4kc053-2"
|
|
633
|
-
})(["position:absolute;", " color:", ";"],
|
|
634
|
-
prisma:
|
|
635
|
-
enterprise:
|
|
636
|
-
}),
|
|
637
|
-
prisma:
|
|
638
|
-
enterprise:
|
|
384
|
+
})(["position:absolute;", " color:", ";"], (0,themes_namespaceObject.pick)({
|
|
385
|
+
prisma: (0,external_styled_components_namespaceObject.css)(["right:16px;"]),
|
|
386
|
+
enterprise: (0,external_styled_components_namespaceObject.css)(["top:5px;right:3px;left:8px;"])
|
|
387
|
+
}), (0,themes_namespaceObject.pick)({
|
|
388
|
+
prisma: themes_namespaceObject.variables.contentColorActive,
|
|
389
|
+
enterprise: themes_namespaceObject.variables.accentColorL10
|
|
639
390
|
}));
|
|
640
|
-
var StyledItemIcon =
|
|
391
|
+
var StyledItemIcon = external_styled_components_default().span.withConfig({
|
|
641
392
|
displayName: "ItemStyles__StyledItemIcon",
|
|
642
393
|
componentId: "sc-4kc053-3"
|
|
643
|
-
})(["flex:0 0 auto;padding-right:", ";min-width:10px;display:inline-block;text-align:center;vertical-align:", ";", ""],
|
|
394
|
+
})(["flex:0 0 auto;padding-right:", ";min-width:10px;display:inline-block;text-align:center;vertical-align:", ";", ""], (0,themes_namespaceObject.pick)({
|
|
644
395
|
prisma: '8px',
|
|
645
396
|
enterprise: '3px'
|
|
646
|
-
}),
|
|
397
|
+
}), (0,themes_namespaceObject.pick)({
|
|
647
398
|
prisma: 'initial',
|
|
648
399
|
enterprise: 'middle'
|
|
649
|
-
}),
|
|
650
|
-
prisma:
|
|
651
|
-
enterprise:
|
|
400
|
+
}), (0,themes_namespaceObject.pick)({
|
|
401
|
+
prisma: (0,external_styled_components_namespaceObject.css)(["color:", ";display:inline-flex;align-items:center;min-width:20px;min-height:20px;& > svg{width:20px;height:20px;}"], themes_namespaceObject.variables.contentColorMuted),
|
|
402
|
+
enterprise: (0,external_styled_components_namespaceObject.css)(["transform:translateY(-1px);"])
|
|
652
403
|
}));
|
|
653
|
-
var StyledClickable =
|
|
404
|
+
var StyledClickable = external_styled_components_default()((Clickable_default())).withConfig({
|
|
654
405
|
displayName: "ItemStyles__StyledClickable",
|
|
655
406
|
componentId: "sc-4kc053-4"
|
|
656
|
-
})(["display:block;position:relative;cursor:pointer;color:", ";word-wrap:break-word;max-width:100%;width:100%;padding:", ";", " ", " ", " &:not([disabled]){&:hover{background:", ";", "}&:focus{outline:0;box-shadow:", ";", "}", " ", "}&[disabled]{color:", ";cursor:not-allowed;", ",", "{color:inherit;}", "{cursor:not-allowed;color:", ";}", "}", ""],
|
|
657
|
-
prisma:
|
|
407
|
+
})(["display:block;position:relative;cursor:pointer;color:", ";word-wrap:break-word;max-width:100%;width:100%;padding:", ";", " ", " ", " &:not([disabled]){&:hover{background:", ";", "}&:focus{outline:0;box-shadow:", ";", "}", " ", "}&[disabled]{color:", ";cursor:not-allowed;", ",", "{color:inherit;}", "{cursor:not-allowed;color:", ";}", "}", ""], (0,themes_namespaceObject.pick)({
|
|
408
|
+
prisma: themes_namespaceObject.variables.contentColorActive,
|
|
658
409
|
enterprise: {
|
|
659
|
-
dark:
|
|
660
|
-
light:
|
|
410
|
+
dark: themes_namespaceObject.variables.gray96,
|
|
411
|
+
light: themes_namespaceObject.variables.gray22
|
|
661
412
|
}
|
|
662
|
-
}),
|
|
413
|
+
}), (0,themes_namespaceObject.pick)({
|
|
663
414
|
prisma: {
|
|
664
415
|
comfortable: '10px 16px',
|
|
665
416
|
compact: '6px 16px'
|
|
@@ -668,129 +419,317 @@ var StyledClickable = styled_components__WEBPACK_IMPORTED_MODULE_0___default()(_
|
|
|
668
419
|
}), function (_ref) {
|
|
669
420
|
var $isSelectable = _ref.$isSelectable,
|
|
670
421
|
$selectableAppearance = _ref.$selectableAppearance;
|
|
671
|
-
return $isSelectable &&
|
|
672
|
-
prisma:
|
|
422
|
+
return $isSelectable && (0,themes_namespaceObject.pick)({
|
|
423
|
+
prisma: (0,external_styled_components_namespaceObject.css)(["padding-right:44px;", ""], function () {
|
|
673
424
|
return $selectableAppearance === 'checkbox' && 'padding-left: 42px;';
|
|
674
425
|
}),
|
|
675
|
-
enterprise:
|
|
426
|
+
enterprise: (0,external_styled_components_namespaceObject.css)(["padding-right:10px;padding-left:", ";"], function () {
|
|
676
427
|
return $selectableAppearance === 'checkbox' ? '32px' : '28px';
|
|
677
428
|
})
|
|
678
429
|
});
|
|
679
430
|
}, function (_ref2) {
|
|
680
431
|
var $active = _ref2.$active,
|
|
681
432
|
$preventFocus = _ref2.$preventFocus;
|
|
682
|
-
return $active && !$preventFocus &&
|
|
433
|
+
return $active && !$preventFocus && (0,external_styled_components_namespaceObject.css)(["box-shadow:", ";"], themes_namespaceObject.variables.focusShadowInset);
|
|
683
434
|
}, function (_ref3) {
|
|
684
435
|
var $active = _ref3.$active;
|
|
685
|
-
return $active &&
|
|
436
|
+
return $active && (0,external_styled_components_namespaceObject.css)(["background:", ";font-weight:", ";"], (0,themes_namespaceObject.pick)({
|
|
686
437
|
enterprise: {
|
|
687
|
-
light:
|
|
688
|
-
dark:
|
|
438
|
+
light: themes_namespaceObject.variables.gray92,
|
|
439
|
+
dark: themes_namespaceObject.variables.gray22
|
|
689
440
|
},
|
|
690
|
-
prisma:
|
|
691
|
-
}),
|
|
692
|
-
},
|
|
693
|
-
prisma:
|
|
694
|
-
enterprise:
|
|
441
|
+
prisma: themes_namespaceObject.variables.neutral100
|
|
442
|
+
}), themes_namespaceObject.variables.fontWeightBold);
|
|
443
|
+
}, (0,themes_namespaceObject.pick)({
|
|
444
|
+
prisma: themes_namespaceObject.variables.interactiveColorOverlayHover,
|
|
445
|
+
enterprise: themes_namespaceObject.variables.backgroundColorHover
|
|
695
446
|
}), function (_ref4) {
|
|
696
447
|
var $selected = _ref4.$selected;
|
|
697
|
-
return $selected &&
|
|
698
|
-
prisma:
|
|
448
|
+
return $selected && (0,themes_namespaceObject.pick)({
|
|
449
|
+
prisma: (0,external_styled_components_namespaceObject.css)(["background:", ";"], themes_namespaceObject.mixins.overlayColors(themes_namespaceObject.variables.interactiveColorOverlaySelected, themes_namespaceObject.variables.interactiveColorOverlayHover))
|
|
699
450
|
});
|
|
700
|
-
},
|
|
701
|
-
prisma:
|
|
702
|
-
}),
|
|
703
|
-
prisma:
|
|
451
|
+
}, themes_namespaceObject.variables.focusShadowInset, (0,themes_namespaceObject.pick)({
|
|
452
|
+
prisma: (0,external_styled_components_namespaceObject.css)(["background:", ";"], themes_namespaceObject.variables.interactiveColorOverlayHover)
|
|
453
|
+
}), (0,themes_namespaceObject.pick)({
|
|
454
|
+
prisma: (0,external_styled_components_namespaceObject.css)(["&:active{background:", ";}"], themes_namespaceObject.variables.interactiveColorOverlayActive)
|
|
704
455
|
}), function (_ref5) {
|
|
705
456
|
var $selected = _ref5.$selected;
|
|
706
|
-
return $selected &&
|
|
707
|
-
prisma:
|
|
457
|
+
return $selected && (0,themes_namespaceObject.pick)({
|
|
458
|
+
prisma: (0,external_styled_components_namespaceObject.css)(["background:", ";&:active{background:", ";}"], themes_namespaceObject.variables.interactiveColorOverlaySelected, themes_namespaceObject.mixins.overlayColors(themes_namespaceObject.variables.interactiveColorOverlaySelected, themes_namespaceObject.variables.interactiveColorOverlayActive))
|
|
708
459
|
});
|
|
709
|
-
},
|
|
460
|
+
}, (0,themes_namespaceObject.pick)({
|
|
710
461
|
enterprise: {
|
|
711
|
-
light:
|
|
712
|
-
dark:
|
|
462
|
+
light: themes_namespaceObject.variables.gray45,
|
|
463
|
+
dark: themes_namespaceObject.variables.contentColorDisabled
|
|
713
464
|
},
|
|
714
|
-
prisma:
|
|
465
|
+
prisma: themes_namespaceObject.variables.contentColorDisabled
|
|
715
466
|
}),
|
|
716
467
|
/* sc-sel */
|
|
717
468
|
StyledItemDescriptionBottom,
|
|
718
469
|
/* sc-sel */
|
|
719
470
|
StyledItemDescriptionRight,
|
|
720
471
|
/* sc-sel */
|
|
721
|
-
StyledItemSelectedIcon,
|
|
722
|
-
prisma:
|
|
723
|
-
enterprise:
|
|
724
|
-
}),
|
|
725
|
-
prisma:
|
|
472
|
+
StyledItemSelectedIcon, (0,themes_namespaceObject.pick)({
|
|
473
|
+
prisma: themes_namespaceObject.variables.contentColorDisabled,
|
|
474
|
+
enterprise: themes_namespaceObject.variables.gray80
|
|
475
|
+
}), (0,themes_namespaceObject.pick)({
|
|
476
|
+
prisma: (0,external_styled_components_namespaceObject.css)(["& > * > ", "{color:", ";}"],
|
|
726
477
|
/* sc-sel */
|
|
727
|
-
StyledItemIcon,
|
|
478
|
+
StyledItemIcon, themes_namespaceObject.variables.contentColorDisabled)
|
|
728
479
|
}), function (_ref6) {
|
|
729
480
|
var $selected = _ref6.$selected;
|
|
730
|
-
return $selected &&
|
|
731
|
-
prisma:
|
|
481
|
+
return $selected && (0,themes_namespaceObject.pick)({
|
|
482
|
+
prisma: (0,external_styled_components_namespaceObject.css)(["", "{color:", ";}"],
|
|
732
483
|
/* sc-sel */
|
|
733
|
-
StyledItemIcon,
|
|
484
|
+
StyledItemIcon, themes_namespaceObject.variables.contentColorActive)
|
|
734
485
|
});
|
|
735
486
|
});
|
|
736
|
-
var StyledSwitch =
|
|
487
|
+
var StyledSwitch = external_styled_components_default()((Switch_default())).withConfig({
|
|
737
488
|
displayName: "ItemStyles__StyledSwitch",
|
|
738
489
|
componentId: "sc-4kc053-5"
|
|
739
|
-
})(["position:absolute;left:", ";top:", ";"],
|
|
490
|
+
})(["position:absolute;left:", ";top:", ";"], (0,themes_namespaceObject.pick)({
|
|
740
491
|
prisma: '16px',
|
|
741
492
|
enterprise: '8px'
|
|
742
|
-
}),
|
|
493
|
+
}), (0,themes_namespaceObject.pick)({
|
|
743
494
|
prisma: '0px',
|
|
744
495
|
enterprise: {
|
|
745
496
|
comfortable: '-1px',
|
|
746
497
|
compact: '2px'
|
|
747
498
|
}
|
|
748
499
|
}));
|
|
749
|
-
var StyledInnerWrapper =
|
|
500
|
+
var StyledInnerWrapper = external_styled_components_default().span.withConfig({
|
|
750
501
|
displayName: "ItemStyles__StyledInnerWrapper",
|
|
751
502
|
componentId: "sc-4kc053-6"
|
|
752
503
|
})(["display:flex;align-items:flex-start;"]);
|
|
753
|
-
var StyledTitleAndDescriptionWrapper =
|
|
504
|
+
var StyledTitleAndDescriptionWrapper = external_styled_components_default().span.withConfig({
|
|
754
505
|
displayName: "ItemStyles__StyledTitleAndDescriptionWrapper",
|
|
755
506
|
componentId: "sc-4kc053-7"
|
|
756
507
|
})(["max-width:100%;width:100%;align-self:center;word-break:break-word;white-space:normal;", ""], function (_ref7) {
|
|
757
508
|
var $truncate = _ref7.$truncate;
|
|
758
|
-
return $truncate &&
|
|
509
|
+
return $truncate && (0,external_styled_components_namespaceObject.css)(["white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"]);
|
|
759
510
|
});
|
|
760
|
-
var StyledLabel =
|
|
511
|
+
var StyledLabel = external_styled_components_default().div.withConfig({
|
|
761
512
|
displayName: "ItemStyles__StyledLabel",
|
|
762
513
|
componentId: "sc-4kc053-8"
|
|
763
514
|
})(["overflow:inherit;white-space:inherit;text-overflow:inherit;max-width:100%;min-height:20px;", ""], function (_ref8) {
|
|
764
515
|
var $truncate = _ref8.$truncate;
|
|
765
|
-
return $truncate &&
|
|
516
|
+
return $truncate && (0,external_styled_components_namespaceObject.css)(["display:block;clear:both;"]);
|
|
766
517
|
});
|
|
767
|
-
var StyledMatch =
|
|
518
|
+
var StyledMatch = external_styled_components_default().span.withConfig({
|
|
768
519
|
displayName: "ItemStyles__StyledMatch",
|
|
769
520
|
componentId: "sc-4kc053-9"
|
|
770
|
-
})(["border-bottom:1px solid ", ";"],
|
|
771
|
-
prisma:
|
|
521
|
+
})(["border-bottom:1px solid ", ";"], (0,themes_namespaceObject.pick)({
|
|
522
|
+
prisma: themes_namespaceObject.variables.contentColorActive,
|
|
772
523
|
enterprise: {
|
|
773
|
-
dark:
|
|
774
|
-
light:
|
|
524
|
+
dark: themes_namespaceObject.variables.gray96,
|
|
525
|
+
light: themes_namespaceObject.variables.gray45
|
|
775
526
|
}
|
|
776
527
|
}));
|
|
777
|
-
var StyledSubmenu =
|
|
528
|
+
var StyledSubmenu = external_styled_components_default().span.withConfig({
|
|
778
529
|
displayName: "ItemStyles__StyledSubmenu",
|
|
779
530
|
componentId: "sc-4kc053-10"
|
|
780
|
-
})(["float:right;padding-left:", ";color:", ";"],
|
|
531
|
+
})(["float:right;padding-left:", ";color:", ";"], themes_namespaceObject.variables.spacingSmall, (0,themes_namespaceObject.pick)({
|
|
781
532
|
prisma: 'inherit',
|
|
782
|
-
enterprise:
|
|
533
|
+
enterprise: themes_namespaceObject.variables.textGray
|
|
534
|
+
}));
|
|
535
|
+
|
|
536
|
+
;// CONCATENATED MODULE: ./src/Select/SelectAllOptionStyles.ts
|
|
537
|
+
|
|
538
|
+
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
var StyledSelectAllLabel = external_styled_components_default()(StyledLabel).withConfig({
|
|
542
|
+
displayName: "SelectAllOptionStyles__StyledSelectAllLabel",
|
|
543
|
+
componentId: "y6bn08-0"
|
|
544
|
+
})(["font-weight:", ";"], themes_namespaceObject.variables.fontWeightBold);
|
|
545
|
+
var StyledSelectAllOption = external_styled_components_default()(OptionBase).withConfig({
|
|
546
|
+
displayName: "SelectAllOptionStyles__StyledSelectAllOption",
|
|
547
|
+
componentId: "y6bn08-1"
|
|
548
|
+
})(["padding-inline-start:", ";box-shadow:none;"], (0,themes_namespaceObject.pick)({
|
|
549
|
+
prisma: '42px;',
|
|
550
|
+
enterprise: '32px;'
|
|
551
|
+
}));
|
|
552
|
+
|
|
553
|
+
;// CONCATENATED MODULE: ./src/Select/SelectAllOption.tsx
|
|
554
|
+
|
|
555
|
+
|
|
556
|
+
|
|
557
|
+
|
|
558
|
+
var SelectAllOption_propTypes = {
|
|
559
|
+
active: (external_prop_types_default()).bool,
|
|
560
|
+
elementRef: external_prop_types_default().oneOfType([(external_prop_types_default()).func, (external_prop_types_default()).object]),
|
|
561
|
+
id: (external_prop_types_default()).string,
|
|
562
|
+
onClick: (external_prop_types_default()).func,
|
|
563
|
+
selectAllLabel: (external_prop_types_default()).string,
|
|
564
|
+
totalCount: (external_prop_types_default()).number,
|
|
565
|
+
changedToggle: (external_prop_types_default()).bool,
|
|
566
|
+
selected: external_prop_types_default().oneOf([false, true, 'some'])
|
|
567
|
+
};
|
|
568
|
+
var SelectAllOption = /*#__PURE__*/external_react_default().forwardRef(function (_ref, ref) {
|
|
569
|
+
var active = _ref.active,
|
|
570
|
+
id = _ref.id,
|
|
571
|
+
onClick = _ref.onClick,
|
|
572
|
+
selectAllLabel = _ref.selectAllLabel,
|
|
573
|
+
totalCount = _ref.totalCount,
|
|
574
|
+
changedToggle = _ref.changedToggle,
|
|
575
|
+
selected = _ref.selected;
|
|
576
|
+
// When toggle is changed the total count is not displayed anymore so the count is now shown in the Select All menu item
|
|
577
|
+
var totalCountDisplay = changedToggle ? " (".concat(totalCount === null || totalCount === void 0 ? void 0 : totalCount.toString(), ")") : '';
|
|
578
|
+
return /*#__PURE__*/external_react_default().createElement(StyledSelectAllOption, {
|
|
579
|
+
label: selectAllLabel,
|
|
580
|
+
value: "selectAll",
|
|
581
|
+
key: "selectAll",
|
|
582
|
+
onClick: onClick,
|
|
583
|
+
"data-test": "select-all",
|
|
584
|
+
"aria-keyshortcuts": "Control+A",
|
|
585
|
+
id: id,
|
|
586
|
+
active: active,
|
|
587
|
+
ref: ref,
|
|
588
|
+
tabIndex: -1
|
|
589
|
+
}, /*#__PURE__*/external_react_default().createElement(StyledSwitch, {
|
|
590
|
+
interactive: false,
|
|
591
|
+
selected: selected === 'some' && 'some' || selected,
|
|
592
|
+
key: "main-checkbox",
|
|
593
|
+
value: "main-checkbox",
|
|
594
|
+
appearance: "checkbox",
|
|
595
|
+
"aria-label": !selected && (0,i18n_namespaceObject._)('No options selected') || selected === 'some' && (0,i18n_namespaceObject._)('Some options selected') || (0,i18n_namespaceObject._)('All options selected'),
|
|
596
|
+
"data-test": "select-all-switch",
|
|
597
|
+
selectedLabel: selected === true ? (0,i18n_namespaceObject._)('All options selected') : (0,i18n_namespaceObject._)('Option selected'),
|
|
598
|
+
unselectedLabel: selected === true ? (0,i18n_namespaceObject._)('No options selected') : (0,i18n_namespaceObject._)('Option unselected'),
|
|
599
|
+
someSelectedLabel: (0,i18n_namespaceObject._)('Some options selected')
|
|
600
|
+
}), /*#__PURE__*/external_react_default().createElement(StyledItemDescriptionRight, {
|
|
601
|
+
"data-test": "description"
|
|
602
|
+
}, "".concat(totalCountDisplay, " Ctrl-a")), /*#__PURE__*/external_react_default().createElement(StyledInnerWrapper, null, /*#__PURE__*/external_react_default().createElement(StyledTitleAndDescriptionWrapper, {
|
|
603
|
+
$truncate: false
|
|
604
|
+
}, /*#__PURE__*/external_react_default().createElement(StyledSelectAllLabel, {
|
|
605
|
+
$truncate: false
|
|
606
|
+
}, selectAllLabel))));
|
|
607
|
+
});
|
|
608
|
+
SelectAllOption.propTypes = SelectAllOption_propTypes;
|
|
609
|
+
/* harmony default export */ const Select_SelectAllOption = (SelectAllOption);
|
|
610
|
+
;// CONCATENATED MODULE: external "@splunk/react-ui/Button"
|
|
611
|
+
const Button_namespaceObject = require("@splunk/react-ui/Button");
|
|
612
|
+
var Button_default = /*#__PURE__*/__webpack_require__.n(Button_namespaceObject);
|
|
613
|
+
;// CONCATENATED MODULE: ./src/Select/SelectBaseStyles.ts
|
|
614
|
+
|
|
615
|
+
|
|
616
|
+
|
|
617
|
+
|
|
618
|
+
var StyledButton = external_styled_components_default()((Button_default())).withConfig({
|
|
619
|
+
displayName: "SelectBaseStyles__StyledButton",
|
|
620
|
+
componentId: "sc-16cj7sk-0"
|
|
621
|
+
})(["&[data-inline]{width:", ";}", ""], function (_ref) {
|
|
622
|
+
var $multiple = _ref.$multiple;
|
|
623
|
+
return $multiple ? '400px' : 'auto';
|
|
624
|
+
}, function (_ref2) {
|
|
625
|
+
var $multiple = _ref2.$multiple;
|
|
626
|
+
return !$multiple && 'flex-grow: 0;';
|
|
627
|
+
});
|
|
628
|
+
var StyledLinkIcon = external_styled_components_default().span.withConfig({
|
|
629
|
+
displayName: "SelectBaseStyles__StyledLinkIcon",
|
|
630
|
+
componentId: "sc-16cj7sk-1"
|
|
631
|
+
})(["padding-right:2px;"]);
|
|
632
|
+
var StyledLinkCaret = external_styled_components_default().span.withConfig({
|
|
633
|
+
displayName: "SelectBaseStyles__StyledLinkCaret",
|
|
634
|
+
componentId: "sc-16cj7sk-2"
|
|
635
|
+
})(["padding-left:2px;"]);
|
|
636
|
+
var StyledFilter = external_styled_components_default().div.withConfig({
|
|
637
|
+
displayName: "SelectBaseStyles__StyledFilter",
|
|
638
|
+
componentId: "sc-16cj7sk-3"
|
|
639
|
+
})(["padding:", ";min-width:160px;"], (0,themes_namespaceObject.pick)({
|
|
640
|
+
enterprise: '8px',
|
|
641
|
+
prisma: '10px 16px'
|
|
642
|
+
}));
|
|
643
|
+
var StyledSearchIconWrapper = external_styled_components_default().span.withConfig({
|
|
644
|
+
displayName: "SelectBaseStyles__StyledSearchIconWrapper",
|
|
645
|
+
componentId: "sc-16cj7sk-4"
|
|
646
|
+
})(["color:", ";pointer-events:none;padding:", ";"], (0,themes_namespaceObject.pick)({
|
|
647
|
+
enterprise: {
|
|
648
|
+
light: themes_namespaceObject.variables.gray60,
|
|
649
|
+
dark: themes_namespaceObject.variables.white
|
|
650
|
+
},
|
|
651
|
+
prisma: themes_namespaceObject.variables.contentColorMuted
|
|
652
|
+
}), (0,themes_namespaceObject.pick)({
|
|
653
|
+
comfortable: '0 8px',
|
|
654
|
+
compact: '0 6px'
|
|
655
|
+
}));
|
|
656
|
+
var StyledCount = external_styled_components_default().span.withConfig({
|
|
657
|
+
displayName: "SelectBaseStyles__StyledCount",
|
|
658
|
+
componentId: "sc-16cj7sk-5"
|
|
659
|
+
})(["padding-right:", ";"], (0,themes_namespaceObject.pick)({
|
|
660
|
+
enterprise: themes_namespaceObject.variables.spacingQuarter,
|
|
661
|
+
prisma: themes_namespaceObject.variables.spacingXSmall
|
|
662
|
+
}));
|
|
663
|
+
var StyledControlsLink = external_styled_components_default()((Link_default())).withConfig({
|
|
664
|
+
displayName: "SelectBaseStyles__StyledControlsLink",
|
|
665
|
+
componentId: "sc-16cj7sk-6"
|
|
666
|
+
})(["margin-right:20px;", ";"], function (_ref3) {
|
|
667
|
+
var $disabled = _ref3.$disabled;
|
|
668
|
+
return $disabled && (0,external_styled_components_namespaceObject.css)(["color:", ";"], themes_namespaceObject.variables.contentColorDisabled);
|
|
669
|
+
});
|
|
670
|
+
var StyledToggleAllControls = external_styled_components_default().div.withConfig({
|
|
671
|
+
displayName: "SelectBaseStyles__StyledToggleAllControls",
|
|
672
|
+
componentId: "sc-16cj7sk-7"
|
|
673
|
+
})(["padding:", ";", ""], (0,themes_namespaceObject.pick)({
|
|
674
|
+
enterprise: "5px 8px",
|
|
675
|
+
prisma: '10px 16px'
|
|
676
|
+
}), (0,themes_namespaceObject.pickVariant)('$placement', {
|
|
677
|
+
above: {
|
|
678
|
+
enterprise: (0,external_styled_components_namespaceObject.css)(["border-top:", ";"], themes_namespaceObject.variables.border),
|
|
679
|
+
prisma: (0,external_styled_components_namespaceObject.css)(["border-top:1px solid ", ";"], themes_namespaceObject.variables.neutral200)
|
|
680
|
+
},
|
|
681
|
+
below: {
|
|
682
|
+
enterprise: (0,external_styled_components_namespaceObject.css)(["border-bottom:", ";"], themes_namespaceObject.variables.border),
|
|
683
|
+
prisma: (0,external_styled_components_namespaceObject.css)(["border-bottom:1px solid ", ";"], themes_namespaceObject.variables.neutral200)
|
|
684
|
+
}
|
|
783
685
|
}));
|
|
784
686
|
|
|
687
|
+
;// CONCATENATED MODULE: ./src/utils/fuzzyMatch.ts
|
|
688
|
+
// A utility for matching keyboard characters to list values
|
|
689
|
+
var charFromMatchOption = function charFromMatchOption(option, charIndex) {
|
|
690
|
+
return option ? option.label.charAt(charIndex).toLowerCase() : '';
|
|
691
|
+
};
|
|
692
|
+
|
|
693
|
+
var fuzzyMatch = function fuzzyMatch(options, matchChar) {
|
|
694
|
+
if (!options.length) {
|
|
695
|
+
return options;
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
var defaultMatch = null;
|
|
699
|
+
var hasMatch = false;
|
|
700
|
+
var matches = options.filter(function (option) {
|
|
701
|
+
var characterValue = charFromMatchOption(option, matchChar.index);
|
|
702
|
+
|
|
703
|
+
if (characterValue === matchChar.value) {
|
|
704
|
+
hasMatch = true;
|
|
705
|
+
return true;
|
|
706
|
+
} // If we haven't found a match yet, keep track of the next closest match.
|
|
707
|
+
// Secondary matching looks for the closest character of a higher value, and failing that, closest of a lower value.
|
|
708
|
+
|
|
709
|
+
|
|
710
|
+
if (!hasMatch) {
|
|
711
|
+
var defaultValue = charFromMatchOption(defaultMatch, matchChar.index);
|
|
712
|
+
|
|
713
|
+
if (!defaultValue) {
|
|
714
|
+
defaultMatch = option;
|
|
715
|
+
} else if (characterValue > matchChar.value) {
|
|
716
|
+
if (defaultValue < matchChar.value) {
|
|
717
|
+
defaultMatch = option;
|
|
718
|
+
} else if (defaultValue > characterValue) {
|
|
719
|
+
defaultMatch = option;
|
|
720
|
+
}
|
|
721
|
+
} else if (characterValue > defaultValue) {
|
|
722
|
+
defaultMatch = option;
|
|
723
|
+
}
|
|
724
|
+
}
|
|
785
725
|
|
|
786
|
-
|
|
726
|
+
return false;
|
|
727
|
+
});
|
|
728
|
+
return matches.length === 0 && defaultMatch ? [defaultMatch] : matches;
|
|
729
|
+
};
|
|
787
730
|
|
|
788
|
-
/***/ 28:
|
|
789
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
790
731
|
|
|
791
|
-
|
|
792
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getDocument; });
|
|
793
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return ssrDocument; });
|
|
732
|
+
;// CONCATENATED MODULE: ./src/utils/ssrDocument.ts
|
|
794
733
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
795
734
|
var ssrDocument = {
|
|
796
735
|
body: {
|
|
@@ -853,696 +792,75 @@ function getDocument() {
|
|
|
853
792
|
}
|
|
854
793
|
|
|
855
794
|
|
|
795
|
+
;// CONCATENATED MODULE: ./src/utils/ssrWindow.ts
|
|
796
|
+
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
856
797
|
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
function
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
889
|
-
|
|
890
|
-
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); }
|
|
891
|
-
|
|
892
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
893
|
-
|
|
894
|
-
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); }; }
|
|
895
|
-
|
|
896
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
897
|
-
|
|
898
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
899
|
-
|
|
900
|
-
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; } }
|
|
901
|
-
|
|
902
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
903
|
-
|
|
904
|
-
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; }
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
var propTypes = {
|
|
910
|
-
/** @private */
|
|
911
|
-
active: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
|
|
912
|
-
children: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.node,
|
|
913
|
-
description: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,
|
|
914
|
-
descriptionPosition: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOf(['right', 'bottom']),
|
|
915
|
-
disabled: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
|
|
916
|
-
hidden: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
|
|
917
|
-
icon: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.node,
|
|
918
|
-
label: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string.isRequired,
|
|
919
|
-
|
|
920
|
-
/**
|
|
921
|
-
* @private Passed down from <BaseSelect>
|
|
922
|
-
*/
|
|
923
|
-
multiple: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
|
|
924
|
-
matchRanges: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.shape({
|
|
925
|
-
start: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number.isRequired,
|
|
926
|
-
end: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number.isRequired
|
|
927
|
-
})),
|
|
928
|
-
|
|
929
|
-
/** @private */
|
|
930
|
-
onClick: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
|
|
931
|
-
|
|
932
|
-
/** @private */
|
|
933
|
-
selected: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
|
|
934
|
-
truncate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
|
|
935
|
-
value: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool]).isRequired
|
|
936
|
-
};
|
|
937
|
-
var defaultProps = {
|
|
938
|
-
descriptionPosition: 'bottom',
|
|
939
|
-
disabled: false,
|
|
940
|
-
multiple: false,
|
|
941
|
-
selected: false,
|
|
942
|
-
truncate: false
|
|
943
|
-
};
|
|
944
|
-
|
|
945
|
-
/**
|
|
946
|
-
* An option within a `Multiselect`. This inherits from
|
|
947
|
-
* [PureComponent](https://reactjs.org/docs/react-api.html#reactpurecomponent)
|
|
948
|
-
* so any elements passed to it must also be pure.
|
|
949
|
-
*/
|
|
950
|
-
var Option = /*#__PURE__*/function (_PureComponent) {
|
|
951
|
-
_inherits(Option, _PureComponent);
|
|
952
|
-
|
|
953
|
-
var _super = _createSuper(Option);
|
|
954
|
-
|
|
955
|
-
function Option() {
|
|
956
|
-
var _this;
|
|
957
|
-
|
|
958
|
-
_classCallCheck(this, Option);
|
|
959
|
-
|
|
960
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
961
|
-
args[_key] = arguments[_key];
|
|
962
|
-
}
|
|
963
|
-
|
|
964
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
965
|
-
|
|
966
|
-
_defineProperty(_assertThisInitialized(_this), "c", null);
|
|
967
|
-
|
|
968
|
-
_defineProperty(_assertThisInitialized(_this), "handleClick", function (e) {
|
|
969
|
-
var _this$props = _this.props,
|
|
970
|
-
onClick = _this$props.onClick,
|
|
971
|
-
value = _this$props.value,
|
|
972
|
-
disabled = _this$props.disabled;
|
|
973
|
-
|
|
974
|
-
if (!disabled) {
|
|
975
|
-
onClick === null || onClick === void 0 ? void 0 : onClick(e, {
|
|
976
|
-
value: value
|
|
977
|
-
});
|
|
978
|
-
}
|
|
979
|
-
});
|
|
980
|
-
|
|
981
|
-
_defineProperty(_assertThisInitialized(_this), "handleMount", function (c) {
|
|
982
|
-
_this.c = c;
|
|
983
|
-
});
|
|
984
|
-
|
|
985
|
-
return _this;
|
|
986
|
-
}
|
|
987
|
-
|
|
988
|
-
_createClass(Option, [{
|
|
989
|
-
key: "scrollIntoViewIfNeeded",
|
|
990
|
-
value: function scrollIntoViewIfNeeded() {
|
|
991
|
-
var _this$c;
|
|
992
|
-
|
|
993
|
-
(_this$c = this.c) === null || _this$c === void 0 ? void 0 : _this$c.scrollIntoViewIfNeeded();
|
|
994
|
-
}
|
|
995
|
-
/**
|
|
996
|
-
* Place focus on the button.
|
|
997
|
-
*/
|
|
998
|
-
|
|
999
|
-
}, {
|
|
1000
|
-
key: "focus",
|
|
1001
|
-
value: function focus() {
|
|
1002
|
-
var _this$c2;
|
|
1003
|
-
|
|
1004
|
-
(_this$c2 = this.c) === null || _this$c2 === void 0 ? void 0 : _this$c2.focus();
|
|
1005
|
-
}
|
|
1006
|
-
}, {
|
|
1007
|
-
key: "render",
|
|
1008
|
-
value: function render() {
|
|
1009
|
-
var _this$props2 = this.props,
|
|
1010
|
-
value = _this$props2.value,
|
|
1011
|
-
children = _this$props2.children,
|
|
1012
|
-
label = _this$props2.label,
|
|
1013
|
-
multiple = _this$props2.multiple,
|
|
1014
|
-
otherProps = _objectWithoutProperties(_this$props2, ["value", "children", "label", "multiple"]);
|
|
1015
|
-
|
|
1016
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_splunk_react_ui_Menu__WEBPACK_IMPORTED_MODULE_2__["Item"], _extends({
|
|
1017
|
-
"aria-selected": this.props.selected,
|
|
1018
|
-
"data-test-value": value,
|
|
1019
|
-
"data-test": "option",
|
|
1020
|
-
ref: this.handleMount
|
|
1021
|
-
}, otherProps, {
|
|
1022
|
-
selectable: true,
|
|
1023
|
-
selectableAppearance: multiple ? 'checkbox' : undefined,
|
|
1024
|
-
onClick: this.handleClick,
|
|
1025
|
-
role: "option",
|
|
1026
|
-
value: value.toString()
|
|
1027
|
-
}), children || label);
|
|
1028
|
-
}
|
|
1029
|
-
}]);
|
|
1030
|
-
|
|
1031
|
-
return Option;
|
|
1032
|
-
}(react__WEBPACK_IMPORTED_MODULE_0__["PureComponent"]);
|
|
1033
|
-
|
|
1034
|
-
_defineProperty(Option, "propTypes", propTypes);
|
|
1035
|
-
|
|
1036
|
-
_defineProperty(Option, "defaultProps", defaultProps);
|
|
1037
|
-
|
|
1038
|
-
_defineProperty(Option, "type", _splunk_react_ui_Menu__WEBPACK_IMPORTED_MODULE_2__["Item"]);
|
|
1039
|
-
|
|
1040
|
-
/* harmony default export */ __webpack_exports__["a"] = (Option);
|
|
1041
|
-
|
|
1042
|
-
/***/ }),
|
|
1043
|
-
|
|
1044
|
-
/***/ 32:
|
|
1045
|
-
/***/ (function(module, exports) {
|
|
1046
|
-
|
|
1047
|
-
module.exports = require("@splunk/react-ui/Text");
|
|
1048
|
-
|
|
1049
|
-
/***/ }),
|
|
1050
|
-
|
|
1051
|
-
/***/ 35:
|
|
1052
|
-
/***/ (function(module, exports) {
|
|
1053
|
-
|
|
1054
|
-
module.exports = require("@splunk/ui-utils/filter");
|
|
1055
|
-
|
|
1056
|
-
/***/ }),
|
|
1057
|
-
|
|
1058
|
-
/***/ 37:
|
|
1059
|
-
/***/ (function(module, exports) {
|
|
1060
|
-
|
|
1061
|
-
module.exports = require("@splunk/react-ui/Link");
|
|
1062
|
-
|
|
1063
|
-
/***/ }),
|
|
1064
|
-
|
|
1065
|
-
/***/ 39:
|
|
1066
|
-
/***/ (function(module, exports) {
|
|
1067
|
-
|
|
1068
|
-
module.exports = require("@splunk/react-ui/Switch");
|
|
1069
|
-
|
|
1070
|
-
/***/ }),
|
|
1071
|
-
|
|
1072
|
-
/***/ 4:
|
|
1073
|
-
/***/ (function(module, exports) {
|
|
1074
|
-
|
|
1075
|
-
module.exports = require("@splunk/ui-utils/i18n");
|
|
1076
|
-
|
|
1077
|
-
/***/ }),
|
|
1078
|
-
|
|
1079
|
-
/***/ 40:
|
|
1080
|
-
/***/ (function(module, exports) {
|
|
1081
|
-
|
|
1082
|
-
module.exports = require("lodash/memoize");
|
|
1083
|
-
|
|
1084
|
-
/***/ }),
|
|
1085
|
-
|
|
1086
|
-
/***/ 42:
|
|
1087
|
-
/***/ (function(module, exports) {
|
|
1088
|
-
|
|
1089
|
-
module.exports = require("lodash/isUndefined");
|
|
1090
|
-
|
|
1091
|
-
/***/ }),
|
|
1092
|
-
|
|
1093
|
-
/***/ 44:
|
|
1094
|
-
/***/ (function(module, exports) {
|
|
1095
|
-
|
|
1096
|
-
module.exports = require("lodash/pick");
|
|
1097
|
-
|
|
1098
|
-
/***/ }),
|
|
1099
|
-
|
|
1100
|
-
/***/ 47:
|
|
1101
|
-
/***/ (function(module, exports) {
|
|
1102
|
-
|
|
1103
|
-
module.exports = require("@splunk/react-ui/ResultsMenu");
|
|
1104
|
-
|
|
1105
|
-
/***/ }),
|
|
1106
|
-
|
|
1107
|
-
/***/ 49:
|
|
1108
|
-
/***/ (function(module, exports) {
|
|
1109
|
-
|
|
1110
|
-
module.exports = require("@splunk/react-icons/Magnifier");
|
|
1111
|
-
|
|
1112
|
-
/***/ }),
|
|
1113
|
-
|
|
1114
|
-
/***/ 5:
|
|
1115
|
-
/***/ (function(module, exports) {
|
|
1116
|
-
|
|
1117
|
-
module.exports = require("lodash/omit");
|
|
1118
|
-
|
|
1119
|
-
/***/ }),
|
|
1120
|
-
|
|
1121
|
-
/***/ 54:
|
|
1122
|
-
/***/ (function(module, exports) {
|
|
1123
|
-
|
|
1124
|
-
module.exports = require("@splunk/react-icons/enterprise/Search");
|
|
1125
|
-
|
|
1126
|
-
/***/ }),
|
|
1127
|
-
|
|
1128
|
-
/***/ 55:
|
|
1129
|
-
/***/ (function(module, exports) {
|
|
1130
|
-
|
|
1131
|
-
module.exports = require("lodash/find");
|
|
1132
|
-
|
|
1133
|
-
/***/ }),
|
|
1134
|
-
|
|
1135
|
-
/***/ 56:
|
|
1136
|
-
/***/ (function(module, exports) {
|
|
1137
|
-
|
|
1138
|
-
module.exports = require("@splunk/react-icons/CaretSmallDown");
|
|
1139
|
-
|
|
1140
|
-
/***/ }),
|
|
1141
|
-
|
|
1142
|
-
/***/ 57:
|
|
1143
|
-
/***/ (function(module, exports) {
|
|
1144
|
-
|
|
1145
|
-
module.exports = require("@splunk/react-icons/enterprise/Caret");
|
|
1146
|
-
|
|
1147
|
-
/***/ }),
|
|
1148
|
-
|
|
1149
|
-
/***/ 59:
|
|
1150
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1151
|
-
|
|
1152
|
-
"use strict";
|
|
1153
|
-
/* unused harmony export charFromMatchOption */
|
|
1154
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return fuzzyMatch; });
|
|
1155
|
-
// A utility for matching keyboard characters to list values
|
|
1156
|
-
var charFromMatchOption = function charFromMatchOption(option, charIndex) {
|
|
1157
|
-
return option ? option.label.charAt(charIndex).toLowerCase() : '';
|
|
1158
|
-
};
|
|
1159
|
-
|
|
1160
|
-
var fuzzyMatch = function fuzzyMatch(options, matchChar) {
|
|
1161
|
-
if (!options.length) {
|
|
1162
|
-
return options;
|
|
1163
|
-
}
|
|
1164
|
-
|
|
1165
|
-
var defaultMatch = null;
|
|
1166
|
-
var hasMatch = false;
|
|
1167
|
-
var matches = options.filter(function (option) {
|
|
1168
|
-
var characterValue = charFromMatchOption(option, matchChar.index);
|
|
1169
|
-
|
|
1170
|
-
if (characterValue === matchChar.value) {
|
|
1171
|
-
hasMatch = true;
|
|
1172
|
-
return true;
|
|
1173
|
-
} // If we haven't found a match yet, keep track of the next closest match.
|
|
1174
|
-
// Secondary matching looks for the closest character of a higher value, and failing that, closest of a lower value.
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
if (!hasMatch) {
|
|
1178
|
-
var defaultValue = charFromMatchOption(defaultMatch, matchChar.index);
|
|
1179
|
-
|
|
1180
|
-
if (!defaultValue) {
|
|
1181
|
-
defaultMatch = option;
|
|
1182
|
-
} else if (characterValue > matchChar.value) {
|
|
1183
|
-
if (defaultValue < matchChar.value) {
|
|
1184
|
-
defaultMatch = option;
|
|
1185
|
-
} else if (defaultValue > characterValue) {
|
|
1186
|
-
defaultMatch = option;
|
|
1187
|
-
}
|
|
1188
|
-
} else if (characterValue > defaultValue) {
|
|
1189
|
-
defaultMatch = option;
|
|
798
|
+
var ssrWindow = {
|
|
799
|
+
document: ssrDocument,
|
|
800
|
+
navigator: {
|
|
801
|
+
userAgent: ''
|
|
802
|
+
},
|
|
803
|
+
location: {
|
|
804
|
+
hash: '',
|
|
805
|
+
host: '',
|
|
806
|
+
hostname: '',
|
|
807
|
+
href: '',
|
|
808
|
+
origin: '',
|
|
809
|
+
pathname: '',
|
|
810
|
+
protocol: '',
|
|
811
|
+
search: ''
|
|
812
|
+
},
|
|
813
|
+
history: {
|
|
814
|
+
replaceState: function replaceState() {},
|
|
815
|
+
pushState: function pushState() {},
|
|
816
|
+
go: function go() {},
|
|
817
|
+
back: function back() {}
|
|
818
|
+
},
|
|
819
|
+
CustomEvent: function CustomEvent() {
|
|
820
|
+
return this;
|
|
821
|
+
},
|
|
822
|
+
addEventListener: function addEventListener() {},
|
|
823
|
+
removeEventListener: function removeEventListener() {},
|
|
824
|
+
getComputedStyle: function getComputedStyle() {
|
|
825
|
+
return {
|
|
826
|
+
getPropertyValue: function getPropertyValue() {
|
|
827
|
+
return '';
|
|
1190
828
|
}
|
|
1191
|
-
}
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
}
|
|
1195
|
-
|
|
1196
|
-
}
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
/***/ }),
|
|
1201
|
-
|
|
1202
|
-
/***/ 61:
|
|
1203
|
-
/***/ (function(module, exports) {
|
|
1204
|
-
|
|
1205
|
-
module.exports = require("lodash/without");
|
|
1206
|
-
|
|
1207
|
-
/***/ }),
|
|
1208
|
-
|
|
1209
|
-
/***/ 62:
|
|
1210
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1211
|
-
|
|
1212
|
-
"use strict";
|
|
1213
|
-
|
|
1214
|
-
// EXPORTS
|
|
1215
|
-
__webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ Menu_["Divider"]; });
|
|
1216
|
-
__webpack_require__.d(__webpack_exports__, "b", function() { return /* reexport */ Menu_["Heading"]; });
|
|
1217
|
-
__webpack_require__.d(__webpack_exports__, "d", function() { return /* binding */ isOption; });
|
|
1218
|
-
|
|
1219
|
-
// UNUSED EXPORTS: Option
|
|
1220
|
-
|
|
1221
|
-
// EXTERNAL MODULE: external "react"
|
|
1222
|
-
var external_react_ = __webpack_require__(2);
|
|
1223
|
-
var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
|
|
1224
|
-
|
|
1225
|
-
// EXTERNAL MODULE: external "prop-types"
|
|
1226
|
-
var external_prop_types_ = __webpack_require__(1);
|
|
1227
|
-
var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
|
|
1228
|
-
|
|
1229
|
-
// EXTERNAL MODULE: external "lodash/castArray"
|
|
1230
|
-
var castArray_ = __webpack_require__(67);
|
|
1231
|
-
var castArray_default = /*#__PURE__*/__webpack_require__.n(castArray_);
|
|
1232
|
-
|
|
1233
|
-
// EXTERNAL MODULE: external "lodash/find"
|
|
1234
|
-
var find_ = __webpack_require__(55);
|
|
1235
|
-
var find_default = /*#__PURE__*/__webpack_require__.n(find_);
|
|
1236
|
-
|
|
1237
|
-
// EXTERNAL MODULE: external "lodash/forEachRight"
|
|
1238
|
-
var forEachRight_ = __webpack_require__(105);
|
|
1239
|
-
var forEachRight_default = /*#__PURE__*/__webpack_require__.n(forEachRight_);
|
|
1240
|
-
|
|
1241
|
-
// EXTERNAL MODULE: external "lodash/has"
|
|
1242
|
-
var has_ = __webpack_require__(11);
|
|
1243
|
-
var has_default = /*#__PURE__*/__webpack_require__.n(has_);
|
|
1244
|
-
|
|
1245
|
-
// EXTERNAL MODULE: external "lodash/includes"
|
|
1246
|
-
var includes_ = __webpack_require__(15);
|
|
1247
|
-
var includes_default = /*#__PURE__*/__webpack_require__.n(includes_);
|
|
1248
|
-
|
|
1249
|
-
// EXTERNAL MODULE: external "lodash/isUndefined"
|
|
1250
|
-
var isUndefined_ = __webpack_require__(42);
|
|
1251
|
-
var isUndefined_default = /*#__PURE__*/__webpack_require__.n(isUndefined_);
|
|
1252
|
-
|
|
1253
|
-
// EXTERNAL MODULE: external "lodash/keys"
|
|
1254
|
-
var keys_ = __webpack_require__(9);
|
|
1255
|
-
var keys_default = /*#__PURE__*/__webpack_require__.n(keys_);
|
|
1256
|
-
|
|
1257
|
-
// EXTERNAL MODULE: external "lodash/memoize"
|
|
1258
|
-
var memoize_ = __webpack_require__(40);
|
|
1259
|
-
var memoize_default = /*#__PURE__*/__webpack_require__.n(memoize_);
|
|
1260
|
-
|
|
1261
|
-
// EXTERNAL MODULE: external "lodash/omit"
|
|
1262
|
-
var omit_ = __webpack_require__(5);
|
|
1263
|
-
var omit_default = /*#__PURE__*/__webpack_require__.n(omit_);
|
|
1264
|
-
|
|
1265
|
-
// EXTERNAL MODULE: external "lodash/pick"
|
|
1266
|
-
var pick_ = __webpack_require__(44);
|
|
1267
|
-
var pick_default = /*#__PURE__*/__webpack_require__.n(pick_);
|
|
1268
|
-
|
|
1269
|
-
// EXTERNAL MODULE: external "lodash/uniq"
|
|
1270
|
-
var uniq_ = __webpack_require__(106);
|
|
1271
|
-
var uniq_default = /*#__PURE__*/__webpack_require__.n(uniq_);
|
|
1272
|
-
|
|
1273
|
-
// EXTERNAL MODULE: external "lodash/without"
|
|
1274
|
-
var without_ = __webpack_require__(61);
|
|
1275
|
-
var without_default = /*#__PURE__*/__webpack_require__.n(without_);
|
|
1276
|
-
|
|
1277
|
-
// EXTERNAL MODULE: external "@splunk/ui-utils/id"
|
|
1278
|
-
var id_ = __webpack_require__(8);
|
|
1279
|
-
|
|
1280
|
-
// EXTERNAL MODULE: external "@splunk/react-ui/Menu"
|
|
1281
|
-
var Menu_ = __webpack_require__(13);
|
|
1282
|
-
|
|
1283
|
-
// EXTERNAL MODULE: external "@splunk/react-ui/Dropdown"
|
|
1284
|
-
var Dropdown_ = __webpack_require__(22);
|
|
1285
|
-
var Dropdown_default = /*#__PURE__*/__webpack_require__.n(Dropdown_);
|
|
1286
|
-
|
|
1287
|
-
// EXTERNAL MODULE: external "@splunk/ui-utils/keyboard"
|
|
1288
|
-
var keyboard_ = __webpack_require__(7);
|
|
1289
|
-
|
|
1290
|
-
// EXTERNAL MODULE: external "@splunk/ui-utils/filter"
|
|
1291
|
-
var filter_ = __webpack_require__(35);
|
|
1292
|
-
|
|
1293
|
-
// EXTERNAL MODULE: external "@splunk/react-ui/Link"
|
|
1294
|
-
var Link_ = __webpack_require__(37);
|
|
1295
|
-
var Link_default = /*#__PURE__*/__webpack_require__.n(Link_);
|
|
1296
|
-
|
|
1297
|
-
// EXTERNAL MODULE: external "@splunk/react-ui/ResultsMenu"
|
|
1298
|
-
var ResultsMenu_ = __webpack_require__(47);
|
|
1299
|
-
var ResultsMenu_default = /*#__PURE__*/__webpack_require__.n(ResultsMenu_);
|
|
1300
|
-
|
|
1301
|
-
// EXTERNAL MODULE: external "@splunk/react-ui/Text"
|
|
1302
|
-
var Text_ = __webpack_require__(32);
|
|
1303
|
-
var Text_default = /*#__PURE__*/__webpack_require__.n(Text_);
|
|
1304
|
-
|
|
1305
|
-
// EXTERNAL MODULE: external "@splunk/ui-utils/i18n"
|
|
1306
|
-
var i18n_ = __webpack_require__(4);
|
|
1307
|
-
|
|
1308
|
-
// EXTERNAL MODULE: external "@splunk/react-icons/CaretSmallDown"
|
|
1309
|
-
var CaretSmallDown_ = __webpack_require__(56);
|
|
1310
|
-
var CaretSmallDown_default = /*#__PURE__*/__webpack_require__.n(CaretSmallDown_);
|
|
1311
|
-
|
|
1312
|
-
// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/Caret"
|
|
1313
|
-
var Caret_ = __webpack_require__(57);
|
|
1314
|
-
var Caret_default = /*#__PURE__*/__webpack_require__.n(Caret_);
|
|
1315
|
-
|
|
1316
|
-
// EXTERNAL MODULE: external "@splunk/themes"
|
|
1317
|
-
var themes_ = __webpack_require__(0);
|
|
1318
|
-
|
|
1319
|
-
// CONCATENATED MODULE: ./src/Select/icons/CaretSmallDown.tsx
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
var CaretSmallDown_CaretSmallDownIcon = function CaretSmallDownIcon() {
|
|
1326
|
-
var _useSplunkTheme = Object(themes_["useSplunkTheme"])(),
|
|
1327
|
-
isEnterprise = _useSplunkTheme.isEnterprise;
|
|
1328
|
-
|
|
1329
|
-
var familyCaretSmallDownIcon = isEnterprise ? /*#__PURE__*/external_react_default.a.createElement(Caret_default.a, {
|
|
1330
|
-
screenReaderText: null,
|
|
1331
|
-
hideDefaultTooltip: true,
|
|
1332
|
-
size: 0.5
|
|
1333
|
-
}) : /*#__PURE__*/external_react_default.a.createElement(CaretSmallDown_default.a, null);
|
|
1334
|
-
return familyCaretSmallDownIcon;
|
|
1335
|
-
};
|
|
1336
|
-
|
|
1337
|
-
/* harmony default export */ var CaretSmallDown = (CaretSmallDown_CaretSmallDownIcon);
|
|
1338
|
-
// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/Search"
|
|
1339
|
-
var Search_ = __webpack_require__(54);
|
|
1340
|
-
var Search_default = /*#__PURE__*/__webpack_require__.n(Search_);
|
|
1341
|
-
|
|
1342
|
-
// EXTERNAL MODULE: external "@splunk/react-icons/Magnifier"
|
|
1343
|
-
var Magnifier_ = __webpack_require__(49);
|
|
1344
|
-
var Magnifier_default = /*#__PURE__*/__webpack_require__.n(Magnifier_);
|
|
1345
|
-
|
|
1346
|
-
// CONCATENATED MODULE: ./src/Select/icons/Search.tsx
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
var Search_Search = function Search() {
|
|
1354
|
-
var _useSplunkTheme = Object(themes_["useSplunkTheme"])(),
|
|
1355
|
-
isEnterprise = _useSplunkTheme.isEnterprise,
|
|
1356
|
-
isCompact = _useSplunkTheme.isCompact;
|
|
1357
|
-
|
|
1358
|
-
var screenReaderText = Object(i18n_["_"])('Search');
|
|
1359
|
-
|
|
1360
|
-
var prismaSize = isCompact ? '20px' : '24px';
|
|
1361
|
-
var familyIcon = isEnterprise ? /*#__PURE__*/external_react_default.a.createElement(Search_default.a, {
|
|
1362
|
-
role: "presentation",
|
|
1363
|
-
size: "16px",
|
|
1364
|
-
screenReaderText: screenReaderText,
|
|
1365
|
-
hideDefaultTooltip: true
|
|
1366
|
-
}) : /*#__PURE__*/external_react_default.a.createElement(Magnifier_default.a, {
|
|
1367
|
-
role: "presentation",
|
|
1368
|
-
"aria-label": screenReaderText,
|
|
1369
|
-
width: prismaSize,
|
|
1370
|
-
height: prismaSize
|
|
1371
|
-
});
|
|
1372
|
-
return familyIcon;
|
|
1373
|
-
};
|
|
1374
|
-
|
|
1375
|
-
/* harmony default export */ var icons_Search = (Search_Search);
|
|
1376
|
-
// EXTERNAL MODULE: ./src/Select/OptionBase.tsx
|
|
1377
|
-
var OptionBase = __webpack_require__(30);
|
|
1378
|
-
|
|
1379
|
-
// EXTERNAL MODULE: external "styled-components"
|
|
1380
|
-
var external_styled_components_ = __webpack_require__(3);
|
|
1381
|
-
var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_);
|
|
1382
|
-
|
|
1383
|
-
// EXTERNAL MODULE: ./src/Menu/ItemStyles.ts
|
|
1384
|
-
var ItemStyles = __webpack_require__(25);
|
|
1385
|
-
|
|
1386
|
-
// CONCATENATED MODULE: ./src/Select/SelectAllOptionStyles.ts
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
var StyledSelectAllLabel = external_styled_components_default()(ItemStyles["g" /* StyledLabel */]).withConfig({
|
|
1392
|
-
displayName: "SelectAllOptionStyles__StyledSelectAllLabel",
|
|
1393
|
-
componentId: "y6bn08-0"
|
|
1394
|
-
})(["font-weight:", ";"], themes_["variables"].fontWeightBold);
|
|
1395
|
-
var StyledSelectAllOption = external_styled_components_default()(OptionBase["a" /* default */]).withConfig({
|
|
1396
|
-
displayName: "SelectAllOptionStyles__StyledSelectAllOption",
|
|
1397
|
-
componentId: "y6bn08-1"
|
|
1398
|
-
})(["padding-inline-start:", ";box-shadow:none;"], Object(themes_["pick"])({
|
|
1399
|
-
prisma: '42px;',
|
|
1400
|
-
enterprise: '32px;'
|
|
1401
|
-
}));
|
|
1402
|
-
|
|
1403
|
-
// CONCATENATED MODULE: ./src/Select/SelectAllOption.tsx
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
var propTypes = {
|
|
1409
|
-
active: external_prop_types_default.a.bool,
|
|
1410
|
-
elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]),
|
|
1411
|
-
id: external_prop_types_default.a.string,
|
|
1412
|
-
onClick: external_prop_types_default.a.func,
|
|
1413
|
-
selectAllLabel: external_prop_types_default.a.string,
|
|
1414
|
-
totalCount: external_prop_types_default.a.number,
|
|
1415
|
-
changedToggle: external_prop_types_default.a.bool,
|
|
1416
|
-
selected: external_prop_types_default.a.oneOf([false, true, 'some'])
|
|
1417
|
-
};
|
|
1418
|
-
var SelectAllOption = /*#__PURE__*/external_react_default.a.forwardRef(function (_ref, ref) {
|
|
1419
|
-
var active = _ref.active,
|
|
1420
|
-
id = _ref.id,
|
|
1421
|
-
onClick = _ref.onClick,
|
|
1422
|
-
selectAllLabel = _ref.selectAllLabel,
|
|
1423
|
-
totalCount = _ref.totalCount,
|
|
1424
|
-
changedToggle = _ref.changedToggle,
|
|
1425
|
-
selected = _ref.selected;
|
|
1426
|
-
// When toggle is changed the total count is not displayed anymore so the count is now shown in the Select All menu item
|
|
1427
|
-
var totalCountDisplay = changedToggle ? " (".concat(totalCount === null || totalCount === void 0 ? void 0 : totalCount.toString(), ")") : '';
|
|
1428
|
-
return /*#__PURE__*/external_react_default.a.createElement(StyledSelectAllOption, {
|
|
1429
|
-
label: selectAllLabel,
|
|
1430
|
-
value: "selectAll",
|
|
1431
|
-
key: "selectAll",
|
|
1432
|
-
onClick: onClick,
|
|
1433
|
-
"data-test": "select-all",
|
|
1434
|
-
"aria-keyshortcuts": "Control+A",
|
|
1435
|
-
id: id,
|
|
1436
|
-
active: active,
|
|
1437
|
-
ref: ref,
|
|
1438
|
-
tabIndex: -1
|
|
1439
|
-
}, /*#__PURE__*/external_react_default.a.createElement(ItemStyles["j" /* StyledSwitch */], {
|
|
1440
|
-
interactive: false,
|
|
1441
|
-
selected: selected === 'some' && 'some' || selected,
|
|
1442
|
-
key: "main-checkbox",
|
|
1443
|
-
value: "main-checkbox",
|
|
1444
|
-
appearance: "checkbox",
|
|
1445
|
-
"aria-label": !selected && Object(i18n_["_"])('No options selected') || selected === 'some' && Object(i18n_["_"])('Some options selected') || Object(i18n_["_"])('All options selected'),
|
|
1446
|
-
"data-test": "select-all-switch",
|
|
1447
|
-
selectedLabel: selected === true ? Object(i18n_["_"])('All options selected') : Object(i18n_["_"])('Option selected'),
|
|
1448
|
-
unselectedLabel: selected === true ? Object(i18n_["_"])('No options selected') : Object(i18n_["_"])('Option unselected'),
|
|
1449
|
-
someSelectedLabel: Object(i18n_["_"])('Some options selected')
|
|
1450
|
-
}), /*#__PURE__*/external_react_default.a.createElement(ItemStyles["d" /* StyledItemDescriptionRight */], {
|
|
1451
|
-
"data-test": "description"
|
|
1452
|
-
}, "".concat(totalCountDisplay, " Ctrl-a")), /*#__PURE__*/external_react_default.a.createElement(ItemStyles["b" /* StyledInnerWrapper */], null, /*#__PURE__*/external_react_default.a.createElement(ItemStyles["k" /* StyledTitleAndDescriptionWrapper */], {
|
|
1453
|
-
$truncate: false
|
|
1454
|
-
}, /*#__PURE__*/external_react_default.a.createElement(StyledSelectAllLabel, {
|
|
1455
|
-
$truncate: false
|
|
1456
|
-
}, selectAllLabel))));
|
|
1457
|
-
});
|
|
1458
|
-
SelectAllOption.propTypes = propTypes;
|
|
1459
|
-
/* harmony default export */ var Select_SelectAllOption = (SelectAllOption);
|
|
1460
|
-
// EXTERNAL MODULE: external "@splunk/react-ui/Button"
|
|
1461
|
-
var Button_ = __webpack_require__(17);
|
|
1462
|
-
var Button_default = /*#__PURE__*/__webpack_require__.n(Button_);
|
|
1463
|
-
|
|
1464
|
-
// CONCATENATED MODULE: ./src/Select/SelectBaseStyles.ts
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
var StyledButton = external_styled_components_default()(Button_default.a).withConfig({
|
|
1470
|
-
displayName: "SelectBaseStyles__StyledButton",
|
|
1471
|
-
componentId: "sc-16cj7sk-0"
|
|
1472
|
-
})(["&[data-inline]{width:", ";}", ""], function (_ref) {
|
|
1473
|
-
var $multiple = _ref.$multiple;
|
|
1474
|
-
return $multiple ? '400px' : 'auto';
|
|
1475
|
-
}, function (_ref2) {
|
|
1476
|
-
var $multiple = _ref2.$multiple;
|
|
1477
|
-
return !$multiple && 'flex-grow: 0;';
|
|
1478
|
-
});
|
|
1479
|
-
var StyledLinkIcon = external_styled_components_default.a.span.withConfig({
|
|
1480
|
-
displayName: "SelectBaseStyles__StyledLinkIcon",
|
|
1481
|
-
componentId: "sc-16cj7sk-1"
|
|
1482
|
-
})(["padding-right:2px;"]);
|
|
1483
|
-
var StyledLinkCaret = external_styled_components_default.a.span.withConfig({
|
|
1484
|
-
displayName: "SelectBaseStyles__StyledLinkCaret",
|
|
1485
|
-
componentId: "sc-16cj7sk-2"
|
|
1486
|
-
})(["padding-left:2px;"]);
|
|
1487
|
-
var StyledFilter = external_styled_components_default.a.div.withConfig({
|
|
1488
|
-
displayName: "SelectBaseStyles__StyledFilter",
|
|
1489
|
-
componentId: "sc-16cj7sk-3"
|
|
1490
|
-
})(["padding:", ";min-width:160px;"], Object(themes_["pick"])({
|
|
1491
|
-
enterprise: '8px',
|
|
1492
|
-
prisma: '10px 16px'
|
|
1493
|
-
}));
|
|
1494
|
-
var StyledSearchIconWrapper = external_styled_components_default.a.span.withConfig({
|
|
1495
|
-
displayName: "SelectBaseStyles__StyledSearchIconWrapper",
|
|
1496
|
-
componentId: "sc-16cj7sk-4"
|
|
1497
|
-
})(["color:", ";pointer-events:none;padding:", ";"], Object(themes_["pick"])({
|
|
1498
|
-
enterprise: {
|
|
1499
|
-
light: themes_["variables"].gray60,
|
|
1500
|
-
dark: themes_["variables"].white
|
|
829
|
+
};
|
|
830
|
+
},
|
|
831
|
+
Image: function Image() {},
|
|
832
|
+
Date: function Date() {},
|
|
833
|
+
screen: {},
|
|
834
|
+
setTimeout: function setTimeout() {},
|
|
835
|
+
clearTimeout: function clearTimeout() {},
|
|
836
|
+
matchMedia: function matchMedia() {
|
|
837
|
+
return {};
|
|
1501
838
|
},
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
}
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
componentId: "sc-16cj7sk-5"
|
|
1510
|
-
})(["padding-right:", ";"], Object(themes_["pick"])({
|
|
1511
|
-
enterprise: themes_["variables"].spacingQuarter,
|
|
1512
|
-
prisma: themes_["variables"].spacingXSmall
|
|
1513
|
-
}));
|
|
1514
|
-
var StyledControlsLink = external_styled_components_default()(Link_default.a).withConfig({
|
|
1515
|
-
displayName: "SelectBaseStyles__StyledControlsLink",
|
|
1516
|
-
componentId: "sc-16cj7sk-6"
|
|
1517
|
-
})(["margin-right:20px;", ";"], function (_ref3) {
|
|
1518
|
-
var $disabled = _ref3.$disabled;
|
|
1519
|
-
return $disabled && Object(external_styled_components_["css"])(["color:", ";"], themes_["variables"].contentColorDisabled);
|
|
1520
|
-
});
|
|
1521
|
-
var StyledToggleAllControls = external_styled_components_default.a.div.withConfig({
|
|
1522
|
-
displayName: "SelectBaseStyles__StyledToggleAllControls",
|
|
1523
|
-
componentId: "sc-16cj7sk-7"
|
|
1524
|
-
})(["padding:", ";", ""], Object(themes_["pick"])({
|
|
1525
|
-
enterprise: "5px 8px",
|
|
1526
|
-
prisma: '10px 16px'
|
|
1527
|
-
}), Object(themes_["pickVariant"])('$placement', {
|
|
1528
|
-
above: {
|
|
1529
|
-
enterprise: Object(external_styled_components_["css"])(["border-top:", ";"], themes_["variables"].border),
|
|
1530
|
-
prisma: Object(external_styled_components_["css"])(["border-top:1px solid ", ";"], themes_["variables"].neutral200)
|
|
839
|
+
requestAnimationFrame: function requestAnimationFrame(callback) {
|
|
840
|
+
if (typeof setTimeout === 'undefined') {
|
|
841
|
+
callback();
|
|
842
|
+
return null;
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
return setTimeout(callback, 0);
|
|
1531
846
|
},
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
847
|
+
cancelAnimationFrame: function cancelAnimationFrame(id) {
|
|
848
|
+
if (typeof setTimeout === 'undefined') {
|
|
849
|
+
return;
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
clearTimeout(id);
|
|
1535
853
|
}
|
|
1536
|
-
}
|
|
854
|
+
};
|
|
1537
855
|
|
|
1538
|
-
|
|
1539
|
-
var
|
|
856
|
+
function getWindow() {
|
|
857
|
+
var win = typeof window !== 'undefined' ? window : ssrWindow;
|
|
858
|
+
return win;
|
|
859
|
+
}
|
|
1540
860
|
|
|
1541
|
-
// EXTERNAL MODULE: ./src/utils/ssrWindow.ts
|
|
1542
|
-
var ssrWindow = __webpack_require__(18);
|
|
1543
861
|
|
|
1544
|
-
|
|
1545
|
-
function
|
|
862
|
+
;// CONCATENATED MODULE: ./src/Select/SelectBase.tsx
|
|
863
|
+
function SelectBase_extends() { SelectBase_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 SelectBase_extends.apply(this, arguments); }
|
|
1546
864
|
|
|
1547
865
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
1548
866
|
|
|
@@ -1564,33 +882,33 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
|
|
|
1564
882
|
|
|
1565
883
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
1566
884
|
|
|
1567
|
-
function
|
|
885
|
+
function SelectBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
1568
886
|
|
|
1569
|
-
function
|
|
887
|
+
function SelectBase_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); } }
|
|
1570
888
|
|
|
1571
|
-
function
|
|
889
|
+
function SelectBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) SelectBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) SelectBase_defineProperties(Constructor, staticProps); return Constructor; }
|
|
1572
890
|
|
|
1573
|
-
function
|
|
891
|
+
function SelectBase_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) SelectBase_setPrototypeOf(subClass, superClass); }
|
|
1574
892
|
|
|
1575
|
-
function
|
|
893
|
+
function SelectBase_setPrototypeOf(o, p) { SelectBase_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SelectBase_setPrototypeOf(o, p); }
|
|
1576
894
|
|
|
1577
|
-
function
|
|
895
|
+
function SelectBase_createSuper(Derived) { var hasNativeReflectConstruct = SelectBase_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SelectBase_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SelectBase_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SelectBase_possibleConstructorReturn(this, result); }; }
|
|
1578
896
|
|
|
1579
|
-
function
|
|
897
|
+
function SelectBase_possibleConstructorReturn(self, call) { if (call && (SelectBase_typeof(call) === "object" || typeof call === "function")) { return call; } return SelectBase_assertThisInitialized(self); }
|
|
1580
898
|
|
|
1581
|
-
function
|
|
899
|
+
function SelectBase_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
1582
900
|
|
|
1583
|
-
function
|
|
901
|
+
function SelectBase_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; } }
|
|
1584
902
|
|
|
1585
|
-
function
|
|
903
|
+
function SelectBase_getPrototypeOf(o) { SelectBase_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SelectBase_getPrototypeOf(o); }
|
|
1586
904
|
|
|
1587
|
-
function
|
|
905
|
+
function SelectBase_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SelectBase_typeof = function _typeof(obj) { return typeof obj; }; } else { SelectBase_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SelectBase_typeof(obj); }
|
|
1588
906
|
|
|
1589
907
|
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; }
|
|
1590
908
|
|
|
1591
|
-
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) {
|
|
909
|
+
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) { SelectBase_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; }
|
|
1592
910
|
|
|
1593
|
-
function
|
|
911
|
+
function SelectBase_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; }
|
|
1594
912
|
|
|
1595
913
|
|
|
1596
914
|
|
|
@@ -1623,51 +941,51 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
1623
941
|
|
|
1624
942
|
|
|
1625
943
|
var SelectBase_propTypes = {
|
|
1626
|
-
allowKeyMatching: external_prop_types_default.
|
|
1627
|
-
allowNewValues: external_prop_types_default.
|
|
1628
|
-
animateLoading: external_prop_types_default.
|
|
1629
|
-
appearance: external_prop_types_default.
|
|
1630
|
-
append: external_prop_types_default.
|
|
1631
|
-
children: external_prop_types_default.
|
|
1632
|
-
defaultPlacement: external_prop_types_default.
|
|
1633
|
-
defaultValues: external_prop_types_default.
|
|
1634
|
-
describedBy: external_prop_types_default.
|
|
1635
|
-
disabled: external_prop_types_default.
|
|
1636
|
-
elementRef: external_prop_types_default.
|
|
1637
|
-
error: external_prop_types_default.
|
|
1638
|
-
filter: external_prop_types_default.
|
|
1639
|
-
footerMessage: external_prop_types_default.
|
|
1640
|
-
inline: external_prop_types_default.
|
|
1641
|
-
inputId: external_prop_types_default.
|
|
1642
|
-
inputRef: external_prop_types_default.
|
|
1643
|
-
isLoadingOptions: external_prop_types_default.
|
|
1644
|
-
labelledBy: external_prop_types_default.
|
|
1645
|
-
labelText: external_prop_types_default.
|
|
1646
|
-
loadingMessage: external_prop_types_default.
|
|
1647
|
-
menuStyle: external_prop_types_default.
|
|
1648
|
-
multiple: external_prop_types_default.
|
|
1649
|
-
name: external_prop_types_default.
|
|
1650
|
-
noOptionsMessage: external_prop_types_default.
|
|
1651
|
-
onChange: external_prop_types_default.
|
|
1652
|
-
onClose: external_prop_types_default.
|
|
1653
|
-
onFilterChange: external_prop_types_default.
|
|
1654
|
-
onOpen: external_prop_types_default.
|
|
1655
|
-
onScroll: external_prop_types_default.
|
|
1656
|
-
onScrollBottom: external_prop_types_default.
|
|
944
|
+
allowKeyMatching: (external_prop_types_default()).bool,
|
|
945
|
+
allowNewValues: (external_prop_types_default()).bool,
|
|
946
|
+
animateLoading: (external_prop_types_default()).bool,
|
|
947
|
+
appearance: external_prop_types_default().oneOf(['default', 'link', 'primary', 'pill', 'toggle', 'flat']),
|
|
948
|
+
append: (external_prop_types_default()).bool,
|
|
949
|
+
children: (external_prop_types_default()).node,
|
|
950
|
+
defaultPlacement: external_prop_types_default().oneOf(['above', 'below', 'vertical']),
|
|
951
|
+
defaultValues: (external_prop_types_default()).array,
|
|
952
|
+
describedBy: (external_prop_types_default()).string,
|
|
953
|
+
disabled: (external_prop_types_default()).bool,
|
|
954
|
+
elementRef: external_prop_types_default().oneOfType([(external_prop_types_default()).func, (external_prop_types_default()).object]),
|
|
955
|
+
error: (external_prop_types_default()).bool,
|
|
956
|
+
filter: external_prop_types_default().oneOf([false, true, 'controlled']),
|
|
957
|
+
footerMessage: (external_prop_types_default()).node,
|
|
958
|
+
inline: (external_prop_types_default()).bool,
|
|
959
|
+
inputId: (external_prop_types_default()).string,
|
|
960
|
+
inputRef: external_prop_types_default().oneOfType([(external_prop_types_default()).func, (external_prop_types_default()).object]),
|
|
961
|
+
isLoadingOptions: (external_prop_types_default()).bool,
|
|
962
|
+
labelledBy: (external_prop_types_default()).string,
|
|
963
|
+
labelText: (external_prop_types_default()).string,
|
|
964
|
+
loadingMessage: (external_prop_types_default()).node,
|
|
965
|
+
menuStyle: (external_prop_types_default()).object,
|
|
966
|
+
multiple: (external_prop_types_default()).bool,
|
|
967
|
+
name: (external_prop_types_default()).string,
|
|
968
|
+
noOptionsMessage: (external_prop_types_default()).node,
|
|
969
|
+
onChange: (external_prop_types_default()).func,
|
|
970
|
+
onClose: (external_prop_types_default()).func,
|
|
971
|
+
onFilterChange: (external_prop_types_default()).func,
|
|
972
|
+
onOpen: (external_prop_types_default()).func,
|
|
973
|
+
onScroll: (external_prop_types_default()).func,
|
|
974
|
+
onScrollBottom: (external_prop_types_default()).func,
|
|
1657
975
|
|
|
1658
976
|
/** @private. */
|
|
1659
|
-
required: external_prop_types_default.
|
|
1660
|
-
placeholder: external_prop_types_default.
|
|
1661
|
-
prefixLabel: external_prop_types_default.
|
|
1662
|
-
prepend: external_prop_types_default.
|
|
1663
|
-
repositionMode: external_prop_types_default.
|
|
1664
|
-
selectAllAppearance: external_prop_types_default.
|
|
1665
|
-
showSelectedValuesFirst: external_prop_types_default.
|
|
1666
|
-
suffixLabel: external_prop_types_default.
|
|
1667
|
-
tabConfirmsNewValue: external_prop_types_default.
|
|
1668
|
-
values: external_prop_types_default.
|
|
977
|
+
required: (external_prop_types_default()).bool,
|
|
978
|
+
placeholder: (external_prop_types_default()).string,
|
|
979
|
+
prefixLabel: (external_prop_types_default()).string,
|
|
980
|
+
prepend: (external_prop_types_default()).bool,
|
|
981
|
+
repositionMode: external_prop_types_default().oneOf(['none', 'flip']),
|
|
982
|
+
selectAllAppearance: external_prop_types_default().oneOf(['buttongroup', 'checkbox']),
|
|
983
|
+
showSelectedValuesFirst: external_prop_types_default().oneOf(['nextOpen', 'immediately', 'never']),
|
|
984
|
+
suffixLabel: (external_prop_types_default()).string,
|
|
985
|
+
tabConfirmsNewValue: (external_prop_types_default()).bool,
|
|
986
|
+
values: (external_prop_types_default()).array
|
|
1669
987
|
};
|
|
1670
|
-
var
|
|
988
|
+
var SelectBase_defaultProps = {
|
|
1671
989
|
allowKeyMatching: true,
|
|
1672
990
|
allowNewValues: false,
|
|
1673
991
|
animateLoading: false,
|
|
@@ -1680,8 +998,8 @@ var defaultProps = {
|
|
|
1680
998
|
isLoadingOptions: false,
|
|
1681
999
|
menuStyle: {},
|
|
1682
1000
|
multiple: false,
|
|
1683
|
-
noOptionsMessage:
|
|
1684
|
-
placeholder:
|
|
1001
|
+
noOptionsMessage: (0,i18n_namespaceObject._)('No matches'),
|
|
1002
|
+
placeholder: (0,i18n_namespaceObject._)('Select...'),
|
|
1685
1003
|
prepend: false,
|
|
1686
1004
|
repositionMode: 'flip',
|
|
1687
1005
|
selectAllAppearance: 'buttongroup',
|
|
@@ -1709,15 +1027,15 @@ function isOption(child) {
|
|
|
1709
1027
|
}
|
|
1710
1028
|
|
|
1711
1029
|
function itemKeyFromValueLabel(value, label) {
|
|
1712
|
-
return "".concat(
|
|
1030
|
+
return "".concat(SelectBase_typeof(value), "-").concat(value, "-").concat(label);
|
|
1713
1031
|
}
|
|
1714
1032
|
|
|
1715
|
-
var
|
|
1716
|
-
|
|
1033
|
+
var SelectBase = /*#__PURE__*/function (_Component) {
|
|
1034
|
+
SelectBase_inherits(SelectBase, _Component);
|
|
1717
1035
|
|
|
1718
|
-
var _super =
|
|
1036
|
+
var _super = SelectBase_createSuper(SelectBase);
|
|
1719
1037
|
|
|
1720
|
-
|
|
1038
|
+
SelectBase_createClass(SelectBase, null, [{
|
|
1721
1039
|
key: "validateAppearance",
|
|
1722
1040
|
// @docs-props-type CompactPropsBase
|
|
1723
1041
|
value: function validateAppearance(props) {
|
|
@@ -1728,45 +1046,45 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
1728
1046
|
function SelectBase(props) {
|
|
1729
1047
|
var _this;
|
|
1730
1048
|
|
|
1731
|
-
|
|
1049
|
+
SelectBase_classCallCheck(this, SelectBase);
|
|
1732
1050
|
|
|
1733
1051
|
_this = _super.call(this, props);
|
|
1734
1052
|
|
|
1735
|
-
|
|
1053
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "activeItemId", void 0);
|
|
1736
1054
|
|
|
1737
|
-
|
|
1055
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "activeValue", void 0);
|
|
1738
1056
|
|
|
1739
|
-
|
|
1057
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "availableOptionCount", void 0);
|
|
1740
1058
|
|
|
1741
|
-
|
|
1059
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "controlledExternally", void 0);
|
|
1742
1060
|
|
|
1743
|
-
|
|
1061
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "displayedValues", void 0);
|
|
1744
1062
|
|
|
1745
|
-
|
|
1063
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "dropdown", null);
|
|
1746
1064
|
|
|
1747
|
-
|
|
1065
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "firstSelectedEnabledOption", null);
|
|
1748
1066
|
|
|
1749
|
-
|
|
1067
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "firstSelectedOptionIndex", void 0);
|
|
1750
1068
|
|
|
1751
|
-
|
|
1069
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "menuId", void 0);
|
|
1752
1070
|
|
|
1753
|
-
|
|
1071
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "previousActiveIndex", null);
|
|
1754
1072
|
|
|
1755
|
-
|
|
1073
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "selectedOptionCount", void 0);
|
|
1756
1074
|
|
|
1757
|
-
|
|
1075
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "optionRefsByKey", void 0);
|
|
1758
1076
|
|
|
1759
|
-
|
|
1077
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "matchCharacter", void 0);
|
|
1760
1078
|
|
|
1761
|
-
|
|
1079
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "matchTimeout", void 0);
|
|
1762
1080
|
|
|
1763
|
-
|
|
1081
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "currentMatchOptions", void 0);
|
|
1764
1082
|
|
|
1765
|
-
|
|
1083
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "availableMatchOptions", void 0);
|
|
1766
1084
|
|
|
1767
|
-
|
|
1085
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "optionSelection", void 0);
|
|
1768
1086
|
|
|
1769
|
-
|
|
1087
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "resetMatches", function () {
|
|
1770
1088
|
_this.matchCharacter = null;
|
|
1771
1089
|
_this.currentMatchOptions = [];
|
|
1772
1090
|
|
|
@@ -1775,7 +1093,7 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
1775
1093
|
}
|
|
1776
1094
|
});
|
|
1777
1095
|
|
|
1778
|
-
|
|
1096
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "handleSelectAll", function (e) {
|
|
1779
1097
|
var _this$getCurrentValue, _this$props$onChange, _this$props2;
|
|
1780
1098
|
|
|
1781
1099
|
var _this$props = _this.props,
|
|
@@ -1789,7 +1107,7 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
1789
1107
|
|
|
1790
1108
|
var currentValues = (_this$getCurrentValue = _this.getCurrentValues()) !== null && _this$getCurrentValue !== void 0 ? _this$getCurrentValue : [];
|
|
1791
1109
|
var values = uniq_default()(currentValues.concat(_this.displayedValues));
|
|
1792
|
-
values = external_react_default.
|
|
1110
|
+
values = external_react_default().Children.toArray(children).filter(function (child) {
|
|
1793
1111
|
return isOption(child) && includes_default()(values, child.props.value) && (!child.props.disabled || includes_default()(currentValues, child.props.value));
|
|
1794
1112
|
}).map(function (child) {
|
|
1795
1113
|
return child.props.value;
|
|
@@ -1808,7 +1126,7 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
1808
1126
|
});
|
|
1809
1127
|
});
|
|
1810
1128
|
|
|
1811
|
-
|
|
1129
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "handleClearAll", function (e) {
|
|
1812
1130
|
var _this$getCurrentValue2, _this$props$onChange2, _this$props4;
|
|
1813
1131
|
|
|
1814
1132
|
var _this$props3 = _this.props,
|
|
@@ -1821,9 +1139,9 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
1821
1139
|
}
|
|
1822
1140
|
|
|
1823
1141
|
var currentValues = (_this$getCurrentValue2 = _this.getCurrentValues()) !== null && _this$getCurrentValue2 !== void 0 ? _this$getCurrentValue2 : [];
|
|
1824
|
-
var hiddenCurrentValues = without_default.
|
|
1142
|
+
var hiddenCurrentValues = without_default().apply(void 0, [currentValues].concat(_toConsumableArray(_this.displayedValues))); // this will unselect all selected values unless those values are disabled or hidden by the filter
|
|
1825
1143
|
|
|
1826
|
-
var values = external_react_default.
|
|
1144
|
+
var values = external_react_default().Children.toArray(children).filter(function (child) {
|
|
1827
1145
|
return isOption(child) && (includes_default()(currentValues, child.props.value) && child.props.disabled || includes_default()(hiddenCurrentValues, child.props.value));
|
|
1828
1146
|
}).map(function (child) {
|
|
1829
1147
|
return child.props.value;
|
|
@@ -1842,12 +1160,12 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
1842
1160
|
});
|
|
1843
1161
|
});
|
|
1844
1162
|
|
|
1845
|
-
|
|
1163
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "handleTextKeyDown", function (e) {
|
|
1846
1164
|
var _this$props5 = _this.props,
|
|
1847
1165
|
children = _this$props5.children,
|
|
1848
1166
|
onScrollBottom = _this$props5.onScrollBottom,
|
|
1849
1167
|
tabConfirmsNewValue = _this$props5.tabConfirmsNewValue;
|
|
1850
|
-
var eventKeyCode =
|
|
1168
|
+
var eventKeyCode = (0,keyboard_namespaceObject.keycode)(e.nativeEvent);
|
|
1851
1169
|
|
|
1852
1170
|
if (eventKeyCode === 'tab') {
|
|
1853
1171
|
if (tabConfirmsNewValue && !isUndefined_default()(_this.activeValue) && _this.availableOptionCount <= 1) {
|
|
@@ -1882,7 +1200,7 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
1882
1200
|
if (children && onScrollBottom) {
|
|
1883
1201
|
var _this$getCurrentValue3;
|
|
1884
1202
|
|
|
1885
|
-
var beforeLastChild =
|
|
1203
|
+
var beforeLastChild = external_react_namespaceObject.Children.toArray(children).length - (2 + ((_this$getCurrentValue3 = _this.getCurrentValues()) !== null && _this$getCurrentValue3 !== void 0 ? _this$getCurrentValue3 : []).length);
|
|
1886
1204
|
|
|
1887
1205
|
if (_this.state.activeIndex === beforeLastChild) {
|
|
1888
1206
|
_this.handleScrollBottom(e);
|
|
@@ -1915,7 +1233,7 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
1915
1233
|
}
|
|
1916
1234
|
});
|
|
1917
1235
|
|
|
1918
|
-
|
|
1236
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "handleMenuOptionClick", function (e, _ref2) {
|
|
1919
1237
|
var value = _ref2.value;
|
|
1920
1238
|
e.preventDefault();
|
|
1921
1239
|
|
|
@@ -1926,7 +1244,7 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
1926
1244
|
_this.toggleValue(e, value);
|
|
1927
1245
|
});
|
|
1928
1246
|
|
|
1929
|
-
|
|
1247
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "handleMenuOptionKeyDown", function (e, optionIndex) {
|
|
1930
1248
|
var currentKey = e.nativeEvent.key; // Checking for a single character to avoid complications from double-byte languages and emojis.
|
|
1931
1249
|
|
|
1932
1250
|
if (currentKey.length === 1) {
|
|
@@ -1943,10 +1261,10 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
1943
1261
|
return;
|
|
1944
1262
|
}
|
|
1945
1263
|
|
|
1946
|
-
matches =
|
|
1264
|
+
matches = fuzzyMatch(_this.availableMatchOptions, character);
|
|
1947
1265
|
} else if (_this.currentMatchOptions.length > 1) {
|
|
1948
1266
|
character.index = _this.matchCharacter.index + 1;
|
|
1949
|
-
matches =
|
|
1267
|
+
matches = fuzzyMatch(_this.currentMatchOptions, character);
|
|
1950
1268
|
}
|
|
1951
1269
|
|
|
1952
1270
|
if (matches.length) {
|
|
@@ -1984,7 +1302,7 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
1984
1302
|
}
|
|
1985
1303
|
});
|
|
1986
1304
|
|
|
1987
|
-
|
|
1305
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "handleTextChange", function (e, _ref3) {
|
|
1988
1306
|
var _this$props$onFilterC, _this$props6;
|
|
1989
1307
|
|
|
1990
1308
|
var value = _ref3.value;
|
|
@@ -2000,19 +1318,19 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2000
1318
|
});
|
|
2001
1319
|
});
|
|
2002
1320
|
|
|
2003
|
-
|
|
1321
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "handleTextFocus", function () {
|
|
2004
1322
|
_this.setState({
|
|
2005
1323
|
textHasFocus: true
|
|
2006
1324
|
});
|
|
2007
1325
|
});
|
|
2008
1326
|
|
|
2009
|
-
|
|
1327
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "handleTextBlur", function () {
|
|
2010
1328
|
_this.setState({
|
|
2011
1329
|
textHasFocus: false
|
|
2012
1330
|
});
|
|
2013
1331
|
});
|
|
2014
1332
|
|
|
2015
|
-
|
|
1333
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "handleRequestOpen", function (e) {
|
|
2016
1334
|
var newState = {
|
|
2017
1335
|
open: true,
|
|
2018
1336
|
topValues: _this.getTopValues()
|
|
@@ -2049,7 +1367,7 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2049
1367
|
});
|
|
2050
1368
|
});
|
|
2051
1369
|
|
|
2052
|
-
|
|
1370
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "handleRequestClose", function () {
|
|
2053
1371
|
_this.setState({
|
|
2054
1372
|
open: false,
|
|
2055
1373
|
activeIndex: 0
|
|
@@ -2061,7 +1379,7 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2061
1379
|
});
|
|
2062
1380
|
});
|
|
2063
1381
|
|
|
2064
|
-
|
|
1382
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "handleScrollBottom", function (e) {
|
|
2065
1383
|
if (_this.state.open && !_this.props.isLoadingOptions) {
|
|
2066
1384
|
var _this$props$onScrollB, _this$props10;
|
|
2067
1385
|
|
|
@@ -2069,13 +1387,13 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2069
1387
|
}
|
|
2070
1388
|
});
|
|
2071
1389
|
|
|
2072
|
-
|
|
1390
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "handleActiveOptionMount", function (c) {
|
|
2073
1391
|
if (_this.previousActiveIndex !== _this.state.activeIndex) {
|
|
2074
1392
|
c === null || c === void 0 ? void 0 : c.scrollIntoViewIfNeeded();
|
|
2075
1393
|
}
|
|
2076
1394
|
});
|
|
2077
1395
|
|
|
2078
|
-
|
|
1396
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "handleOptionMount", function (c, itemKey, isFirst) {
|
|
2079
1397
|
if (isFirst) {
|
|
2080
1398
|
_this.firstSelectedEnabledOption = c;
|
|
2081
1399
|
}
|
|
@@ -2087,7 +1405,7 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2087
1405
|
}
|
|
2088
1406
|
});
|
|
2089
1407
|
|
|
2090
|
-
|
|
1408
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "createToggle", function () {
|
|
2091
1409
|
var _this$getCurrentValue4;
|
|
2092
1410
|
|
|
2093
1411
|
var _this$props11 = _this.props,
|
|
@@ -2110,7 +1428,7 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2110
1428
|
var label; // Generate buttonLabels
|
|
2111
1429
|
|
|
2112
1430
|
var currentValues = (_this$getCurrentValue4 = _this.getCurrentValues()) !== null && _this$getCurrentValue4 !== void 0 ? _this$getCurrentValue4 : [];
|
|
2113
|
-
var childrenArray =
|
|
1431
|
+
var childrenArray = external_react_namespaceObject.Children.toArray(children);
|
|
2114
1432
|
var valuesLabel = currentValues.reduce(function (acc, value, index, orig) {
|
|
2115
1433
|
var matchedItem = find_default()(childrenArray, function (item) {
|
|
2116
1434
|
return isOption(item) && item.props.value === value;
|
|
@@ -2128,7 +1446,7 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2128
1446
|
}
|
|
2129
1447
|
|
|
2130
1448
|
if (index < orig.length - 1) {
|
|
2131
|
-
acc.push(
|
|
1449
|
+
acc.push((0,i18n_namespaceObject._)(', '));
|
|
2132
1450
|
}
|
|
2133
1451
|
|
|
2134
1452
|
return acc;
|
|
@@ -2185,16 +1503,16 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2185
1503
|
}
|
|
2186
1504
|
|
|
2187
1505
|
if (toggle) {
|
|
2188
|
-
return /*#__PURE__*/
|
|
1506
|
+
return /*#__PURE__*/(0,external_react_namespaceObject.cloneElement)(toggle, commonProps);
|
|
2189
1507
|
}
|
|
2190
1508
|
|
|
2191
1509
|
if (appearance === 'link') {
|
|
2192
|
-
return /*#__PURE__*/external_react_default.
|
|
1510
|
+
return /*#__PURE__*/external_react_default().createElement((Link_default()), SelectBase_extends({}, commonProps, {
|
|
2193
1511
|
"data-select-appearance": "link"
|
|
2194
|
-
}), !!icon && /*#__PURE__*/external_react_default.
|
|
1512
|
+
}), !!icon && /*#__PURE__*/external_react_default().createElement(StyledLinkIcon, null, icon), label || placeholder, /*#__PURE__*/external_react_default().createElement(StyledLinkCaret, null, /*#__PURE__*/external_react_default().createElement(CaretSmallDown, null)));
|
|
2195
1513
|
}
|
|
2196
1514
|
|
|
2197
|
-
return /*#__PURE__*/external_react_default.
|
|
1515
|
+
return /*#__PURE__*/external_react_default().createElement(StyledButton, SelectBase_extends({}, commonProps, {
|
|
2198
1516
|
$multiple: multiple,
|
|
2199
1517
|
appearance: appearance,
|
|
2200
1518
|
label: label,
|
|
@@ -2206,12 +1524,12 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2206
1524
|
"aria-owns": _this.menuId // @ts-expect-error - accept inconsistency with Button
|
|
2207
1525
|
,
|
|
2208
1526
|
onClick: _this.props.onClick
|
|
2209
|
-
}, pick_default()(_this.props, SelectBase.invalidLinkAppearanceProps)), !!currentValues.length && multiple && /*#__PURE__*/external_react_default.
|
|
1527
|
+
}, pick_default()(_this.props, SelectBase.invalidLinkAppearanceProps)), !!currentValues.length && multiple && /*#__PURE__*/external_react_default().createElement(StyledCount, {
|
|
2210
1528
|
"data-role": "count"
|
|
2211
1529
|
}, "(", currentValues.length, ")"));
|
|
2212
1530
|
});
|
|
2213
1531
|
|
|
2214
|
-
|
|
1532
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "createChildren", function () {
|
|
2215
1533
|
var _this$state = _this.state,
|
|
2216
1534
|
filterKeyword = _this$state.filterKeyword,
|
|
2217
1535
|
textHasFocus = _this$state.textHasFocus,
|
|
@@ -2239,7 +1557,7 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2239
1557
|
|
|
2240
1558
|
var foundSelectedAndEnabled;
|
|
2241
1559
|
var topValues = showSelectedValuesFirst === 'immediately' ? _this.getTopValues() : topValuesState;
|
|
2242
|
-
var children =
|
|
1560
|
+
var children = external_react_namespaceObject.Children.toArray(_this.props.children).reduce(function (acc, item, i) {
|
|
2243
1561
|
// ignore Headings and Dividers
|
|
2244
1562
|
if (!isOption(item)) {
|
|
2245
1563
|
acc.push(item);
|
|
@@ -2267,7 +1585,7 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2267
1585
|
} // Format the Menu.Item
|
|
2268
1586
|
|
|
2269
1587
|
|
|
2270
|
-
var clonedItem = /*#__PURE__*/
|
|
1588
|
+
var clonedItem = /*#__PURE__*/(0,external_react_namespaceObject.cloneElement)(item, {
|
|
2271
1589
|
key: item.key || i,
|
|
2272
1590
|
onClick: _this.handleMenuOptionClick,
|
|
2273
1591
|
onKeyDown: useMatchOptions ? function (e) {
|
|
@@ -2287,7 +1605,7 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2287
1605
|
|
|
2288
1606
|
if (topValues && topValues.indexOf(item.props.value) >= 0) {
|
|
2289
1607
|
if (childrenTopCount === 0) {
|
|
2290
|
-
acc.splice(childrenTopCount, 0, /*#__PURE__*/external_react_default.
|
|
1608
|
+
acc.splice(childrenTopCount, 0, /*#__PURE__*/external_react_default().createElement(Menu_namespaceObject.Divider, {
|
|
2291
1609
|
key: "topDivider"
|
|
2292
1610
|
}));
|
|
2293
1611
|
hasDivider = true;
|
|
@@ -2317,14 +1635,14 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2317
1635
|
var topLength = topValues.length;
|
|
2318
1636
|
|
|
2319
1637
|
if (childrenTopCount === 0) {
|
|
2320
|
-
children.splice(0, 0, /*#__PURE__*/external_react_default.
|
|
1638
|
+
children.splice(0, 0, /*#__PURE__*/external_react_default().createElement(Menu_namespaceObject.Divider, {
|
|
2321
1639
|
key: "topDivider"
|
|
2322
1640
|
}));
|
|
2323
1641
|
childrenTopCount += 1;
|
|
2324
1642
|
hasDivider = true;
|
|
2325
1643
|
}
|
|
2326
1644
|
|
|
2327
|
-
children.splice(isTopValue ? 0 : topLength + 1, 0, /*#__PURE__*/external_react_default.
|
|
1645
|
+
children.splice(isTopValue ? 0 : topLength + 1, 0, /*#__PURE__*/external_react_default().createElement(OptionBase, {
|
|
2328
1646
|
label: String(value),
|
|
2329
1647
|
value: value,
|
|
2330
1648
|
key: "missing-value-".concat(value),
|
|
@@ -2342,10 +1660,10 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2342
1660
|
|
|
2343
1661
|
var controlledFilter = filter === 'controlled'; // Filter the items
|
|
2344
1662
|
|
|
2345
|
-
var keywords =
|
|
1663
|
+
var keywords = (0,filter_namespaceObject.stringToKeywords)(filterKeyword);
|
|
2346
1664
|
children = controlledFilter ? children : children.filter(function (option) {
|
|
2347
1665
|
if (isOption(option)) {
|
|
2348
|
-
return
|
|
1666
|
+
return (0,filter_namespaceObject.testPhrase)(option.props.label, keywords);
|
|
2349
1667
|
}
|
|
2350
1668
|
|
|
2351
1669
|
return true; // Keep all headers and non-interactive options
|
|
@@ -2356,15 +1674,15 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2356
1674
|
} // highlight matched text
|
|
2357
1675
|
|
|
2358
1676
|
|
|
2359
|
-
var matchRanges = keywords &&
|
|
2360
|
-
return /*#__PURE__*/
|
|
1677
|
+
var matchRanges = keywords && (0,filter_namespaceObject.keywordLocations)(option.props.label, keywords);
|
|
1678
|
+
return /*#__PURE__*/(0,external_react_namespaceObject.cloneElement)(option, {
|
|
2361
1679
|
matchRanges: matchRanges || undefined
|
|
2362
1680
|
});
|
|
2363
1681
|
}); // Add the option to add the new value
|
|
2364
1682
|
|
|
2365
1683
|
if (allowNewValues && !foundExactMatch && filterKeyword) {
|
|
2366
1684
|
var insertIndex = hasDivider ? childrenTopCount + 1 : childrenTopCount;
|
|
2367
|
-
children.splice(insertIndex, 0, /*#__PURE__*/external_react_default.
|
|
1685
|
+
children.splice(insertIndex, 0, /*#__PURE__*/external_react_default().createElement(OptionBase, {
|
|
2368
1686
|
label: "".concat(filterKeyword, " (new value)"),
|
|
2369
1687
|
value: filterKeyword,
|
|
2370
1688
|
key: "newValue",
|
|
@@ -2411,7 +1729,7 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2411
1729
|
_this.activeValue = item.props.value;
|
|
2412
1730
|
}
|
|
2413
1731
|
|
|
2414
|
-
var clonedItem = /*#__PURE__*/
|
|
1732
|
+
var clonedItem = /*#__PURE__*/(0,external_react_namespaceObject.cloneElement)(item, {
|
|
2415
1733
|
active: active,
|
|
2416
1734
|
id: _this.activeItemId,
|
|
2417
1735
|
ref: _this.handleActiveOptionMount
|
|
@@ -2428,21 +1746,21 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2428
1746
|
|
|
2429
1747
|
if (_this.optionSelection === 'all') {
|
|
2430
1748
|
if (filterKeyword === '') {
|
|
2431
|
-
selectAllLabel =
|
|
1749
|
+
selectAllLabel = (0,i18n_namespaceObject._)('Clear all');
|
|
2432
1750
|
} else {
|
|
2433
|
-
selectAllLabel =
|
|
1751
|
+
selectAllLabel = (0,i18n_namespaceObject._)('Clear all matches');
|
|
2434
1752
|
}
|
|
2435
1753
|
} else if (filterKeyword === '') {
|
|
2436
|
-
selectAllLabel =
|
|
1754
|
+
selectAllLabel = (0,i18n_namespaceObject._)('Select all');
|
|
2437
1755
|
} else {
|
|
2438
|
-
selectAllLabel =
|
|
1756
|
+
selectAllLabel = (0,i18n_namespaceObject._)('Select all matches');
|
|
2439
1757
|
}
|
|
2440
1758
|
|
|
2441
1759
|
if (_this.state.activeIndex === 0 && textHasFocus) {
|
|
2442
1760
|
_this.activeValue = 'selectAll';
|
|
2443
1761
|
}
|
|
2444
1762
|
|
|
2445
|
-
children.unshift( /*#__PURE__*/external_react_default.
|
|
1763
|
+
children.unshift( /*#__PURE__*/external_react_default().createElement(Select_SelectAllOption, {
|
|
2446
1764
|
key: "selectAllOption",
|
|
2447
1765
|
selected: _this.optionSelection === 'all' || _this.optionSelection !== 'none' && 'some',
|
|
2448
1766
|
selectAllLabel: selectAllLabel,
|
|
@@ -2453,7 +1771,7 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2453
1771
|
active: _this.state.activeIndex === 0,
|
|
2454
1772
|
ref: _this.handleActiveOptionMount,
|
|
2455
1773
|
tabIndex: -1
|
|
2456
|
-
}), /*#__PURE__*/external_react_default.
|
|
1774
|
+
}), /*#__PURE__*/external_react_default().createElement(Menu_namespaceObject.Divider, {
|
|
2457
1775
|
key: "selectAllDivider"
|
|
2458
1776
|
}));
|
|
2459
1777
|
}
|
|
@@ -2468,7 +1786,7 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2468
1786
|
return children;
|
|
2469
1787
|
});
|
|
2470
1788
|
|
|
2471
|
-
|
|
1789
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "wrapLabel", function (_ref4) {
|
|
2472
1790
|
var prefixLabel = _ref4.prefixLabel,
|
|
2473
1791
|
label = _ref4.label,
|
|
2474
1792
|
suffixLabel = _ref4.suffixLabel;
|
|
@@ -2485,7 +1803,7 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2485
1803
|
return wrappedLabel;
|
|
2486
1804
|
});
|
|
2487
1805
|
|
|
2488
|
-
|
|
1806
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "handleDropdownMount", function (c) {
|
|
2489
1807
|
_this.dropdown = c;
|
|
2490
1808
|
});
|
|
2491
1809
|
|
|
@@ -2514,12 +1832,12 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2514
1832
|
if (false) {}
|
|
2515
1833
|
|
|
2516
1834
|
SelectBase.validateAppearance(props);
|
|
2517
|
-
_this.menuId =
|
|
2518
|
-
_this.activeItemId =
|
|
1835
|
+
_this.menuId = (0,id_namespaceObject.createDOMID)('menu');
|
|
1836
|
+
_this.activeItemId = (0,id_namespaceObject.createDOMID)('active-item');
|
|
2519
1837
|
return _this;
|
|
2520
1838
|
}
|
|
2521
1839
|
|
|
2522
|
-
|
|
1840
|
+
SelectBase_createClass(SelectBase, [{
|
|
2523
1841
|
key: "componentDidUpdate",
|
|
2524
1842
|
value: function componentDidUpdate(prevProps, prevState) {
|
|
2525
1843
|
if (false) {}
|
|
@@ -2629,31 +1947,31 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2629
1947
|
multiple = _this$props15.multiple,
|
|
2630
1948
|
selectAllAppearance = _this$props15.selectAllAppearance;
|
|
2631
1949
|
|
|
2632
|
-
var selectAllLabel =
|
|
1950
|
+
var selectAllLabel = (0,i18n_namespaceObject._)("Select all options".concat(this.optionSelection === 'all' ? ' disabled' : ''));
|
|
2633
1951
|
|
|
2634
|
-
var clearAllLabel =
|
|
1952
|
+
var clearAllLabel = (0,i18n_namespaceObject._)("Clear all options".concat(this.optionSelection === 'none' ? ' disabled' : '')); // only visually disable these as opposed to fully disabling to avoid losing keyboard focus - see SUI-2731
|
|
2635
1953
|
|
|
2636
1954
|
|
|
2637
|
-
var selectControls = /*#__PURE__*/external_react_default.
|
|
1955
|
+
var selectControls = /*#__PURE__*/external_react_default().createElement(StyledToggleAllControls, {
|
|
2638
1956
|
$placement: placement,
|
|
2639
1957
|
key: "selectAll"
|
|
2640
|
-
}, /*#__PURE__*/external_react_default.
|
|
1958
|
+
}, /*#__PURE__*/external_react_default().createElement(StyledControlsLink, {
|
|
2641
1959
|
$disabled: this.optionSelection === 'all',
|
|
2642
1960
|
"aria-label": selectAllLabel,
|
|
2643
1961
|
onClick: this.handleSelectAll,
|
|
2644
1962
|
"data-test": "select-all"
|
|
2645
|
-
}, filterKeyword ?
|
|
1963
|
+
}, filterKeyword ? (0,i18n_namespaceObject._)('Select All Matches') : (0,i18n_namespaceObject._)('Select All')), /*#__PURE__*/external_react_default().createElement(StyledControlsLink, {
|
|
2646
1964
|
$disabled: this.optionSelection === 'none',
|
|
2647
1965
|
"aria-label": clearAllLabel,
|
|
2648
1966
|
onClick: this.handleClearAll,
|
|
2649
1967
|
"data-test": "clear-all"
|
|
2650
|
-
}, filterKeyword ?
|
|
2651
|
-
return this.hasFilter() && /*#__PURE__*/external_react_default.
|
|
1968
|
+
}, filterKeyword ? (0,i18n_namespaceObject._)('Clear All Matches') : (0,i18n_namespaceObject._)('Clear All')));
|
|
1969
|
+
return this.hasFilter() && /*#__PURE__*/external_react_default().createElement("div", {
|
|
2652
1970
|
key: "controls"
|
|
2653
|
-
}, /*#__PURE__*/external_react_default.
|
|
1971
|
+
}, /*#__PURE__*/external_react_default().createElement(StyledFilter, {
|
|
2654
1972
|
key: "filter",
|
|
2655
1973
|
"data-test": "filter"
|
|
2656
|
-
}, /*#__PURE__*/external_react_default.
|
|
1974
|
+
}, /*#__PURE__*/external_react_default().createElement((Text_default()), {
|
|
2657
1975
|
value: filterKeyword,
|
|
2658
1976
|
autoCapitalize: "off",
|
|
2659
1977
|
autoComplete: "off",
|
|
@@ -2663,15 +1981,15 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2663
1981
|
onKeyDown: this.handleTextKeyDown,
|
|
2664
1982
|
onFocus: this.handleTextFocus,
|
|
2665
1983
|
onBlur: this.handleTextBlur,
|
|
2666
|
-
placeholder:
|
|
1984
|
+
placeholder: (0,i18n_namespaceObject._)('filter'),
|
|
2667
1985
|
role: "combobox",
|
|
2668
1986
|
"aria-expanded": "true",
|
|
2669
|
-
"aria-label":
|
|
1987
|
+
"aria-label": (0,i18n_namespaceObject._)('Filter'),
|
|
2670
1988
|
"aria-activedescendant": this.activeItemId,
|
|
2671
1989
|
inputRef: inputRef,
|
|
2672
1990
|
inputId: inputId,
|
|
2673
1991
|
canClear: true,
|
|
2674
|
-
startAdornment: /*#__PURE__*/external_react_default.
|
|
1992
|
+
startAdornment: /*#__PURE__*/external_react_default().createElement(StyledSearchIconWrapper, null, /*#__PURE__*/external_react_default().createElement(icons_Search, null))
|
|
2675
1993
|
})), multiple && hasChildren && selectAllAppearance === 'buttongroup' && selectControls);
|
|
2676
1994
|
}
|
|
2677
1995
|
}, {
|
|
@@ -2688,7 +2006,7 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2688
2006
|
repositionMode = _this$props16.repositionMode;
|
|
2689
2007
|
var filterEnabled = this.hasFilter();
|
|
2690
2008
|
var currentValues = (_this$getCurrentValue8 = this.getCurrentValues()) !== null && _this$getCurrentValue8 !== void 0 ? _this$getCurrentValue8 : [];
|
|
2691
|
-
var childrenArray =
|
|
2009
|
+
var childrenArray = external_react_namespaceObject.Children.toArray(children);
|
|
2692
2010
|
var isAnyValueSelected = currentValues.some(function (value) {
|
|
2693
2011
|
var matchedItem = find_default()(childrenArray, function (item) {
|
|
2694
2012
|
return isOption(item) && item.props.value === value;
|
|
@@ -2708,7 +2026,7 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2708
2026
|
menuStyle: _this2.props.menuStyle
|
|
2709
2027
|
});
|
|
2710
2028
|
var tabIndex = currentValues.length > 0 && !isAnyValueSelected && !_this2.hasFilter() ? 0 : undefined;
|
|
2711
|
-
return /*#__PURE__*/external_react_default.
|
|
2029
|
+
return /*#__PURE__*/external_react_default().createElement((ResultsMenu_default()), SelectBase_extends({
|
|
2712
2030
|
"aria-multiselectable": multiple || undefined,
|
|
2713
2031
|
childrenStart: _this2.renderControls({
|
|
2714
2032
|
placement: placement,
|
|
@@ -2727,7 +2045,7 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2727
2045
|
}), finalChildren);
|
|
2728
2046
|
};
|
|
2729
2047
|
|
|
2730
|
-
return /*#__PURE__*/external_react_default.
|
|
2048
|
+
return /*#__PURE__*/external_react_default().createElement((Dropdown_default()), {
|
|
2731
2049
|
closeReasons: dropdownCloseReasons,
|
|
2732
2050
|
inputId: inputId,
|
|
2733
2051
|
toggle: toggle,
|
|
@@ -2737,7 +2055,7 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2737
2055
|
openWithArrowKeys: true,
|
|
2738
2056
|
repositionMode: repositionMode,
|
|
2739
2057
|
defaultPlacement: filterEnabled ? defaultPlacement : undefined,
|
|
2740
|
-
canCoverAnchor:
|
|
2058
|
+
canCoverAnchor: getWindow().innerHeight < 500,
|
|
2741
2059
|
ref: this.handleDropdownMount,
|
|
2742
2060
|
retainFocus: false,
|
|
2743
2061
|
takeFocus: currentValues.length === 0 || currentValues.length > 0 && !isAnyValueSelected || !!filterEnabled
|
|
@@ -2746,51 +2064,331 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2746
2064
|
}]);
|
|
2747
2065
|
|
|
2748
2066
|
return SelectBase;
|
|
2749
|
-
}(
|
|
2067
|
+
}(external_react_namespaceObject.Component);
|
|
2068
|
+
|
|
2069
|
+
SelectBase_defineProperty(SelectBase, "propTypes", SelectBase_propTypes);
|
|
2070
|
+
|
|
2071
|
+
SelectBase_defineProperty(SelectBase, "defaultProps", SelectBase_defaultProps);
|
|
2072
|
+
|
|
2073
|
+
SelectBase_defineProperty(SelectBase, "Option", OptionBase);
|
|
2074
|
+
|
|
2075
|
+
SelectBase_defineProperty(SelectBase, "Divider", Menu_namespaceObject.Divider);
|
|
2076
|
+
|
|
2077
|
+
SelectBase_defineProperty(SelectBase, "Heading", Menu_namespaceObject.Heading);
|
|
2078
|
+
|
|
2079
|
+
SelectBase_defineProperty(SelectBase, "invalidLinkAppearanceProps", ['append', 'error', 'prepend']);
|
|
2080
|
+
|
|
2081
|
+
/* harmony default export */ const Select_SelectBase = (SelectBase);
|
|
2082
|
+
|
|
2083
|
+
;// CONCATENATED MODULE: ./src/Select/Option.tsx
|
|
2084
|
+
function Option_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Option_typeof = function _typeof(obj) { return typeof obj; }; } else { Option_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Option_typeof(obj); }
|
|
2085
|
+
|
|
2086
|
+
function Option_extends() { Option_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 Option_extends.apply(this, arguments); }
|
|
2087
|
+
|
|
2088
|
+
function Option_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2089
|
+
|
|
2090
|
+
function Option_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); } }
|
|
2091
|
+
|
|
2092
|
+
function Option_createClass(Constructor, protoProps, staticProps) { if (protoProps) Option_defineProperties(Constructor.prototype, protoProps); if (staticProps) Option_defineProperties(Constructor, staticProps); return Constructor; }
|
|
2093
|
+
|
|
2094
|
+
function Option_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) Option_setPrototypeOf(subClass, superClass); }
|
|
2095
|
+
|
|
2096
|
+
function Option_setPrototypeOf(o, p) { Option_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Option_setPrototypeOf(o, p); }
|
|
2097
|
+
|
|
2098
|
+
function Option_createSuper(Derived) { var hasNativeReflectConstruct = Option_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Option_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Option_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Option_possibleConstructorReturn(this, result); }; }
|
|
2099
|
+
|
|
2100
|
+
function Option_possibleConstructorReturn(self, call) { if (call && (Option_typeof(call) === "object" || typeof call === "function")) { return call; } return Option_assertThisInitialized(self); }
|
|
2101
|
+
|
|
2102
|
+
function Option_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
2103
|
+
|
|
2104
|
+
function Option_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; } }
|
|
2105
|
+
|
|
2106
|
+
function Option_getPrototypeOf(o) { Option_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Option_getPrototypeOf(o); }
|
|
2107
|
+
|
|
2108
|
+
function Option_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; }
|
|
2109
|
+
|
|
2110
|
+
|
|
2111
|
+
|
|
2112
|
+
|
|
2113
|
+
var Option_propTypes = {
|
|
2114
|
+
/** @private */
|
|
2115
|
+
active: (external_prop_types_default()).bool,
|
|
2116
|
+
children: (external_prop_types_default()).node,
|
|
2117
|
+
description: (external_prop_types_default()).string,
|
|
2118
|
+
descriptionPosition: external_prop_types_default().oneOf(['right', 'bottom']),
|
|
2119
|
+
disabled: (external_prop_types_default()).bool,
|
|
2120
|
+
hidden: (external_prop_types_default()).bool,
|
|
2121
|
+
icon: (external_prop_types_default()).node,
|
|
2122
|
+
label: (external_prop_types_default()).string.isRequired,
|
|
2123
|
+
matchRanges: external_prop_types_default().arrayOf(external_prop_types_default().shape({
|
|
2124
|
+
start: (external_prop_types_default()).number.isRequired,
|
|
2125
|
+
end: (external_prop_types_default()).number.isRequired
|
|
2126
|
+
})),
|
|
2127
|
+
|
|
2128
|
+
/** @private */
|
|
2129
|
+
onClick: (external_prop_types_default()).func,
|
|
2130
|
+
|
|
2131
|
+
/** @private */
|
|
2132
|
+
selected: (external_prop_types_default()).bool,
|
|
2133
|
+
truncate: (external_prop_types_default()).bool,
|
|
2134
|
+
value: external_prop_types_default().oneOfType([(external_prop_types_default()).string, (external_prop_types_default()).number, (external_prop_types_default()).bool]).isRequired
|
|
2135
|
+
};
|
|
2136
|
+
var Option_defaultProps = {
|
|
2137
|
+
active: false,
|
|
2138
|
+
descriptionPosition: 'bottom',
|
|
2139
|
+
disabled: false,
|
|
2140
|
+
hidden: false,
|
|
2141
|
+
selected: false,
|
|
2142
|
+
truncate: false
|
|
2143
|
+
};
|
|
2144
|
+
|
|
2145
|
+
/**
|
|
2146
|
+
* An option within a `Select`. This inherits from
|
|
2147
|
+
* [PureComponent](https://reactjs.org/docs/react-api.html#reactpurecomponent)
|
|
2148
|
+
* so any elements passed to it must also be pure.
|
|
2149
|
+
*/
|
|
2150
|
+
var Option_Option = /*#__PURE__*/function (_PureComponent) {
|
|
2151
|
+
Option_inherits(Option, _PureComponent);
|
|
2152
|
+
|
|
2153
|
+
var _super = Option_createSuper(Option);
|
|
2154
|
+
|
|
2155
|
+
function Option() {
|
|
2156
|
+
var _this;
|
|
2157
|
+
|
|
2158
|
+
Option_classCallCheck(this, Option);
|
|
2159
|
+
|
|
2160
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2161
|
+
args[_key] = arguments[_key];
|
|
2162
|
+
}
|
|
2163
|
+
|
|
2164
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
2165
|
+
|
|
2166
|
+
Option_defineProperty(Option_assertThisInitialized(_this), "c", null);
|
|
2167
|
+
|
|
2168
|
+
Option_defineProperty(Option_assertThisInitialized(_this), "handleMount", function (c) {
|
|
2169
|
+
_this.c = c;
|
|
2170
|
+
});
|
|
2171
|
+
|
|
2172
|
+
return _this;
|
|
2173
|
+
}
|
|
2174
|
+
|
|
2175
|
+
Option_createClass(Option, [{
|
|
2176
|
+
key: "scrollIntoViewIfNeeded",
|
|
2177
|
+
value: function scrollIntoViewIfNeeded() {
|
|
2178
|
+
var _this$c;
|
|
2179
|
+
|
|
2180
|
+
(_this$c = this.c) === null || _this$c === void 0 ? void 0 : _this$c.scrollIntoViewIfNeeded();
|
|
2181
|
+
}
|
|
2182
|
+
/**
|
|
2183
|
+
* Place focus on the button.
|
|
2184
|
+
*/
|
|
2185
|
+
|
|
2186
|
+
}, {
|
|
2187
|
+
key: "focus",
|
|
2188
|
+
value: function focus() {
|
|
2189
|
+
var _this$c2;
|
|
2190
|
+
|
|
2191
|
+
(_this$c2 = this.c) === null || _this$c2 === void 0 ? void 0 : _this$c2.focus();
|
|
2192
|
+
}
|
|
2193
|
+
}, {
|
|
2194
|
+
key: "render",
|
|
2195
|
+
value: function render() {
|
|
2196
|
+
return /*#__PURE__*/external_react_default().createElement(OptionBase, Option_extends({}, this.props, {
|
|
2197
|
+
multiple: false,
|
|
2198
|
+
ref: this.handleMount
|
|
2199
|
+
}), this.props.children || this.props.label);
|
|
2200
|
+
}
|
|
2201
|
+
}]);
|
|
2202
|
+
|
|
2203
|
+
return Option;
|
|
2204
|
+
}(external_react_namespaceObject.PureComponent);
|
|
2205
|
+
|
|
2206
|
+
Option_defineProperty(Option_Option, "propTypes", Option_propTypes);
|
|
2207
|
+
|
|
2208
|
+
Option_defineProperty(Option_Option, "defaultProps", Option_defaultProps);
|
|
2209
|
+
|
|
2210
|
+
/* harmony default export */ const Select_Option = (Option_Option);
|
|
2211
|
+
;// CONCATENATED MODULE: ./src/Select/Select.tsx
|
|
2212
|
+
function Select_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Select_typeof = function _typeof(obj) { return typeof obj; }; } else { Select_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Select_typeof(obj); }
|
|
2213
|
+
|
|
2214
|
+
function Select_extends() { Select_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 Select_extends.apply(this, arguments); }
|
|
2215
|
+
|
|
2216
|
+
function Select_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Select_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; }
|
|
2217
|
+
|
|
2218
|
+
function Select_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; }
|
|
2219
|
+
|
|
2220
|
+
function Select_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2221
|
+
|
|
2222
|
+
function Select_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); } }
|
|
2223
|
+
|
|
2224
|
+
function Select_createClass(Constructor, protoProps, staticProps) { if (protoProps) Select_defineProperties(Constructor.prototype, protoProps); if (staticProps) Select_defineProperties(Constructor, staticProps); return Constructor; }
|
|
2225
|
+
|
|
2226
|
+
function Select_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) Select_setPrototypeOf(subClass, superClass); }
|
|
2750
2227
|
|
|
2751
|
-
|
|
2228
|
+
function Select_setPrototypeOf(o, p) { Select_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Select_setPrototypeOf(o, p); }
|
|
2229
|
+
|
|
2230
|
+
function Select_createSuper(Derived) { var hasNativeReflectConstruct = Select_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Select_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Select_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Select_possibleConstructorReturn(this, result); }; }
|
|
2231
|
+
|
|
2232
|
+
function Select_possibleConstructorReturn(self, call) { if (call && (Select_typeof(call) === "object" || typeof call === "function")) { return call; } return Select_assertThisInitialized(self); }
|
|
2233
|
+
|
|
2234
|
+
function Select_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
2235
|
+
|
|
2236
|
+
function Select_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; } }
|
|
2237
|
+
|
|
2238
|
+
function Select_getPrototypeOf(o) { Select_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Select_getPrototypeOf(o); }
|
|
2239
|
+
|
|
2240
|
+
function Select_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; }
|
|
2241
|
+
|
|
2242
|
+
/* eslint-disable max-classes-per-file */
|
|
2243
|
+
|
|
2244
|
+
|
|
2245
|
+
|
|
2246
|
+
|
|
2247
|
+
|
|
2248
|
+
|
|
2249
|
+
/** @public */
|
|
2250
|
+
|
|
2251
|
+
var Select_propTypes = {
|
|
2252
|
+
allowKeyMatching: (external_prop_types_default()).bool,
|
|
2253
|
+
animateLoading: (external_prop_types_default()).bool,
|
|
2254
|
+
appearance: external_prop_types_default().oneOf(['default', 'link', 'primary', 'pill', 'toggle', 'flat']),
|
|
2255
|
+
append: (external_prop_types_default()).bool,
|
|
2256
|
+
children: (external_prop_types_default()).node,
|
|
2257
|
+
defaultPlacement: external_prop_types_default().oneOf(['above', 'below', 'vertical']),
|
|
2258
|
+
defaultValue: external_prop_types_default().oneOfType([(external_prop_types_default()).string, (external_prop_types_default()).number, (external_prop_types_default()).bool]),
|
|
2259
|
+
describedBy: (external_prop_types_default()).string,
|
|
2260
|
+
disabled: (external_prop_types_default()).bool,
|
|
2261
|
+
elementRef: external_prop_types_default().oneOfType([(external_prop_types_default()).func, (external_prop_types_default()).object]),
|
|
2262
|
+
error: (external_prop_types_default()).bool,
|
|
2263
|
+
filter: external_prop_types_default().oneOf([false, true, 'controlled']),
|
|
2264
|
+
footerMessage: (external_prop_types_default()).node,
|
|
2265
|
+
inline: (external_prop_types_default()).bool,
|
|
2266
|
+
inputId: (external_prop_types_default()).string,
|
|
2267
|
+
inputRef: external_prop_types_default().oneOfType([(external_prop_types_default()).func, (external_prop_types_default()).object]),
|
|
2268
|
+
isLoadingOptions: (external_prop_types_default()).bool,
|
|
2269
|
+
labelledBy: (external_prop_types_default()).string,
|
|
2270
|
+
labelText: (external_prop_types_default()).string,
|
|
2271
|
+
loadingMessage: (external_prop_types_default()).node,
|
|
2272
|
+
menuStyle: (external_prop_types_default()).object,
|
|
2273
|
+
name: (external_prop_types_default()).string,
|
|
2274
|
+
noOptionsMessage: (external_prop_types_default()).node,
|
|
2275
|
+
onChange: (external_prop_types_default()).func,
|
|
2276
|
+
onClose: (external_prop_types_default()).func,
|
|
2277
|
+
onFilterChange: (external_prop_types_default()).func,
|
|
2278
|
+
onOpen: (external_prop_types_default()).func,
|
|
2279
|
+
onScroll: (external_prop_types_default()).func,
|
|
2280
|
+
onScrollBottom: (external_prop_types_default()).func,
|
|
2281
|
+
placeholder: (external_prop_types_default()).string,
|
|
2282
|
+
prefixLabel: (external_prop_types_default()).string,
|
|
2283
|
+
prepend: (external_prop_types_default()).bool,
|
|
2284
|
+
suffixLabel: (external_prop_types_default()).string,
|
|
2285
|
+
value: external_prop_types_default().oneOfType([(external_prop_types_default()).string, (external_prop_types_default()).number, (external_prop_types_default()).bool])
|
|
2286
|
+
};
|
|
2287
|
+
var Select_defaultProps = {
|
|
2288
|
+
allowKeyMatching: true,
|
|
2289
|
+
animateLoading: false,
|
|
2290
|
+
appearance: 'toggle',
|
|
2291
|
+
append: false,
|
|
2292
|
+
children: [],
|
|
2293
|
+
defaultPlacement: 'vertical',
|
|
2294
|
+
disabled: false,
|
|
2295
|
+
error: false,
|
|
2296
|
+
filter: false,
|
|
2297
|
+
inline: true,
|
|
2298
|
+
isLoadingOptions: false,
|
|
2299
|
+
menuStyle: {},
|
|
2300
|
+
noOptionsMessage: (0,i18n_namespaceObject._)('No matches'),
|
|
2301
|
+
placeholder: (0,i18n_namespaceObject._)('Select...'),
|
|
2302
|
+
prepend: false
|
|
2303
|
+
};
|
|
2752
2304
|
|
|
2753
|
-
|
|
2305
|
+
var Select = /*#__PURE__*/function (_Component) {
|
|
2306
|
+
Select_inherits(Select, _Component);
|
|
2754
2307
|
|
|
2755
|
-
|
|
2308
|
+
var _super = Select_createSuper(Select);
|
|
2756
2309
|
|
|
2757
|
-
|
|
2310
|
+
// @docs-props-type SelectPropsBase
|
|
2311
|
+
function Select(props) {
|
|
2312
|
+
var _this;
|
|
2758
2313
|
|
|
2759
|
-
|
|
2314
|
+
Select_classCallCheck(this, Select);
|
|
2760
2315
|
|
|
2761
|
-
|
|
2316
|
+
_this = _super.call(this, props);
|
|
2317
|
+
var state = {}; // wrap defaultValue in an array once to avoid failing <SelectBase>'s defaultValues comparison check
|
|
2318
|
+
// using "has" to make sure that pre-4.3 behavior is preserved if a user explicitly passes "null" or "undefined"
|
|
2762
2319
|
|
|
2763
|
-
|
|
2320
|
+
if (has_default()(props, 'defaultValue')) {
|
|
2321
|
+
if (props.defaultValue != null) {
|
|
2322
|
+
state.defaultValues = [props.defaultValue];
|
|
2323
|
+
} else {
|
|
2324
|
+
state.defaultValues = [];
|
|
2325
|
+
}
|
|
2326
|
+
}
|
|
2764
2327
|
|
|
2328
|
+
_this.state = state;
|
|
2329
|
+
return _this;
|
|
2330
|
+
}
|
|
2765
2331
|
|
|
2766
|
-
|
|
2332
|
+
Select_createClass(Select, [{
|
|
2333
|
+
key: "componentDidUpdate",
|
|
2334
|
+
value: function componentDidUpdate(prevProps) {
|
|
2335
|
+
if (false) {}
|
|
2336
|
+
}
|
|
2337
|
+
}, {
|
|
2338
|
+
key: "render",
|
|
2339
|
+
value: function render() {
|
|
2340
|
+
var _this$props = this.props,
|
|
2341
|
+
defaultValue = _this$props.defaultValue,
|
|
2342
|
+
_onChange = _this$props.onChange,
|
|
2343
|
+
value = _this$props.value,
|
|
2344
|
+
otherProps = Select_objectWithoutProperties(_this$props, ["defaultValue", "onChange", "value"]);
|
|
2767
2345
|
|
|
2768
|
-
|
|
2769
|
-
|
|
2346
|
+
var convertedProps = {
|
|
2347
|
+
onChange: function onChange(e, _ref) {
|
|
2348
|
+
var name = _ref.name,
|
|
2349
|
+
values = _ref.values;
|
|
2350
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange(e, {
|
|
2351
|
+
name: name,
|
|
2352
|
+
value: values[0]
|
|
2353
|
+
});
|
|
2354
|
+
}
|
|
2355
|
+
}; // using "has" as opposed to a null check to match SelectBase
|
|
2770
2356
|
|
|
2771
|
-
|
|
2357
|
+
if (has_default()(this.props, 'value')) {
|
|
2358
|
+
if (value != null) {
|
|
2359
|
+
convertedProps.values = [value];
|
|
2360
|
+
} else {
|
|
2361
|
+
convertedProps.values = [];
|
|
2362
|
+
}
|
|
2363
|
+
} else if (this.state.defaultValues != null) {
|
|
2364
|
+
// using defaultValues from state in order to avoid wrapping defaultValue here
|
|
2365
|
+
convertedProps.defaultValues = this.state.defaultValues;
|
|
2366
|
+
}
|
|
2772
2367
|
|
|
2773
|
-
|
|
2368
|
+
return /*#__PURE__*/external_react_default().createElement(Select_SelectBase, Select_extends({}, otherProps, convertedProps, {
|
|
2369
|
+
multiple: false
|
|
2370
|
+
}));
|
|
2371
|
+
}
|
|
2372
|
+
}]);
|
|
2774
2373
|
|
|
2775
|
-
|
|
2776
|
-
|
|
2374
|
+
return Select;
|
|
2375
|
+
}(external_react_namespaceObject.Component);
|
|
2777
2376
|
|
|
2778
|
-
|
|
2377
|
+
Select_defineProperty(Select, "propTypes", Select_propTypes);
|
|
2779
2378
|
|
|
2780
|
-
|
|
2379
|
+
Select_defineProperty(Select, "defaultProps", Select_defaultProps);
|
|
2781
2380
|
|
|
2782
|
-
|
|
2783
|
-
/***/ (function(module, exports) {
|
|
2381
|
+
Select_defineProperty(Select, "Option", Select_Option);
|
|
2784
2382
|
|
|
2785
|
-
|
|
2383
|
+
Select_defineProperty(Select, "Heading", Menu_namespaceObject.Heading);
|
|
2786
2384
|
|
|
2787
|
-
|
|
2385
|
+
Select_defineProperty(Select, "Divider", Menu_namespaceObject.Divider);
|
|
2788
2386
|
|
|
2789
|
-
|
|
2790
|
-
/***/ (function(module, exports) {
|
|
2387
|
+
/* harmony default export */ const Select_Select = (Select);
|
|
2791
2388
|
|
|
2792
|
-
|
|
2389
|
+
;// CONCATENATED MODULE: ./src/Select/index.ts
|
|
2793
2390
|
|
|
2794
|
-
/***/ })
|
|
2795
2391
|
|
|
2796
|
-
|
|
2392
|
+
module.exports = __webpack_exports__;
|
|
2393
|
+
/******/ })()
|
|
2394
|
+
;
|