@splunk/react-ui 4.19.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.d.ts +2 -0
- package/Breadcrumbs.js +207 -0
- package/Button.js +168 -316
- package/ButtonGroup.js +84 -168
- package/ButtonSimple.js +224 -324
- package/CHANGELOG.md +35 -0
- package/Calendar.js +264 -462
- package/Card.js +223 -371
- package/CardLayout.js +87 -163
- package/Chip.js +199 -323
- package/Clickable.js +132 -248
- package/CloseButton.js +92 -200
- package/Code.js +188 -251
- 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 -355
- package/Menu.js +396 -647
- 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 +2675 -2807
- package/Number.js +178 -334
- package/Paginator.js +170 -336
- package/Paragraph.js +77 -153
- package/Popover.js +436 -623
- package/Progress.js +139 -255
- package/RadioBar.js +156 -280
- package/RadioList.js +182 -282
- package/Resize.js +173 -307
- package/ResultsMenu.js +183 -304
- package/ScreenReaderContent.js +75 -151
- package/Scroll.js +125 -267
- package/ScrollContainerContext.js +129 -201
- package/Search.js +188 -354
- package/Select.js +1243 -1248
- 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 +975 -1447
- 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 +20 -21
- package/stubs-splunkui.d.ts +4 -1
- package/types/src/Breadcrumbs/Breadcrumbs.d.ts +25 -0
- package/types/src/Breadcrumbs/Item.d.ts +42 -0
- package/types/src/Breadcrumbs/docs/examples/Adornments.d.ts +2 -0
- package/types/src/Breadcrumbs/docs/examples/Basic.d.ts +2 -0
- package/types/src/Breadcrumbs/index.d.ts +2 -0
- package/types/src/Code/Code.d.ts +1 -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 +12 -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/Compact.d.ts +4 -0
- package/types/src/Multiselect/Multiselect.d.ts +5 -0
- package/types/src/Multiselect/Option.d.ts +1 -1
- package/types/src/Multiselect/docs/examples/CompactSelectAll.d.ts +2 -0
- 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/Select/SelectAllOption.d.ts +14 -0
- package/types/src/Select/SelectBase.d.ts +11 -3
- package/types/src/Table/Table.d.ts +4 -0
- package/types/src/Text/Text.d.ts +3 -3
- package/types/src/TextArea/TextArea.d.ts +3 -3
- 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/Typography/docs/examples/Variants.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,277 +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 = 231);
|
|
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
|
-
/***/ 103:
|
|
105
|
-
/***/ (function(module, exports) {
|
|
106
|
-
|
|
107
|
-
module.exports = require("lodash/forEachRight");
|
|
108
|
-
|
|
109
|
-
/***/ }),
|
|
110
|
-
|
|
111
|
-
/***/ 104:
|
|
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
|
-
/***/ 13:
|
|
126
|
-
/***/ (function(module, exports) {
|
|
127
|
-
|
|
128
|
-
module.exports = require("@splunk/react-ui/Menu");
|
|
129
|
-
|
|
130
|
-
/***/ }),
|
|
131
|
-
|
|
132
|
-
/***/ 15:
|
|
133
|
-
/***/ (function(module, exports) {
|
|
134
|
-
|
|
135
|
-
module.exports = require("lodash/includes");
|
|
136
|
-
|
|
137
|
-
/***/ }),
|
|
138
|
-
|
|
139
|
-
/***/ 17:
|
|
140
|
-
/***/ (function(module, exports) {
|
|
141
|
-
|
|
142
|
-
module.exports = require("@splunk/react-ui/Button");
|
|
143
|
-
|
|
144
|
-
/***/ }),
|
|
145
|
-
|
|
146
|
-
/***/ 18:
|
|
147
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
148
|
-
|
|
149
|
-
"use strict";
|
|
150
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getWindow; });
|
|
151
|
-
/* unused harmony export ssrWindow */
|
|
152
|
-
/* harmony import */ var _ssrDocument__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27);
|
|
153
|
-
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
48
|
+
var __webpack_exports__ = {};
|
|
49
|
+
// ESM COMPAT FLAG
|
|
50
|
+
__webpack_require__.r(__webpack_exports__);
|
|
154
51
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
host: '',
|
|
163
|
-
hostname: '',
|
|
164
|
-
href: '',
|
|
165
|
-
origin: '',
|
|
166
|
-
pathname: '',
|
|
167
|
-
protocol: '',
|
|
168
|
-
search: ''
|
|
169
|
-
},
|
|
170
|
-
history: {
|
|
171
|
-
replaceState: function replaceState() {},
|
|
172
|
-
pushState: function pushState() {},
|
|
173
|
-
go: function go() {},
|
|
174
|
-
back: function back() {}
|
|
175
|
-
},
|
|
176
|
-
CustomEvent: function CustomEvent() {
|
|
177
|
-
return this;
|
|
178
|
-
},
|
|
179
|
-
addEventListener: function addEventListener() {},
|
|
180
|
-
removeEventListener: function removeEventListener() {},
|
|
181
|
-
getComputedStyle: function getComputedStyle() {
|
|
182
|
-
return {
|
|
183
|
-
getPropertyValue: function getPropertyValue() {
|
|
184
|
-
return '';
|
|
185
|
-
}
|
|
186
|
-
};
|
|
187
|
-
},
|
|
188
|
-
Image: function Image() {},
|
|
189
|
-
Date: function Date() {},
|
|
190
|
-
screen: {},
|
|
191
|
-
setTimeout: function setTimeout() {},
|
|
192
|
-
clearTimeout: function clearTimeout() {},
|
|
193
|
-
matchMedia: function matchMedia() {
|
|
194
|
-
return {};
|
|
195
|
-
},
|
|
196
|
-
requestAnimationFrame: function requestAnimationFrame(callback) {
|
|
197
|
-
if (typeof setTimeout === 'undefined') {
|
|
198
|
-
callback();
|
|
199
|
-
return null;
|
|
200
|
-
}
|
|
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
|
+
});
|
|
201
59
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
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;
|
|
208
141
|
|
|
209
|
-
|
|
210
|
-
|
|
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;
|
|
211
148
|
};
|
|
212
149
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
/***/ 2:
|
|
223
|
-
/***/ (function(module, exports) {
|
|
224
|
-
|
|
225
|
-
module.exports = require("react");
|
|
226
|
-
|
|
227
|
-
/***/ }),
|
|
228
|
-
|
|
229
|
-
/***/ 22:
|
|
230
|
-
/***/ (function(module, exports) {
|
|
231
|
-
|
|
232
|
-
module.exports = require("@splunk/react-ui/Dropdown");
|
|
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
|
-
/***/ 231:
|
|
237
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
238
160
|
|
|
239
|
-
"use strict";
|
|
240
|
-
// ESM COMPAT FLAG
|
|
241
|
-
__webpack_require__.r(__webpack_exports__);
|
|
242
|
-
|
|
243
|
-
// EXPORTS
|
|
244
|
-
__webpack_require__.d(__webpack_exports__, "default", function() { return /* reexport */ src_Select_Select; });
|
|
245
|
-
__webpack_require__.d(__webpack_exports__, "Divider", function() { return /* reexport */ SelectBase["a" /* Divider */]; });
|
|
246
|
-
__webpack_require__.d(__webpack_exports__, "Heading", function() { return /* reexport */ SelectBase["b" /* Heading */]; });
|
|
247
|
-
__webpack_require__.d(__webpack_exports__, "Option", function() { return /* reexport */ Select_Option; });
|
|
248
161
|
|
|
249
|
-
// EXTERNAL MODULE: external "react"
|
|
250
|
-
var external_react_ = __webpack_require__(2);
|
|
251
|
-
var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
|
|
252
162
|
|
|
253
|
-
// EXTERNAL MODULE: external "prop-types"
|
|
254
|
-
var external_prop_types_ = __webpack_require__(1);
|
|
255
|
-
var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
|
|
256
163
|
|
|
257
|
-
|
|
258
|
-
var
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
// EXTERNAL MODULE: external "@splunk/ui-utils/i18n"
|
|
262
|
-
var i18n_ = __webpack_require__(4);
|
|
164
|
+
var Search = function Search() {
|
|
165
|
+
var _useSplunkTheme = (0,themes_namespaceObject.useSplunkTheme)(),
|
|
166
|
+
isEnterprise = _useSplunkTheme.isEnterprise,
|
|
167
|
+
isCompact = _useSplunkTheme.isCompact;
|
|
263
168
|
|
|
264
|
-
|
|
265
|
-
var SelectBase = __webpack_require__(60);
|
|
169
|
+
var screenReaderText = (0,i18n_namespaceObject._)('Search');
|
|
266
170
|
|
|
267
|
-
|
|
268
|
-
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
|
+
};
|
|
269
185
|
|
|
270
|
-
|
|
186
|
+
/* harmony default export */ const icons_Search = (Search);
|
|
187
|
+
;// CONCATENATED MODULE: ./src/Select/OptionBase.tsx
|
|
271
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); }
|
|
272
189
|
|
|
273
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); }
|
|
274
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
|
+
|
|
275
196
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
276
197
|
|
|
277
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); } }
|
|
@@ -299,42 +220,46 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
299
220
|
|
|
300
221
|
var propTypes = {
|
|
301
222
|
/** @private */
|
|
302
|
-
active: external_prop_types_default.
|
|
303
|
-
children: external_prop_types_default.
|
|
304
|
-
description: external_prop_types_default.
|
|
305
|
-
descriptionPosition: external_prop_types_default.
|
|
306
|
-
disabled: external_prop_types_default.
|
|
307
|
-
hidden: external_prop_types_default.
|
|
308
|
-
icon: external_prop_types_default.
|
|
309
|
-
label: external_prop_types_default.
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
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
|
|
313
239
|
})),
|
|
314
240
|
|
|
315
241
|
/** @private */
|
|
316
|
-
onClick: external_prop_types_default.
|
|
242
|
+
onClick: (external_prop_types_default()).func,
|
|
317
243
|
|
|
318
244
|
/** @private */
|
|
319
|
-
selected: external_prop_types_default.
|
|
320
|
-
truncate: external_prop_types_default.
|
|
321
|
-
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
|
|
322
248
|
};
|
|
323
249
|
var defaultProps = {
|
|
324
|
-
active: false,
|
|
325
250
|
descriptionPosition: 'bottom',
|
|
326
251
|
disabled: false,
|
|
327
|
-
|
|
252
|
+
multiple: false,
|
|
328
253
|
selected: false,
|
|
329
254
|
truncate: false
|
|
330
255
|
};
|
|
331
256
|
|
|
332
257
|
/**
|
|
333
|
-
* An option within a `
|
|
258
|
+
* An option within a `Multiselect`. This inherits from
|
|
334
259
|
* [PureComponent](https://reactjs.org/docs/react-api.html#reactpurecomponent)
|
|
335
260
|
* so any elements passed to it must also be pure.
|
|
336
261
|
*/
|
|
337
|
-
var
|
|
262
|
+
var Option = /*#__PURE__*/function (_PureComponent) {
|
|
338
263
|
_inherits(Option, _PureComponent);
|
|
339
264
|
|
|
340
265
|
var _super = _createSuper(Option);
|
|
@@ -352,6 +277,19 @@ var Option_Option = /*#__PURE__*/function (_PureComponent) {
|
|
|
352
277
|
|
|
353
278
|
_defineProperty(_assertThisInitialized(_this), "c", null);
|
|
354
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
|
+
|
|
355
293
|
_defineProperty(_assertThisInitialized(_this), "handleMount", function (c) {
|
|
356
294
|
_this.c = c;
|
|
357
295
|
});
|
|
@@ -380,211 +318,418 @@ var Option_Option = /*#__PURE__*/function (_PureComponent) {
|
|
|
380
318
|
}, {
|
|
381
319
|
key: "render",
|
|
382
320
|
value: function render() {
|
|
383
|
-
|
|
384
|
-
|
|
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",
|
|
385
332
|
ref: this.handleMount
|
|
386
|
-
}
|
|
333
|
+
}, otherProps, {
|
|
334
|
+
selectable: true,
|
|
335
|
+
selectableAppearance: multiple ? 'checkbox' : undefined,
|
|
336
|
+
onClick: this.handleClick,
|
|
337
|
+
role: "option",
|
|
338
|
+
value: value.toString()
|
|
339
|
+
}), children || label);
|
|
387
340
|
}
|
|
388
341
|
}]);
|
|
389
342
|
|
|
390
343
|
return Option;
|
|
391
|
-
}(
|
|
392
|
-
|
|
393
|
-
_defineProperty(Option_Option, "propTypes", propTypes);
|
|
394
|
-
|
|
395
|
-
_defineProperty(Option_Option, "defaultProps", defaultProps);
|
|
396
|
-
|
|
397
|
-
/* harmony default export */ var Select_Option = (Option_Option);
|
|
398
|
-
// CONCATENATED MODULE: ./src/Select/Select.tsx
|
|
399
|
-
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); }
|
|
400
|
-
|
|
401
|
-
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); }
|
|
344
|
+
}(external_react_namespaceObject.PureComponent);
|
|
402
345
|
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
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; }
|
|
406
|
-
|
|
407
|
-
function Select_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
408
|
-
|
|
409
|
-
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); } }
|
|
346
|
+
_defineProperty(Option, "propTypes", propTypes);
|
|
410
347
|
|
|
411
|
-
|
|
348
|
+
_defineProperty(Option, "defaultProps", defaultProps);
|
|
412
349
|
|
|
413
|
-
|
|
350
|
+
_defineProperty(Option, "type", Menu_namespaceObject.Item);
|
|
414
351
|
|
|
415
|
-
|
|
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
|
|
416
363
|
|
|
417
|
-
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); }; }
|
|
418
364
|
|
|
419
|
-
function Select_possibleConstructorReturn(self, call) { if (call && (Select_typeof(call) === "object" || typeof call === "function")) { return call; } return Select_assertThisInitialized(self); }
|
|
420
365
|
|
|
421
|
-
function Select_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
422
366
|
|
|
423
|
-
|
|
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)({
|
|
371
|
+
prisma: '16px'
|
|
372
|
+
}));
|
|
373
|
+
var StyledItemDescriptionBottom = external_styled_components_default().span.withConfig({
|
|
374
|
+
displayName: "ItemStyles__StyledItemDescriptionBottom",
|
|
375
|
+
componentId: "sc-4kc053-0"
|
|
376
|
+
})(["", ";display:block;"], itemDescription);
|
|
377
|
+
var StyledItemDescriptionRight = external_styled_components_default().span.withConfig({
|
|
378
|
+
displayName: "ItemStyles__StyledItemDescriptionRight",
|
|
379
|
+
componentId: "sc-4kc053-1"
|
|
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({
|
|
382
|
+
displayName: "ItemStyles__StyledItemSelectedIcon",
|
|
383
|
+
componentId: "sc-4kc053-2"
|
|
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
|
|
390
|
+
}));
|
|
391
|
+
var StyledItemIcon = external_styled_components_default().span.withConfig({
|
|
392
|
+
displayName: "ItemStyles__StyledItemIcon",
|
|
393
|
+
componentId: "sc-4kc053-3"
|
|
394
|
+
})(["flex:0 0 auto;padding-right:", ";min-width:10px;display:inline-block;text-align:center;vertical-align:", ";", ""], (0,themes_namespaceObject.pick)({
|
|
395
|
+
prisma: '8px',
|
|
396
|
+
enterprise: '3px'
|
|
397
|
+
}), (0,themes_namespaceObject.pick)({
|
|
398
|
+
prisma: 'initial',
|
|
399
|
+
enterprise: 'middle'
|
|
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);"])
|
|
403
|
+
}));
|
|
404
|
+
var StyledClickable = external_styled_components_default()((Clickable_default())).withConfig({
|
|
405
|
+
displayName: "ItemStyles__StyledClickable",
|
|
406
|
+
componentId: "sc-4kc053-4"
|
|
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,
|
|
409
|
+
enterprise: {
|
|
410
|
+
dark: themes_namespaceObject.variables.gray96,
|
|
411
|
+
light: themes_namespaceObject.variables.gray22
|
|
412
|
+
}
|
|
413
|
+
}), (0,themes_namespaceObject.pick)({
|
|
414
|
+
prisma: {
|
|
415
|
+
comfortable: '10px 16px',
|
|
416
|
+
compact: '6px 16px'
|
|
417
|
+
},
|
|
418
|
+
enterprise: '6px 10px'
|
|
419
|
+
}), function (_ref) {
|
|
420
|
+
var $isSelectable = _ref.$isSelectable,
|
|
421
|
+
$selectableAppearance = _ref.$selectableAppearance;
|
|
422
|
+
return $isSelectable && (0,themes_namespaceObject.pick)({
|
|
423
|
+
prisma: (0,external_styled_components_namespaceObject.css)(["padding-right:44px;", ""], function () {
|
|
424
|
+
return $selectableAppearance === 'checkbox' && 'padding-left: 42px;';
|
|
425
|
+
}),
|
|
426
|
+
enterprise: (0,external_styled_components_namespaceObject.css)(["padding-right:10px;padding-left:", ";"], function () {
|
|
427
|
+
return $selectableAppearance === 'checkbox' ? '32px' : '28px';
|
|
428
|
+
})
|
|
429
|
+
});
|
|
430
|
+
}, function (_ref2) {
|
|
431
|
+
var $active = _ref2.$active,
|
|
432
|
+
$preventFocus = _ref2.$preventFocus;
|
|
433
|
+
return $active && !$preventFocus && (0,external_styled_components_namespaceObject.css)(["box-shadow:", ";"], themes_namespaceObject.variables.focusShadowInset);
|
|
434
|
+
}, function (_ref3) {
|
|
435
|
+
var $active = _ref3.$active;
|
|
436
|
+
return $active && (0,external_styled_components_namespaceObject.css)(["background:", ";font-weight:", ";"], (0,themes_namespaceObject.pick)({
|
|
437
|
+
enterprise: {
|
|
438
|
+
light: themes_namespaceObject.variables.gray92,
|
|
439
|
+
dark: themes_namespaceObject.variables.gray22
|
|
440
|
+
},
|
|
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
|
|
446
|
+
}), function (_ref4) {
|
|
447
|
+
var $selected = _ref4.$selected;
|
|
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))
|
|
450
|
+
});
|
|
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)
|
|
455
|
+
}), function (_ref5) {
|
|
456
|
+
var $selected = _ref5.$selected;
|
|
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))
|
|
459
|
+
});
|
|
460
|
+
}, (0,themes_namespaceObject.pick)({
|
|
461
|
+
enterprise: {
|
|
462
|
+
light: themes_namespaceObject.variables.gray45,
|
|
463
|
+
dark: themes_namespaceObject.variables.contentColorDisabled
|
|
464
|
+
},
|
|
465
|
+
prisma: themes_namespaceObject.variables.contentColorDisabled
|
|
466
|
+
}),
|
|
467
|
+
/* sc-sel */
|
|
468
|
+
StyledItemDescriptionBottom,
|
|
469
|
+
/* sc-sel */
|
|
470
|
+
StyledItemDescriptionRight,
|
|
471
|
+
/* sc-sel */
|
|
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:", ";}"],
|
|
477
|
+
/* sc-sel */
|
|
478
|
+
StyledItemIcon, themes_namespaceObject.variables.contentColorDisabled)
|
|
479
|
+
}), function (_ref6) {
|
|
480
|
+
var $selected = _ref6.$selected;
|
|
481
|
+
return $selected && (0,themes_namespaceObject.pick)({
|
|
482
|
+
prisma: (0,external_styled_components_namespaceObject.css)(["", "{color:", ";}"],
|
|
483
|
+
/* sc-sel */
|
|
484
|
+
StyledItemIcon, themes_namespaceObject.variables.contentColorActive)
|
|
485
|
+
});
|
|
486
|
+
});
|
|
487
|
+
var StyledSwitch = external_styled_components_default()((Switch_default())).withConfig({
|
|
488
|
+
displayName: "ItemStyles__StyledSwitch",
|
|
489
|
+
componentId: "sc-4kc053-5"
|
|
490
|
+
})(["position:absolute;left:", ";top:", ";"], (0,themes_namespaceObject.pick)({
|
|
491
|
+
prisma: '16px',
|
|
492
|
+
enterprise: '8px'
|
|
493
|
+
}), (0,themes_namespaceObject.pick)({
|
|
494
|
+
prisma: '0px',
|
|
495
|
+
enterprise: {
|
|
496
|
+
comfortable: '-1px',
|
|
497
|
+
compact: '2px'
|
|
498
|
+
}
|
|
499
|
+
}));
|
|
500
|
+
var StyledInnerWrapper = external_styled_components_default().span.withConfig({
|
|
501
|
+
displayName: "ItemStyles__StyledInnerWrapper",
|
|
502
|
+
componentId: "sc-4kc053-6"
|
|
503
|
+
})(["display:flex;align-items:flex-start;"]);
|
|
504
|
+
var StyledTitleAndDescriptionWrapper = external_styled_components_default().span.withConfig({
|
|
505
|
+
displayName: "ItemStyles__StyledTitleAndDescriptionWrapper",
|
|
506
|
+
componentId: "sc-4kc053-7"
|
|
507
|
+
})(["max-width:100%;width:100%;align-self:center;word-break:break-word;white-space:normal;", ""], function (_ref7) {
|
|
508
|
+
var $truncate = _ref7.$truncate;
|
|
509
|
+
return $truncate && (0,external_styled_components_namespaceObject.css)(["white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"]);
|
|
510
|
+
});
|
|
511
|
+
var StyledLabel = external_styled_components_default().div.withConfig({
|
|
512
|
+
displayName: "ItemStyles__StyledLabel",
|
|
513
|
+
componentId: "sc-4kc053-8"
|
|
514
|
+
})(["overflow:inherit;white-space:inherit;text-overflow:inherit;max-width:100%;min-height:20px;", ""], function (_ref8) {
|
|
515
|
+
var $truncate = _ref8.$truncate;
|
|
516
|
+
return $truncate && (0,external_styled_components_namespaceObject.css)(["display:block;clear:both;"]);
|
|
517
|
+
});
|
|
518
|
+
var StyledMatch = external_styled_components_default().span.withConfig({
|
|
519
|
+
displayName: "ItemStyles__StyledMatch",
|
|
520
|
+
componentId: "sc-4kc053-9"
|
|
521
|
+
})(["border-bottom:1px solid ", ";"], (0,themes_namespaceObject.pick)({
|
|
522
|
+
prisma: themes_namespaceObject.variables.contentColorActive,
|
|
523
|
+
enterprise: {
|
|
524
|
+
dark: themes_namespaceObject.variables.gray96,
|
|
525
|
+
light: themes_namespaceObject.variables.gray45
|
|
526
|
+
}
|
|
527
|
+
}));
|
|
528
|
+
var StyledSubmenu = external_styled_components_default().span.withConfig({
|
|
529
|
+
displayName: "ItemStyles__StyledSubmenu",
|
|
530
|
+
componentId: "sc-4kc053-10"
|
|
531
|
+
})(["float:right;padding-left:", ";color:", ";"], themes_namespaceObject.variables.spacingSmall, (0,themes_namespaceObject.pick)({
|
|
532
|
+
prisma: 'inherit',
|
|
533
|
+
enterprise: themes_namespaceObject.variables.textGray
|
|
534
|
+
}));
|
|
424
535
|
|
|
425
|
-
|
|
536
|
+
;// CONCATENATED MODULE: ./src/Select/SelectAllOptionStyles.ts
|
|
426
537
|
|
|
427
|
-
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; }
|
|
428
538
|
|
|
429
|
-
/* eslint-disable max-classes-per-file */
|
|
430
539
|
|
|
431
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
|
+
}));
|
|
432
552
|
|
|
553
|
+
;// CONCATENATED MODULE: ./src/Select/SelectAllOption.tsx
|
|
433
554
|
|
|
434
555
|
|
|
435
556
|
|
|
436
|
-
/** @public */
|
|
437
557
|
|
|
438
|
-
var
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
disabled: external_prop_types_default.a.bool,
|
|
448
|
-
elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]),
|
|
449
|
-
error: external_prop_types_default.a.bool,
|
|
450
|
-
filter: external_prop_types_default.a.oneOf([false, true, 'controlled']),
|
|
451
|
-
footerMessage: external_prop_types_default.a.node,
|
|
452
|
-
inline: external_prop_types_default.a.bool,
|
|
453
|
-
inputId: external_prop_types_default.a.string,
|
|
454
|
-
inputRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]),
|
|
455
|
-
isLoadingOptions: external_prop_types_default.a.bool,
|
|
456
|
-
labelledBy: external_prop_types_default.a.string,
|
|
457
|
-
labelText: external_prop_types_default.a.string,
|
|
458
|
-
loadingMessage: external_prop_types_default.a.node,
|
|
459
|
-
menuStyle: external_prop_types_default.a.object,
|
|
460
|
-
name: external_prop_types_default.a.string,
|
|
461
|
-
noOptionsMessage: external_prop_types_default.a.node,
|
|
462
|
-
onChange: external_prop_types_default.a.func,
|
|
463
|
-
onClose: external_prop_types_default.a.func,
|
|
464
|
-
onFilterChange: external_prop_types_default.a.func,
|
|
465
|
-
onOpen: external_prop_types_default.a.func,
|
|
466
|
-
onScroll: external_prop_types_default.a.func,
|
|
467
|
-
onScrollBottom: external_prop_types_default.a.func,
|
|
468
|
-
placeholder: external_prop_types_default.a.string,
|
|
469
|
-
prefixLabel: external_prop_types_default.a.string,
|
|
470
|
-
prepend: external_prop_types_default.a.bool,
|
|
471
|
-
suffixLabel: external_prop_types_default.a.string,
|
|
472
|
-
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])
|
|
473
|
-
};
|
|
474
|
-
var Select_defaultProps = {
|
|
475
|
-
allowKeyMatching: true,
|
|
476
|
-
animateLoading: false,
|
|
477
|
-
appearance: 'toggle',
|
|
478
|
-
append: false,
|
|
479
|
-
children: [],
|
|
480
|
-
defaultPlacement: 'vertical',
|
|
481
|
-
disabled: false,
|
|
482
|
-
error: false,
|
|
483
|
-
filter: false,
|
|
484
|
-
inline: true,
|
|
485
|
-
isLoadingOptions: false,
|
|
486
|
-
menuStyle: {},
|
|
487
|
-
noOptionsMessage: Object(i18n_["_"])('No matches'),
|
|
488
|
-
placeholder: Object(i18n_["_"])('Select...'),
|
|
489
|
-
prepend: false
|
|
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'])
|
|
490
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
|
|
491
614
|
|
|
492
|
-
var Select_Select = /*#__PURE__*/function (_Component) {
|
|
493
|
-
Select_inherits(Select, _Component);
|
|
494
|
-
|
|
495
|
-
var _super = Select_createSuper(Select);
|
|
496
|
-
|
|
497
|
-
// @docs-props-type SelectPropsBase
|
|
498
|
-
function Select(props) {
|
|
499
|
-
var _this;
|
|
500
|
-
|
|
501
|
-
Select_classCallCheck(this, Select);
|
|
502
615
|
|
|
503
|
-
_this = _super.call(this, props);
|
|
504
|
-
var state = {}; // wrap defaultValue in an array once to avoid failing <SelectBase>'s defaultValues comparison check
|
|
505
|
-
// using "has" to make sure that pre-4.3 behavior is preserved if a user explicitly passes "null" or "undefined"
|
|
506
616
|
|
|
507
|
-
if (has_default()(props, 'defaultValue')) {
|
|
508
|
-
if (props.defaultValue != null) {
|
|
509
|
-
state.defaultValues = [props.defaultValue];
|
|
510
|
-
} else {
|
|
511
|
-
state.defaultValues = [];
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
617
|
|
|
515
|
-
|
|
516
|
-
|
|
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)
|
|
517
684
|
}
|
|
685
|
+
}));
|
|
518
686
|
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
}, {
|
|
525
|
-
key: "render",
|
|
526
|
-
value: function render() {
|
|
527
|
-
var _this$props = this.props,
|
|
528
|
-
defaultValue = _this$props.defaultValue,
|
|
529
|
-
_onChange = _this$props.onChange,
|
|
530
|
-
value = _this$props.value,
|
|
531
|
-
otherProps = _objectWithoutProperties(_this$props, ["defaultValue", "onChange", "value"]);
|
|
532
|
-
|
|
533
|
-
var convertedProps = {
|
|
534
|
-
onChange: function onChange(e, _ref) {
|
|
535
|
-
var name = _ref.name,
|
|
536
|
-
values = _ref.values;
|
|
537
|
-
_onChange === null || _onChange === void 0 ? void 0 : _onChange(e, {
|
|
538
|
-
name: name,
|
|
539
|
-
value: values[0]
|
|
540
|
-
});
|
|
541
|
-
}
|
|
542
|
-
}; // using "has" as opposed to a null check to match SelectBase
|
|
543
|
-
|
|
544
|
-
if (has_default()(this.props, 'value')) {
|
|
545
|
-
if (value != null) {
|
|
546
|
-
convertedProps.values = [value];
|
|
547
|
-
} else {
|
|
548
|
-
convertedProps.values = [];
|
|
549
|
-
}
|
|
550
|
-
} else if (this.state.defaultValues != null) {
|
|
551
|
-
// using defaultValues from state in order to avoid wrapping defaultValue here
|
|
552
|
-
convertedProps.defaultValues = this.state.defaultValues;
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
return /*#__PURE__*/external_react_default.a.createElement(SelectBase["c" /* default */], Select_extends({}, otherProps, convertedProps, {
|
|
556
|
-
multiple: false
|
|
557
|
-
}));
|
|
558
|
-
}
|
|
559
|
-
}]);
|
|
560
|
-
|
|
561
|
-
return Select;
|
|
562
|
-
}(external_react_["Component"]);
|
|
563
|
-
|
|
564
|
-
Select_defineProperty(Select_Select, "propTypes", Select_propTypes);
|
|
565
|
-
|
|
566
|
-
Select_defineProperty(Select_Select, "defaultProps", Select_defaultProps);
|
|
567
|
-
|
|
568
|
-
Select_defineProperty(Select_Select, "Option", Select_Option);
|
|
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
|
+
};
|
|
569
692
|
|
|
570
|
-
|
|
693
|
+
var fuzzyMatch = function fuzzyMatch(options, matchChar) {
|
|
694
|
+
if (!options.length) {
|
|
695
|
+
return options;
|
|
696
|
+
}
|
|
571
697
|
|
|
572
|
-
|
|
698
|
+
var defaultMatch = null;
|
|
699
|
+
var hasMatch = false;
|
|
700
|
+
var matches = options.filter(function (option) {
|
|
701
|
+
var characterValue = charFromMatchOption(option, matchChar.index);
|
|
573
702
|
|
|
574
|
-
|
|
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.
|
|
575
708
|
|
|
576
|
-
// CONCATENATED MODULE: ./src/Select/index.ts
|
|
577
709
|
|
|
710
|
+
if (!hasMatch) {
|
|
711
|
+
var defaultValue = charFromMatchOption(defaultMatch, matchChar.index);
|
|
578
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
|
+
}
|
|
579
725
|
|
|
580
|
-
|
|
726
|
+
return false;
|
|
727
|
+
});
|
|
728
|
+
return matches.length === 0 && defaultMatch ? [defaultMatch] : matches;
|
|
729
|
+
};
|
|
581
730
|
|
|
582
|
-
/***/ 27:
|
|
583
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
584
731
|
|
|
585
|
-
|
|
586
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getDocument; });
|
|
587
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return ssrDocument; });
|
|
732
|
+
;// CONCATENATED MODULE: ./src/utils/ssrDocument.ts
|
|
588
733
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
589
734
|
var ssrDocument = {
|
|
590
735
|
body: {
|
|
@@ -647,649 +792,125 @@ function getDocument() {
|
|
|
647
792
|
}
|
|
648
793
|
|
|
649
794
|
|
|
795
|
+
;// CONCATENATED MODULE: ./src/utils/ssrWindow.ts
|
|
796
|
+
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
650
797
|
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
function
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
function
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
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); }
|
|
699
|
-
|
|
700
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
701
|
-
|
|
702
|
-
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); }; }
|
|
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 '';
|
|
828
|
+
}
|
|
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 {};
|
|
838
|
+
},
|
|
839
|
+
requestAnimationFrame: function requestAnimationFrame(callback) {
|
|
840
|
+
if (typeof setTimeout === 'undefined') {
|
|
841
|
+
callback();
|
|
842
|
+
return null;
|
|
843
|
+
}
|
|
703
844
|
|
|
704
|
-
|
|
845
|
+
return setTimeout(callback, 0);
|
|
846
|
+
},
|
|
847
|
+
cancelAnimationFrame: function cancelAnimationFrame(id) {
|
|
848
|
+
if (typeof setTimeout === 'undefined') {
|
|
849
|
+
return;
|
|
850
|
+
}
|
|
705
851
|
|
|
706
|
-
|
|
852
|
+
clearTimeout(id);
|
|
853
|
+
}
|
|
854
|
+
};
|
|
707
855
|
|
|
708
|
-
function
|
|
856
|
+
function getWindow() {
|
|
857
|
+
var win = typeof window !== 'undefined' ? window : ssrWindow;
|
|
858
|
+
return win;
|
|
859
|
+
}
|
|
709
860
|
|
|
710
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
711
861
|
|
|
712
|
-
|
|
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); }
|
|
713
864
|
|
|
865
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
714
866
|
|
|
867
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
715
868
|
|
|
869
|
+
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
716
870
|
|
|
717
|
-
|
|
718
|
-
/** @private */
|
|
719
|
-
active: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
|
|
720
|
-
children: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.node,
|
|
721
|
-
description: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,
|
|
722
|
-
descriptionPosition: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOf(['right', 'bottom']),
|
|
723
|
-
disabled: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
|
|
724
|
-
hidden: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
|
|
725
|
-
icon: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.node,
|
|
726
|
-
label: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string.isRequired,
|
|
871
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
727
872
|
|
|
728
|
-
|
|
729
|
-
* @private Passed down from <BaseSelect>
|
|
730
|
-
*/
|
|
731
|
-
multiple: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
|
|
732
|
-
matchRanges: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.shape({
|
|
733
|
-
start: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number.isRequired,
|
|
734
|
-
end: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number.isRequired
|
|
735
|
-
})),
|
|
873
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
736
874
|
|
|
737
|
-
|
|
738
|
-
onClick: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
|
|
875
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
739
876
|
|
|
740
|
-
|
|
741
|
-
selected: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
|
|
742
|
-
truncate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
|
|
743
|
-
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
|
|
744
|
-
};
|
|
745
|
-
var defaultProps = {
|
|
746
|
-
descriptionPosition: 'bottom',
|
|
747
|
-
disabled: false,
|
|
748
|
-
multiple: false,
|
|
749
|
-
selected: false,
|
|
750
|
-
truncate: false
|
|
751
|
-
};
|
|
877
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
752
878
|
|
|
753
|
-
|
|
754
|
-
* An option within a `Multiselect`. This inherits from
|
|
755
|
-
* [PureComponent](https://reactjs.org/docs/react-api.html#reactpurecomponent)
|
|
756
|
-
* so any elements passed to it must also be pure.
|
|
757
|
-
*/
|
|
758
|
-
var Option = /*#__PURE__*/function (_PureComponent) {
|
|
759
|
-
_inherits(Option, _PureComponent);
|
|
879
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
|
|
760
880
|
|
|
761
|
-
|
|
881
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
762
882
|
|
|
763
|
-
|
|
764
|
-
var _this;
|
|
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; }
|
|
765
884
|
|
|
766
|
-
|
|
885
|
+
function SelectBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
767
886
|
|
|
768
|
-
|
|
769
|
-
args[_key] = arguments[_key];
|
|
770
|
-
}
|
|
771
|
-
|
|
772
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
773
|
-
|
|
774
|
-
_defineProperty(_assertThisInitialized(_this), "c", null);
|
|
775
|
-
|
|
776
|
-
_defineProperty(_assertThisInitialized(_this), "handleClick", function (e) {
|
|
777
|
-
var _this$props = _this.props,
|
|
778
|
-
onClick = _this$props.onClick,
|
|
779
|
-
value = _this$props.value,
|
|
780
|
-
disabled = _this$props.disabled;
|
|
781
|
-
|
|
782
|
-
if (!disabled) {
|
|
783
|
-
onClick === null || onClick === void 0 ? void 0 : onClick(e, {
|
|
784
|
-
value: value
|
|
785
|
-
});
|
|
786
|
-
}
|
|
787
|
-
});
|
|
788
|
-
|
|
789
|
-
_defineProperty(_assertThisInitialized(_this), "handleMount", function (c) {
|
|
790
|
-
_this.c = c;
|
|
791
|
-
});
|
|
792
|
-
|
|
793
|
-
return _this;
|
|
794
|
-
}
|
|
795
|
-
|
|
796
|
-
_createClass(Option, [{
|
|
797
|
-
key: "scrollIntoViewIfNeeded",
|
|
798
|
-
value: function scrollIntoViewIfNeeded() {
|
|
799
|
-
var _this$c;
|
|
800
|
-
|
|
801
|
-
(_this$c = this.c) === null || _this$c === void 0 ? void 0 : _this$c.scrollIntoViewIfNeeded();
|
|
802
|
-
}
|
|
803
|
-
/**
|
|
804
|
-
* Place focus on the button.
|
|
805
|
-
*/
|
|
806
|
-
|
|
807
|
-
}, {
|
|
808
|
-
key: "focus",
|
|
809
|
-
value: function focus() {
|
|
810
|
-
var _this$c2;
|
|
811
|
-
|
|
812
|
-
(_this$c2 = this.c) === null || _this$c2 === void 0 ? void 0 : _this$c2.focus();
|
|
813
|
-
}
|
|
814
|
-
}, {
|
|
815
|
-
key: "render",
|
|
816
|
-
value: function render() {
|
|
817
|
-
var _this$props2 = this.props,
|
|
818
|
-
value = _this$props2.value,
|
|
819
|
-
children = _this$props2.children,
|
|
820
|
-
label = _this$props2.label,
|
|
821
|
-
multiple = _this$props2.multiple,
|
|
822
|
-
otherProps = _objectWithoutProperties(_this$props2, ["value", "children", "label", "multiple"]);
|
|
823
|
-
|
|
824
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_splunk_react_ui_Menu__WEBPACK_IMPORTED_MODULE_2__["Item"], _extends({
|
|
825
|
-
"aria-selected": this.props.selected,
|
|
826
|
-
"data-test-value": value,
|
|
827
|
-
"data-test": "option",
|
|
828
|
-
ref: this.handleMount
|
|
829
|
-
}, otherProps, {
|
|
830
|
-
selectable: true,
|
|
831
|
-
selectableAppearance: multiple ? 'checkbox' : undefined,
|
|
832
|
-
onClick: this.handleClick,
|
|
833
|
-
role: "option",
|
|
834
|
-
value: value.toString()
|
|
835
|
-
}), children || label);
|
|
836
|
-
}
|
|
837
|
-
}]);
|
|
838
|
-
|
|
839
|
-
return Option;
|
|
840
|
-
}(react__WEBPACK_IMPORTED_MODULE_0__["PureComponent"]);
|
|
841
|
-
|
|
842
|
-
_defineProperty(Option, "propTypes", propTypes);
|
|
843
|
-
|
|
844
|
-
_defineProperty(Option, "defaultProps", defaultProps);
|
|
845
|
-
|
|
846
|
-
_defineProperty(Option, "type", _splunk_react_ui_Menu__WEBPACK_IMPORTED_MODULE_2__["Item"]);
|
|
847
|
-
|
|
848
|
-
/* harmony default export */ __webpack_exports__["a"] = (Option);
|
|
849
|
-
|
|
850
|
-
/***/ }),
|
|
851
|
-
|
|
852
|
-
/***/ 38:
|
|
853
|
-
/***/ (function(module, exports) {
|
|
854
|
-
|
|
855
|
-
module.exports = require("lodash/isUndefined");
|
|
856
|
-
|
|
857
|
-
/***/ }),
|
|
858
|
-
|
|
859
|
-
/***/ 39:
|
|
860
|
-
/***/ (function(module, exports) {
|
|
861
|
-
|
|
862
|
-
module.exports = require("@splunk/react-ui/Link");
|
|
863
|
-
|
|
864
|
-
/***/ }),
|
|
865
|
-
|
|
866
|
-
/***/ 4:
|
|
867
|
-
/***/ (function(module, exports) {
|
|
868
|
-
|
|
869
|
-
module.exports = require("@splunk/ui-utils/i18n");
|
|
870
|
-
|
|
871
|
-
/***/ }),
|
|
872
|
-
|
|
873
|
-
/***/ 41:
|
|
874
|
-
/***/ (function(module, exports) {
|
|
875
|
-
|
|
876
|
-
module.exports = require("lodash/pick");
|
|
877
|
-
|
|
878
|
-
/***/ }),
|
|
879
|
-
|
|
880
|
-
/***/ 44:
|
|
881
|
-
/***/ (function(module, exports) {
|
|
882
|
-
|
|
883
|
-
module.exports = require("@splunk/react-ui/ResultsMenu");
|
|
884
|
-
|
|
885
|
-
/***/ }),
|
|
886
|
-
|
|
887
|
-
/***/ 46:
|
|
888
|
-
/***/ (function(module, exports) {
|
|
889
|
-
|
|
890
|
-
module.exports = require("@splunk/react-icons/Magnifier");
|
|
891
|
-
|
|
892
|
-
/***/ }),
|
|
893
|
-
|
|
894
|
-
/***/ 5:
|
|
895
|
-
/***/ (function(module, exports) {
|
|
896
|
-
|
|
897
|
-
module.exports = require("lodash/omit");
|
|
898
|
-
|
|
899
|
-
/***/ }),
|
|
900
|
-
|
|
901
|
-
/***/ 51:
|
|
902
|
-
/***/ (function(module, exports) {
|
|
903
|
-
|
|
904
|
-
module.exports = require("@splunk/react-icons/enterprise/Search");
|
|
905
|
-
|
|
906
|
-
/***/ }),
|
|
907
|
-
|
|
908
|
-
/***/ 52:
|
|
909
|
-
/***/ (function(module, exports) {
|
|
910
|
-
|
|
911
|
-
module.exports = require("lodash/find");
|
|
912
|
-
|
|
913
|
-
/***/ }),
|
|
914
|
-
|
|
915
|
-
/***/ 53:
|
|
916
|
-
/***/ (function(module, exports) {
|
|
917
|
-
|
|
918
|
-
module.exports = require("@splunk/react-icons/CaretSmallDown");
|
|
919
|
-
|
|
920
|
-
/***/ }),
|
|
921
|
-
|
|
922
|
-
/***/ 54:
|
|
923
|
-
/***/ (function(module, exports) {
|
|
924
|
-
|
|
925
|
-
module.exports = require("@splunk/react-icons/enterprise/Caret");
|
|
926
|
-
|
|
927
|
-
/***/ }),
|
|
928
|
-
|
|
929
|
-
/***/ 56:
|
|
930
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
931
|
-
|
|
932
|
-
"use strict";
|
|
933
|
-
/* unused harmony export charFromMatchOption */
|
|
934
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return fuzzyMatch; });
|
|
935
|
-
// A utility for matching keyboard characters to list values
|
|
936
|
-
var charFromMatchOption = function charFromMatchOption(option, charIndex) {
|
|
937
|
-
return option ? option.label.charAt(charIndex).toLowerCase() : '';
|
|
938
|
-
};
|
|
939
|
-
|
|
940
|
-
var fuzzyMatch = function fuzzyMatch(options, matchChar) {
|
|
941
|
-
if (!options.length) {
|
|
942
|
-
return options;
|
|
943
|
-
}
|
|
944
|
-
|
|
945
|
-
var defaultMatch = null;
|
|
946
|
-
var hasMatch = false;
|
|
947
|
-
var matches = options.filter(function (option) {
|
|
948
|
-
var characterValue = charFromMatchOption(option, matchChar.index);
|
|
949
|
-
|
|
950
|
-
if (characterValue === matchChar.value) {
|
|
951
|
-
hasMatch = true;
|
|
952
|
-
return true;
|
|
953
|
-
} // If we haven't found a match yet, keep track of the next closest match.
|
|
954
|
-
// Secondary matching looks for the closest character of a higher value, and failing that, closest of a lower value.
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
if (!hasMatch) {
|
|
958
|
-
var defaultValue = charFromMatchOption(defaultMatch, matchChar.index);
|
|
959
|
-
|
|
960
|
-
if (!defaultValue) {
|
|
961
|
-
defaultMatch = option;
|
|
962
|
-
} else if (characterValue > matchChar.value) {
|
|
963
|
-
if (defaultValue < matchChar.value) {
|
|
964
|
-
defaultMatch = option;
|
|
965
|
-
} else if (defaultValue > characterValue) {
|
|
966
|
-
defaultMatch = option;
|
|
967
|
-
}
|
|
968
|
-
} else if (characterValue > defaultValue) {
|
|
969
|
-
defaultMatch = option;
|
|
970
|
-
}
|
|
971
|
-
}
|
|
972
|
-
|
|
973
|
-
return false;
|
|
974
|
-
});
|
|
975
|
-
return matches.length === 0 && defaultMatch ? [defaultMatch] : matches;
|
|
976
|
-
};
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
/***/ }),
|
|
981
|
-
|
|
982
|
-
/***/ 59:
|
|
983
|
-
/***/ (function(module, exports) {
|
|
984
|
-
|
|
985
|
-
module.exports = require("lodash/without");
|
|
986
|
-
|
|
987
|
-
/***/ }),
|
|
988
|
-
|
|
989
|
-
/***/ 60:
|
|
990
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
991
|
-
|
|
992
|
-
"use strict";
|
|
993
|
-
|
|
994
|
-
// EXPORTS
|
|
995
|
-
__webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ Menu_["Divider"]; });
|
|
996
|
-
__webpack_require__.d(__webpack_exports__, "b", function() { return /* reexport */ Menu_["Heading"]; });
|
|
997
|
-
__webpack_require__.d(__webpack_exports__, "d", function() { return /* binding */ isOption; });
|
|
998
|
-
|
|
999
|
-
// UNUSED EXPORTS: Option
|
|
1000
|
-
|
|
1001
|
-
// EXTERNAL MODULE: external "react"
|
|
1002
|
-
var external_react_ = __webpack_require__(2);
|
|
1003
|
-
var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
|
|
1004
|
-
|
|
1005
|
-
// EXTERNAL MODULE: external "prop-types"
|
|
1006
|
-
var external_prop_types_ = __webpack_require__(1);
|
|
1007
|
-
var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
|
|
1008
|
-
|
|
1009
|
-
// EXTERNAL MODULE: external "lodash/castArray"
|
|
1010
|
-
var castArray_ = __webpack_require__(65);
|
|
1011
|
-
var castArray_default = /*#__PURE__*/__webpack_require__.n(castArray_);
|
|
1012
|
-
|
|
1013
|
-
// EXTERNAL MODULE: external "lodash/find"
|
|
1014
|
-
var find_ = __webpack_require__(52);
|
|
1015
|
-
var find_default = /*#__PURE__*/__webpack_require__.n(find_);
|
|
1016
|
-
|
|
1017
|
-
// EXTERNAL MODULE: external "lodash/forEachRight"
|
|
1018
|
-
var forEachRight_ = __webpack_require__(103);
|
|
1019
|
-
var forEachRight_default = /*#__PURE__*/__webpack_require__.n(forEachRight_);
|
|
1020
|
-
|
|
1021
|
-
// EXTERNAL MODULE: external "lodash/has"
|
|
1022
|
-
var has_ = __webpack_require__(11);
|
|
1023
|
-
var has_default = /*#__PURE__*/__webpack_require__.n(has_);
|
|
1024
|
-
|
|
1025
|
-
// EXTERNAL MODULE: external "lodash/includes"
|
|
1026
|
-
var includes_ = __webpack_require__(15);
|
|
1027
|
-
var includes_default = /*#__PURE__*/__webpack_require__.n(includes_);
|
|
1028
|
-
|
|
1029
|
-
// EXTERNAL MODULE: external "lodash/isUndefined"
|
|
1030
|
-
var isUndefined_ = __webpack_require__(38);
|
|
1031
|
-
var isUndefined_default = /*#__PURE__*/__webpack_require__.n(isUndefined_);
|
|
1032
|
-
|
|
1033
|
-
// EXTERNAL MODULE: external "lodash/keys"
|
|
1034
|
-
var keys_ = __webpack_require__(9);
|
|
1035
|
-
var keys_default = /*#__PURE__*/__webpack_require__.n(keys_);
|
|
1036
|
-
|
|
1037
|
-
// EXTERNAL MODULE: external "lodash/omit"
|
|
1038
|
-
var omit_ = __webpack_require__(5);
|
|
1039
|
-
var omit_default = /*#__PURE__*/__webpack_require__.n(omit_);
|
|
1040
|
-
|
|
1041
|
-
// EXTERNAL MODULE: external "lodash/pick"
|
|
1042
|
-
var pick_ = __webpack_require__(41);
|
|
1043
|
-
var pick_default = /*#__PURE__*/__webpack_require__.n(pick_);
|
|
1044
|
-
|
|
1045
|
-
// EXTERNAL MODULE: external "lodash/uniq"
|
|
1046
|
-
var uniq_ = __webpack_require__(104);
|
|
1047
|
-
var uniq_default = /*#__PURE__*/__webpack_require__.n(uniq_);
|
|
1048
|
-
|
|
1049
|
-
// EXTERNAL MODULE: external "lodash/without"
|
|
1050
|
-
var without_ = __webpack_require__(59);
|
|
1051
|
-
var without_default = /*#__PURE__*/__webpack_require__.n(without_);
|
|
1052
|
-
|
|
1053
|
-
// EXTERNAL MODULE: external "@splunk/ui-utils/id"
|
|
1054
|
-
var id_ = __webpack_require__(8);
|
|
1055
|
-
|
|
1056
|
-
// EXTERNAL MODULE: external "@splunk/react-ui/Menu"
|
|
1057
|
-
var Menu_ = __webpack_require__(13);
|
|
1058
|
-
|
|
1059
|
-
// EXTERNAL MODULE: external "@splunk/react-ui/Dropdown"
|
|
1060
|
-
var Dropdown_ = __webpack_require__(22);
|
|
1061
|
-
var Dropdown_default = /*#__PURE__*/__webpack_require__.n(Dropdown_);
|
|
1062
|
-
|
|
1063
|
-
// EXTERNAL MODULE: external "@splunk/ui-utils/keyboard"
|
|
1064
|
-
var keyboard_ = __webpack_require__(7);
|
|
1065
|
-
|
|
1066
|
-
// EXTERNAL MODULE: external "@splunk/ui-utils/filter"
|
|
1067
|
-
var filter_ = __webpack_require__(33);
|
|
1068
|
-
|
|
1069
|
-
// EXTERNAL MODULE: external "@splunk/react-ui/Link"
|
|
1070
|
-
var Link_ = __webpack_require__(39);
|
|
1071
|
-
var Link_default = /*#__PURE__*/__webpack_require__.n(Link_);
|
|
1072
|
-
|
|
1073
|
-
// EXTERNAL MODULE: external "@splunk/react-ui/ResultsMenu"
|
|
1074
|
-
var ResultsMenu_ = __webpack_require__(44);
|
|
1075
|
-
var ResultsMenu_default = /*#__PURE__*/__webpack_require__.n(ResultsMenu_);
|
|
1076
|
-
|
|
1077
|
-
// EXTERNAL MODULE: external "@splunk/react-ui/Text"
|
|
1078
|
-
var Text_ = __webpack_require__(30);
|
|
1079
|
-
var Text_default = /*#__PURE__*/__webpack_require__.n(Text_);
|
|
1080
|
-
|
|
1081
|
-
// EXTERNAL MODULE: external "@splunk/ui-utils/i18n"
|
|
1082
|
-
var i18n_ = __webpack_require__(4);
|
|
1083
|
-
|
|
1084
|
-
// EXTERNAL MODULE: external "@splunk/react-icons/CaretSmallDown"
|
|
1085
|
-
var CaretSmallDown_ = __webpack_require__(53);
|
|
1086
|
-
var CaretSmallDown_default = /*#__PURE__*/__webpack_require__.n(CaretSmallDown_);
|
|
1087
|
-
|
|
1088
|
-
// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/Caret"
|
|
1089
|
-
var Caret_ = __webpack_require__(54);
|
|
1090
|
-
var Caret_default = /*#__PURE__*/__webpack_require__.n(Caret_);
|
|
1091
|
-
|
|
1092
|
-
// EXTERNAL MODULE: external "@splunk/themes"
|
|
1093
|
-
var themes_ = __webpack_require__(0);
|
|
1094
|
-
|
|
1095
|
-
// CONCATENATED MODULE: ./src/Select/icons/CaretSmallDown.tsx
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
var CaretSmallDown_CaretSmallDownIcon = function CaretSmallDownIcon() {
|
|
1102
|
-
var _useSplunkTheme = Object(themes_["useSplunkTheme"])(),
|
|
1103
|
-
isEnterprise = _useSplunkTheme.isEnterprise;
|
|
1104
|
-
|
|
1105
|
-
var familyCaretSmallDownIcon = isEnterprise ? /*#__PURE__*/external_react_default.a.createElement(Caret_default.a, {
|
|
1106
|
-
screenReaderText: null,
|
|
1107
|
-
hideDefaultTooltip: true,
|
|
1108
|
-
size: 0.5
|
|
1109
|
-
}) : /*#__PURE__*/external_react_default.a.createElement(CaretSmallDown_default.a, null);
|
|
1110
|
-
return familyCaretSmallDownIcon;
|
|
1111
|
-
};
|
|
1112
|
-
|
|
1113
|
-
/* harmony default export */ var CaretSmallDown = (CaretSmallDown_CaretSmallDownIcon);
|
|
1114
|
-
// EXTERNAL MODULE: ./src/Select/OptionBase.tsx
|
|
1115
|
-
var OptionBase = __webpack_require__(36);
|
|
1116
|
-
|
|
1117
|
-
// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/Search"
|
|
1118
|
-
var Search_ = __webpack_require__(51);
|
|
1119
|
-
var Search_default = /*#__PURE__*/__webpack_require__.n(Search_);
|
|
1120
|
-
|
|
1121
|
-
// EXTERNAL MODULE: external "@splunk/react-icons/Magnifier"
|
|
1122
|
-
var Magnifier_ = __webpack_require__(46);
|
|
1123
|
-
var Magnifier_default = /*#__PURE__*/__webpack_require__.n(Magnifier_);
|
|
1124
|
-
|
|
1125
|
-
// CONCATENATED MODULE: ./src/Select/icons/Search.tsx
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
var Search_Search = function Search() {
|
|
1133
|
-
var _useSplunkTheme = Object(themes_["useSplunkTheme"])(),
|
|
1134
|
-
isEnterprise = _useSplunkTheme.isEnterprise,
|
|
1135
|
-
isCompact = _useSplunkTheme.isCompact;
|
|
1136
|
-
|
|
1137
|
-
var screenReaderText = Object(i18n_["_"])('Search');
|
|
1138
|
-
|
|
1139
|
-
var prismaSize = isCompact ? '20px' : '24px';
|
|
1140
|
-
var familyIcon = isEnterprise ? /*#__PURE__*/external_react_default.a.createElement(Search_default.a, {
|
|
1141
|
-
role: "presentation",
|
|
1142
|
-
size: "16px",
|
|
1143
|
-
screenReaderText: screenReaderText,
|
|
1144
|
-
hideDefaultTooltip: true
|
|
1145
|
-
}) : /*#__PURE__*/external_react_default.a.createElement(Magnifier_default.a, {
|
|
1146
|
-
role: "presentation",
|
|
1147
|
-
"aria-label": screenReaderText,
|
|
1148
|
-
width: prismaSize,
|
|
1149
|
-
height: prismaSize
|
|
1150
|
-
});
|
|
1151
|
-
return familyIcon;
|
|
1152
|
-
};
|
|
1153
|
-
|
|
1154
|
-
/* harmony default export */ var icons_Search = (Search_Search);
|
|
1155
|
-
// EXTERNAL MODULE: external "styled-components"
|
|
1156
|
-
var external_styled_components_ = __webpack_require__(3);
|
|
1157
|
-
var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_);
|
|
1158
|
-
|
|
1159
|
-
// EXTERNAL MODULE: external "@splunk/react-ui/Button"
|
|
1160
|
-
var Button_ = __webpack_require__(17);
|
|
1161
|
-
var Button_default = /*#__PURE__*/__webpack_require__.n(Button_);
|
|
1162
|
-
|
|
1163
|
-
// CONCATENATED MODULE: ./src/Select/SelectBaseStyles.ts
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
var StyledButton = external_styled_components_default()(Button_default.a).withConfig({
|
|
1169
|
-
displayName: "SelectBaseStyles__StyledButton",
|
|
1170
|
-
componentId: "sc-16cj7sk-0"
|
|
1171
|
-
})(["&[data-inline]{width:", ";}", ""], function (_ref) {
|
|
1172
|
-
var $multiple = _ref.$multiple;
|
|
1173
|
-
return $multiple ? '400px' : 'auto';
|
|
1174
|
-
}, function (_ref2) {
|
|
1175
|
-
var $multiple = _ref2.$multiple;
|
|
1176
|
-
return !$multiple && 'flex-grow: 0;';
|
|
1177
|
-
});
|
|
1178
|
-
var StyledLinkIcon = external_styled_components_default.a.span.withConfig({
|
|
1179
|
-
displayName: "SelectBaseStyles__StyledLinkIcon",
|
|
1180
|
-
componentId: "sc-16cj7sk-1"
|
|
1181
|
-
})(["padding-right:2px;"]);
|
|
1182
|
-
var StyledLinkCaret = external_styled_components_default.a.span.withConfig({
|
|
1183
|
-
displayName: "SelectBaseStyles__StyledLinkCaret",
|
|
1184
|
-
componentId: "sc-16cj7sk-2"
|
|
1185
|
-
})(["padding-left:2px;"]);
|
|
1186
|
-
var StyledFilter = external_styled_components_default.a.div.withConfig({
|
|
1187
|
-
displayName: "SelectBaseStyles__StyledFilter",
|
|
1188
|
-
componentId: "sc-16cj7sk-3"
|
|
1189
|
-
})(["padding:", ";min-width:160px;"], Object(themes_["pick"])({
|
|
1190
|
-
enterprise: '8px',
|
|
1191
|
-
prisma: '10px 16px'
|
|
1192
|
-
}));
|
|
1193
|
-
var StyledSearchIconWrapper = external_styled_components_default.a.span.withConfig({
|
|
1194
|
-
displayName: "SelectBaseStyles__StyledSearchIconWrapper",
|
|
1195
|
-
componentId: "sc-16cj7sk-4"
|
|
1196
|
-
})(["color:", ";pointer-events:none;padding:", ";"], Object(themes_["pick"])({
|
|
1197
|
-
enterprise: {
|
|
1198
|
-
light: themes_["variables"].gray60,
|
|
1199
|
-
dark: themes_["variables"].white
|
|
1200
|
-
},
|
|
1201
|
-
prisma: themes_["variables"].contentColorMuted
|
|
1202
|
-
}), Object(themes_["pick"])({
|
|
1203
|
-
comfortable: '0 8px',
|
|
1204
|
-
compact: '0 6px'
|
|
1205
|
-
}));
|
|
1206
|
-
var StyledCount = external_styled_components_default.a.span.withConfig({
|
|
1207
|
-
displayName: "SelectBaseStyles__StyledCount",
|
|
1208
|
-
componentId: "sc-16cj7sk-5"
|
|
1209
|
-
})(["padding-right:", ";"], Object(themes_["pick"])({
|
|
1210
|
-
enterprise: themes_["variables"].spacingQuarter,
|
|
1211
|
-
prisma: themes_["variables"].spacingXSmall
|
|
1212
|
-
}));
|
|
1213
|
-
var StyledControlsLink = external_styled_components_default()(Link_default.a).withConfig({
|
|
1214
|
-
displayName: "SelectBaseStyles__StyledControlsLink",
|
|
1215
|
-
componentId: "sc-16cj7sk-6"
|
|
1216
|
-
})(["", ";"], function (_ref3) {
|
|
1217
|
-
var $disabled = _ref3.$disabled;
|
|
1218
|
-
return $disabled && Object(external_styled_components_["css"])(["color:", ";"], themes_["variables"].contentColorDisabled);
|
|
1219
|
-
});
|
|
1220
|
-
var StyledToggleAllControls = external_styled_components_default.a.div.withConfig({
|
|
1221
|
-
displayName: "SelectBaseStyles__StyledToggleAllControls",
|
|
1222
|
-
componentId: "sc-16cj7sk-7"
|
|
1223
|
-
})(["padding:", ";", ""], Object(themes_["pick"])({
|
|
1224
|
-
enterprise: "5px 8px",
|
|
1225
|
-
prisma: '10px 16px'
|
|
1226
|
-
}), Object(themes_["pickVariant"])('$placement', {
|
|
1227
|
-
above: {
|
|
1228
|
-
enterprise: Object(external_styled_components_["css"])(["border-top:", ";"], themes_["variables"].border),
|
|
1229
|
-
prisma: Object(external_styled_components_["css"])(["border-top:1px solid ", ";"], themes_["variables"].neutral200)
|
|
1230
|
-
},
|
|
1231
|
-
below: {
|
|
1232
|
-
enterprise: Object(external_styled_components_["css"])(["border-bottom:", ";"], themes_["variables"].border),
|
|
1233
|
-
prisma: Object(external_styled_components_["css"])(["border-bottom:1px solid ", ";"], themes_["variables"].neutral200)
|
|
1234
|
-
}
|
|
1235
|
-
}));
|
|
1236
|
-
|
|
1237
|
-
// EXTERNAL MODULE: ./src/utils/fuzzyMatch.ts
|
|
1238
|
-
var fuzzyMatch = __webpack_require__(56);
|
|
1239
|
-
|
|
1240
|
-
// EXTERNAL MODULE: ./src/utils/ssrWindow.ts
|
|
1241
|
-
var ssrWindow = __webpack_require__(18);
|
|
1242
|
-
|
|
1243
|
-
// CONCATENATED MODULE: ./src/Select/SelectBase.tsx
|
|
1244
|
-
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); }
|
|
1245
|
-
|
|
1246
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
1247
|
-
|
|
1248
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
1249
|
-
|
|
1250
|
-
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
1251
|
-
|
|
1252
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
1253
|
-
|
|
1254
|
-
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; }
|
|
1255
|
-
|
|
1256
|
-
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) { _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; }
|
|
1257
|
-
|
|
1258
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
1259
|
-
|
|
1260
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
1261
|
-
|
|
1262
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
1263
|
-
|
|
1264
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
|
|
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); } }
|
|
1265
888
|
|
|
1266
|
-
function
|
|
889
|
+
function SelectBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) SelectBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) SelectBase_defineProperties(Constructor, staticProps); return Constructor; }
|
|
1267
890
|
|
|
1268
|
-
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); }
|
|
1269
892
|
|
|
1270
|
-
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); }
|
|
1271
894
|
|
|
1272
|
-
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); }; }
|
|
1273
896
|
|
|
1274
|
-
function
|
|
897
|
+
function SelectBase_possibleConstructorReturn(self, call) { if (call && (SelectBase_typeof(call) === "object" || typeof call === "function")) { return call; } return SelectBase_assertThisInitialized(self); }
|
|
1275
898
|
|
|
1276
|
-
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; }
|
|
1277
900
|
|
|
1278
|
-
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; } }
|
|
1279
902
|
|
|
1280
|
-
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); }
|
|
1281
904
|
|
|
1282
|
-
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); }
|
|
1283
906
|
|
|
1284
|
-
function
|
|
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; }
|
|
1285
908
|
|
|
1286
|
-
function
|
|
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; }
|
|
1287
910
|
|
|
1288
|
-
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; }
|
|
1289
912
|
|
|
1290
|
-
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; }
|
|
1291
913
|
|
|
1292
|
-
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); }
|
|
1293
914
|
|
|
1294
915
|
|
|
1295
916
|
|
|
@@ -1319,51 +940,52 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1319
940
|
|
|
1320
941
|
|
|
1321
942
|
|
|
1322
|
-
var
|
|
1323
|
-
allowKeyMatching: external_prop_types_default.
|
|
1324
|
-
allowNewValues: external_prop_types_default.
|
|
1325
|
-
animateLoading: external_prop_types_default.
|
|
1326
|
-
appearance: external_prop_types_default.
|
|
1327
|
-
append: external_prop_types_default.
|
|
1328
|
-
children: external_prop_types_default.
|
|
1329
|
-
defaultPlacement: external_prop_types_default.
|
|
1330
|
-
defaultValues: external_prop_types_default.
|
|
1331
|
-
describedBy: external_prop_types_default.
|
|
1332
|
-
disabled: external_prop_types_default.
|
|
1333
|
-
elementRef: external_prop_types_default.
|
|
1334
|
-
error: external_prop_types_default.
|
|
1335
|
-
filter: external_prop_types_default.
|
|
1336
|
-
footerMessage: external_prop_types_default.
|
|
1337
|
-
inline: external_prop_types_default.
|
|
1338
|
-
inputId: external_prop_types_default.
|
|
1339
|
-
inputRef: external_prop_types_default.
|
|
1340
|
-
isLoadingOptions: external_prop_types_default.
|
|
1341
|
-
labelledBy: external_prop_types_default.
|
|
1342
|
-
labelText: external_prop_types_default.
|
|
1343
|
-
loadingMessage: external_prop_types_default.
|
|
1344
|
-
menuStyle: external_prop_types_default.
|
|
1345
|
-
multiple: external_prop_types_default.
|
|
1346
|
-
name: external_prop_types_default.
|
|
1347
|
-
noOptionsMessage: external_prop_types_default.
|
|
1348
|
-
onChange: external_prop_types_default.
|
|
1349
|
-
onClose: external_prop_types_default.
|
|
1350
|
-
onFilterChange: external_prop_types_default.
|
|
1351
|
-
onOpen: external_prop_types_default.
|
|
1352
|
-
onScroll: external_prop_types_default.
|
|
1353
|
-
onScrollBottom: external_prop_types_default.
|
|
943
|
+
var SelectBase_propTypes = {
|
|
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,
|
|
1354
975
|
|
|
1355
976
|
/** @private. */
|
|
1356
|
-
required: external_prop_types_default.
|
|
1357
|
-
placeholder: external_prop_types_default.
|
|
1358
|
-
prefixLabel: external_prop_types_default.
|
|
1359
|
-
prepend: external_prop_types_default.
|
|
1360
|
-
repositionMode: external_prop_types_default.
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
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
|
|
1365
987
|
};
|
|
1366
|
-
var
|
|
988
|
+
var SelectBase_defaultProps = {
|
|
1367
989
|
allowKeyMatching: true,
|
|
1368
990
|
allowNewValues: false,
|
|
1369
991
|
animateLoading: false,
|
|
@@ -1376,27 +998,44 @@ var defaultProps = {
|
|
|
1376
998
|
isLoadingOptions: false,
|
|
1377
999
|
menuStyle: {},
|
|
1378
1000
|
multiple: false,
|
|
1379
|
-
noOptionsMessage:
|
|
1380
|
-
placeholder:
|
|
1001
|
+
noOptionsMessage: (0,i18n_namespaceObject._)('No matches'),
|
|
1002
|
+
placeholder: (0,i18n_namespaceObject._)('Select...'),
|
|
1381
1003
|
prepend: false,
|
|
1382
1004
|
repositionMode: 'flip',
|
|
1005
|
+
selectAllAppearance: 'buttongroup',
|
|
1383
1006
|
tabConfirmsNewValue: false
|
|
1384
1007
|
};
|
|
1008
|
+
var getLabelFromPlaceholder = memoize_default()(function (placeholder) {
|
|
1009
|
+
return [placeholder];
|
|
1010
|
+
}); // preserve separate widths for single vs. multi mode
|
|
1011
|
+
|
|
1012
|
+
var getInlineMenuStyle = memoize_default()(function (_ref) {
|
|
1013
|
+
var anchorWidth = _ref.anchorWidth,
|
|
1014
|
+
isMultiple = _ref.isMultiple,
|
|
1015
|
+
menuStyle = _ref.menuStyle;
|
|
1016
|
+
return isMultiple ? _objectSpread({
|
|
1017
|
+
width: Math.max(anchorWidth !== null && anchorWidth !== void 0 ? anchorWidth : 0, 200)
|
|
1018
|
+
}, menuStyle) : _objectSpread({
|
|
1019
|
+
minWidth: anchorWidth !== null && anchorWidth !== void 0 ? anchorWidth : undefined,
|
|
1020
|
+
maxWidth: Math.max(anchorWidth !== null && anchorWidth !== void 0 ? anchorWidth : 0, 300)
|
|
1021
|
+
}, menuStyle);
|
|
1022
|
+
});
|
|
1023
|
+
var dropdownCloseReasons = ['clickAway', 'escapeKey', 'offScreen', 'tabKey', 'toggleClick'];
|
|
1385
1024
|
|
|
1386
1025
|
function isOption(child) {
|
|
1387
1026
|
return child && has_default()(child.props, 'value');
|
|
1388
1027
|
}
|
|
1389
1028
|
|
|
1390
1029
|
function itemKeyFromValueLabel(value, label) {
|
|
1391
|
-
return "".concat(
|
|
1030
|
+
return "".concat(SelectBase_typeof(value), "-").concat(value, "-").concat(label);
|
|
1392
1031
|
}
|
|
1393
1032
|
|
|
1394
|
-
var
|
|
1395
|
-
|
|
1033
|
+
var SelectBase = /*#__PURE__*/function (_Component) {
|
|
1034
|
+
SelectBase_inherits(SelectBase, _Component);
|
|
1396
1035
|
|
|
1397
|
-
var _super =
|
|
1036
|
+
var _super = SelectBase_createSuper(SelectBase);
|
|
1398
1037
|
|
|
1399
|
-
|
|
1038
|
+
SelectBase_createClass(SelectBase, null, [{
|
|
1400
1039
|
key: "validateAppearance",
|
|
1401
1040
|
// @docs-props-type CompactPropsBase
|
|
1402
1041
|
value: function validateAppearance(props) {
|
|
@@ -1407,43 +1046,45 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
1407
1046
|
function SelectBase(props) {
|
|
1408
1047
|
var _this;
|
|
1409
1048
|
|
|
1410
|
-
|
|
1049
|
+
SelectBase_classCallCheck(this, SelectBase);
|
|
1411
1050
|
|
|
1412
1051
|
_this = _super.call(this, props);
|
|
1413
1052
|
|
|
1414
|
-
|
|
1053
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "activeItemId", void 0);
|
|
1415
1054
|
|
|
1416
|
-
|
|
1055
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "activeValue", void 0);
|
|
1417
1056
|
|
|
1418
|
-
|
|
1057
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "availableOptionCount", void 0);
|
|
1419
1058
|
|
|
1420
|
-
|
|
1059
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "controlledExternally", void 0);
|
|
1421
1060
|
|
|
1422
|
-
|
|
1061
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "displayedValues", void 0);
|
|
1423
1062
|
|
|
1424
|
-
|
|
1063
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "dropdown", null);
|
|
1425
1064
|
|
|
1426
|
-
|
|
1065
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "firstSelectedEnabledOption", null);
|
|
1427
1066
|
|
|
1428
|
-
|
|
1067
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "firstSelectedOptionIndex", void 0);
|
|
1429
1068
|
|
|
1430
|
-
|
|
1069
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "menuId", void 0);
|
|
1431
1070
|
|
|
1432
|
-
|
|
1071
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "previousActiveIndex", null);
|
|
1433
1072
|
|
|
1434
|
-
|
|
1073
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "selectedOptionCount", void 0);
|
|
1435
1074
|
|
|
1436
|
-
|
|
1075
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "optionRefsByKey", void 0);
|
|
1437
1076
|
|
|
1438
|
-
|
|
1077
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "matchCharacter", void 0);
|
|
1439
1078
|
|
|
1440
|
-
|
|
1079
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "matchTimeout", void 0);
|
|
1441
1080
|
|
|
1442
|
-
|
|
1081
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "currentMatchOptions", void 0);
|
|
1443
1082
|
|
|
1444
|
-
|
|
1083
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "availableMatchOptions", void 0);
|
|
1445
1084
|
|
|
1446
|
-
|
|
1085
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "optionSelection", void 0);
|
|
1086
|
+
|
|
1087
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "resetMatches", function () {
|
|
1447
1088
|
_this.matchCharacter = null;
|
|
1448
1089
|
_this.currentMatchOptions = [];
|
|
1449
1090
|
|
|
@@ -1452,7 +1093,7 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
1452
1093
|
}
|
|
1453
1094
|
});
|
|
1454
1095
|
|
|
1455
|
-
|
|
1096
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "handleSelectAll", function (e) {
|
|
1456
1097
|
var _this$getCurrentValue, _this$props$onChange, _this$props2;
|
|
1457
1098
|
|
|
1458
1099
|
var _this$props = _this.props,
|
|
@@ -1466,7 +1107,7 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
1466
1107
|
|
|
1467
1108
|
var currentValues = (_this$getCurrentValue = _this.getCurrentValues()) !== null && _this$getCurrentValue !== void 0 ? _this$getCurrentValue : [];
|
|
1468
1109
|
var values = uniq_default()(currentValues.concat(_this.displayedValues));
|
|
1469
|
-
values = external_react_default.
|
|
1110
|
+
values = external_react_default().Children.toArray(children).filter(function (child) {
|
|
1470
1111
|
return isOption(child) && includes_default()(values, child.props.value) && (!child.props.disabled || includes_default()(currentValues, child.props.value));
|
|
1471
1112
|
}).map(function (child) {
|
|
1472
1113
|
return child.props.value;
|
|
@@ -1480,11 +1121,12 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
1480
1121
|
|
|
1481
1122
|
(_this$props$onChange = (_this$props2 = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props2, e, {
|
|
1482
1123
|
values: values,
|
|
1483
|
-
name: name
|
|
1124
|
+
name: name,
|
|
1125
|
+
reason: 'selectAll'
|
|
1484
1126
|
});
|
|
1485
1127
|
});
|
|
1486
1128
|
|
|
1487
|
-
|
|
1129
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "handleClearAll", function (e) {
|
|
1488
1130
|
var _this$getCurrentValue2, _this$props$onChange2, _this$props4;
|
|
1489
1131
|
|
|
1490
1132
|
var _this$props3 = _this.props,
|
|
@@ -1497,9 +1139,9 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
1497
1139
|
}
|
|
1498
1140
|
|
|
1499
1141
|
var currentValues = (_this$getCurrentValue2 = _this.getCurrentValues()) !== null && _this$getCurrentValue2 !== void 0 ? _this$getCurrentValue2 : [];
|
|
1500
|
-
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
|
|
1501
1143
|
|
|
1502
|
-
var values = external_react_default.
|
|
1144
|
+
var values = external_react_default().Children.toArray(children).filter(function (child) {
|
|
1503
1145
|
return isOption(child) && (includes_default()(currentValues, child.props.value) && child.props.disabled || includes_default()(hiddenCurrentValues, child.props.value));
|
|
1504
1146
|
}).map(function (child) {
|
|
1505
1147
|
return child.props.value;
|
|
@@ -1513,16 +1155,17 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
1513
1155
|
|
|
1514
1156
|
(_this$props$onChange2 = (_this$props4 = _this.props).onChange) === null || _this$props$onChange2 === void 0 ? void 0 : _this$props$onChange2.call(_this$props4, e, {
|
|
1515
1157
|
values: values,
|
|
1516
|
-
name: name
|
|
1158
|
+
name: name,
|
|
1159
|
+
reason: 'clearAll'
|
|
1517
1160
|
});
|
|
1518
1161
|
});
|
|
1519
1162
|
|
|
1520
|
-
|
|
1163
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "handleTextKeyDown", function (e) {
|
|
1521
1164
|
var _this$props5 = _this.props,
|
|
1522
1165
|
children = _this$props5.children,
|
|
1523
1166
|
onScrollBottom = _this$props5.onScrollBottom,
|
|
1524
1167
|
tabConfirmsNewValue = _this$props5.tabConfirmsNewValue;
|
|
1525
|
-
var eventKeyCode =
|
|
1168
|
+
var eventKeyCode = (0,keyboard_namespaceObject.keycode)(e.nativeEvent);
|
|
1526
1169
|
|
|
1527
1170
|
if (eventKeyCode === 'tab') {
|
|
1528
1171
|
if (tabConfirmsNewValue && !isUndefined_default()(_this.activeValue) && _this.availableOptionCount <= 1) {
|
|
@@ -1533,6 +1176,15 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
1533
1176
|
}
|
|
1534
1177
|
|
|
1535
1178
|
if (e.shiftKey || e.metaKey || e.ctrlKey) {
|
|
1179
|
+
if (eventKeyCode === 'a' && (e.ctrlKey || e.metaKey)) {
|
|
1180
|
+
// handle control + A
|
|
1181
|
+
if (_this.optionSelection === 'all') {
|
|
1182
|
+
_this.handleClearAll(e);
|
|
1183
|
+
} else {
|
|
1184
|
+
_this.handleSelectAll(e);
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1536
1188
|
return;
|
|
1537
1189
|
}
|
|
1538
1190
|
|
|
@@ -1541,14 +1193,14 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
1541
1193
|
|
|
1542
1194
|
_this.setState(function (state) {
|
|
1543
1195
|
return {
|
|
1544
|
-
activeIndex: Math.min(state.activeIndex + 1, _this.availableOptionCount - 1)
|
|
1196
|
+
activeIndex: Math.min(state.activeIndex + 1, _this.props.selectAllAppearance === 'checkbox' ? _this.availableOptionCount : _this.availableOptionCount - 1)
|
|
1545
1197
|
};
|
|
1546
1198
|
});
|
|
1547
1199
|
|
|
1548
1200
|
if (children && onScrollBottom) {
|
|
1549
1201
|
var _this$getCurrentValue3;
|
|
1550
1202
|
|
|
1551
|
-
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);
|
|
1552
1204
|
|
|
1553
1205
|
if (_this.state.activeIndex === beforeLastChild) {
|
|
1554
1206
|
_this.handleScrollBottom(e);
|
|
@@ -1567,14 +1219,22 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
1567
1219
|
}
|
|
1568
1220
|
|
|
1569
1221
|
if (eventKeyCode === 'enter' && !isUndefined_default()(_this.activeValue) && _this.state.open) {
|
|
1570
|
-
|
|
1222
|
+
if (_this.activeValue === 'selectAll') {
|
|
1223
|
+
if (_this.optionSelection === 'all') {
|
|
1224
|
+
_this.handleClearAll(e);
|
|
1225
|
+
} else {
|
|
1226
|
+
_this.handleSelectAll(e);
|
|
1227
|
+
}
|
|
1228
|
+
} else {
|
|
1229
|
+
e.preventDefault();
|
|
1571
1230
|
|
|
1572
|
-
|
|
1231
|
+
_this.toggleValue(e, _this.activeValue);
|
|
1232
|
+
}
|
|
1573
1233
|
}
|
|
1574
1234
|
});
|
|
1575
1235
|
|
|
1576
|
-
|
|
1577
|
-
var value =
|
|
1236
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "handleMenuOptionClick", function (e, _ref2) {
|
|
1237
|
+
var value = _ref2.value;
|
|
1578
1238
|
e.preventDefault();
|
|
1579
1239
|
|
|
1580
1240
|
if (!_this.state.open) {
|
|
@@ -1584,7 +1244,7 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
1584
1244
|
_this.toggleValue(e, value);
|
|
1585
1245
|
});
|
|
1586
1246
|
|
|
1587
|
-
|
|
1247
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "handleMenuOptionKeyDown", function (e, optionIndex) {
|
|
1588
1248
|
var currentKey = e.nativeEvent.key; // Checking for a single character to avoid complications from double-byte languages and emojis.
|
|
1589
1249
|
|
|
1590
1250
|
if (currentKey.length === 1) {
|
|
@@ -1601,10 +1261,10 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
1601
1261
|
return;
|
|
1602
1262
|
}
|
|
1603
1263
|
|
|
1604
|
-
matches =
|
|
1264
|
+
matches = fuzzyMatch(_this.availableMatchOptions, character);
|
|
1605
1265
|
} else if (_this.currentMatchOptions.length > 1) {
|
|
1606
1266
|
character.index = _this.matchCharacter.index + 1;
|
|
1607
|
-
matches =
|
|
1267
|
+
matches = fuzzyMatch(_this.currentMatchOptions, character);
|
|
1608
1268
|
}
|
|
1609
1269
|
|
|
1610
1270
|
if (matches.length) {
|
|
@@ -1642,10 +1302,10 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
1642
1302
|
}
|
|
1643
1303
|
});
|
|
1644
1304
|
|
|
1645
|
-
|
|
1305
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "handleTextChange", function (e, _ref3) {
|
|
1646
1306
|
var _this$props$onFilterC, _this$props6;
|
|
1647
1307
|
|
|
1648
|
-
var value =
|
|
1308
|
+
var value = _ref3.value;
|
|
1649
1309
|
|
|
1650
1310
|
_this.setState({
|
|
1651
1311
|
filterKeyword: value,
|
|
@@ -1658,19 +1318,19 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
1658
1318
|
});
|
|
1659
1319
|
});
|
|
1660
1320
|
|
|
1661
|
-
|
|
1321
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "handleTextFocus", function () {
|
|
1662
1322
|
_this.setState({
|
|
1663
1323
|
textHasFocus: true
|
|
1664
1324
|
});
|
|
1665
1325
|
});
|
|
1666
1326
|
|
|
1667
|
-
|
|
1327
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "handleTextBlur", function () {
|
|
1668
1328
|
_this.setState({
|
|
1669
1329
|
textHasFocus: false
|
|
1670
1330
|
});
|
|
1671
1331
|
});
|
|
1672
1332
|
|
|
1673
|
-
|
|
1333
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "handleRequestOpen", function (e) {
|
|
1674
1334
|
var newState = {
|
|
1675
1335
|
open: true,
|
|
1676
1336
|
topValues: _this.getTopValues()
|
|
@@ -1707,7 +1367,7 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
1707
1367
|
});
|
|
1708
1368
|
});
|
|
1709
1369
|
|
|
1710
|
-
|
|
1370
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "handleRequestClose", function () {
|
|
1711
1371
|
_this.setState({
|
|
1712
1372
|
open: false,
|
|
1713
1373
|
activeIndex: 0
|
|
@@ -1719,7 +1379,7 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
1719
1379
|
});
|
|
1720
1380
|
});
|
|
1721
1381
|
|
|
1722
|
-
|
|
1382
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "handleScrollBottom", function (e) {
|
|
1723
1383
|
if (_this.state.open && !_this.props.isLoadingOptions) {
|
|
1724
1384
|
var _this$props$onScrollB, _this$props10;
|
|
1725
1385
|
|
|
@@ -1727,13 +1387,13 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
1727
1387
|
}
|
|
1728
1388
|
});
|
|
1729
1389
|
|
|
1730
|
-
|
|
1390
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "handleActiveOptionMount", function (c) {
|
|
1731
1391
|
if (_this.previousActiveIndex !== _this.state.activeIndex) {
|
|
1732
1392
|
c === null || c === void 0 ? void 0 : c.scrollIntoViewIfNeeded();
|
|
1733
1393
|
}
|
|
1734
1394
|
});
|
|
1735
1395
|
|
|
1736
|
-
|
|
1396
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "handleOptionMount", function (c, itemKey, isFirst) {
|
|
1737
1397
|
if (isFirst) {
|
|
1738
1398
|
_this.firstSelectedEnabledOption = c;
|
|
1739
1399
|
}
|
|
@@ -1745,7 +1405,7 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
1745
1405
|
}
|
|
1746
1406
|
});
|
|
1747
1407
|
|
|
1748
|
-
|
|
1408
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "createToggle", function () {
|
|
1749
1409
|
var _this$getCurrentValue4;
|
|
1750
1410
|
|
|
1751
1411
|
var _this$props11 = _this.props,
|
|
@@ -1768,7 +1428,7 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
1768
1428
|
var label; // Generate buttonLabels
|
|
1769
1429
|
|
|
1770
1430
|
var currentValues = (_this$getCurrentValue4 = _this.getCurrentValues()) !== null && _this$getCurrentValue4 !== void 0 ? _this$getCurrentValue4 : [];
|
|
1771
|
-
var childrenArray =
|
|
1431
|
+
var childrenArray = external_react_namespaceObject.Children.toArray(children);
|
|
1772
1432
|
var valuesLabel = currentValues.reduce(function (acc, value, index, orig) {
|
|
1773
1433
|
var matchedItem = find_default()(childrenArray, function (item) {
|
|
1774
1434
|
return isOption(item) && item.props.value === value;
|
|
@@ -1786,7 +1446,7 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
1786
1446
|
}
|
|
1787
1447
|
|
|
1788
1448
|
if (index < orig.length - 1) {
|
|
1789
|
-
acc.push(
|
|
1449
|
+
acc.push((0,i18n_namespaceObject._)(', '));
|
|
1790
1450
|
}
|
|
1791
1451
|
|
|
1792
1452
|
return acc;
|
|
@@ -1806,7 +1466,7 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
1806
1466
|
if (label.length === 0 || !multiple && label.every(function (labelNode) {
|
|
1807
1467
|
return labelNode === '';
|
|
1808
1468
|
})) {
|
|
1809
|
-
label =
|
|
1469
|
+
label = getLabelFromPlaceholder(placeholder);
|
|
1810
1470
|
}
|
|
1811
1471
|
|
|
1812
1472
|
var ariaLabel = label; // If there's more than one item selected, read out the selected total
|
|
@@ -1843,16 +1503,16 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
1843
1503
|
}
|
|
1844
1504
|
|
|
1845
1505
|
if (toggle) {
|
|
1846
|
-
return /*#__PURE__*/
|
|
1506
|
+
return /*#__PURE__*/(0,external_react_namespaceObject.cloneElement)(toggle, commonProps);
|
|
1847
1507
|
}
|
|
1848
1508
|
|
|
1849
1509
|
if (appearance === 'link') {
|
|
1850
|
-
return /*#__PURE__*/external_react_default.
|
|
1510
|
+
return /*#__PURE__*/external_react_default().createElement((Link_default()), SelectBase_extends({}, commonProps, {
|
|
1851
1511
|
"data-select-appearance": "link"
|
|
1852
|
-
}), !!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)));
|
|
1853
1513
|
}
|
|
1854
1514
|
|
|
1855
|
-
return /*#__PURE__*/external_react_default.
|
|
1515
|
+
return /*#__PURE__*/external_react_default().createElement(StyledButton, SelectBase_extends({}, commonProps, {
|
|
1856
1516
|
$multiple: multiple,
|
|
1857
1517
|
appearance: appearance,
|
|
1858
1518
|
label: label,
|
|
@@ -1864,12 +1524,12 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
1864
1524
|
"aria-owns": _this.menuId // @ts-expect-error - accept inconsistency with Button
|
|
1865
1525
|
,
|
|
1866
1526
|
onClick: _this.props.onClick
|
|
1867
|
-
}, 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, {
|
|
1868
1528
|
"data-role": "count"
|
|
1869
1529
|
}, "(", currentValues.length, ")"));
|
|
1870
1530
|
});
|
|
1871
1531
|
|
|
1872
|
-
|
|
1532
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "createChildren", function () {
|
|
1873
1533
|
var _this$state = _this.state,
|
|
1874
1534
|
filterKeyword = _this$state.filterKeyword,
|
|
1875
1535
|
textHasFocus = _this$state.textHasFocus,
|
|
@@ -1879,6 +1539,7 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
1879
1539
|
allowNewValues = _this$props12.allowNewValues,
|
|
1880
1540
|
filter = _this$props12.filter,
|
|
1881
1541
|
multiple = _this$props12.multiple,
|
|
1542
|
+
selectAllAppearance = _this$props12.selectAllAppearance,
|
|
1882
1543
|
showSelectedValuesFirst = _this$props12.showSelectedValuesFirst,
|
|
1883
1544
|
isLoadingOptions = _this$props12.isLoadingOptions,
|
|
1884
1545
|
onScrollBottom = _this$props12.onScrollBottom;
|
|
@@ -1896,7 +1557,7 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
1896
1557
|
|
|
1897
1558
|
var foundSelectedAndEnabled;
|
|
1898
1559
|
var topValues = showSelectedValuesFirst === 'immediately' ? _this.getTopValues() : topValuesState;
|
|
1899
|
-
var children =
|
|
1560
|
+
var children = external_react_namespaceObject.Children.toArray(_this.props.children).reduce(function (acc, item, i) {
|
|
1900
1561
|
// ignore Headings and Dividers
|
|
1901
1562
|
if (!isOption(item)) {
|
|
1902
1563
|
acc.push(item);
|
|
@@ -1924,7 +1585,7 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
1924
1585
|
} // Format the Menu.Item
|
|
1925
1586
|
|
|
1926
1587
|
|
|
1927
|
-
var clonedItem = /*#__PURE__*/
|
|
1588
|
+
var clonedItem = /*#__PURE__*/(0,external_react_namespaceObject.cloneElement)(item, {
|
|
1928
1589
|
key: item.key || i,
|
|
1929
1590
|
onClick: _this.handleMenuOptionClick,
|
|
1930
1591
|
onKeyDown: useMatchOptions ? function (e) {
|
|
@@ -1944,7 +1605,7 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
1944
1605
|
|
|
1945
1606
|
if (topValues && topValues.indexOf(item.props.value) >= 0) {
|
|
1946
1607
|
if (childrenTopCount === 0) {
|
|
1947
|
-
acc.splice(childrenTopCount, 0, /*#__PURE__*/external_react_default.
|
|
1608
|
+
acc.splice(childrenTopCount, 0, /*#__PURE__*/external_react_default().createElement(Menu_namespaceObject.Divider, {
|
|
1948
1609
|
key: "topDivider"
|
|
1949
1610
|
}));
|
|
1950
1611
|
hasDivider = true;
|
|
@@ -1974,14 +1635,14 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
1974
1635
|
var topLength = topValues.length;
|
|
1975
1636
|
|
|
1976
1637
|
if (childrenTopCount === 0) {
|
|
1977
|
-
children.splice(0, 0, /*#__PURE__*/external_react_default.
|
|
1638
|
+
children.splice(0, 0, /*#__PURE__*/external_react_default().createElement(Menu_namespaceObject.Divider, {
|
|
1978
1639
|
key: "topDivider"
|
|
1979
1640
|
}));
|
|
1980
1641
|
childrenTopCount += 1;
|
|
1981
1642
|
hasDivider = true;
|
|
1982
1643
|
}
|
|
1983
1644
|
|
|
1984
|
-
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, {
|
|
1985
1646
|
label: String(value),
|
|
1986
1647
|
value: value,
|
|
1987
1648
|
key: "missing-value-".concat(value),
|
|
@@ -1999,10 +1660,10 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
1999
1660
|
|
|
2000
1661
|
var controlledFilter = filter === 'controlled'; // Filter the items
|
|
2001
1662
|
|
|
2002
|
-
var keywords =
|
|
1663
|
+
var keywords = (0,filter_namespaceObject.stringToKeywords)(filterKeyword);
|
|
2003
1664
|
children = controlledFilter ? children : children.filter(function (option) {
|
|
2004
1665
|
if (isOption(option)) {
|
|
2005
|
-
return
|
|
1666
|
+
return (0,filter_namespaceObject.testPhrase)(option.props.label, keywords);
|
|
2006
1667
|
}
|
|
2007
1668
|
|
|
2008
1669
|
return true; // Keep all headers and non-interactive options
|
|
@@ -2013,24 +1674,27 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2013
1674
|
} // highlight matched text
|
|
2014
1675
|
|
|
2015
1676
|
|
|
2016
|
-
var matchRanges = keywords &&
|
|
2017
|
-
return /*#__PURE__*/
|
|
1677
|
+
var matchRanges = keywords && (0,filter_namespaceObject.keywordLocations)(option.props.label, keywords);
|
|
1678
|
+
return /*#__PURE__*/(0,external_react_namespaceObject.cloneElement)(option, {
|
|
2018
1679
|
matchRanges: matchRanges || undefined
|
|
2019
1680
|
});
|
|
2020
1681
|
}); // Add the option to add the new value
|
|
2021
1682
|
|
|
2022
1683
|
if (allowNewValues && !foundExactMatch && filterKeyword) {
|
|
2023
1684
|
var insertIndex = hasDivider ? childrenTopCount + 1 : childrenTopCount;
|
|
2024
|
-
children.splice(insertIndex, 0, /*#__PURE__*/external_react_default.
|
|
1685
|
+
children.splice(insertIndex, 0, /*#__PURE__*/external_react_default().createElement(OptionBase, {
|
|
2025
1686
|
label: "".concat(filterKeyword, " (new value)"),
|
|
2026
1687
|
value: filterKeyword,
|
|
2027
1688
|
key: "newValue",
|
|
2028
1689
|
multiple: multiple,
|
|
2029
1690
|
onClick: _this.handleMenuOptionClick
|
|
2030
1691
|
}));
|
|
2031
|
-
} //
|
|
1692
|
+
} // When selectAll is a menu item, add an offset so that activeItem accounts for the extra selectAll option.
|
|
2032
1693
|
|
|
2033
1694
|
|
|
1695
|
+
var totalOptionCount = selectAllAppearance === 'checkbox' && multiple && children.length > 1 ? 1 : 0;
|
|
1696
|
+
var allOptionsSelected = true; // Highlight the selected Items and remove hidden
|
|
1697
|
+
|
|
2034
1698
|
children = children.reduce(function (acc, item) {
|
|
2035
1699
|
// ignore Dividers & Headings
|
|
2036
1700
|
if (!isOption(item)) {
|
|
@@ -2047,10 +1711,15 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2047
1711
|
_this.firstSelectedOptionIndex = _this.availableOptionCount;
|
|
2048
1712
|
}
|
|
2049
1713
|
|
|
2050
|
-
var active =
|
|
1714
|
+
var active = totalOptionCount === _this.state.activeIndex;
|
|
1715
|
+
totalOptionCount += 1;
|
|
2051
1716
|
_this.availableOptionCount += 1;
|
|
2052
1717
|
_this.selectedOptionCount += item.props.selected ? 1 : 0;
|
|
2053
1718
|
|
|
1719
|
+
if (item.key !== 'newValue' && !item.props.disabled && !item.props.selected) {
|
|
1720
|
+
allOptionsSelected = false;
|
|
1721
|
+
}
|
|
1722
|
+
|
|
2054
1723
|
if (!active || !textHasFocus) {
|
|
2055
1724
|
acc.push(item);
|
|
2056
1725
|
return acc;
|
|
@@ -2060,7 +1729,7 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2060
1729
|
_this.activeValue = item.props.value;
|
|
2061
1730
|
}
|
|
2062
1731
|
|
|
2063
|
-
var clonedItem = /*#__PURE__*/
|
|
1732
|
+
var clonedItem = /*#__PURE__*/(0,external_react_namespaceObject.cloneElement)(item, {
|
|
2064
1733
|
active: active,
|
|
2065
1734
|
id: _this.activeItemId,
|
|
2066
1735
|
ref: _this.handleActiveOptionMount
|
|
@@ -2068,6 +1737,45 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2068
1737
|
acc.push(clonedItem);
|
|
2069
1738
|
return acc;
|
|
2070
1739
|
}, []);
|
|
1740
|
+
_this.optionSelection = _this.selectedOptionCount === 0 && 'none' || allOptionsSelected && 'all' || 'some'; // add select all option
|
|
1741
|
+
|
|
1742
|
+
if (selectAllAppearance === 'checkbox' && multiple && _this.availableOptionCount > 0) {
|
|
1743
|
+
var _this$getCurrentValue5;
|
|
1744
|
+
|
|
1745
|
+
var selectAllLabel;
|
|
1746
|
+
|
|
1747
|
+
if (_this.optionSelection === 'all') {
|
|
1748
|
+
if (filterKeyword === '') {
|
|
1749
|
+
selectAllLabel = (0,i18n_namespaceObject._)('Clear all');
|
|
1750
|
+
} else {
|
|
1751
|
+
selectAllLabel = (0,i18n_namespaceObject._)('Clear all matches');
|
|
1752
|
+
}
|
|
1753
|
+
} else if (filterKeyword === '') {
|
|
1754
|
+
selectAllLabel = (0,i18n_namespaceObject._)('Select all');
|
|
1755
|
+
} else {
|
|
1756
|
+
selectAllLabel = (0,i18n_namespaceObject._)('Select all matches');
|
|
1757
|
+
}
|
|
1758
|
+
|
|
1759
|
+
if (_this.state.activeIndex === 0 && textHasFocus) {
|
|
1760
|
+
_this.activeValue = 'selectAll';
|
|
1761
|
+
}
|
|
1762
|
+
|
|
1763
|
+
children.unshift( /*#__PURE__*/external_react_default().createElement(Select_SelectAllOption, {
|
|
1764
|
+
key: "selectAllOption",
|
|
1765
|
+
selected: _this.optionSelection === 'all' || _this.optionSelection !== 'none' && 'some',
|
|
1766
|
+
selectAllLabel: selectAllLabel,
|
|
1767
|
+
totalCount: (_this$getCurrentValue5 = _this.getCurrentValues()) === null || _this$getCurrentValue5 === void 0 ? void 0 : _this$getCurrentValue5.length,
|
|
1768
|
+
changedToggle: !!_this.props.toggle,
|
|
1769
|
+
onClick: _this.optionSelection === 'all' ? _this.handleClearAll : _this.handleSelectAll,
|
|
1770
|
+
id: _this.state.activeIndex === 0 ? _this.activeItemId : undefined,
|
|
1771
|
+
active: _this.state.activeIndex === 0,
|
|
1772
|
+
ref: _this.handleActiveOptionMount,
|
|
1773
|
+
tabIndex: -1
|
|
1774
|
+
}), /*#__PURE__*/external_react_default().createElement(Menu_namespaceObject.Divider, {
|
|
1775
|
+
key: "selectAllDivider"
|
|
1776
|
+
}));
|
|
1777
|
+
}
|
|
1778
|
+
|
|
2071
1779
|
_this.displayedValues = children.reduce(function (acc, item) {
|
|
2072
1780
|
if (isOption(item)) {
|
|
2073
1781
|
acc.push(item.props.value);
|
|
@@ -2078,10 +1786,10 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2078
1786
|
return children;
|
|
2079
1787
|
});
|
|
2080
1788
|
|
|
2081
|
-
|
|
2082
|
-
var prefixLabel =
|
|
2083
|
-
label =
|
|
2084
|
-
suffixLabel =
|
|
1789
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "wrapLabel", function (_ref4) {
|
|
1790
|
+
var prefixLabel = _ref4.prefixLabel,
|
|
1791
|
+
label = _ref4.label,
|
|
1792
|
+
suffixLabel = _ref4.suffixLabel;
|
|
2085
1793
|
var wrappedLabel = label;
|
|
2086
1794
|
|
|
2087
1795
|
if (prefixLabel) {
|
|
@@ -2095,6 +1803,10 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2095
1803
|
return wrappedLabel;
|
|
2096
1804
|
});
|
|
2097
1805
|
|
|
1806
|
+
SelectBase_defineProperty(SelectBase_assertThisInitialized(_this), "handleDropdownMount", function (c) {
|
|
1807
|
+
_this.dropdown = c;
|
|
1808
|
+
});
|
|
1809
|
+
|
|
2098
1810
|
_this.state = {
|
|
2099
1811
|
activeIndex: 0,
|
|
2100
1812
|
filterKeyword: '',
|
|
@@ -2113,18 +1825,19 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2113
1825
|
_this.currentMatchOptions = [];
|
|
2114
1826
|
_this.availableMatchOptions = [];
|
|
2115
1827
|
_this.optionRefsByKey = {};
|
|
1828
|
+
_this.optionSelection = 'none';
|
|
2116
1829
|
|
|
2117
1830
|
if (false) {}
|
|
2118
1831
|
|
|
2119
1832
|
if (false) {}
|
|
2120
1833
|
|
|
2121
1834
|
SelectBase.validateAppearance(props);
|
|
2122
|
-
_this.menuId =
|
|
2123
|
-
_this.activeItemId =
|
|
1835
|
+
_this.menuId = (0,id_namespaceObject.createDOMID)('menu');
|
|
1836
|
+
_this.activeItemId = (0,id_namespaceObject.createDOMID)('active-item');
|
|
2124
1837
|
return _this;
|
|
2125
1838
|
}
|
|
2126
1839
|
|
|
2127
|
-
|
|
1840
|
+
SelectBase_createClass(SelectBase, [{
|
|
2128
1841
|
key: "componentDidUpdate",
|
|
2129
1842
|
value: function componentDidUpdate(prevProps, prevState) {
|
|
2130
1843
|
if (false) {}
|
|
@@ -2143,10 +1856,10 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2143
1856
|
}, {
|
|
2144
1857
|
key: "getTopValues",
|
|
2145
1858
|
value: function getTopValues() {
|
|
2146
|
-
var _this$
|
|
1859
|
+
var _this$getCurrentValue6;
|
|
2147
1860
|
|
|
2148
1861
|
// in non-multiple mode, don't move values to the top of the list
|
|
2149
|
-
return this.props.multiple && this.props.showSelectedValuesFirst !== 'never' ? (_this$
|
|
1862
|
+
return this.props.multiple && this.props.showSelectedValuesFirst !== 'never' ? (_this$getCurrentValue6 = this.getCurrentValues()) !== null && _this$getCurrentValue6 !== void 0 ? _this$getCurrentValue6 : [] : [];
|
|
2150
1863
|
}
|
|
2151
1864
|
}, {
|
|
2152
1865
|
key: "isControlled",
|
|
@@ -2161,9 +1874,9 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2161
1874
|
}, {
|
|
2162
1875
|
key: "toggleValue",
|
|
2163
1876
|
value: function toggleValue(e, value) {
|
|
2164
|
-
var _this$
|
|
1877
|
+
var _this$getCurrentValue7, _this$props$onChange3, _this$props14;
|
|
2165
1878
|
|
|
2166
|
-
var values = (_this$
|
|
1879
|
+
var values = (_this$getCurrentValue7 = this.getCurrentValues()) !== null && _this$getCurrentValue7 !== void 0 ? _this$getCurrentValue7 : [];
|
|
2167
1880
|
var currentIndex = values.indexOf(value);
|
|
2168
1881
|
var _this$props13 = this.props,
|
|
2169
1882
|
name = _this$props13.name,
|
|
@@ -2207,7 +1920,8 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2207
1920
|
|
|
2208
1921
|
(_this$props$onChange3 = (_this$props14 = this.props).onChange) === null || _this$props$onChange3 === void 0 ? void 0 : _this$props$onChange3.call(_this$props14, e, {
|
|
2209
1922
|
values: newValues,
|
|
2210
|
-
name: name
|
|
1923
|
+
name: name,
|
|
1924
|
+
reason: 'valueToggle'
|
|
2211
1925
|
});
|
|
2212
1926
|
}
|
|
2213
1927
|
/**
|
|
@@ -2223,36 +1937,41 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2223
1937
|
}
|
|
2224
1938
|
}, {
|
|
2225
1939
|
key: "renderControls",
|
|
2226
|
-
value: function renderControls(
|
|
2227
|
-
var hasChildren =
|
|
2228
|
-
placement =
|
|
1940
|
+
value: function renderControls(_ref5) {
|
|
1941
|
+
var hasChildren = _ref5.hasChildren,
|
|
1942
|
+
placement = _ref5.placement;
|
|
2229
1943
|
var filterKeyword = this.state.filterKeyword;
|
|
2230
1944
|
var _this$props15 = this.props,
|
|
2231
1945
|
inputId = _this$props15.inputId,
|
|
2232
1946
|
inputRef = _this$props15.inputRef,
|
|
2233
|
-
multiple = _this$props15.multiple
|
|
1947
|
+
multiple = _this$props15.multiple,
|
|
1948
|
+
selectAllAppearance = _this$props15.selectAllAppearance;
|
|
1949
|
+
|
|
1950
|
+
var selectAllLabel = (0,i18n_namespaceObject._)("Select all options".concat(this.optionSelection === 'all' ? ' disabled' : ''));
|
|
2234
1951
|
|
|
2235
|
-
var
|
|
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
|
|
1953
|
+
|
|
1954
|
+
|
|
1955
|
+
var selectControls = /*#__PURE__*/external_react_default().createElement(StyledToggleAllControls, {
|
|
2236
1956
|
$placement: placement,
|
|
2237
1957
|
key: "selectAll"
|
|
2238
|
-
}, /*#__PURE__*/external_react_default.
|
|
2239
|
-
$disabled:
|
|
1958
|
+
}, /*#__PURE__*/external_react_default().createElement(StyledControlsLink, {
|
|
1959
|
+
$disabled: this.optionSelection === 'all',
|
|
1960
|
+
"aria-label": selectAllLabel,
|
|
2240
1961
|
onClick: this.handleSelectAll,
|
|
2241
|
-
"data-test": "select-all"
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
}, filterKeyword ? Object(i18n_["_"])('Select All Matches') : Object(i18n_["_"])('Select All')), /*#__PURE__*/external_react_default.a.createElement(StyledControlsLink, {
|
|
2246
|
-
$disabled: !this.selectedOptionCount,
|
|
1962
|
+
"data-test": "select-all"
|
|
1963
|
+
}, filterKeyword ? (0,i18n_namespaceObject._)('Select All Matches') : (0,i18n_namespaceObject._)('Select All')), /*#__PURE__*/external_react_default().createElement(StyledControlsLink, {
|
|
1964
|
+
$disabled: this.optionSelection === 'none',
|
|
1965
|
+
"aria-label": clearAllLabel,
|
|
2247
1966
|
onClick: this.handleClearAll,
|
|
2248
1967
|
"data-test": "clear-all"
|
|
2249
|
-
}, filterKeyword ?
|
|
2250
|
-
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", {
|
|
2251
1970
|
key: "controls"
|
|
2252
|
-
}, /*#__PURE__*/external_react_default.
|
|
1971
|
+
}, /*#__PURE__*/external_react_default().createElement(StyledFilter, {
|
|
2253
1972
|
key: "filter",
|
|
2254
1973
|
"data-test": "filter"
|
|
2255
|
-
}, /*#__PURE__*/external_react_default.
|
|
1974
|
+
}, /*#__PURE__*/external_react_default().createElement((Text_default()), {
|
|
2256
1975
|
value: filterKeyword,
|
|
2257
1976
|
autoCapitalize: "off",
|
|
2258
1977
|
autoComplete: "off",
|
|
@@ -2262,21 +1981,21 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2262
1981
|
onKeyDown: this.handleTextKeyDown,
|
|
2263
1982
|
onFocus: this.handleTextFocus,
|
|
2264
1983
|
onBlur: this.handleTextBlur,
|
|
2265
|
-
placeholder:
|
|
1984
|
+
placeholder: (0,i18n_namespaceObject._)('filter'),
|
|
2266
1985
|
role: "combobox",
|
|
2267
1986
|
"aria-expanded": "true",
|
|
2268
|
-
"aria-label":
|
|
1987
|
+
"aria-label": (0,i18n_namespaceObject._)('Filter'),
|
|
2269
1988
|
"aria-activedescendant": this.activeItemId,
|
|
2270
1989
|
inputRef: inputRef,
|
|
2271
1990
|
inputId: inputId,
|
|
2272
1991
|
canClear: true,
|
|
2273
|
-
startAdornment: /*#__PURE__*/external_react_default.
|
|
2274
|
-
})), multiple && hasChildren && selectControls);
|
|
1992
|
+
startAdornment: /*#__PURE__*/external_react_default().createElement(StyledSearchIconWrapper, null, /*#__PURE__*/external_react_default().createElement(icons_Search, null))
|
|
1993
|
+
})), multiple && hasChildren && selectAllAppearance === 'buttongroup' && selectControls);
|
|
2275
1994
|
}
|
|
2276
1995
|
}, {
|
|
2277
1996
|
key: "render",
|
|
2278
1997
|
value: function render() {
|
|
2279
|
-
var _this$
|
|
1998
|
+
var _this$getCurrentValue8,
|
|
2280
1999
|
_this2 = this;
|
|
2281
2000
|
|
|
2282
2001
|
var _this$props16 = this.props,
|
|
@@ -2286,8 +2005,8 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2286
2005
|
multiple = _this$props16.multiple,
|
|
2287
2006
|
repositionMode = _this$props16.repositionMode;
|
|
2288
2007
|
var filterEnabled = this.hasFilter();
|
|
2289
|
-
var currentValues = (_this$
|
|
2290
|
-
var childrenArray =
|
|
2008
|
+
var currentValues = (_this$getCurrentValue8 = this.getCurrentValues()) !== null && _this$getCurrentValue8 !== void 0 ? _this$getCurrentValue8 : [];
|
|
2009
|
+
var childrenArray = external_react_namespaceObject.Children.toArray(children);
|
|
2291
2010
|
var isAnyValueSelected = currentValues.some(function (value) {
|
|
2292
2011
|
var matchedItem = find_default()(childrenArray, function (item) {
|
|
2293
2012
|
return isOption(item) && item.props.value === value;
|
|
@@ -2297,19 +2016,17 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2297
2016
|
var finalChildren = this.createChildren();
|
|
2298
2017
|
var toggle = this.createToggle();
|
|
2299
2018
|
|
|
2300
|
-
var createMenu = function createMenu(
|
|
2301
|
-
var anchorWidth =
|
|
2302
|
-
maxHeight =
|
|
2303
|
-
placement =
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
maxWidth: Math.max(anchorWidth !== null && anchorWidth !== void 0 ? anchorWidth : 0, 300)
|
|
2310
|
-
};
|
|
2019
|
+
var createMenu = function createMenu(_ref6) {
|
|
2020
|
+
var anchorWidth = _ref6.anchorWidth,
|
|
2021
|
+
maxHeight = _ref6.maxHeight,
|
|
2022
|
+
placement = _ref6.placement;
|
|
2023
|
+
var internalMenuStyle = getInlineMenuStyle({
|
|
2024
|
+
anchorWidth: anchorWidth,
|
|
2025
|
+
isMultiple: _this2.props.multiple,
|
|
2026
|
+
menuStyle: _this2.props.menuStyle
|
|
2027
|
+
});
|
|
2311
2028
|
var tabIndex = currentValues.length > 0 && !isAnyValueSelected && !_this2.hasFilter() ? 0 : undefined;
|
|
2312
|
-
return /*#__PURE__*/external_react_default.
|
|
2029
|
+
return /*#__PURE__*/external_react_default().createElement((ResultsMenu_default()), SelectBase_extends({
|
|
2313
2030
|
"aria-multiselectable": multiple || undefined,
|
|
2314
2031
|
childrenStart: _this2.renderControls({
|
|
2315
2032
|
placement: placement,
|
|
@@ -2323,13 +2040,13 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2323
2040
|
isLoading: _this2.props.isLoadingOptions,
|
|
2324
2041
|
id: _this2.menuId
|
|
2325
2042
|
}, pick_default()(_this2.props, 'noOptionsMessage', 'footerMessage', 'animateLoading', 'loadingMessage', 'onScroll'), {
|
|
2326
|
-
style:
|
|
2043
|
+
style: internalMenuStyle,
|
|
2327
2044
|
tabIndex: tabIndex
|
|
2328
2045
|
}), finalChildren);
|
|
2329
2046
|
};
|
|
2330
2047
|
|
|
2331
|
-
return /*#__PURE__*/external_react_default.
|
|
2332
|
-
closeReasons:
|
|
2048
|
+
return /*#__PURE__*/external_react_default().createElement((Dropdown_default()), {
|
|
2049
|
+
closeReasons: dropdownCloseReasons,
|
|
2333
2050
|
inputId: inputId,
|
|
2334
2051
|
toggle: toggle,
|
|
2335
2052
|
onRequestOpen: this.handleRequestOpen,
|
|
@@ -2338,10 +2055,8 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2338
2055
|
openWithArrowKeys: true,
|
|
2339
2056
|
repositionMode: repositionMode,
|
|
2340
2057
|
defaultPlacement: filterEnabled ? defaultPlacement : undefined,
|
|
2341
|
-
canCoverAnchor:
|
|
2342
|
-
ref:
|
|
2343
|
-
_this2.dropdown = c;
|
|
2344
|
-
},
|
|
2058
|
+
canCoverAnchor: getWindow().innerHeight < 500,
|
|
2059
|
+
ref: this.handleDropdownMount,
|
|
2345
2060
|
retainFocus: false,
|
|
2346
2061
|
takeFocus: currentValues.length === 0 || currentValues.length > 0 && !isAnyValueSelected || !!filterEnabled
|
|
2347
2062
|
}, createMenu);
|
|
@@ -2349,51 +2064,331 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2349
2064
|
}]);
|
|
2350
2065
|
|
|
2351
2066
|
return SelectBase;
|
|
2352
|
-
}(
|
|
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); }
|
|
2353
2227
|
|
|
2354
|
-
|
|
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
|
+
};
|
|
2355
2304
|
|
|
2356
|
-
|
|
2305
|
+
var Select = /*#__PURE__*/function (_Component) {
|
|
2306
|
+
Select_inherits(Select, _Component);
|
|
2357
2307
|
|
|
2358
|
-
|
|
2308
|
+
var _super = Select_createSuper(Select);
|
|
2359
2309
|
|
|
2360
|
-
|
|
2310
|
+
// @docs-props-type SelectPropsBase
|
|
2311
|
+
function Select(props) {
|
|
2312
|
+
var _this;
|
|
2361
2313
|
|
|
2362
|
-
|
|
2314
|
+
Select_classCallCheck(this, Select);
|
|
2363
2315
|
|
|
2364
|
-
|
|
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"
|
|
2365
2319
|
|
|
2366
|
-
|
|
2320
|
+
if (has_default()(props, 'defaultValue')) {
|
|
2321
|
+
if (props.defaultValue != null) {
|
|
2322
|
+
state.defaultValues = [props.defaultValue];
|
|
2323
|
+
} else {
|
|
2324
|
+
state.defaultValues = [];
|
|
2325
|
+
}
|
|
2326
|
+
}
|
|
2367
2327
|
|
|
2328
|
+
_this.state = state;
|
|
2329
|
+
return _this;
|
|
2330
|
+
}
|
|
2368
2331
|
|
|
2369
|
-
|
|
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"]);
|
|
2370
2345
|
|
|
2371
|
-
|
|
2372
|
-
|
|
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
|
|
2373
2356
|
|
|
2374
|
-
|
|
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
|
+
}
|
|
2375
2367
|
|
|
2376
|
-
|
|
2368
|
+
return /*#__PURE__*/external_react_default().createElement(Select_SelectBase, Select_extends({}, otherProps, convertedProps, {
|
|
2369
|
+
multiple: false
|
|
2370
|
+
}));
|
|
2371
|
+
}
|
|
2372
|
+
}]);
|
|
2377
2373
|
|
|
2378
|
-
|
|
2379
|
-
|
|
2374
|
+
return Select;
|
|
2375
|
+
}(external_react_namespaceObject.Component);
|
|
2380
2376
|
|
|
2381
|
-
|
|
2377
|
+
Select_defineProperty(Select, "propTypes", Select_propTypes);
|
|
2382
2378
|
|
|
2383
|
-
|
|
2379
|
+
Select_defineProperty(Select, "defaultProps", Select_defaultProps);
|
|
2384
2380
|
|
|
2385
|
-
|
|
2386
|
-
/***/ (function(module, exports) {
|
|
2381
|
+
Select_defineProperty(Select, "Option", Select_Option);
|
|
2387
2382
|
|
|
2388
|
-
|
|
2383
|
+
Select_defineProperty(Select, "Heading", Menu_namespaceObject.Heading);
|
|
2389
2384
|
|
|
2390
|
-
|
|
2385
|
+
Select_defineProperty(Select, "Divider", Menu_namespaceObject.Divider);
|
|
2391
2386
|
|
|
2392
|
-
|
|
2393
|
-
/***/ (function(module, exports) {
|
|
2387
|
+
/* harmony default export */ const Select_Select = (Select);
|
|
2394
2388
|
|
|
2395
|
-
|
|
2389
|
+
;// CONCATENATED MODULE: ./src/Select/index.ts
|
|
2396
2390
|
|
|
2397
|
-
/***/ })
|
|
2398
2391
|
|
|
2399
|
-
|
|
2392
|
+
module.exports = __webpack_exports__;
|
|
2393
|
+
/******/ })()
|
|
2394
|
+
;
|