@splunk/react-ui 4.40.0 → 4.42.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/ButtonGroup.js +1 -3
- package/CHANGELOG.md +43 -0
- package/Calendar.js +548 -744
- package/Date.js +158 -161
- package/Dropdown.js +33 -32
- package/FormRows.js +93 -97
- package/Layer.js +115 -97
- package/MIGRATION.mdx +24 -3
- package/Menu.js +10 -9
- package/MessageBar.js +5 -5
- package/Multiselect.js +1498 -1599
- package/Number.js +51 -48
- package/Popover.js +481 -479
- package/RadioBar.js +19 -15
- package/Resize.js +61 -61
- package/ResultsMenu.js +1208 -1028
- package/Scroll.js +482 -475
- package/Select.js +949 -1030
- package/Slider.js +346 -300
- package/SlidingPanels.js +166 -148
- package/TabBar.js +187 -172
- package/TabLayout.js +8 -8
- package/Table.js +1518 -1432
- package/Text.js +29 -17
- package/TextArea.js +37 -37
- package/Tooltip.js +300 -207
- package/TransitionOpen.js +44 -65
- package/package.json +4 -4
- package/types/src/ButtonGroup/ButtonGroup.d.ts +0 -4
- package/types/src/ButtonSimple/ButtonSimple.d.ts +1 -1
- package/types/src/Calendar/Calendar.d.ts +28 -30
- package/types/src/Calendar/MonthHeader.d.ts +12 -22
- package/types/src/Color/Color.d.ts +2 -2
- package/types/src/Date/Date.d.ts +18 -19
- package/types/src/Dropdown/Dropdown.d.ts +2 -1
- package/types/src/File/File.d.ts +1 -1
- package/types/src/FormRows/FormRows.d.ts +5 -60
- package/types/src/FormRows/Row.d.ts +1 -1
- package/types/src/Layer/Layer.d.ts +2 -1
- package/types/src/Link/Link.d.ts +5 -0
- package/types/src/Link/index.d.ts +1 -0
- package/types/src/Menu/Item.d.ts +1 -1
- package/types/src/Menu/Menu.d.ts +1 -1
- package/types/src/Multiselect/Option.d.ts +1 -1
- package/types/src/Number/Number.d.ts +10 -2
- package/types/src/Popover/Popover.d.ts +1 -4
- package/types/src/RadioBar/RadioBar.d.ts +2 -2
- package/types/src/Resize/Resize.d.ts +0 -11
- package/types/src/ResultsMenu/VirtualizedResultsMenu/VirtualizedResultsMenu.d.ts +1 -1
- package/types/src/ResultsMenu/VirtualizedResultsMenu/injectVirtualizedItem.d.ts +2 -0
- package/types/src/Scroll/Inner.d.ts +17 -19
- package/types/src/Search/Option.d.ts +1 -1
- package/types/src/Select/Option.d.ts +5 -1
- package/types/src/Select/OptionBase.d.ts +41 -23
- package/types/src/Select/SelectAllOption.d.ts +6 -2
- package/types/src/Select/SelectBase.d.ts +8 -34
- package/types/src/Slider/Slider.d.ts +7 -16
- package/types/src/SlidingPanels/SlidingPanels.d.ts +4 -3
- package/types/src/TabBar/TabBar.d.ts +10 -2
- package/types/src/TabBar/TabBarContext.d.ts +1 -0
- package/types/src/TabBar/docs/examples/IconsAbove.d.ts +2 -0
- package/types/src/TabBar/docs/examples/IconsLeft.d.ts +2 -0
- package/types/src/TabBar/docs/examples/VerticalIconsAbove.d.ts +2 -0
- package/types/src/TabBar/docs/examples/VerticalIconsLeft.d.ts +2 -0
- package/types/src/TabLayout/TabLayout.d.ts +4 -2
- package/types/src/Table/ExpandButton.d.ts +8 -0
- package/types/src/Table/HeadDropdownCell.d.ts +2 -0
- package/types/src/Table/HeadInner.d.ts +5 -1
- package/types/src/Table/Row.d.ts +8 -4
- package/types/src/Table/Table.d.ts +0 -2
- package/types/src/Table/docs/examples/Complex.d.ts +14 -3
- package/types/src/Text/Text.d.ts +2 -2
- package/types/src/TextArea/TextArea.d.ts +2 -2
- package/types/src/Tooltip/Tooltip.d.ts +38 -5
- package/types/src/Tooltip/docs/examples/CustomProps.d.ts +2 -0
- package/types/src/Tooltip/docs/examples/Toggletip.d.ts +2 -0
- package/types/src/Typography/Typography.d.ts +4 -2
- package/types/src/useControlled/useControlled.d.ts +5 -4
- package/useControlled.js +37 -15
- package/usePrevious.js +62 -30
- package/useRovingFocus.js +5 -4
- package/types/src/TabBar/docs/examples/IconsInline.d.ts +0 -2
- package/types/src/TabBar/docs/examples/IconsSmall.d.ts +0 -2
- package/types/src/TabBar/docs/examples/VerticalSmallIcons.d.ts +0 -2
- package/types/src/Table/docs/examples/prisma/Complex.d.ts +0 -48
- package/types/src/Table/icons/ExpansionRow.d.ts +0 -6
- package/types/src/Tooltip/docs/examples/CustomContent.d.ts +0 -2
- /package/types/src/Table/docs/examples/{prisma/RowActions.d.ts → RowActions.d.ts} +0 -0
package/Multiselect.js
CHANGED
|
@@ -3,13 +3,16 @@
|
|
|
3
3
|
/******/ "use strict";
|
|
4
4
|
/******/ var e = {
|
|
5
5
|
/***/ 2907:
|
|
6
|
-
/***/ (e, t,
|
|
6
|
+
/***/ (e, t, r) => {
|
|
7
7
|
// EXPORTS
|
|
8
|
-
|
|
9
|
-
default: () => /* reexport */
|
|
8
|
+
r.d(t, {
|
|
9
|
+
default: () => /* reexport */ i
|
|
10
10
|
});
|
|
11
11
|
// EXTERNAL MODULE: external "react"
|
|
12
|
-
var
|
|
12
|
+
var n = r(9497);
|
|
13
|
+
// EXTERNAL MODULE: external "lodash/has"
|
|
14
|
+
var o = r(5919);
|
|
15
|
+
var a = r.n(o);
|
|
13
16
|
// CONCATENATED MODULE: ./src/useControlled/useControlled.tsx
|
|
14
17
|
/**
|
|
15
18
|
* This is a private component not intended for use outside @splunk/react-ui
|
|
@@ -21,22 +24,26 @@
|
|
|
21
24
|
*
|
|
22
25
|
* Return the controlled state of the component.
|
|
23
26
|
*/
|
|
24
|
-
function
|
|
25
|
-
var t = e.
|
|
26
|
-
var s = (0,
|
|
27
|
-
var f = (0,
|
|
28
|
-
(0,
|
|
27
|
+
function l(e) {
|
|
28
|
+
var t = e.componentProps, r = e.componentName, o = r === void 0 ? "this component" : r, l = e.defaultValuePropName, i = l === void 0 ? "defaultValue" : l, u = e.valuePropName, c = u === void 0 ? "value" : u;
|
|
29
|
+
var s = (0, n.useRef)(a()(t, c));
|
|
30
|
+
var f = (0, n.useRef)(t[i]);
|
|
31
|
+
(0, n.useEffect)((function() {
|
|
29
32
|
if (false) {}
|
|
30
|
-
}), [
|
|
31
|
-
(0,
|
|
33
|
+
}), [ o, t, i, c ]);
|
|
34
|
+
(0, n.useEffect)((function() {
|
|
32
35
|
if (false) {}
|
|
33
36
|
if (false) {}
|
|
34
|
-
}), [
|
|
37
|
+
}), [ o, t, i, c ]);
|
|
35
38
|
return s.current;
|
|
36
39
|
}
|
|
37
|
-
/* harmony default export */ const
|
|
40
|
+
/* harmony default export */ const i = l;
|
|
38
41
|
} // CONCATENATED MODULE: ./src/useControlled/index.ts
|
|
39
42
|
/***/ ,
|
|
43
|
+
/***/ 5919:
|
|
44
|
+
/***/ e => {
|
|
45
|
+
e.exports = require("lodash/has");
|
|
46
|
+
/***/ },
|
|
40
47
|
/***/ 9497:
|
|
41
48
|
/***/ e => {
|
|
42
49
|
e.exports = require("react");
|
|
@@ -48,21 +55,21 @@
|
|
|
48
55
|
/******/ var t = {};
|
|
49
56
|
/******/
|
|
50
57
|
/******/ // The require function
|
|
51
|
-
/******/ function n
|
|
58
|
+
/******/ function r(n) {
|
|
52
59
|
/******/ // Check if module is in cache
|
|
53
|
-
/******/ var o = t[
|
|
60
|
+
/******/ var o = t[n];
|
|
54
61
|
/******/ if (o !== undefined) {
|
|
55
62
|
/******/ return o.exports;
|
|
56
63
|
/******/ }
|
|
57
64
|
/******/ // Create a new module (and put it into the cache)
|
|
58
|
-
/******/ var a = t[
|
|
65
|
+
/******/ var a = t[n] = {
|
|
59
66
|
/******/ // no module.id needed
|
|
60
67
|
/******/ // no module.loaded needed
|
|
61
68
|
/******/ exports: {}
|
|
62
69
|
/******/ };
|
|
63
70
|
/******/
|
|
64
71
|
/******/ // Execute the module function
|
|
65
|
-
/******/ e[
|
|
72
|
+
/******/ e[n](a, a.exports, r);
|
|
66
73
|
/******/
|
|
67
74
|
/******/ // Return the exports of the module
|
|
68
75
|
/******/ return a.exports;
|
|
@@ -72,12 +79,12 @@
|
|
|
72
79
|
/******/ /* webpack/runtime/compat get default export */
|
|
73
80
|
/******/ (() => {
|
|
74
81
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
75
|
-
/******/
|
|
82
|
+
/******/ r.n = e => {
|
|
76
83
|
/******/ var t = e && e.__esModule ?
|
|
77
84
|
/******/ () => e["default"]
|
|
78
85
|
/******/ : () => e
|
|
79
86
|
/******/;
|
|
80
|
-
|
|
87
|
+
r.d(t, {
|
|
81
88
|
a: t
|
|
82
89
|
});
|
|
83
90
|
/******/ return t;
|
|
@@ -87,12 +94,12 @@
|
|
|
87
94
|
/******/ /* webpack/runtime/define property getters */
|
|
88
95
|
/******/ (() => {
|
|
89
96
|
/******/ // define getter functions for harmony exports
|
|
90
|
-
/******/
|
|
91
|
-
/******/ for (var
|
|
92
|
-
/******/ if (
|
|
93
|
-
/******/ Object.defineProperty(e,
|
|
97
|
+
/******/ r.d = (e, t) => {
|
|
98
|
+
/******/ for (var n in t) {
|
|
99
|
+
/******/ if (r.o(t, n) && !r.o(e, n)) {
|
|
100
|
+
/******/ Object.defineProperty(e, n, {
|
|
94
101
|
enumerable: true,
|
|
95
|
-
get: t[
|
|
102
|
+
get: t[n]
|
|
96
103
|
});
|
|
97
104
|
/******/ }
|
|
98
105
|
/******/ }
|
|
@@ -101,14 +108,14 @@
|
|
|
101
108
|
/******/
|
|
102
109
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
103
110
|
/******/ (() => {
|
|
104
|
-
/******/
|
|
111
|
+
/******/ r.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t)
|
|
105
112
|
/******/;
|
|
106
113
|
})();
|
|
107
114
|
/******/
|
|
108
115
|
/******/ /* webpack/runtime/make namespace object */
|
|
109
116
|
/******/ (() => {
|
|
110
117
|
/******/ // define __esModule on exports
|
|
111
|
-
/******/
|
|
118
|
+
/******/ r.r = e => {
|
|
112
119
|
/******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
|
|
113
120
|
/******/ Object.defineProperty(e, Symbol.toStringTag, {
|
|
114
121
|
value: "Module"
|
|
@@ -120,30 +127,30 @@
|
|
|
120
127
|
/******/ };
|
|
121
128
|
/******/ })();
|
|
122
129
|
/******/
|
|
123
|
-
/************************************************************************/ var
|
|
130
|
+
/************************************************************************/ var n = {};
|
|
124
131
|
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
|
125
132
|
(() => {
|
|
126
133
|
// ESM COMPAT FLAG
|
|
127
|
-
|
|
134
|
+
r.r(n);
|
|
128
135
|
// EXPORTS
|
|
129
|
-
|
|
136
|
+
r.d(n, {
|
|
130
137
|
Divider: () => /* reexport */ f.Divider,
|
|
131
138
|
Heading: () => /* reexport */ f.Heading,
|
|
132
|
-
Option: () => /* reexport */
|
|
133
|
-
default: () => /* reexport */
|
|
139
|
+
Option: () => /* reexport */ W,
|
|
140
|
+
default: () => /* reexport */ Rn
|
|
134
141
|
});
|
|
135
142
|
// EXTERNAL MODULE: external "react"
|
|
136
|
-
var e =
|
|
137
|
-
var t =
|
|
143
|
+
var e = r(9497);
|
|
144
|
+
var t = r.n(e);
|
|
138
145
|
// CONCATENATED MODULE: external "prop-types"
|
|
139
146
|
const o = require("prop-types");
|
|
140
|
-
var a =
|
|
141
|
-
//
|
|
142
|
-
|
|
143
|
-
var i =
|
|
147
|
+
var a = r.n(o);
|
|
148
|
+
// EXTERNAL MODULE: external "lodash/has"
|
|
149
|
+
var l = r(5919);
|
|
150
|
+
var i = r.n(l);
|
|
144
151
|
// CONCATENATED MODULE: external "lodash/omit"
|
|
145
152
|
const u = require("lodash/omit");
|
|
146
|
-
var c =
|
|
153
|
+
var c = r.n(u);
|
|
147
154
|
// CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
|
|
148
155
|
const s = require("@splunk/ui-utils/i18n");
|
|
149
156
|
// CONCATENATED MODULE: external "@splunk/react-ui/Menu"
|
|
@@ -160,130 +167,87 @@
|
|
|
160
167
|
function d() {
|
|
161
168
|
return d = Object.assign ? Object.assign.bind() : function(e) {
|
|
162
169
|
for (var t = 1; t < arguments.length; t++) {
|
|
163
|
-
var
|
|
164
|
-
for (var
|
|
165
|
-
({}).hasOwnProperty.call(
|
|
170
|
+
var r = arguments[t];
|
|
171
|
+
for (var n in r) {
|
|
172
|
+
({}).hasOwnProperty.call(r, n) && (e[n] = r[n]);
|
|
166
173
|
}
|
|
167
174
|
}
|
|
168
175
|
return e;
|
|
169
176
|
}, d.apply(null, arguments);
|
|
170
177
|
}
|
|
171
178
|
function v(e, t) {
|
|
172
|
-
|
|
173
|
-
var n, r, o = b(e, t);
|
|
179
|
+
var r = Object.keys(e);
|
|
174
180
|
if (Object.getOwnPropertySymbols) {
|
|
175
|
-
var
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
return o;
|
|
181
|
-
}
|
|
182
|
-
function b(e, t) {
|
|
183
|
-
if (null == e) return {};
|
|
184
|
-
var n = {};
|
|
185
|
-
for (var r in e) {
|
|
186
|
-
if ({}.hasOwnProperty.call(e, r)) {
|
|
187
|
-
if (t.includes(r)) continue;
|
|
188
|
-
n[r] = e[r];
|
|
189
|
-
}
|
|
181
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
182
|
+
t && (n = n.filter((function(t) {
|
|
183
|
+
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
184
|
+
}))), r.push.apply(r, n);
|
|
190
185
|
}
|
|
191
|
-
return
|
|
192
|
-
}
|
|
193
|
-
function y(e, t) {
|
|
194
|
-
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
186
|
+
return r;
|
|
195
187
|
}
|
|
196
|
-
function
|
|
197
|
-
for (var
|
|
198
|
-
var r = t[
|
|
199
|
-
|
|
200
|
-
|
|
188
|
+
function b(e) {
|
|
189
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
190
|
+
var r = null != arguments[t] ? arguments[t] : {};
|
|
191
|
+
t % 2 ? v(Object(r), !0).forEach((function(t) {
|
|
192
|
+
y(e, t, r[t]);
|
|
193
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : v(Object(r)).forEach((function(t) {
|
|
194
|
+
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(r, t));
|
|
195
|
+
}));
|
|
201
196
|
}
|
|
202
|
-
}
|
|
203
|
-
function h(e, t, n) {
|
|
204
|
-
return t && m(e.prototype, t), n && m(e, n), Object.defineProperty(e, "prototype", {
|
|
205
|
-
writable: !1
|
|
206
|
-
}), e;
|
|
207
|
-
}
|
|
208
|
-
function g(e, t) {
|
|
209
|
-
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
|
|
210
|
-
e.prototype = Object.create(t && t.prototype, {
|
|
211
|
-
constructor: {
|
|
212
|
-
value: e,
|
|
213
|
-
writable: !0,
|
|
214
|
-
configurable: !0
|
|
215
|
-
}
|
|
216
|
-
}), Object.defineProperty(e, "prototype", {
|
|
217
|
-
writable: !1
|
|
218
|
-
}), t && O(e, t);
|
|
219
|
-
}
|
|
220
|
-
function O(e, t) {
|
|
221
|
-
return O = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
|
|
222
|
-
return e.__proto__ = t, e;
|
|
223
|
-
}, O(e, t);
|
|
224
|
-
}
|
|
225
|
-
function w(e) {
|
|
226
|
-
var t = k();
|
|
227
|
-
return function() {
|
|
228
|
-
var n, r = x(e);
|
|
229
|
-
if (t) {
|
|
230
|
-
var o = x(this).constructor;
|
|
231
|
-
n = Reflect.construct(r, arguments, o);
|
|
232
|
-
} else n = r.apply(this, arguments);
|
|
233
|
-
return C(this, n);
|
|
234
|
-
};
|
|
235
|
-
}
|
|
236
|
-
function C(e, t) {
|
|
237
|
-
if (t && ("object" == p(t) || "function" == typeof t)) return t;
|
|
238
|
-
if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
|
|
239
|
-
return S(e);
|
|
240
|
-
}
|
|
241
|
-
function S(e) {
|
|
242
|
-
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
243
197
|
return e;
|
|
244
198
|
}
|
|
245
|
-
function
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
} catch (e) {}
|
|
249
|
-
return (k = function t() {
|
|
250
|
-
return !!e;
|
|
251
|
-
})();
|
|
252
|
-
}
|
|
253
|
-
function x(e) {
|
|
254
|
-
return x = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
|
|
255
|
-
return e.__proto__ || Object.getPrototypeOf(e);
|
|
256
|
-
}, x(e);
|
|
257
|
-
}
|
|
258
|
-
function j(e, t, n) {
|
|
259
|
-
return (t = I(t)) in e ? Object.defineProperty(e, t, {
|
|
260
|
-
value: n,
|
|
199
|
+
function y(e, t, r) {
|
|
200
|
+
return (t = m(t)) in e ? Object.defineProperty(e, t, {
|
|
201
|
+
value: r,
|
|
261
202
|
enumerable: !0,
|
|
262
203
|
configurable: !0,
|
|
263
204
|
writable: !0
|
|
264
|
-
}) : e[t] =
|
|
205
|
+
}) : e[t] = r, e;
|
|
265
206
|
}
|
|
266
|
-
function
|
|
267
|
-
var t =
|
|
207
|
+
function m(e) {
|
|
208
|
+
var t = h(e, "string");
|
|
268
209
|
return "symbol" == p(t) ? t : t + "";
|
|
269
210
|
}
|
|
270
|
-
function
|
|
211
|
+
function h(e, t) {
|
|
271
212
|
if ("object" != p(e) || !e) return e;
|
|
272
|
-
var
|
|
273
|
-
if (void 0 !==
|
|
274
|
-
var
|
|
275
|
-
if ("object" != p(
|
|
213
|
+
var r = e[Symbol.toPrimitive];
|
|
214
|
+
if (void 0 !== r) {
|
|
215
|
+
var n = r.call(e, t || "default");
|
|
216
|
+
if ("object" != p(n)) return n;
|
|
276
217
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
277
218
|
}
|
|
278
219
|
return ("string" === t ? String : Number)(e);
|
|
279
220
|
}
|
|
280
|
-
|
|
221
|
+
function g(e, t) {
|
|
222
|
+
if (null == e) return {};
|
|
223
|
+
var r, n, o = O(e, t);
|
|
224
|
+
if (Object.getOwnPropertySymbols) {
|
|
225
|
+
var a = Object.getOwnPropertySymbols(e);
|
|
226
|
+
for (n = 0; n < a.length; n++) {
|
|
227
|
+
r = a[n], t.includes(r) || {}.propertyIsEnumerable.call(e, r) && (o[r] = e[r]);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
return o;
|
|
231
|
+
}
|
|
232
|
+
function O(e, t) {
|
|
233
|
+
if (null == e) return {};
|
|
234
|
+
var r = {};
|
|
235
|
+
for (var n in e) {
|
|
236
|
+
if ({}.hasOwnProperty.call(e, n)) {
|
|
237
|
+
if (t.includes(n)) continue;
|
|
238
|
+
r[n] = e[n];
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
return r;
|
|
242
|
+
}
|
|
243
|
+
var w = {
|
|
281
244
|
/** @private */
|
|
282
245
|
active: a().bool,
|
|
283
246
|
children: a().node,
|
|
284
247
|
description: a().string,
|
|
285
248
|
descriptionPosition: a().oneOf([ "right", "bottom" ]),
|
|
286
249
|
disabled: a().bool,
|
|
250
|
+
elementRef: a().oneOfType([ a().func, a().object ]),
|
|
287
251
|
hidden: a().bool,
|
|
288
252
|
icon: a().node,
|
|
289
253
|
label: a().string.isRequired,
|
|
@@ -304,144 +268,136 @@
|
|
|
304
268
|
truncate: a().bool,
|
|
305
269
|
value: a().oneOfType([ a().string, a().number, a().bool ]).isRequired
|
|
306
270
|
};
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
multiple:
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
271
|
+
/**
|
|
272
|
+
* An option within a `Multiselect`.
|
|
273
|
+
*/ function S(r) {
|
|
274
|
+
var n = r.children, o = r.descriptionPosition, a = o === void 0 ? "bottom" : o, l = r.disabled, i = r.elementRef, u = r.icon, c = r.label, s = r.multiple, p = r.onClick, v = r.role, y = v === void 0 ? "option" : v, m = r.value, h = g(r, [ "children", "descriptionPosition", "disabled", "elementRef", "icon", "label", "multiple", "onClick", "role", "value" ]);
|
|
275
|
+
// @docs-props-type OptionPropsBase
|
|
276
|
+
var O = (0, e.useCallback)((function(e) {
|
|
277
|
+
if (!l) {
|
|
278
|
+
p === null || p === void 0 ? void 0 : p(e, {
|
|
279
|
+
value: m
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
}), [ l, p, m ]);
|
|
283
|
+
var w = m.toString();
|
|
284
|
+
var S = b({
|
|
285
|
+
descriptionPosition: a,
|
|
286
|
+
disabled: l
|
|
287
|
+
}, h);
|
|
288
|
+
|
|
289
|
+
return t().createElement(f.Item, d({
|
|
290
|
+
"data-test-value": m,
|
|
291
|
+
"data-test": "option",
|
|
292
|
+
elementRef: i
|
|
293
|
+
}, S, {
|
|
294
|
+
selectable: true,
|
|
295
|
+
selectableAppearance: s ? "checkbox" : "checkmark",
|
|
296
|
+
startAdornment: u,
|
|
297
|
+
onClick: O,
|
|
298
|
+
role: y,
|
|
299
|
+
value: w
|
|
300
|
+
}), n || c);
|
|
301
|
+
}
|
|
302
|
+
S.propTypes = w;
|
|
303
|
+
S.type = f.Item;
|
|
304
|
+
// For components to distinguish if their children are Options or Headings/Dividers
|
|
305
|
+
/* harmony default export */ const C = S;
|
|
306
|
+
// CONCATENATED MODULE: ./src/utils/scrollIntoViewIfNeeded.ts
|
|
307
|
+
// A utility that attempts to move an element into view by scrolling it's derived parent.
|
|
308
|
+
var k = function e(t) {
|
|
309
|
+
if (!t) {
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
var r = t.offsetParent;
|
|
313
|
+
if (!r) {
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
// Below the bottom of the container.
|
|
317
|
+
if (r.scrollTop + r.clientHeight < t.offsetTop + t.clientHeight) {
|
|
318
|
+
r.scrollTop = t.offsetTop + t.clientHeight - r.clientHeight;
|
|
319
|
+
// Above the top of the container.
|
|
320
|
+
} else if (r.scrollTop > t.offsetTop) {
|
|
321
|
+
r.scrollTop = t.offsetTop;
|
|
322
|
+
}
|
|
314
323
|
};
|
|
324
|
+
// CONCATENATED MODULE: ./src/utils/updateReactRef.ts
|
|
315
325
|
/**
|
|
316
|
-
*
|
|
317
|
-
*
|
|
318
|
-
*
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
var n = e.props, r = n.onClick, o = n.value, a = n.disabled;
|
|
332
|
-
if (!a) {
|
|
333
|
-
r === null || r === void 0 ? void 0 : r(t, {
|
|
334
|
-
value: o
|
|
335
|
-
});
|
|
336
|
-
}
|
|
337
|
-
}));
|
|
338
|
-
j(S(e), "handleMount", (function(t) {
|
|
339
|
-
e.c = t;
|
|
340
|
-
}));
|
|
341
|
-
return e;
|
|
326
|
+
* Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
|
|
327
|
+
*
|
|
328
|
+
* @param ref - The React callback or object ref. Can be `null` or `undefined`.
|
|
329
|
+
* @param current - The new value of the ref.
|
|
330
|
+
*/
|
|
331
|
+
function x(e, t) {
|
|
332
|
+
if (e) {
|
|
333
|
+
if (typeof e === "function") {
|
|
334
|
+
e(t);
|
|
335
|
+
} else {
|
|
336
|
+
// the public signature of this util uses React.Ref<T> to mirror the way React types refs.
|
|
337
|
+
// the intention here is to signal "we will take care of setting 'current', not you".
|
|
338
|
+
e.current = t;
|
|
339
|
+
// eslint-disable-line no-param-reassign
|
|
340
|
+
}
|
|
342
341
|
}
|
|
343
|
-
|
|
344
|
-
h(r, [ {
|
|
345
|
-
key: "scrollIntoViewIfNeeded",
|
|
346
|
-
// eslint-disable-next-line react/no-unused-class-component-methods
|
|
347
|
-
value: function e() {
|
|
348
|
-
var t;
|
|
349
|
-
(t = this.c) === null || t === void 0 ? void 0 : t.scrollIntoViewIfNeeded();
|
|
350
|
-
}
|
|
351
|
-
/**
|
|
352
|
-
* Place focus on the button.
|
|
353
|
-
*/
|
|
354
|
-
// eslint-disable-next-line react/no-unused-class-component-methods
|
|
355
|
-
}, {
|
|
356
|
-
key: "focus",
|
|
357
|
-
value: function e() {
|
|
358
|
-
var t;
|
|
359
|
-
(t = this.c) === null || t === void 0 ? void 0 : t.focus();
|
|
360
|
-
}
|
|
361
|
-
}, {
|
|
362
|
-
key: "render",
|
|
363
|
-
value: function e() {
|
|
364
|
-
var n = this.props, r = n.value, o = n.children, a = n.label, l = n.multiple, i = n.role, u = n.icon, c = v(n, [ "value", "children", "label", "multiple", "role", "icon" ]);
|
|
365
|
-
var s = r.toString();
|
|
366
|
-
|
|
367
|
-
return t().createElement(f.Item, d({
|
|
368
|
-
"data-test-value": r,
|
|
369
|
-
"data-test": "option",
|
|
370
|
-
ref: this.handleMount
|
|
371
|
-
}, c, {
|
|
372
|
-
selectable: true,
|
|
373
|
-
selectableAppearance: l ? "checkbox" : "checkmark",
|
|
374
|
-
onClick: this.handleClick,
|
|
375
|
-
role: i,
|
|
376
|
-
value: s,
|
|
377
|
-
startAdornment: u
|
|
378
|
-
}), o || a);
|
|
379
|
-
}
|
|
380
|
-
} ]);
|
|
381
|
-
return r;
|
|
382
|
-
}(e.PureComponent);
|
|
383
|
-
j(A, "propTypes", E);
|
|
384
|
-
j(A, "defaultProps", M);
|
|
385
|
-
j(A, "type", f.Item);
|
|
386
|
-
/* harmony default export */ const _ = A;
|
|
342
|
+
}
|
|
387
343
|
// CONCATENATED MODULE: ./src/Multiselect/Option.tsx
|
|
388
|
-
function
|
|
344
|
+
function j(e) {
|
|
389
345
|
"@babel/helpers - typeof";
|
|
390
|
-
return
|
|
346
|
+
return j = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
391
347
|
return typeof e;
|
|
392
348
|
} : function(e) {
|
|
393
349
|
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
394
|
-
},
|
|
350
|
+
}, j(e);
|
|
395
351
|
}
|
|
396
|
-
function
|
|
397
|
-
return
|
|
352
|
+
function P() {
|
|
353
|
+
return P = Object.assign ? Object.assign.bind() : function(e) {
|
|
398
354
|
for (var t = 1; t < arguments.length; t++) {
|
|
399
|
-
var
|
|
400
|
-
for (var
|
|
401
|
-
({}).hasOwnProperty.call(
|
|
355
|
+
var r = arguments[t];
|
|
356
|
+
for (var n in r) {
|
|
357
|
+
({}).hasOwnProperty.call(r, n) && (e[n] = r[n]);
|
|
402
358
|
}
|
|
403
359
|
}
|
|
404
360
|
return e;
|
|
405
|
-
},
|
|
361
|
+
}, P.apply(null, arguments);
|
|
406
362
|
}
|
|
407
|
-
function
|
|
363
|
+
function E(e, t) {
|
|
408
364
|
if (null == e) return {};
|
|
409
|
-
var
|
|
365
|
+
var r, n, o = I(e, t);
|
|
410
366
|
if (Object.getOwnPropertySymbols) {
|
|
411
367
|
var a = Object.getOwnPropertySymbols(e);
|
|
412
|
-
for (
|
|
413
|
-
|
|
368
|
+
for (n = 0; n < a.length; n++) {
|
|
369
|
+
r = a[n], t.includes(r) || {}.propertyIsEnumerable.call(e, r) && (o[r] = e[r]);
|
|
414
370
|
}
|
|
415
371
|
}
|
|
416
372
|
return o;
|
|
417
373
|
}
|
|
418
|
-
function
|
|
374
|
+
function I(e, t) {
|
|
419
375
|
if (null == e) return {};
|
|
420
|
-
var
|
|
421
|
-
for (var
|
|
422
|
-
if ({}.hasOwnProperty.call(e,
|
|
423
|
-
if (t.includes(
|
|
424
|
-
n
|
|
376
|
+
var r = {};
|
|
377
|
+
for (var n in e) {
|
|
378
|
+
if ({}.hasOwnProperty.call(e, n)) {
|
|
379
|
+
if (t.includes(n)) continue;
|
|
380
|
+
r[n] = e[n];
|
|
425
381
|
}
|
|
426
382
|
}
|
|
427
|
-
return
|
|
383
|
+
return r;
|
|
428
384
|
}
|
|
429
|
-
function
|
|
385
|
+
function R(e, t) {
|
|
430
386
|
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
431
387
|
}
|
|
432
|
-
function
|
|
433
|
-
for (var
|
|
434
|
-
var
|
|
435
|
-
|
|
436
|
-
Object.defineProperty(e,
|
|
388
|
+
function M(e, t) {
|
|
389
|
+
for (var r = 0; r < t.length; r++) {
|
|
390
|
+
var n = t[r];
|
|
391
|
+
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
|
|
392
|
+
Object.defineProperty(e, F(n.key), n);
|
|
437
393
|
}
|
|
438
394
|
}
|
|
439
|
-
function
|
|
440
|
-
return t &&
|
|
395
|
+
function T(e, t, r) {
|
|
396
|
+
return t && M(e.prototype, t), r && M(e, r), Object.defineProperty(e, "prototype", {
|
|
441
397
|
writable: !1
|
|
442
398
|
}), e;
|
|
443
399
|
}
|
|
444
|
-
function
|
|
400
|
+
function _(e, t) {
|
|
445
401
|
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
|
|
446
402
|
e.prototype = Object.create(t && t.prototype, {
|
|
447
403
|
constructor: {
|
|
@@ -451,69 +407,69 @@
|
|
|
451
407
|
}
|
|
452
408
|
}), Object.defineProperty(e, "prototype", {
|
|
453
409
|
writable: !1
|
|
454
|
-
}), t &&
|
|
410
|
+
}), t && A(e, t);
|
|
455
411
|
}
|
|
456
|
-
function
|
|
457
|
-
return
|
|
412
|
+
function A(e, t) {
|
|
413
|
+
return A = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
|
|
458
414
|
return e.__proto__ = t, e;
|
|
459
|
-
},
|
|
415
|
+
}, A(e, t);
|
|
460
416
|
}
|
|
461
|
-
function
|
|
462
|
-
var t =
|
|
417
|
+
function B(e) {
|
|
418
|
+
var t = D();
|
|
463
419
|
return function() {
|
|
464
|
-
var
|
|
420
|
+
var r, n = N(e);
|
|
465
421
|
if (t) {
|
|
466
|
-
var o =
|
|
467
|
-
|
|
468
|
-
} else
|
|
469
|
-
return
|
|
422
|
+
var o = N(this).constructor;
|
|
423
|
+
r = Reflect.construct(n, arguments, o);
|
|
424
|
+
} else r = n.apply(this, arguments);
|
|
425
|
+
return q(this, r);
|
|
470
426
|
};
|
|
471
427
|
}
|
|
472
|
-
function
|
|
473
|
-
if (t && ("object" ==
|
|
428
|
+
function q(e, t) {
|
|
429
|
+
if (t && ("object" == j(t) || "function" == typeof t)) return t;
|
|
474
430
|
if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
|
|
475
|
-
return
|
|
431
|
+
return V(e);
|
|
476
432
|
}
|
|
477
|
-
function
|
|
433
|
+
function V(e) {
|
|
478
434
|
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
479
435
|
return e;
|
|
480
436
|
}
|
|
481
|
-
function
|
|
437
|
+
function D() {
|
|
482
438
|
try {
|
|
483
439
|
var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
|
|
484
440
|
} catch (e) {}
|
|
485
|
-
return (
|
|
441
|
+
return (D = function t() {
|
|
486
442
|
return !!e;
|
|
487
443
|
})();
|
|
488
444
|
}
|
|
489
|
-
function
|
|
490
|
-
return
|
|
445
|
+
function N(e) {
|
|
446
|
+
return N = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
|
|
491
447
|
return e.__proto__ || Object.getPrototypeOf(e);
|
|
492
|
-
},
|
|
448
|
+
}, N(e);
|
|
493
449
|
}
|
|
494
|
-
function
|
|
495
|
-
return (t =
|
|
496
|
-
value:
|
|
450
|
+
function L(e, t, r) {
|
|
451
|
+
return (t = F(t)) in e ? Object.defineProperty(e, t, {
|
|
452
|
+
value: r,
|
|
497
453
|
enumerable: !0,
|
|
498
454
|
configurable: !0,
|
|
499
455
|
writable: !0
|
|
500
|
-
}) : e[t] =
|
|
501
|
-
}
|
|
502
|
-
function
|
|
503
|
-
var t =
|
|
504
|
-
return "symbol" ==
|
|
505
|
-
}
|
|
506
|
-
function
|
|
507
|
-
if ("object" !=
|
|
508
|
-
var
|
|
509
|
-
if (void 0 !==
|
|
510
|
-
var
|
|
511
|
-
if ("object" !=
|
|
456
|
+
}) : e[t] = r, e;
|
|
457
|
+
}
|
|
458
|
+
function F(e) {
|
|
459
|
+
var t = K(e, "string");
|
|
460
|
+
return "symbol" == j(t) ? t : t + "";
|
|
461
|
+
}
|
|
462
|
+
function K(e, t) {
|
|
463
|
+
if ("object" != j(e) || !e) return e;
|
|
464
|
+
var r = e[Symbol.toPrimitive];
|
|
465
|
+
if (void 0 !== r) {
|
|
466
|
+
var n = r.call(e, t || "default");
|
|
467
|
+
if ("object" != j(n)) return n;
|
|
512
468
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
513
469
|
}
|
|
514
470
|
return ("string" === t ? String : Number)(e);
|
|
515
471
|
}
|
|
516
|
-
var
|
|
472
|
+
var H = {
|
|
517
473
|
/** @private */
|
|
518
474
|
active: a().bool,
|
|
519
475
|
children: a().node,
|
|
@@ -543,7 +499,7 @@
|
|
|
543
499
|
truncate: a().bool,
|
|
544
500
|
value: a().oneOfType([ a().string, a().number, a().bool ]).isRequired
|
|
545
501
|
};
|
|
546
|
-
var
|
|
502
|
+
var $ = {
|
|
547
503
|
compact: false,
|
|
548
504
|
descriptionPosition: "bottom",
|
|
549
505
|
disabled: false,
|
|
@@ -554,29 +510,28 @@
|
|
|
554
510
|
* An option within a `Multiselect`. This inherits from
|
|
555
511
|
* [PureComponent](https://reactjs.org/docs/react-api.html#reactpurecomponent)
|
|
556
512
|
* so any elements passed to it must also be pure.
|
|
557
|
-
*/ var
|
|
558
|
-
|
|
559
|
-
var
|
|
560
|
-
function
|
|
513
|
+
*/ var z = function(e) {
|
|
514
|
+
_(n, e);
|
|
515
|
+
var r = B(n);
|
|
516
|
+
function n() {
|
|
561
517
|
var e;
|
|
562
|
-
|
|
563
|
-
for (var
|
|
564
|
-
|
|
565
|
-
}
|
|
566
|
-
e =
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
e.
|
|
518
|
+
R(this, n);
|
|
519
|
+
for (var o = arguments.length, a = new Array(o), l = 0; l < o; l++) {
|
|
520
|
+
a[l] = arguments[l];
|
|
521
|
+
}
|
|
522
|
+
e = r.call.apply(r, [ this ].concat(a));
|
|
523
|
+
L(V(e), "optionBaseRef", t().createRef());
|
|
524
|
+
L(V(e), "handleMount", (function(t) {
|
|
525
|
+
x(e.optionBaseRef, t);
|
|
570
526
|
}));
|
|
571
527
|
return e;
|
|
572
528
|
}
|
|
573
529
|
// @docs-props-type OptionPropsBase
|
|
574
|
-
|
|
530
|
+
T(n, [ {
|
|
575
531
|
key: "scrollIntoViewIfNeeded",
|
|
576
532
|
// eslint-disable-next-line react/no-unused-class-component-methods
|
|
577
533
|
value: function e() {
|
|
578
|
-
|
|
579
|
-
(t = this.c) === null || t === void 0 ? void 0 : t.scrollIntoViewIfNeeded();
|
|
534
|
+
k(this.optionBaseRef.current);
|
|
580
535
|
}
|
|
581
536
|
/**
|
|
582
537
|
* Place focus on the button.
|
|
@@ -585,106 +540,109 @@
|
|
|
585
540
|
}, {
|
|
586
541
|
key: "focus",
|
|
587
542
|
value: function e() {
|
|
588
|
-
var t;
|
|
589
|
-
(t = this.
|
|
543
|
+
var t, r;
|
|
544
|
+
(t = this.optionBaseRef) === null || t === void 0 ? void 0 : (r = t.current) === null || r === void 0 ? void 0 : r.focus();
|
|
590
545
|
}
|
|
591
546
|
}, {
|
|
592
547
|
key: "render",
|
|
593
548
|
value: function e() {
|
|
594
|
-
var
|
|
549
|
+
var r = this.props, n = r.compact, o = E(r, [ "compact" ]);
|
|
595
550
|
|
|
596
|
-
return t().createElement(
|
|
597
|
-
|
|
598
|
-
|
|
551
|
+
return t().createElement(C, P({}, o, {
|
|
552
|
+
elementRef: this.handleMount,
|
|
553
|
+
multiple: n
|
|
599
554
|
}), this.props.children || this.props.label);
|
|
600
555
|
}
|
|
601
556
|
} ]);
|
|
602
|
-
return
|
|
557
|
+
return n;
|
|
603
558
|
}(e.PureComponent);
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
/* harmony default export */ const
|
|
559
|
+
L(z, "propTypes", H);
|
|
560
|
+
L(z, "defaultProps", $);
|
|
561
|
+
/* harmony default export */ const W = z;
|
|
607
562
|
// CONCATENATED MODULE: external "lodash/castArray"
|
|
608
|
-
const
|
|
609
|
-
var
|
|
563
|
+
const U = require("lodash/castArray");
|
|
564
|
+
var G = r.n(U);
|
|
610
565
|
// CONCATENATED MODULE: external "lodash/find"
|
|
611
|
-
const
|
|
612
|
-
var
|
|
566
|
+
const J = require("lodash/find");
|
|
567
|
+
var X = r.n(J);
|
|
613
568
|
// CONCATENATED MODULE: external "lodash/forEachRight"
|
|
614
|
-
const
|
|
615
|
-
var
|
|
569
|
+
const Q = require("lodash/forEachRight");
|
|
570
|
+
var Y = r.n(Q);
|
|
616
571
|
// CONCATENATED MODULE: external "lodash/includes"
|
|
617
|
-
const
|
|
618
|
-
var
|
|
572
|
+
const Z = require("lodash/includes");
|
|
573
|
+
var ee = r.n(Z);
|
|
619
574
|
// CONCATENATED MODULE: external "lodash/memoize"
|
|
620
|
-
const
|
|
621
|
-
var
|
|
575
|
+
const te = require("lodash/memoize");
|
|
576
|
+
var re = r.n(te);
|
|
622
577
|
// CONCATENATED MODULE: external "lodash/pick"
|
|
623
|
-
const
|
|
624
|
-
var
|
|
578
|
+
const ne = require("lodash/pick");
|
|
579
|
+
var oe = r.n(ne);
|
|
625
580
|
// CONCATENATED MODULE: external "lodash/uniq"
|
|
626
|
-
const
|
|
627
|
-
var
|
|
581
|
+
const ae = require("lodash/uniq");
|
|
582
|
+
var le = r.n(ae);
|
|
628
583
|
// CONCATENATED MODULE: external "lodash/without"
|
|
629
|
-
const
|
|
630
|
-
var
|
|
584
|
+
const ie = require("lodash/without");
|
|
585
|
+
var ue = r.n(ie);
|
|
631
586
|
// CONCATENATED MODULE: external "@splunk/react-ui/Dropdown"
|
|
632
|
-
const
|
|
633
|
-
var
|
|
587
|
+
const ce = require("@splunk/react-ui/Dropdown");
|
|
588
|
+
var se = r.n(ce);
|
|
634
589
|
// CONCATENATED MODULE: external "@splunk/react-ui/Link"
|
|
635
|
-
const
|
|
636
|
-
var
|
|
590
|
+
const fe = require("@splunk/react-ui/Link");
|
|
591
|
+
var pe = r.n(fe);
|
|
637
592
|
// CONCATENATED MODULE: external "@splunk/react-ui/ResultsMenu"
|
|
638
|
-
const
|
|
639
|
-
var
|
|
593
|
+
const de = require("@splunk/react-ui/ResultsMenu");
|
|
594
|
+
var ve = r.n(de);
|
|
640
595
|
// CONCATENATED MODULE: external "@splunk/react-ui/Text"
|
|
641
|
-
const
|
|
642
|
-
var
|
|
596
|
+
const be = require("@splunk/react-ui/Text");
|
|
597
|
+
var ye = r.n(be);
|
|
598
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/ScreenReaderContent"
|
|
599
|
+
const me = require("@splunk/react-ui/ScreenReaderContent");
|
|
600
|
+
var he = r.n(me);
|
|
643
601
|
// CONCATENATED MODULE: external "@splunk/react-ui/usePrevious"
|
|
644
|
-
const
|
|
645
|
-
var
|
|
602
|
+
const ge = require("@splunk/react-ui/usePrevious");
|
|
603
|
+
var Oe = r.n(ge);
|
|
646
604
|
// CONCATENATED MODULE: external "@splunk/ui-utils/filter"
|
|
647
|
-
const
|
|
605
|
+
const we = require("@splunk/ui-utils/filter");
|
|
648
606
|
// CONCATENATED MODULE: external "@splunk/ui-utils/id"
|
|
649
|
-
const
|
|
607
|
+
const Se = require("@splunk/ui-utils/id");
|
|
650
608
|
// CONCATENATED MODULE: external "@splunk/ui-utils/keyboard"
|
|
651
|
-
const
|
|
609
|
+
const Ce = require("@splunk/ui-utils/keyboard");
|
|
652
610
|
// CONCATENATED MODULE: external "@splunk/react-icons/CaretSmallDown"
|
|
653
|
-
const
|
|
654
|
-
var
|
|
611
|
+
const ke = require("@splunk/react-icons/CaretSmallDown");
|
|
612
|
+
var xe = r.n(ke);
|
|
655
613
|
// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/Caret"
|
|
656
|
-
const
|
|
657
|
-
var
|
|
614
|
+
const je = require("@splunk/react-icons/enterprise/Caret");
|
|
615
|
+
var Pe = r.n(je);
|
|
658
616
|
// CONCATENATED MODULE: external "@splunk/themes"
|
|
659
|
-
const
|
|
617
|
+
const Ee = require("@splunk/themes");
|
|
660
618
|
// CONCATENATED MODULE: ./src/Select/icons/CaretSmallDown.tsx
|
|
661
|
-
var
|
|
662
|
-
var
|
|
663
|
-
var o =
|
|
619
|
+
var Ie = function e() {
|
|
620
|
+
var r = (0, Ee.useSplunkTheme)(), n = r.isEnterprise;
|
|
621
|
+
var o = n ? t().createElement(Pe(), {
|
|
664
622
|
screenReaderText: null,
|
|
665
623
|
hideDefaultTooltip: true,
|
|
666
624
|
size: .5
|
|
667
|
-
}) : t().createElement(
|
|
625
|
+
}) : t().createElement(xe(), null);
|
|
668
626
|
return o;
|
|
669
627
|
};
|
|
670
|
-
/* harmony default export */ const
|
|
628
|
+
/* harmony default export */ const Re = Ie;
|
|
671
629
|
// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/Search"
|
|
672
|
-
const
|
|
673
|
-
var
|
|
630
|
+
const Me = require("@splunk/react-icons/enterprise/Search");
|
|
631
|
+
var Te = r.n(Me);
|
|
674
632
|
// CONCATENATED MODULE: external "@splunk/react-icons/Magnifier"
|
|
675
|
-
const
|
|
676
|
-
var
|
|
633
|
+
const _e = require("@splunk/react-icons/Magnifier");
|
|
634
|
+
var Ae = r.n(_e);
|
|
677
635
|
// CONCATENATED MODULE: ./src/Select/icons/Search.tsx
|
|
678
|
-
var
|
|
679
|
-
var
|
|
636
|
+
var Be = function e() {
|
|
637
|
+
var r = (0, Ee.useSplunkTheme)(), n = r.isEnterprise, o = r.isCompact;
|
|
680
638
|
var a = (0, s._)("Search");
|
|
681
639
|
var l = o ? "20px" : "24px";
|
|
682
|
-
var i =
|
|
640
|
+
var i = n ? t().createElement(Te(), {
|
|
683
641
|
role: "presentation",
|
|
684
642
|
size: "16px",
|
|
685
643
|
screenReaderText: a,
|
|
686
644
|
hideDefaultTooltip: true
|
|
687
|
-
}) : t().createElement(
|
|
645
|
+
}) : t().createElement(Ae(), {
|
|
688
646
|
role: "presentation",
|
|
689
647
|
"aria-label": a,
|
|
690
648
|
width: l,
|
|
@@ -692,9 +650,9 @@
|
|
|
692
650
|
});
|
|
693
651
|
return i;
|
|
694
652
|
};
|
|
695
|
-
/* harmony default export */ const
|
|
653
|
+
/* harmony default export */ const qe = Be;
|
|
696
654
|
// CONCATENATED MODULE: ./src/Select/SelectAllOption.tsx
|
|
697
|
-
var
|
|
655
|
+
var Ve = {
|
|
698
656
|
active: a().bool,
|
|
699
657
|
changedToggle: a().bool,
|
|
700
658
|
elementRef: a().oneOfType([ a().func, a().object ]),
|
|
@@ -704,13 +662,14 @@
|
|
|
704
662
|
selected: a().oneOf([ false, true, "some" ]),
|
|
705
663
|
totalCount: a().number
|
|
706
664
|
};
|
|
707
|
-
|
|
708
|
-
var r = e.active, o = e.id, a = e.onClick, l = e.selectAllLabel, i = e.totalCount, u = e.changedToggle, c = e.selected;
|
|
665
|
+
function De(e) {
|
|
666
|
+
var r = e.active, n = e.elementRef, o = e.id, a = e.onClick, l = e.selectAllLabel, i = e.totalCount, u = e.changedToggle, c = e.selected;
|
|
709
667
|
// When toggle is changed the total count is not displayed anymore so the count is now shown in the Select all menu item
|
|
710
668
|
var s = u ? " (".concat(i === null || i === void 0 ? void 0 : i.toString(), ")") : "";
|
|
711
669
|
|
|
712
|
-
return t().createElement(
|
|
670
|
+
return t().createElement(C, {
|
|
713
671
|
active: r,
|
|
672
|
+
elementRef: n,
|
|
714
673
|
"aria-keyshortcuts": "Control+A",
|
|
715
674
|
"data-test": "select-all",
|
|
716
675
|
description: "".concat(s, " Ctrl-a"),
|
|
@@ -720,23 +679,22 @@
|
|
|
720
679
|
label: l,
|
|
721
680
|
multiple: true,
|
|
722
681
|
onClick: a,
|
|
723
|
-
ref: n,
|
|
724
682
|
role: "menuitemcheckbox",
|
|
725
683
|
selected: c,
|
|
726
684
|
tabIndex: -1,
|
|
727
685
|
value: "selectAll"
|
|
728
686
|
});
|
|
729
|
-
}
|
|
730
|
-
|
|
731
|
-
/* harmony default export */ const
|
|
687
|
+
}
|
|
688
|
+
De.propTypes = Ve;
|
|
689
|
+
/* harmony default export */ const Ne = De;
|
|
732
690
|
// CONCATENATED MODULE: external "styled-components"
|
|
733
|
-
const
|
|
734
|
-
var
|
|
691
|
+
const Le = require("styled-components");
|
|
692
|
+
var Fe = r.n(Le);
|
|
735
693
|
// CONCATENATED MODULE: external "@splunk/react-ui/Button"
|
|
736
|
-
const
|
|
737
|
-
var
|
|
694
|
+
const Ke = require("@splunk/react-ui/Button");
|
|
695
|
+
var He = r.n(Ke);
|
|
738
696
|
// CONCATENATED MODULE: ./src/Select/SelectBaseStyles.ts
|
|
739
|
-
var
|
|
697
|
+
var $e = Fe()(He()).withConfig({
|
|
740
698
|
displayName: "SelectBaseStyles__StyledButton",
|
|
741
699
|
componentId: "sc-16cj7sk-0"
|
|
742
700
|
})([ "&[data-inline]{width:", ";}", "" ], (function(e) {
|
|
@@ -746,103 +704,103 @@
|
|
|
746
704
|
var t = e.$multiple;
|
|
747
705
|
return !t && "flex-grow: 0;";
|
|
748
706
|
}));
|
|
749
|
-
var
|
|
707
|
+
var ze = Fe().span.withConfig({
|
|
750
708
|
displayName: "SelectBaseStyles__StyledLinkIcon",
|
|
751
709
|
componentId: "sc-16cj7sk-1"
|
|
752
710
|
})([ "padding-right:2px;" ]);
|
|
753
|
-
var
|
|
711
|
+
var We = Fe().span.withConfig({
|
|
754
712
|
displayName: "SelectBaseStyles__StyledLinkCaret",
|
|
755
713
|
componentId: "sc-16cj7sk-2"
|
|
756
714
|
})([ "padding-left:2px;" ]);
|
|
757
|
-
var
|
|
715
|
+
var Ue = Fe().div.withConfig({
|
|
758
716
|
displayName: "SelectBaseStyles__StyledFilter",
|
|
759
717
|
componentId: "sc-16cj7sk-3"
|
|
760
|
-
})([ "padding:", ";min-width:160px;" ], (0,
|
|
718
|
+
})([ "padding:", ";min-width:160px;" ], (0, Ee.pick)({
|
|
761
719
|
enterprise: "8px",
|
|
762
720
|
prisma: "10px 16px"
|
|
763
721
|
}));
|
|
764
|
-
var
|
|
722
|
+
var Ge = Fe().span.withConfig({
|
|
765
723
|
displayName: "SelectBaseStyles__StyledSearchIconWrapper",
|
|
766
724
|
componentId: "sc-16cj7sk-4"
|
|
767
|
-
})([ "color:", ";pointer-events:none;padding:", ";" ], (0,
|
|
725
|
+
})([ "color:", ";pointer-events:none;padding:", ";" ], (0, Ee.pick)({
|
|
768
726
|
enterprise: {
|
|
769
|
-
light:
|
|
770
|
-
dark:
|
|
727
|
+
light: Ee.variables.gray60,
|
|
728
|
+
dark: Ee.variables.white
|
|
771
729
|
},
|
|
772
|
-
prisma:
|
|
773
|
-
}), (0,
|
|
730
|
+
prisma: Ee.variables.contentColorMuted
|
|
731
|
+
}), (0, Ee.pick)({
|
|
774
732
|
comfortable: "0 8px",
|
|
775
733
|
compact: "0 6px"
|
|
776
734
|
}));
|
|
777
|
-
var
|
|
735
|
+
var Je = Fe().span.withConfig({
|
|
778
736
|
displayName: "SelectBaseStyles__StyledCount",
|
|
779
737
|
componentId: "sc-16cj7sk-5"
|
|
780
|
-
})([ "padding-right:", ";" ],
|
|
781
|
-
var
|
|
738
|
+
})([ "padding-right:", ";" ], Ee.variables.spacingXSmall);
|
|
739
|
+
var Xe = Fe()(pe()).withConfig({
|
|
782
740
|
displayName: "SelectBaseStyles__StyledControlsLink",
|
|
783
741
|
componentId: "sc-16cj7sk-6"
|
|
784
742
|
})([ "margin-right:20px;", ";" ], (function(e) {
|
|
785
743
|
var t = e.$disabled;
|
|
786
|
-
return t && (0,
|
|
744
|
+
return t && (0, Le.css)([ "color:", ";" ], Ee.variables.contentColorDisabled);
|
|
787
745
|
}));
|
|
788
|
-
var
|
|
746
|
+
var Qe = Fe().div.withConfig({
|
|
789
747
|
displayName: "SelectBaseStyles__StyledToggleAllControls",
|
|
790
748
|
componentId: "sc-16cj7sk-7"
|
|
791
|
-
})([ "padding:", ";", "" ], (0,
|
|
749
|
+
})([ "padding:", ";", "" ], (0, Ee.pick)({
|
|
792
750
|
enterprise: "5px 8px",
|
|
793
751
|
prisma: "10px 16px"
|
|
794
|
-
}), (0,
|
|
752
|
+
}), (0, Ee.pickVariant)("$placement", {
|
|
795
753
|
above: {
|
|
796
|
-
enterprise: (0,
|
|
797
|
-
prisma: (0,
|
|
754
|
+
enterprise: (0, Le.css)([ "border-top:", ";" ], Ee.variables.border),
|
|
755
|
+
prisma: (0, Le.css)([ "border-top:1px solid ", ";" ], Ee.variables.neutral200)
|
|
798
756
|
},
|
|
799
757
|
below: {
|
|
800
|
-
enterprise: (0,
|
|
801
|
-
prisma: (0,
|
|
758
|
+
enterprise: (0, Le.css)([ "border-bottom:", ";" ], Ee.variables.border),
|
|
759
|
+
prisma: (0, Le.css)([ "border-bottom:1px solid ", ";" ], Ee.variables.neutral200)
|
|
802
760
|
}
|
|
803
761
|
}));
|
|
804
762
|
// EXTERNAL MODULE: ./src/useControlled/index.ts + 1 modules
|
|
805
|
-
var
|
|
763
|
+
var Ye = r(2907);
|
|
806
764
|
// CONCATENATED MODULE: ./src/utils/fuzzyMatch.ts
|
|
807
765
|
// A utility for matching keyboard characters to list values
|
|
808
|
-
var
|
|
809
|
-
return t ? t.label.charAt(
|
|
766
|
+
var Ze = function e(t, r) {
|
|
767
|
+
return t ? t.label.charAt(r).toLowerCase() : "";
|
|
810
768
|
};
|
|
811
|
-
var
|
|
769
|
+
var et = function e(t, r) {
|
|
812
770
|
if (!t.length) {
|
|
813
771
|
return t;
|
|
814
772
|
}
|
|
815
|
-
var
|
|
773
|
+
var n = null;
|
|
816
774
|
var o = false;
|
|
817
775
|
var a = t.filter((function(e) {
|
|
818
|
-
var t =
|
|
819
|
-
if (t ===
|
|
776
|
+
var t = Ze(e, r.index);
|
|
777
|
+
if (t === r.value) {
|
|
820
778
|
o = true;
|
|
821
779
|
return true;
|
|
822
780
|
}
|
|
823
781
|
// If we haven't found a match yet, keep track of the next closest match.
|
|
824
782
|
// Secondary matching looks for the closest character of a higher value, and failing that, closest of a lower value.
|
|
825
783
|
if (!o) {
|
|
826
|
-
var a =
|
|
784
|
+
var a = Ze(n, r.index);
|
|
827
785
|
if (!a) {
|
|
828
|
-
|
|
829
|
-
} else if (t >
|
|
830
|
-
if (a <
|
|
831
|
-
|
|
786
|
+
n = e;
|
|
787
|
+
} else if (t > r.value) {
|
|
788
|
+
if (a < r.value) {
|
|
789
|
+
n = e;
|
|
832
790
|
} else if (a > t) {
|
|
833
|
-
|
|
791
|
+
n = e;
|
|
834
792
|
}
|
|
835
793
|
} else if (t > a) {
|
|
836
|
-
|
|
794
|
+
n = e;
|
|
837
795
|
}
|
|
838
796
|
}
|
|
839
797
|
return false;
|
|
840
798
|
}));
|
|
841
|
-
return a.length === 0 &&
|
|
799
|
+
return a.length === 0 && n ? [ n ] : a;
|
|
842
800
|
};
|
|
843
801
|
// CONCATENATED MODULE: ./src/utils/ssrDocument.ts
|
|
844
802
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
845
|
-
var
|
|
803
|
+
var tt = {
|
|
846
804
|
body: {
|
|
847
805
|
appendChild: function e() {
|
|
848
806
|
return [];
|
|
@@ -896,14 +854,14 @@
|
|
|
896
854
|
search: ""
|
|
897
855
|
}
|
|
898
856
|
};
|
|
899
|
-
function
|
|
900
|
-
var e = typeof document !== "undefined" ? document :
|
|
857
|
+
function rt() {
|
|
858
|
+
var e = typeof document !== "undefined" ? document : tt;
|
|
901
859
|
return e;
|
|
902
860
|
}
|
|
903
861
|
// CONCATENATED MODULE: ./src/utils/ssrWindow.ts
|
|
904
862
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
905
|
-
var
|
|
906
|
-
document:
|
|
863
|
+
var nt = {
|
|
864
|
+
document: tt,
|
|
907
865
|
navigator: {
|
|
908
866
|
userAgent: ""
|
|
909
867
|
},
|
|
@@ -957,69 +915,69 @@
|
|
|
957
915
|
clearTimeout(t);
|
|
958
916
|
}
|
|
959
917
|
};
|
|
960
|
-
function
|
|
961
|
-
var e = typeof window !== "undefined" ? window :
|
|
918
|
+
function ot() {
|
|
919
|
+
var e = typeof window !== "undefined" ? window : nt;
|
|
962
920
|
return e;
|
|
963
921
|
}
|
|
964
922
|
// CONCATENATED MODULE: ./src/Select/SelectBase.tsx
|
|
965
|
-
function
|
|
966
|
-
return
|
|
923
|
+
function at(e) {
|
|
924
|
+
return ut(e) || it(e) || pt(e) || lt();
|
|
967
925
|
}
|
|
968
|
-
function
|
|
926
|
+
function lt() {
|
|
969
927
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
970
928
|
}
|
|
971
|
-
function
|
|
929
|
+
function it(e) {
|
|
972
930
|
if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"]) return Array.from(e);
|
|
973
931
|
}
|
|
974
|
-
function
|
|
975
|
-
if (Array.isArray(e)) return
|
|
932
|
+
function ut(e) {
|
|
933
|
+
if (Array.isArray(e)) return dt(e);
|
|
976
934
|
}
|
|
977
|
-
function
|
|
978
|
-
return
|
|
935
|
+
function ct() {
|
|
936
|
+
return ct = Object.assign ? Object.assign.bind() : function(e) {
|
|
979
937
|
for (var t = 1; t < arguments.length; t++) {
|
|
980
|
-
var
|
|
981
|
-
for (var
|
|
982
|
-
({}).hasOwnProperty.call(
|
|
938
|
+
var r = arguments[t];
|
|
939
|
+
for (var n in r) {
|
|
940
|
+
({}).hasOwnProperty.call(r, n) && (e[n] = r[n]);
|
|
983
941
|
}
|
|
984
942
|
}
|
|
985
943
|
return e;
|
|
986
|
-
},
|
|
944
|
+
}, ct.apply(null, arguments);
|
|
987
945
|
}
|
|
988
|
-
function
|
|
989
|
-
return
|
|
946
|
+
function st(e, t) {
|
|
947
|
+
return bt(e) || vt(e, t) || pt(e, t) || ft();
|
|
990
948
|
}
|
|
991
|
-
function
|
|
949
|
+
function ft() {
|
|
992
950
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
993
951
|
}
|
|
994
|
-
function
|
|
952
|
+
function pt(e, t) {
|
|
995
953
|
if (e) {
|
|
996
|
-
if ("string" == typeof e) return
|
|
997
|
-
var
|
|
998
|
-
return "Object" ===
|
|
954
|
+
if ("string" == typeof e) return dt(e, t);
|
|
955
|
+
var r = {}.toString.call(e).slice(8, -1);
|
|
956
|
+
return "Object" === r && e.constructor && (r = e.constructor.name), "Map" === r || "Set" === r ? Array.from(e) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? dt(e, t) : void 0;
|
|
999
957
|
}
|
|
1000
958
|
}
|
|
1001
|
-
function
|
|
959
|
+
function dt(e, t) {
|
|
1002
960
|
(null == t || t > e.length) && (t = e.length);
|
|
1003
|
-
for (var
|
|
1004
|
-
r
|
|
961
|
+
for (var r = 0, n = Array(t); r < t; r++) {
|
|
962
|
+
n[r] = e[r];
|
|
1005
963
|
}
|
|
1006
|
-
return
|
|
964
|
+
return n;
|
|
1007
965
|
}
|
|
1008
|
-
function
|
|
1009
|
-
var
|
|
1010
|
-
if (null !=
|
|
1011
|
-
var
|
|
966
|
+
function vt(e, t) {
|
|
967
|
+
var r = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
|
|
968
|
+
if (null != r) {
|
|
969
|
+
var n, o, a, l, i = [], u = !0, c = !1;
|
|
1012
970
|
try {
|
|
1013
|
-
if (a = (
|
|
1014
|
-
if (Object(
|
|
971
|
+
if (a = (r = r.call(e)).next, 0 === t) {
|
|
972
|
+
if (Object(r) !== r) return;
|
|
1015
973
|
u = !1;
|
|
1016
|
-
} else for (;!(u = (
|
|
974
|
+
} else for (;!(u = (n = a.call(r)).done) && (i.push(n.value), i.length !== t); u = !0) {
|
|
1017
975
|
}
|
|
1018
976
|
} catch (e) {
|
|
1019
977
|
c = !0, o = e;
|
|
1020
978
|
} finally {
|
|
1021
979
|
try {
|
|
1022
|
-
if (!u && null !=
|
|
980
|
+
if (!u && null != r["return"] && (l = r["return"](), Object(l) !== l)) return;
|
|
1023
981
|
} finally {
|
|
1024
982
|
if (c) throw o;
|
|
1025
983
|
}
|
|
@@ -1027,83 +985,83 @@
|
|
|
1027
985
|
return i;
|
|
1028
986
|
}
|
|
1029
987
|
}
|
|
1030
|
-
function
|
|
988
|
+
function bt(e) {
|
|
1031
989
|
if (Array.isArray(e)) return e;
|
|
1032
990
|
}
|
|
1033
|
-
function
|
|
991
|
+
function yt(e, t) {
|
|
1034
992
|
if (null == e) return {};
|
|
1035
|
-
var
|
|
993
|
+
var r, n, o = mt(e, t);
|
|
1036
994
|
if (Object.getOwnPropertySymbols) {
|
|
1037
995
|
var a = Object.getOwnPropertySymbols(e);
|
|
1038
|
-
for (
|
|
1039
|
-
|
|
996
|
+
for (n = 0; n < a.length; n++) {
|
|
997
|
+
r = a[n], t.includes(r) || {}.propertyIsEnumerable.call(e, r) && (o[r] = e[r]);
|
|
1040
998
|
}
|
|
1041
999
|
}
|
|
1042
1000
|
return o;
|
|
1043
1001
|
}
|
|
1044
|
-
function
|
|
1002
|
+
function mt(e, t) {
|
|
1045
1003
|
if (null == e) return {};
|
|
1046
|
-
var
|
|
1047
|
-
for (var
|
|
1048
|
-
if ({}.hasOwnProperty.call(e,
|
|
1049
|
-
if (t.includes(
|
|
1050
|
-
n
|
|
1004
|
+
var r = {};
|
|
1005
|
+
for (var n in e) {
|
|
1006
|
+
if ({}.hasOwnProperty.call(e, n)) {
|
|
1007
|
+
if (t.includes(n)) continue;
|
|
1008
|
+
r[n] = e[n];
|
|
1051
1009
|
}
|
|
1052
1010
|
}
|
|
1053
|
-
return
|
|
1011
|
+
return r;
|
|
1054
1012
|
}
|
|
1055
|
-
function
|
|
1013
|
+
function ht(e) {
|
|
1056
1014
|
"@babel/helpers - typeof";
|
|
1057
|
-
return
|
|
1015
|
+
return ht = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
1058
1016
|
return typeof e;
|
|
1059
1017
|
} : function(e) {
|
|
1060
1018
|
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
1061
|
-
},
|
|
1019
|
+
}, ht(e);
|
|
1062
1020
|
}
|
|
1063
|
-
function
|
|
1064
|
-
var
|
|
1021
|
+
function gt(e, t) {
|
|
1022
|
+
var r = Object.keys(e);
|
|
1065
1023
|
if (Object.getOwnPropertySymbols) {
|
|
1066
|
-
var
|
|
1067
|
-
t && (
|
|
1024
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
1025
|
+
t && (n = n.filter((function(t) {
|
|
1068
1026
|
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
1069
|
-
}))),
|
|
1027
|
+
}))), r.push.apply(r, n);
|
|
1070
1028
|
}
|
|
1071
|
-
return
|
|
1029
|
+
return r;
|
|
1072
1030
|
}
|
|
1073
|
-
function
|
|
1031
|
+
function Ot(e) {
|
|
1074
1032
|
for (var t = 1; t < arguments.length; t++) {
|
|
1075
|
-
var
|
|
1076
|
-
t % 2 ?
|
|
1077
|
-
|
|
1078
|
-
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(
|
|
1079
|
-
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(
|
|
1033
|
+
var r = null != arguments[t] ? arguments[t] : {};
|
|
1034
|
+
t % 2 ? gt(Object(r), !0).forEach((function(t) {
|
|
1035
|
+
wt(e, t, r[t]);
|
|
1036
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : gt(Object(r)).forEach((function(t) {
|
|
1037
|
+
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(r, t));
|
|
1080
1038
|
}));
|
|
1081
1039
|
}
|
|
1082
1040
|
return e;
|
|
1083
1041
|
}
|
|
1084
|
-
function
|
|
1085
|
-
return (t =
|
|
1086
|
-
value:
|
|
1042
|
+
function wt(e, t, r) {
|
|
1043
|
+
return (t = St(t)) in e ? Object.defineProperty(e, t, {
|
|
1044
|
+
value: r,
|
|
1087
1045
|
enumerable: !0,
|
|
1088
1046
|
configurable: !0,
|
|
1089
1047
|
writable: !0
|
|
1090
|
-
}) : e[t] =
|
|
1091
|
-
}
|
|
1092
|
-
function
|
|
1093
|
-
var t =
|
|
1094
|
-
return "symbol" ==
|
|
1095
|
-
}
|
|
1096
|
-
function
|
|
1097
|
-
if ("object" !=
|
|
1098
|
-
var
|
|
1099
|
-
if (void 0 !==
|
|
1100
|
-
var
|
|
1101
|
-
if ("object" !=
|
|
1048
|
+
}) : e[t] = r, e;
|
|
1049
|
+
}
|
|
1050
|
+
function St(e) {
|
|
1051
|
+
var t = Ct(e, "string");
|
|
1052
|
+
return "symbol" == ht(t) ? t : t + "";
|
|
1053
|
+
}
|
|
1054
|
+
function Ct(e, t) {
|
|
1055
|
+
if ("object" != ht(e) || !e) return e;
|
|
1056
|
+
var r = e[Symbol.toPrimitive];
|
|
1057
|
+
if (void 0 !== r) {
|
|
1058
|
+
var n = r.call(e, t || "default");
|
|
1059
|
+
if ("object" != ht(n)) return n;
|
|
1102
1060
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1103
1061
|
}
|
|
1104
1062
|
return ("string" === t ? String : Number)(e);
|
|
1105
1063
|
}
|
|
1106
|
-
var
|
|
1064
|
+
var kt = {
|
|
1107
1065
|
allowKeyMatching: a().bool,
|
|
1108
1066
|
allowNewValues: a().bool,
|
|
1109
1067
|
animateLoading: a().bool,
|
|
@@ -1152,322 +1110,110 @@
|
|
|
1152
1110
|
/** @private. */
|
|
1153
1111
|
virtualization: a().number
|
|
1154
1112
|
};
|
|
1155
|
-
var
|
|
1113
|
+
var xt = re()((function(e) {
|
|
1156
1114
|
return [ e ];
|
|
1157
1115
|
}));
|
|
1158
1116
|
// preserve separate widths for single vs. multi mode
|
|
1159
|
-
var
|
|
1160
|
-
var t = e.anchorWidth,
|
|
1161
|
-
return
|
|
1117
|
+
var jt = re()((function(e) {
|
|
1118
|
+
var t = e.anchorWidth, r = e.isMultiple, n = e.maxHeight, o = e.menuStyle;
|
|
1119
|
+
return r ? Ot({
|
|
1162
1120
|
width: Math.max(t !== null && t !== void 0 ? t : 0, 200),
|
|
1163
|
-
maxHeight:
|
|
1164
|
-
}, o) :
|
|
1121
|
+
maxHeight: n
|
|
1122
|
+
}, o) : Ot({
|
|
1165
1123
|
minWidth: t !== null && t !== void 0 ? t : undefined,
|
|
1166
1124
|
maxWidth: Math.max(t !== null && t !== void 0 ? t : 0, 300),
|
|
1167
|
-
maxHeight:
|
|
1125
|
+
maxHeight: n
|
|
1168
1126
|
}, o);
|
|
1169
1127
|
}));
|
|
1170
|
-
var
|
|
1171
|
-
function
|
|
1128
|
+
var Pt = [ "clickAway", "escapeKey", "offScreen", "tabKey", "toggleClick" ];
|
|
1129
|
+
function Et(e) {
|
|
1172
1130
|
return e && i()(e.props, "value");
|
|
1173
1131
|
}
|
|
1174
|
-
function
|
|
1175
|
-
return "".concat(
|
|
1132
|
+
function It(e, t) {
|
|
1133
|
+
return "".concat(ht(e), "-").concat(e, "-").concat(t);
|
|
1176
1134
|
}
|
|
1177
|
-
var
|
|
1178
|
-
var
|
|
1179
|
-
var
|
|
1180
|
-
var
|
|
1181
|
-
var
|
|
1182
|
-
var
|
|
1183
|
-
var C = (0, s._)("Clear all options".concat(
|
|
1135
|
+
var Rt = [ "append", "error", "prepend" ];
|
|
1136
|
+
var Mt = (0, s._)("No matches");
|
|
1137
|
+
var Tt = (0, s._)("Select...");
|
|
1138
|
+
var _t = function e(r) {
|
|
1139
|
+
var n = r.activeItemId, o = r.filterA11yId, a = r.filterKeyword, l = r.hasChildren, i = r.inputId, u = r.inputRef, c = r.menuListboxId, f = r.multiple, p = r.onClearAll, d = r.onSelectAll, v = r.onTextBlur, b = r.onTextChange, y = r.onTextFocus, m = r.onTextKeyDown, h = r.optionSelection, g = r.placement, O = r.selectAllAppearance, w = r.textHasFocus;
|
|
1140
|
+
var S = (0, s._)("Select all options".concat(h.current === "all" ? " disabled" : ""));
|
|
1141
|
+
var C = (0, s._)("Clear all options".concat(h.current === "none" ? " disabled" : ""));
|
|
1184
1142
|
// only visually disable these as opposed to fully disabling to avoid losing keyboard focus - see SUI-2731
|
|
1185
|
-
var
|
|
1186
|
-
$placement:
|
|
1143
|
+
var k = t().createElement(Qe, {
|
|
1144
|
+
$placement: g,
|
|
1187
1145
|
key: "selectAll"
|
|
1188
|
-
}, t().createElement(
|
|
1189
|
-
$disabled:
|
|
1190
|
-
"aria-label":
|
|
1191
|
-
onClick:
|
|
1146
|
+
}, t().createElement(Xe, {
|
|
1147
|
+
$disabled: h.current === "all",
|
|
1148
|
+
"aria-label": S,
|
|
1149
|
+
onClick: d,
|
|
1192
1150
|
"data-test": "select-all"
|
|
1193
|
-
},
|
|
1194
|
-
$disabled:
|
|
1151
|
+
}, a ? (0, s._)("Select all Matches") : (0, s._)("Select all")), t().createElement(Xe, {
|
|
1152
|
+
$disabled: h.current === "none",
|
|
1195
1153
|
"aria-label": C,
|
|
1196
|
-
onClick:
|
|
1154
|
+
onClick: p,
|
|
1197
1155
|
"data-test": "clear-all"
|
|
1198
|
-
},
|
|
1156
|
+
}, a ? (0, s._)("Clear all Matches") : (0, s._)("Clear all")));
|
|
1199
1157
|
|
|
1200
1158
|
return t().createElement("div", {
|
|
1201
1159
|
key: "controls"
|
|
1202
|
-
}, t().createElement(
|
|
1160
|
+
}, o && t().createElement(he(), {
|
|
1161
|
+
id: o
|
|
1162
|
+
}, (0, s._)("Type to filter")), t().createElement(Ue, {
|
|
1203
1163
|
key: "filter",
|
|
1204
1164
|
"data-test": "filter"
|
|
1205
|
-
}, t().createElement(
|
|
1206
|
-
value:
|
|
1165
|
+
}, t().createElement(ye(), {
|
|
1166
|
+
value: a,
|
|
1207
1167
|
autoCapitalize: "off",
|
|
1208
1168
|
autoComplete: "off",
|
|
1209
1169
|
autoCorrect: "off",
|
|
1210
1170
|
spellCheck: false,
|
|
1211
|
-
onChange:
|
|
1212
|
-
onKeyDown:
|
|
1213
|
-
onFocus:
|
|
1214
|
-
onBlur:
|
|
1171
|
+
onChange: b,
|
|
1172
|
+
onKeyDown: m,
|
|
1173
|
+
onFocus: y,
|
|
1174
|
+
onBlur: v,
|
|
1215
1175
|
placeholder: (0, s._)("filter"),
|
|
1216
1176
|
role: "combobox",
|
|
1217
1177
|
"aria-expanded": "true",
|
|
1218
|
-
"aria-controls":
|
|
1219
|
-
"aria-owns":
|
|
1178
|
+
"aria-controls": c,
|
|
1179
|
+
"aria-owns": l ? n : undefined,
|
|
1220
1180
|
"aria-label": (0, s._)("Filter"),
|
|
1221
1181
|
"aria-autocomplete": "list",
|
|
1222
|
-
"aria-activedescendant":
|
|
1223
|
-
inputRef:
|
|
1224
|
-
inputId:
|
|
1182
|
+
"aria-activedescendant": w && l ? n : undefined,
|
|
1183
|
+
inputRef: u,
|
|
1184
|
+
inputId: i,
|
|
1225
1185
|
canClear: true,
|
|
1226
|
-
startAdornment: t().createElement(
|
|
1227
|
-
})),
|
|
1228
|
-
};
|
|
1229
|
-
var Dt = false;
|
|
1230
|
-
var Lt = function n(r) {
|
|
1231
|
-
var o = r.activeIndex, a = r.activeItemId, l = r.allowKeyMatching, i = r.allowNewValues, u = r.availableMatchOptions, c = r.availableOptionCount, p = r.children, d = r.currentValues, v = r.filter, b = r.filterKeyword, y = r.firstSelectedOptionIndex, m = r.isLoadingOptions, h = r.multiple, g = r.newTopValues, O = r.onActiveOptionMount, w = r.onClearAll, C = r.onClick, S = r.onKeyDown, k = r.onOptionMount, x = r.onScrollBottom, j = r.onSelectAll, I = r.optionSelection, P = r.selectAllAppearance, E = r.selectedOptionCount, M = r.setActiveValue, A = r.setAvailableMatchOptions, R = r.setAvailableOptionCount, V = r.setDisplayedValues, T = r.setFirstSelectedOptionIndex, B = r.setOptionSelection, q = r.setSelectedOptionCount, N = r.textHasFocus, D = r.toggle;
|
|
1232
|
-
R(0);
|
|
1233
|
-
T(undefined);
|
|
1234
|
-
q(0);
|
|
1235
|
-
M(undefined);
|
|
1236
|
-
A([]);
|
|
1237
|
-
var L;
|
|
1238
|
-
var F = 0;
|
|
1239
|
-
var K = false;
|
|
1240
|
-
// used to avoid overwriting the selected item ref in multiple mode
|
|
1241
|
-
var H;
|
|
1242
|
-
var $ = e.Children.toArray(p).reduce((function(n, r, o) {
|
|
1243
|
-
// ignore Headings and Dividers
|
|
1244
|
-
if (!Rt(r)) {
|
|
1245
|
-
n.push(r);
|
|
1246
|
-
return n;
|
|
1247
|
-
}
|
|
1248
|
-
var a = r.props, i = a.disabled, c = a.hidden, s = a.label, p = a.value;
|
|
1249
|
-
// Find out if the search string exactly matches a value
|
|
1250
|
-
if (p === b) {
|
|
1251
|
-
L = true;
|
|
1252
|
-
}
|
|
1253
|
-
var y = d && d.indexOf(p) >= 0;
|
|
1254
|
-
var O = !!y && !i && !H;
|
|
1255
|
-
var w = l && !h && !v && !m && !x;
|
|
1256
|
-
var j = Vt(p, s);
|
|
1257
|
-
var I = -1;
|
|
1258
|
-
if (w && !i && !c) {
|
|
1259
|
-
u.current.push({
|
|
1260
|
-
label: s,
|
|
1261
|
-
value: p
|
|
1262
|
-
});
|
|
1263
|
-
I = u.current.length - 1;
|
|
1264
|
-
}
|
|
1265
|
-
// Format the Menu.Item
|
|
1266
|
-
var P = (0, e.cloneElement)(r, {
|
|
1267
|
-
key: r.key || o,
|
|
1268
|
-
onClick: C,
|
|
1269
|
-
onKeyDown: w ? function(e) {
|
|
1270
|
-
return S(e, I);
|
|
1271
|
-
} : undefined,
|
|
1272
|
-
selected: y,
|
|
1273
|
-
multiple: h,
|
|
1274
|
-
role: "option",
|
|
1275
|
-
ref: function e(t) {
|
|
1276
|
-
return k(t, j, O);
|
|
1277
|
-
}
|
|
1278
|
-
});
|
|
1279
|
-
if (O) {
|
|
1280
|
-
H = true;
|
|
1281
|
-
}
|
|
1282
|
-
if (g && g.indexOf(p) >= 0) {
|
|
1283
|
-
if (F === 0) {
|
|
1284
|
-
n.splice(F, 0, t().createElement(f.Divider, {
|
|
1285
|
-
key: "topDivider"
|
|
1286
|
-
}));
|
|
1287
|
-
K = true;
|
|
1288
|
-
}
|
|
1289
|
-
n.splice(F, 0, P);
|
|
1290
|
-
F += 1;
|
|
1291
|
-
} else {
|
|
1292
|
-
n.push(P);
|
|
1293
|
-
}
|
|
1294
|
-
return n;
|
|
1295
|
-
}), []);
|
|
1296
|
-
// In multiple mode, add missing items
|
|
1297
|
-
if (h) {
|
|
1298
|
-
ae()(d, (function(e) {
|
|
1299
|
-
var n = re()($, (function(t) {
|
|
1300
|
-
return Rt(t) && t.props && t.props.value === e;
|
|
1301
|
-
}));
|
|
1302
|
-
if (!n) {
|
|
1303
|
-
if (e === b) {
|
|
1304
|
-
L = true;
|
|
1305
|
-
}
|
|
1306
|
-
var r = g && g.indexOf(e) >= 0;
|
|
1307
|
-
var o = g.length;
|
|
1308
|
-
if (F === 0) {
|
|
1309
|
-
$.splice(0, 0, t().createElement(f.Divider, {
|
|
1310
|
-
key: "topDivider"
|
|
1311
|
-
}));
|
|
1312
|
-
F += 1;
|
|
1313
|
-
K = true;
|
|
1314
|
-
}
|
|
1315
|
-
$.splice(r ? 0 : o + 1, 0, t().createElement(_, {
|
|
1316
|
-
label: String(e),
|
|
1317
|
-
value: e,
|
|
1318
|
-
key: "missing-value-".concat(e),
|
|
1319
|
-
onClick: C,
|
|
1320
|
-
multiple: h,
|
|
1321
|
-
selected: true
|
|
1322
|
-
}));
|
|
1323
|
-
if (r) {
|
|
1324
|
-
F += 1;
|
|
1325
|
-
}
|
|
1326
|
-
}
|
|
1327
|
-
}));
|
|
1328
|
-
}
|
|
1329
|
-
var z = v === "controlled";
|
|
1330
|
-
// Filter the items
|
|
1331
|
-
var W = (0, je.stringToKeywords)(b);
|
|
1332
|
-
$ = z ? $ : $.filter((function(e) {
|
|
1333
|
-
if (Rt(e)) {
|
|
1334
|
-
return (0, je.testPhrase)(e.props.label, W);
|
|
1335
|
-
}
|
|
1336
|
-
return true;
|
|
1337
|
-
// Keep all headers and non-interactive options
|
|
1338
|
-
})).map((function(t) {
|
|
1339
|
-
if (!Rt(t)) {
|
|
1340
|
-
return t;
|
|
1341
|
-
}
|
|
1342
|
-
// highlight matched text
|
|
1343
|
-
var n = W && (0, je.keywordLocations)(t.props.label, W);
|
|
1344
|
-
|
|
1345
|
-
return (0, e.cloneElement)(t, {
|
|
1346
|
-
matchRanges: n || undefined
|
|
1347
|
-
});
|
|
1348
|
-
}));
|
|
1349
|
-
// Add the option to add the new value
|
|
1350
|
-
if (i && !L && b) {
|
|
1351
|
-
var U = K ? F + 1 : F;
|
|
1352
|
-
$.splice(U, 0, t().createElement(_, {
|
|
1353
|
-
label: "".concat(b, " (new value)"),
|
|
1354
|
-
value: b,
|
|
1355
|
-
key: "newValue",
|
|
1356
|
-
multiple: h,
|
|
1357
|
-
onClick: C
|
|
1358
|
-
}));
|
|
1359
|
-
}
|
|
1360
|
-
// When selectAll is a menu item, add an offset so that activeItem accounts for the extra selectAll option.
|
|
1361
|
-
var G = P === "checkbox" && h && $.length > 1 ? 1 : 0;
|
|
1362
|
-
var J = true;
|
|
1363
|
-
// Highlight the selected Items and remove hidden
|
|
1364
|
-
$ = $.reduce((function(t, n) {
|
|
1365
|
-
// ignore Dividers & Headings
|
|
1366
|
-
if (!Rt(n)) {
|
|
1367
|
-
t.push(n);
|
|
1368
|
-
return t;
|
|
1369
|
-
}
|
|
1370
|
-
// Ignore any hidden items
|
|
1371
|
-
if (n.props && n.props.hidden) {
|
|
1372
|
-
return t;
|
|
1373
|
-
}
|
|
1374
|
-
if (n.props.selected && !n.props.disabled && y.current == null) {
|
|
1375
|
-
T(c.current);
|
|
1376
|
-
}
|
|
1377
|
-
var r = G === o;
|
|
1378
|
-
G += 1;
|
|
1379
|
-
R(c.current + 1);
|
|
1380
|
-
q(E.current + (n.props.selected ? 1 : 0));
|
|
1381
|
-
if (n.key !== "newValue" && !n.props.disabled && !n.props.selected) {
|
|
1382
|
-
J = false;
|
|
1383
|
-
}
|
|
1384
|
-
if (!r || !N) {
|
|
1385
|
-
t.push(n);
|
|
1386
|
-
return t;
|
|
1387
|
-
}
|
|
1388
|
-
if (!n.props.disabled) {
|
|
1389
|
-
M(n.props.value);
|
|
1390
|
-
}
|
|
1391
|
-
var l = (0, e.cloneElement)(n, {
|
|
1392
|
-
active: r,
|
|
1393
|
-
id: a,
|
|
1394
|
-
ref: O
|
|
1395
|
-
});
|
|
1396
|
-
t.push(l);
|
|
1397
|
-
return t;
|
|
1398
|
-
}), []);
|
|
1399
|
-
B(E.current === 0 && "none" || J && "all" || "some");
|
|
1400
|
-
// add select all option
|
|
1401
|
-
if (P === "checkbox" && h && c.current > 0) {
|
|
1402
|
-
var X;
|
|
1403
|
-
if (I.current === "all") {
|
|
1404
|
-
if (b === "") {
|
|
1405
|
-
X = (0, s._)("Clear all");
|
|
1406
|
-
} else {
|
|
1407
|
-
X = (0, s._)("Clear all matches");
|
|
1408
|
-
}
|
|
1409
|
-
} else if (b === "") {
|
|
1410
|
-
X = (0, s._)("Select all");
|
|
1411
|
-
} else {
|
|
1412
|
-
X = (0, s._)("Select all matches");
|
|
1413
|
-
}
|
|
1414
|
-
if (o === 0 && N) {
|
|
1415
|
-
M("selectAll");
|
|
1416
|
-
}
|
|
1417
|
-
$.unshift( t().createElement($e, {
|
|
1418
|
-
active: o === 0,
|
|
1419
|
-
changedToggle: !!D,
|
|
1420
|
-
id: o === 0 ? a : undefined,
|
|
1421
|
-
onClick: I.current === "all" ? w : j,
|
|
1422
|
-
selectAllLabel: X,
|
|
1423
|
-
selected: I.current === "all" || I.current !== "none" && "some",
|
|
1424
|
-
totalCount: d.length,
|
|
1425
|
-
tabIndex: -1,
|
|
1426
|
-
ref: O
|
|
1427
|
-
}), t().createElement(f.Divider, {
|
|
1428
|
-
key: "selectAllDivider"
|
|
1429
|
-
}));
|
|
1430
|
-
}
|
|
1431
|
-
V($.reduce((function(e, t) {
|
|
1432
|
-
if (Rt(t)) {
|
|
1433
|
-
e.push(t.props.value);
|
|
1434
|
-
}
|
|
1435
|
-
return e;
|
|
1436
|
-
}), []));
|
|
1437
|
-
Dt = $.some((function(e) {
|
|
1438
|
-
return Rt(e);
|
|
1439
|
-
}));
|
|
1440
|
-
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
1441
|
-
|
|
1442
|
-
return t().createElement(t().Fragment, null, $);
|
|
1186
|
+
startAdornment: t().createElement(Ge, null, t().createElement(qe, null))
|
|
1187
|
+
})), f && l && O === "buttongroup" && k);
|
|
1443
1188
|
};
|
|
1444
|
-
var
|
|
1445
|
-
|
|
1446
|
-
var
|
|
1447
|
-
|
|
1448
|
-
|
|
1189
|
+
var At = false;
|
|
1190
|
+
var Bt = function e(t) {
|
|
1191
|
+
var r = t.prefixLabel, n = t.label, o = t.suffixLabel;
|
|
1192
|
+
var a = n;
|
|
1193
|
+
if (r) {
|
|
1194
|
+
a = [ "".concat(r, ": ") ].concat(a);
|
|
1449
1195
|
}
|
|
1450
1196
|
if (o) {
|
|
1451
|
-
a =
|
|
1197
|
+
a = G()(a).concat(" ".concat(o));
|
|
1452
1198
|
}
|
|
1453
1199
|
return a;
|
|
1454
1200
|
};
|
|
1455
|
-
function
|
|
1456
|
-
var
|
|
1201
|
+
function qt(r) {
|
|
1202
|
+
var n = r.appearance, o = r.append, a = r.children, l = r.currentValues, i = l === void 0 ? [] : l, u = r.describedBy, c = r.disabled, f = r.elementRef, p = r.error, d = r.inline, v = r.labelText, b = r.labelledBy, y = r.multiple, m = r.onClick, h = r.placeholder, g = r.prefixLabel, O = r.prepend, w = r.required, S = r.suffixLabel, C = r.toggle, k = r.toggleContent, x = yt(r, [ "appearance", "append", "children", "currentValues", "describedBy", "disabled", "elementRef", "error", "inline", "labelText", "labelledBy", "multiple", "onClick", "placeholder", "prefixLabel", "prepend", "required", "suffixLabel", "toggle", "toggleContent" ]);
|
|
1457
1203
|
var j;
|
|
1458
|
-
var
|
|
1459
|
-
var
|
|
1204
|
+
var P;
|
|
1205
|
+
var E = [];
|
|
1460
1206
|
// Generate buttonLabels
|
|
1461
|
-
var
|
|
1462
|
-
var
|
|
1463
|
-
var o =
|
|
1464
|
-
return
|
|
1207
|
+
var I = e.Children.toArray(a);
|
|
1208
|
+
var R = i.reduce((function(e, t, r, n) {
|
|
1209
|
+
var o = X()(I, (function(e) {
|
|
1210
|
+
return Et(e) && e.props.value === t;
|
|
1465
1211
|
}));
|
|
1466
1212
|
if (o) {
|
|
1467
1213
|
var a = o.props, l = a.children, u = a.icon, c = a.label;
|
|
1468
1214
|
var f = k !== "optionLabel" && l ? l : c;
|
|
1469
1215
|
e.push(f);
|
|
1470
|
-
|
|
1216
|
+
E.push(c);
|
|
1471
1217
|
// if not in multiple mode, add the icon
|
|
1472
1218
|
if (!y && i.length === 1) {
|
|
1473
1219
|
j = u;
|
|
@@ -1475,45 +1221,46 @@
|
|
|
1475
1221
|
} else if (y) {
|
|
1476
1222
|
// only add values that don't match an option in "multiple" mode to preserve old behaviour
|
|
1477
1223
|
e.push(t);
|
|
1478
|
-
|
|
1224
|
+
E.push(t.toString());
|
|
1479
1225
|
}
|
|
1480
|
-
if (
|
|
1226
|
+
if (r < n.length - 1) {
|
|
1481
1227
|
e.push((0, s._)(", "));
|
|
1482
|
-
|
|
1228
|
+
E.push((0, s._)(", "));
|
|
1483
1229
|
}
|
|
1484
1230
|
return e;
|
|
1485
1231
|
}), []);
|
|
1486
|
-
|
|
1232
|
+
P = R;
|
|
1487
1233
|
// only apply prefix / suffix if the label is not empty
|
|
1488
|
-
if (
|
|
1234
|
+
if (P.length > 0) {
|
|
1489
1235
|
// If there's more than one item selected, read out the selected total
|
|
1490
1236
|
// rather than reading out each selected item
|
|
1491
|
-
|
|
1237
|
+
E = Bt({
|
|
1492
1238
|
prefixLabel: g,
|
|
1493
|
-
label:
|
|
1494
|
-
suffixLabel:
|
|
1239
|
+
label: P.length > 1 ? [ "".concat(i.length, " items selected") ] : E,
|
|
1240
|
+
suffixLabel: S
|
|
1495
1241
|
});
|
|
1496
|
-
|
|
1242
|
+
P = Bt({
|
|
1497
1243
|
prefixLabel: g,
|
|
1498
|
-
label:
|
|
1499
|
-
suffixLabel:
|
|
1244
|
+
label: P,
|
|
1245
|
+
suffixLabel: S
|
|
1500
1246
|
});
|
|
1501
1247
|
}
|
|
1502
1248
|
// single <Select> behaviour is to show the placeholder if all parts of the label
|
|
1503
1249
|
// are empty strings so we replicate this behaviour here
|
|
1504
|
-
if (
|
|
1250
|
+
if (P.length === 0 || !y && P.every((function(e) {
|
|
1505
1251
|
return e === "";
|
|
1506
1252
|
}))) {
|
|
1507
|
-
|
|
1508
|
-
|
|
1253
|
+
P = xt(h);
|
|
1254
|
+
E = P;
|
|
1509
1255
|
}
|
|
1510
|
-
var
|
|
1256
|
+
var M = Object.keys(x).includes("aria-labelledby");
|
|
1257
|
+
var T = Ot({
|
|
1511
1258
|
"aria-describedby": u,
|
|
1512
|
-
"aria-label": "".concat(v ? "".concat(v, ", ") : "").concat(
|
|
1259
|
+
"aria-label": b || M ? undefined : "".concat(v ? "".concat(v, ", ") : "").concat(E.join("")),
|
|
1260
|
+
// aria-labelledby takes precedence over aria-label, so existence of both is redundant
|
|
1513
1261
|
"aria-labelledby": b,
|
|
1514
|
-
// aria-labelledby takes precedence over aria-label if exists
|
|
1515
1262
|
"aria-required": w,
|
|
1516
|
-
"data-select-appearance":
|
|
1263
|
+
"data-select-appearance": n,
|
|
1517
1264
|
append: o,
|
|
1518
1265
|
prepend: O,
|
|
1519
1266
|
onClick: m,
|
|
@@ -1523,568 +1270,738 @@
|
|
|
1523
1270
|
error: p
|
|
1524
1271
|
}, x);
|
|
1525
1272
|
if (y) {
|
|
1526
|
-
|
|
1273
|
+
T["data-test-values"] = JSON.stringify(i);
|
|
1527
1274
|
} else {
|
|
1528
|
-
var _ =
|
|
1529
|
-
|
|
1275
|
+
var _ = st(i, 1), A = _[0];
|
|
1276
|
+
T["data-test-value"] = A;
|
|
1530
1277
|
}
|
|
1531
|
-
if (
|
|
1278
|
+
if (C) {
|
|
1532
1279
|
|
|
1533
|
-
return (0, e.cloneElement)(
|
|
1280
|
+
return (0, e.cloneElement)(C, T);
|
|
1534
1281
|
}
|
|
1535
|
-
if (
|
|
1282
|
+
if (n === "link") {
|
|
1536
1283
|
|
|
1537
|
-
return t().createElement(
|
|
1284
|
+
return t().createElement(pe(), ct({}, T, {
|
|
1538
1285
|
"data-select-appearance": "link"
|
|
1539
|
-
}), !!j && t().createElement(
|
|
1286
|
+
}), !!j && t().createElement(ze, null, j), P || h, t().createElement(We, null, t().createElement(Re, null)));
|
|
1540
1287
|
}
|
|
1541
1288
|
|
|
1542
|
-
return t().createElement(
|
|
1289
|
+
return t().createElement($e, ct({}, T, {
|
|
1543
1290
|
$multiple: y,
|
|
1544
|
-
appearance:
|
|
1545
|
-
label:
|
|
1291
|
+
appearance: n,
|
|
1292
|
+
label: P,
|
|
1546
1293
|
error: p,
|
|
1547
1294
|
icon: j,
|
|
1548
1295
|
inline: d,
|
|
1549
1296
|
isMenu: true,
|
|
1550
1297
|
onClick: m
|
|
1551
|
-
},
|
|
1298
|
+
}, oe()(x, Rt)), !!i.length && y && t().createElement(Je, {
|
|
1552
1299
|
"data-role": "count"
|
|
1553
1300
|
}, "(", i.length, ")"));
|
|
1554
1301
|
}
|
|
1555
|
-
|
|
1556
|
-
function
|
|
1557
|
-
var r;
|
|
1558
|
-
var o = n.allowKeyMatching, a = o === void 0 ? true : o, l = n.animateLoading, i = n.appearance, u = i === void 0 ? "toggle" : i, c = n.append, s = n.allowNewValues, f = n.children, p = n.defaultPlacement, d = p === void 0 ? "vertical" : p, v = n.defaultValues, b = n.describedBy, y = n.disabled, m = n.elementRef, h = n.error, g = n.filter, O = n.footerMessage, w = n.inline, C = n.inputId, S = n.inputRef, k = n.isLoadingOptions, x = n.labelledBy, j = n.labelText, I = n.loadingMessage, P = n.menuStyle, E = P === void 0 ? {} : P, M = n.multiple, A = n.name, _ = n.noOptionsMessage, R = _ === void 0 ? Bt : _, V = n.onChange, T = n.onScroll, B = n.onScrollBottom, q = n.onFilterChange, N = n.onClick, D = n.onClose, L = n.onOpen, F = n.required, K = n.placeholder, H = K === void 0 ? qt : K, $ = n.prefixLabel, z = n.prepend, W = n.repositionMode, U = W === void 0 ? "flip" : W, G = n.selectAllAppearance, J = G === void 0 ? "buttongroup" : G, X = n.showSelectedValuesFirst, Q = n.suffixLabel, Y = n.tabConfirmsNewValue, Z = n.values, ee = n.virtualization, te = n.toggle, ne = n.toggleContent, oe = ne === void 0 ? "optionChildren" : ne, ae = wt(n, [ "allowKeyMatching", "animateLoading", "appearance", "append", "allowNewValues", "children", "defaultPlacement", "defaultValues", "describedBy", "disabled", "elementRef", "error", "filter", "footerMessage", "inline", "inputId", "inputRef", "isLoadingOptions", "labelledBy", "labelText", "loadingMessage", "menuStyle", "multiple", "name", "noOptionsMessage", "onChange", "onScroll", "onScrollBottom", "onFilterChange", "onClick", "onClose", "onOpen", "required", "placeholder", "prefixLabel", "prepend", "repositionMode", "selectAllAppearance", "showSelectedValuesFirst", "suffixLabel", "tabConfirmsNewValue", "values", "virtualization", "toggle", "toggleContent" ]);
|
|
1302
|
+
qt[ce.legacyRefMode] = true;
|
|
1303
|
+
function Vt(r) {
|
|
1304
|
+
var n = r.allowKeyMatching, o = n === void 0 ? true : n, a = r.animateLoading, l = r.appearance, i = l === void 0 ? "toggle" : l, u = r.append, c = r.allowNewValues, p = r.children, d = r.defaultPlacement, v = d === void 0 ? "vertical" : d, b = r.defaultValues, y = r.describedBy, m = r.disabled, h = r.elementRef, g = r.error, O = r.filter, w = r.footerMessage, S = r.inline, x = r.inputId, j = r.inputRef, P = r.isLoadingOptions, E = r.labelledBy, I = r.labelText, R = r.loadingMessage, M = r.menuStyle, T = M === void 0 ? {} : M, _ = r.multiple, A = r.name, B = r.noOptionsMessage, q = B === void 0 ? Mt : B, V = r.onChange, D = r.onScroll, N = r.onScrollBottom, L = r.onFilterChange, F = r.onClick, K = r.onClose, H = r.onOpen, $ = r.required, z = r.placeholder, W = z === void 0 ? Tt : z, U = r.prefixLabel, G = r.prepend, J = r.repositionMode, Q = J === void 0 ? "flip" : J, Z = r.selectAllAppearance, te = Z === void 0 ? "buttongroup" : Z, re = r.showSelectedValuesFirst, ne = r.suffixLabel, oe = r.tabConfirmsNewValue, ae = r.values, ie = r.virtualization, ce = r.toggle, fe = r.toggleContent, pe = fe === void 0 ? "optionChildren" : fe, be = yt(r, [ "allowKeyMatching", "animateLoading", "appearance", "append", "allowNewValues", "children", "defaultPlacement", "defaultValues", "describedBy", "disabled", "elementRef", "error", "filter", "footerMessage", "inline", "inputId", "inputRef", "isLoadingOptions", "labelledBy", "labelText", "loadingMessage", "menuStyle", "multiple", "name", "noOptionsMessage", "onChange", "onScroll", "onScrollBottom", "onFilterChange", "onClick", "onClose", "onOpen", "required", "placeholder", "prefixLabel", "prepend", "repositionMode", "selectAllAppearance", "showSelectedValuesFirst", "suffixLabel", "tabConfirmsNewValue", "values", "virtualization", "toggle", "toggleContent" ]);
|
|
1559
1305
|
// @docs-props-type SelectBasePropsBase
|
|
1560
|
-
var
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1306
|
+
var ye = (0, Ye["default"])({
|
|
1307
|
+
componentName: "SelectBase",
|
|
1308
|
+
/* eslint-disable-next-line prefer-rest-params */
|
|
1309
|
+
componentProps: arguments[0],
|
|
1310
|
+
// see SUI-7028
|
|
1311
|
+
defaultValuePropName: "defaultValues",
|
|
1312
|
+
valuePropName: "values"
|
|
1564
1313
|
});
|
|
1565
1314
|
// states
|
|
1566
|
-
var
|
|
1315
|
+
var me = (0, e.useState)((function() {
|
|
1567
1316
|
return {
|
|
1568
|
-
activeItemId: (0,
|
|
1569
|
-
menuListboxId: (0,
|
|
1317
|
+
activeItemId: (0, Se.createDOMID)("active-item"),
|
|
1318
|
+
menuListboxId: (0, Se.createDOMID)("menu-listbox")
|
|
1570
1319
|
};
|
|
1571
|
-
})),
|
|
1572
|
-
var
|
|
1573
|
-
var
|
|
1574
|
-
var
|
|
1575
|
-
var
|
|
1576
|
-
var
|
|
1577
|
-
var
|
|
1320
|
+
})), he = st(me, 1), ge = he[0], ke = ge.activeItemId, xe = ge.menuListboxId;
|
|
1321
|
+
var je = (0, e.useState)(0), Pe = st(je, 2), Ee = Pe[0], Ie = Pe[1];
|
|
1322
|
+
var Re = (0, e.useState)(""), Me = st(Re, 2), Te = Me[0], _e = Me[1];
|
|
1323
|
+
var Ae = (0, e.useState)(false), Be = st(Ae, 2), qe = Be[0], Ve = Be[1];
|
|
1324
|
+
var De = (0, e.useState)(false), Le = st(De, 2), Fe = Le[0], Ke = Le[1];
|
|
1325
|
+
var He = (0, e.useState)([]), $e = st(He, 2), ze = $e[0], We = $e[1];
|
|
1326
|
+
var Ue = (0, e.useState)(b || []), Ge = st(Ue, 2), Je = Ge[0], Xe = Ge[1];
|
|
1578
1327
|
// previous state
|
|
1579
|
-
var
|
|
1328
|
+
var Qe = Oe()(Ee);
|
|
1580
1329
|
// refs
|
|
1581
|
-
var
|
|
1582
|
-
var
|
|
1583
|
-
var
|
|
1584
|
-
var
|
|
1585
|
-
var
|
|
1586
|
-
var
|
|
1587
|
-
var
|
|
1588
|
-
var
|
|
1589
|
-
var
|
|
1590
|
-
var
|
|
1591
|
-
var
|
|
1592
|
-
var
|
|
1593
|
-
var
|
|
1594
|
-
var
|
|
1595
|
-
|
|
1596
|
-
var ut = function e(t) {
|
|
1597
|
-
et.current = t;
|
|
1598
|
-
};
|
|
1599
|
-
var ft = function e(t) {
|
|
1600
|
-
ot.current = t;
|
|
1601
|
-
};
|
|
1602
|
-
var pt = function e(t) {
|
|
1603
|
-
lt.current = t;
|
|
1604
|
-
};
|
|
1605
|
-
var dt = function e(t) {
|
|
1606
|
-
Ye.current = t;
|
|
1607
|
-
};
|
|
1608
|
-
var yt = function e(t) {
|
|
1609
|
-
Xe.current = t;
|
|
1610
|
-
};
|
|
1611
|
-
var mt = function e(t) {
|
|
1612
|
-
it.current = t;
|
|
1613
|
-
};
|
|
1614
|
-
var ht = function e(t) {
|
|
1615
|
-
tt.current = t;
|
|
1616
|
-
};
|
|
1330
|
+
var Ze = (0, e.useRef)(null);
|
|
1331
|
+
var tt = (0, e.useRef)(null);
|
|
1332
|
+
var rt = (0, e.useRef)(null);
|
|
1333
|
+
var nt = (0, e.useRef)([]);
|
|
1334
|
+
var lt = (0, e.useRef)([]);
|
|
1335
|
+
var it = (0, e.useRef)(Qe);
|
|
1336
|
+
var ut = (0, e.useRef)();
|
|
1337
|
+
var ft = (0, e.useRef)({});
|
|
1338
|
+
var pt = (0, e.useRef)(0);
|
|
1339
|
+
var dt = (0, e.useRef)([]);
|
|
1340
|
+
var vt = (0, e.useRef)(null);
|
|
1341
|
+
var bt = (0, e.useRef)();
|
|
1342
|
+
var mt = (0, e.useRef)(0);
|
|
1343
|
+
var ht = (0, e.useRef)("none");
|
|
1344
|
+
var gt = (0, e.useState)(O ? (0, Se.createDOMID)("filter") : undefined), Ot = st(gt, 1), wt = Ot[0];
|
|
1617
1345
|
(0, e.useEffect)((function() {
|
|
1618
1346
|
if (false) {}
|
|
1619
|
-
}), [
|
|
1620
|
-
var
|
|
1621
|
-
var e =
|
|
1622
|
-
return
|
|
1623
|
-
}), [
|
|
1624
|
-
var
|
|
1347
|
+
}), [ i, u, g, G ]);
|
|
1348
|
+
var St = (0, e.useCallback)((function() {
|
|
1349
|
+
var e = ye ? ae : Je;
|
|
1350
|
+
return _ || e == null ? e : e.slice(0, 1);
|
|
1351
|
+
}), [ ye, _, ae, Je ]);
|
|
1352
|
+
var Ct = (0, e.useCallback)((function() {
|
|
1625
1353
|
var e;
|
|
1626
1354
|
// in non-multiple mode, don't move values to the top of the list
|
|
1627
|
-
return
|
|
1628
|
-
}), [
|
|
1629
|
-
var
|
|
1630
|
-
var t =
|
|
1631
|
-
|
|
1632
|
-
|
|
1355
|
+
return _ && re !== "never" ? (e = St()) !== null && e !== void 0 ? e : [] : [];
|
|
1356
|
+
}), [ St, _, re ]);
|
|
1357
|
+
var kt = (0, e.useCallback)((function(e) {
|
|
1358
|
+
var t = Te;
|
|
1359
|
+
Ve(true);
|
|
1360
|
+
We(Ct());
|
|
1633
1361
|
// SUI-3234: preserve existing behavior difference between <Select> and <Multiselect.Compact>
|
|
1634
|
-
if (
|
|
1635
|
-
|
|
1362
|
+
if (_) {
|
|
1363
|
+
_e("");
|
|
1636
1364
|
}
|
|
1637
|
-
if (t !==
|
|
1638
|
-
|
|
1639
|
-
keyword:
|
|
1365
|
+
if (t !== Te) {
|
|
1366
|
+
L === null || L === void 0 ? void 0 : L(e, {
|
|
1367
|
+
keyword: Te
|
|
1640
1368
|
});
|
|
1641
1369
|
}
|
|
1642
|
-
}), [
|
|
1370
|
+
}), [ Te, Ct, _, L ]);
|
|
1643
1371
|
(0, e.useEffect)((function() {
|
|
1644
|
-
if (
|
|
1645
|
-
|
|
1646
|
-
if (
|
|
1647
|
-
|
|
1372
|
+
if (qe) {
|
|
1373
|
+
H === null || H === void 0 ? void 0 : H();
|
|
1374
|
+
if (vt.current && !O) {
|
|
1375
|
+
vt.current.focus();
|
|
1648
1376
|
} else {
|
|
1649
1377
|
var e;
|
|
1650
|
-
|
|
1378
|
+
Ie((e = bt.current) !== null && e !== void 0 ? e : 0);
|
|
1651
1379
|
}
|
|
1652
1380
|
}
|
|
1653
|
-
}), [
|
|
1654
|
-
var
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
}), [
|
|
1660
|
-
var
|
|
1661
|
-
var
|
|
1662
|
-
var
|
|
1663
|
-
var o =
|
|
1381
|
+
}), [ H, qe, ze, Te, O ]);
|
|
1382
|
+
var xt = (0, e.useCallback)((function() {
|
|
1383
|
+
Ve(false);
|
|
1384
|
+
Ie(0);
|
|
1385
|
+
it.current = null;
|
|
1386
|
+
K === null || K === void 0 ? void 0 : K();
|
|
1387
|
+
}), [ K ]);
|
|
1388
|
+
var Rt = (0, e.useCallback)((function(e, t) {
|
|
1389
|
+
var r;
|
|
1390
|
+
var n = (r = St()) !== null && r !== void 0 ? r : [];
|
|
1391
|
+
var o = n.indexOf(t);
|
|
1664
1392
|
var a;
|
|
1665
|
-
if (
|
|
1393
|
+
if (_) {
|
|
1666
1394
|
if (o >= 0) {
|
|
1667
|
-
a = [].concat(
|
|
1395
|
+
a = [].concat(at(n.slice(0, o)), at(n.slice(o + 1)));
|
|
1668
1396
|
} else {
|
|
1669
|
-
a =
|
|
1397
|
+
a = n.concat([ t ]);
|
|
1670
1398
|
}
|
|
1671
1399
|
} else {
|
|
1672
1400
|
// non-multiple mode must always have a value
|
|
1673
1401
|
a = [ t ];
|
|
1674
1402
|
}
|
|
1675
|
-
var l = !
|
|
1403
|
+
var l = !ye;
|
|
1676
1404
|
if (l) {
|
|
1677
|
-
|
|
1405
|
+
Xe(a);
|
|
1678
1406
|
}
|
|
1679
|
-
if (
|
|
1407
|
+
if (_) {
|
|
1680
1408
|
// in uncontrolled multiple mode, keep the menu open
|
|
1681
1409
|
if (l) {
|
|
1682
|
-
|
|
1410
|
+
Ve(true);
|
|
1683
1411
|
}
|
|
1684
1412
|
} else {
|
|
1685
1413
|
var i;
|
|
1686
1414
|
// non-multiple mode only supports a single selection
|
|
1687
1415
|
// so close the menu once a selection is made
|
|
1688
|
-
|
|
1416
|
+
xt({
|
|
1689
1417
|
reason: "contentClick"
|
|
1690
1418
|
});
|
|
1691
|
-
(i =
|
|
1419
|
+
(i = Ze.current) === null || i === void 0 ? void 0 : i.focus();
|
|
1692
1420
|
}
|
|
1693
1421
|
V === null || V === void 0 ? void 0 : V(e, {
|
|
1694
1422
|
values: a,
|
|
1695
1423
|
name: A,
|
|
1696
1424
|
reason: "valueToggle"
|
|
1697
1425
|
});
|
|
1698
|
-
}), [
|
|
1699
|
-
var
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
if (
|
|
1703
|
-
clearTimeout(
|
|
1426
|
+
}), [ St, xt, ye, _, A, V ]);
|
|
1427
|
+
var Bt = function e() {
|
|
1428
|
+
tt.current = null;
|
|
1429
|
+
nt.current = [];
|
|
1430
|
+
if (rt.current) {
|
|
1431
|
+
clearTimeout(rt.current);
|
|
1704
1432
|
}
|
|
1705
1433
|
};
|
|
1706
|
-
var
|
|
1707
|
-
var
|
|
1434
|
+
var Vt = (0, e.useCallback)((function(e) {
|
|
1435
|
+
var r;
|
|
1708
1436
|
// this doesn't make sense if we can't select multiple values
|
|
1709
|
-
if (!
|
|
1437
|
+
if (!_) {
|
|
1710
1438
|
return;
|
|
1711
1439
|
}
|
|
1712
|
-
var
|
|
1713
|
-
var o =
|
|
1714
|
-
o = t().Children.toArray(
|
|
1715
|
-
return
|
|
1440
|
+
var n = (r = St()) !== null && r !== void 0 ? r : [];
|
|
1441
|
+
var o = le()(n.concat(dt.current));
|
|
1442
|
+
o = t().Children.toArray(p).filter((function(e) {
|
|
1443
|
+
return Et(e) && ee()(o, e.props.value) && (!e.props.disabled || ee()(n, e.props.value));
|
|
1716
1444
|
})).map((function(e) {
|
|
1717
1445
|
return e.props.value;
|
|
1718
1446
|
}));
|
|
1719
|
-
if (!
|
|
1720
|
-
|
|
1447
|
+
if (!ye) {
|
|
1448
|
+
Xe(o);
|
|
1721
1449
|
}
|
|
1722
1450
|
V === null || V === void 0 ? void 0 : V(e, {
|
|
1723
1451
|
values: o,
|
|
1724
1452
|
name: A,
|
|
1725
1453
|
reason: "selectAll"
|
|
1726
1454
|
});
|
|
1727
|
-
}), [
|
|
1728
|
-
var
|
|
1729
|
-
var
|
|
1455
|
+
}), [ p, St, ye, _, A, V ]);
|
|
1456
|
+
var Dt = (0, e.useCallback)((function(e) {
|
|
1457
|
+
var r;
|
|
1730
1458
|
// this doesn't make sense if we can't select multiple values
|
|
1731
|
-
if (!
|
|
1459
|
+
if (!_) {
|
|
1732
1460
|
return;
|
|
1733
1461
|
}
|
|
1734
|
-
var
|
|
1735
|
-
var o =
|
|
1462
|
+
var n = (r = St()) !== null && r !== void 0 ? r : [];
|
|
1463
|
+
var o = ue().apply(void 0, [ n ].concat(at(dt.current)));
|
|
1736
1464
|
// this will unselect all selected values unless those values are disabled or hidden by the filter
|
|
1737
|
-
var a = t().Children.toArray(
|
|
1738
|
-
return
|
|
1465
|
+
var a = t().Children.toArray(p).filter((function(e) {
|
|
1466
|
+
return Et(e) && (ee()(n, e.props.value) && e.props.disabled || ee()(o, e.props.value));
|
|
1739
1467
|
})).map((function(e) {
|
|
1740
1468
|
return e.props.value;
|
|
1741
1469
|
}));
|
|
1742
|
-
if (!
|
|
1743
|
-
|
|
1470
|
+
if (!ye) {
|
|
1471
|
+
Xe(a);
|
|
1744
1472
|
}
|
|
1745
1473
|
V === null || V === void 0 ? void 0 : V(e, {
|
|
1746
1474
|
values: a,
|
|
1747
1475
|
name: A,
|
|
1748
1476
|
reason: "clearAll"
|
|
1749
1477
|
});
|
|
1750
|
-
}), [
|
|
1751
|
-
var
|
|
1752
|
-
if (
|
|
1753
|
-
|
|
1754
|
-
}
|
|
1755
|
-
}), [
|
|
1756
|
-
var
|
|
1757
|
-
var
|
|
1758
|
-
if (
|
|
1759
|
-
if (
|
|
1478
|
+
}), [ p, St, ye, _, A, V ]);
|
|
1479
|
+
var Nt = (0, e.useCallback)((function(e) {
|
|
1480
|
+
if (qe && !P) {
|
|
1481
|
+
N === null || N === void 0 ? void 0 : N(e);
|
|
1482
|
+
}
|
|
1483
|
+
}), [ qe, P, N ]);
|
|
1484
|
+
var Lt = (0, e.useCallback)((function(t) {
|
|
1485
|
+
var r = (0, Ce.keycode)(t.nativeEvent);
|
|
1486
|
+
if (r === "tab") {
|
|
1487
|
+
if (oe && ut.current && pt.current <= 1) {
|
|
1760
1488
|
t.preventDefault();
|
|
1761
|
-
|
|
1489
|
+
Rt(t, ut.current);
|
|
1762
1490
|
}
|
|
1763
1491
|
}
|
|
1764
1492
|
if (t.shiftKey || t.metaKey || t.ctrlKey) {
|
|
1765
|
-
if (
|
|
1493
|
+
if (r === "a" && (t.ctrlKey || t.metaKey)) {
|
|
1766
1494
|
// handle control + A
|
|
1767
|
-
if (
|
|
1768
|
-
|
|
1495
|
+
if (ht.current === "all") {
|
|
1496
|
+
Dt(t);
|
|
1769
1497
|
} else {
|
|
1770
|
-
|
|
1498
|
+
Vt(t);
|
|
1771
1499
|
}
|
|
1772
1500
|
}
|
|
1773
1501
|
return;
|
|
1774
1502
|
}
|
|
1775
|
-
if (
|
|
1503
|
+
if (r === "down") {
|
|
1776
1504
|
t.preventDefault();
|
|
1777
|
-
|
|
1778
|
-
if (
|
|
1779
|
-
var
|
|
1780
|
-
var o = e.Children.toArray(
|
|
1781
|
-
if (
|
|
1782
|
-
|
|
1505
|
+
Ie(Math.min(Ee + 1, te === "checkbox" ? pt.current : pt.current - 1));
|
|
1506
|
+
if (p && N) {
|
|
1507
|
+
var n;
|
|
1508
|
+
var o = e.Children.toArray(p).length - (2 + ((n = St()) !== null && n !== void 0 ? n : []).length);
|
|
1509
|
+
if (Ee === o) {
|
|
1510
|
+
Nt(t);
|
|
1783
1511
|
}
|
|
1784
1512
|
}
|
|
1785
1513
|
}
|
|
1786
|
-
if (
|
|
1514
|
+
if (r === "up") {
|
|
1787
1515
|
t.preventDefault();
|
|
1788
|
-
|
|
1516
|
+
Ie(Math.max(Ee - 1, 0));
|
|
1789
1517
|
}
|
|
1790
|
-
if (
|
|
1791
|
-
if (
|
|
1792
|
-
if (
|
|
1793
|
-
|
|
1518
|
+
if (r === "enter" && ut.current && qe) {
|
|
1519
|
+
if (ut.current === "selectAll") {
|
|
1520
|
+
if (ht.current === "all") {
|
|
1521
|
+
Dt(t);
|
|
1794
1522
|
} else {
|
|
1795
|
-
|
|
1523
|
+
Vt(t);
|
|
1796
1524
|
}
|
|
1797
1525
|
} else {
|
|
1798
1526
|
t.preventDefault();
|
|
1799
|
-
|
|
1527
|
+
Rt(t, ut.current);
|
|
1800
1528
|
}
|
|
1801
1529
|
}
|
|
1802
|
-
}), [
|
|
1803
|
-
var
|
|
1804
|
-
var
|
|
1530
|
+
}), [ Ee, p, St, Dt, Nt, Vt, N, qe, te, oe, Rt ]);
|
|
1531
|
+
var Ft = (0, e.useCallback)((function(e, t) {
|
|
1532
|
+
var r = t.value;
|
|
1805
1533
|
e.preventDefault();
|
|
1806
|
-
if (!
|
|
1534
|
+
if (!qe) {
|
|
1807
1535
|
return;
|
|
1808
1536
|
}
|
|
1809
|
-
|
|
1810
|
-
}), [
|
|
1811
|
-
var
|
|
1812
|
-
var
|
|
1537
|
+
Rt(e, r);
|
|
1538
|
+
}), [ qe, Rt ]);
|
|
1539
|
+
var Kt = (0, e.useCallback)((function(e, t) {
|
|
1540
|
+
var r = e.nativeEvent.key;
|
|
1813
1541
|
// Checking for a single character to avoid complications from double-byte languages and emojis.
|
|
1814
|
-
if (
|
|
1815
|
-
var
|
|
1542
|
+
if (r.length === 1) {
|
|
1543
|
+
var n = [];
|
|
1816
1544
|
var o = {
|
|
1817
1545
|
index: 0,
|
|
1818
|
-
value:
|
|
1546
|
+
value: r
|
|
1819
1547
|
};
|
|
1820
|
-
if (!
|
|
1821
|
-
if (
|
|
1822
|
-
|
|
1548
|
+
if (!tt.current) {
|
|
1549
|
+
if (r === " ") {
|
|
1550
|
+
Bt();
|
|
1823
1551
|
return;
|
|
1824
1552
|
}
|
|
1825
|
-
|
|
1826
|
-
} else if (
|
|
1827
|
-
o.index =
|
|
1828
|
-
|
|
1553
|
+
n = et(lt.current, o);
|
|
1554
|
+
} else if (nt.current.length > 1) {
|
|
1555
|
+
o.index = tt.current.index + 1;
|
|
1556
|
+
n = et(nt.current, o);
|
|
1829
1557
|
}
|
|
1830
|
-
if (
|
|
1831
|
-
var a
|
|
1558
|
+
if (n.length) {
|
|
1559
|
+
var a;
|
|
1560
|
+
var l = 0;
|
|
1832
1561
|
// If the active option is a first character match, cycle to the next matching option.
|
|
1833
|
-
if (o.index === 0 &&
|
|
1834
|
-
var
|
|
1835
|
-
if (
|
|
1836
|
-
|
|
1562
|
+
if (o.index === 0 && n.length > 1) {
|
|
1563
|
+
var i = n.indexOf(lt.current[t]);
|
|
1564
|
+
if (i >= 0) {
|
|
1565
|
+
l = i === n.length - 1 ? 0 : i + 1;
|
|
1837
1566
|
}
|
|
1838
1567
|
}
|
|
1839
|
-
var
|
|
1840
|
-
var
|
|
1841
|
-
var
|
|
1842
|
-
|
|
1843
|
-
var f;
|
|
1844
|
-
(f = s.focus) === null || f === void 0 ? void 0 : f.call(s);
|
|
1845
|
-
}
|
|
1568
|
+
var u = n[l];
|
|
1569
|
+
var c = u.value, s = u.label;
|
|
1570
|
+
var f = ft.current[It(c, s)];
|
|
1571
|
+
f === null || f === void 0 ? void 0 : (a = f.focus) === null || a === void 0 ? void 0 : a.call(f);
|
|
1846
1572
|
}
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
if (
|
|
1850
|
-
clearTimeout(
|
|
1573
|
+
nt.current = n;
|
|
1574
|
+
tt.current = o;
|
|
1575
|
+
if (rt.current) {
|
|
1576
|
+
clearTimeout(rt.current);
|
|
1851
1577
|
}
|
|
1852
|
-
|
|
1578
|
+
rt.current = setTimeout(Bt, 500);
|
|
1853
1579
|
e.preventDefault();
|
|
1854
1580
|
e.stopPropagation();
|
|
1855
1581
|
}
|
|
1856
1582
|
}), []);
|
|
1857
|
-
var
|
|
1858
|
-
var
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
keyword:
|
|
1583
|
+
var Ht = (0, e.useCallback)((function(e, t) {
|
|
1584
|
+
var r = t.value;
|
|
1585
|
+
_e(r);
|
|
1586
|
+
Ve(true);
|
|
1587
|
+
Ie(0);
|
|
1588
|
+
L === null || L === void 0 ? void 0 : L(e, {
|
|
1589
|
+
keyword: r
|
|
1864
1590
|
});
|
|
1865
|
-
}), [
|
|
1866
|
-
var Ht = (0, e.useCallback)((function() {
|
|
1867
|
-
Be(true);
|
|
1868
|
-
}), []);
|
|
1591
|
+
}), [ L ]);
|
|
1869
1592
|
var $t = (0, e.useCallback)((function() {
|
|
1870
|
-
|
|
1593
|
+
Ke(true);
|
|
1594
|
+
}), []);
|
|
1595
|
+
var zt = (0, e.useCallback)((function() {
|
|
1596
|
+
Ke(false);
|
|
1871
1597
|
}), []);
|
|
1872
|
-
var
|
|
1873
|
-
if (
|
|
1874
|
-
e
|
|
1598
|
+
var Wt = (0, e.useCallback)((function(e) {
|
|
1599
|
+
if (it.current !== Ee) {
|
|
1600
|
+
k(e);
|
|
1875
1601
|
}
|
|
1876
|
-
}), [
|
|
1877
|
-
var
|
|
1878
|
-
if (
|
|
1879
|
-
|
|
1602
|
+
}), [ Ee ]);
|
|
1603
|
+
var Ut = (0, e.useCallback)((function(e, t, r) {
|
|
1604
|
+
if (r) {
|
|
1605
|
+
vt.current = e;
|
|
1880
1606
|
}
|
|
1881
1607
|
if (e == null) {
|
|
1882
|
-
delete
|
|
1608
|
+
delete ft.current[t];
|
|
1883
1609
|
} else {
|
|
1884
|
-
|
|
1610
|
+
ft.current[t] = e;
|
|
1885
1611
|
}
|
|
1886
|
-
}), []);
|
|
1887
|
-
var
|
|
1888
|
-
|
|
1889
|
-
}), [
|
|
1890
|
-
var
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1612
|
+
}), [ ft ]);
|
|
1613
|
+
var Gt = (0, e.useCallback)((function(e) {
|
|
1614
|
+
Ze.current = e;
|
|
1615
|
+
}), [ Ze ]);
|
|
1616
|
+
var Jt = (0, e.useMemo)((function() {
|
|
1617
|
+
var e;
|
|
1618
|
+
return (e = St()) !== null && e !== void 0 ? e : [];
|
|
1619
|
+
}), [ St ]);
|
|
1620
|
+
var Xt = e.Children.toArray(p);
|
|
1621
|
+
var Qt = Jt.some((function(e) {
|
|
1622
|
+
var t = X()(Xt, (function(t) {
|
|
1623
|
+
return Et(t) && t.props.value === e;
|
|
1895
1624
|
}));
|
|
1896
1625
|
return t && !t.props.disabled;
|
|
1897
1626
|
}));
|
|
1898
|
-
var
|
|
1899
|
-
var
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1627
|
+
var Yt = re === "immediately" ? Ct() : ze;
|
|
1628
|
+
var Zt = (0, e.useMemo)((function() {
|
|
1629
|
+
pt.current = 0;
|
|
1630
|
+
bt.current = undefined;
|
|
1631
|
+
mt.current = 0;
|
|
1632
|
+
ut.current = undefined;
|
|
1633
|
+
lt.current = [];
|
|
1634
|
+
var r = function e(t, r) {
|
|
1635
|
+
return function(e) {
|
|
1636
|
+
return Ut(e, t, r);
|
|
1637
|
+
};
|
|
1638
|
+
};
|
|
1639
|
+
var n;
|
|
1640
|
+
var a = 0;
|
|
1641
|
+
var l = false;
|
|
1642
|
+
// used to avoid overwriting the selected item ref in multiple mode
|
|
1643
|
+
var i;
|
|
1644
|
+
var u = e.Children.toArray(p).reduce((function(u, c, s) {
|
|
1645
|
+
// ignore Headings and Dividers
|
|
1646
|
+
if (!Et(c)) {
|
|
1647
|
+
u.push(c);
|
|
1648
|
+
return u;
|
|
1649
|
+
}
|
|
1650
|
+
var p = c.props, d = p.disabled, v = p.hidden, b = p.label, y = p.value;
|
|
1651
|
+
// Find out if the search string exactly matches a value
|
|
1652
|
+
if (y === Te) {
|
|
1653
|
+
n = true;
|
|
1654
|
+
}
|
|
1655
|
+
var m = Jt && Jt.indexOf(y) >= 0;
|
|
1656
|
+
var h = !!m && !d && !i;
|
|
1657
|
+
var g = o && !_ && !O && !P && !N;
|
|
1658
|
+
var w = It(y, b);
|
|
1659
|
+
var S = -1;
|
|
1660
|
+
if (g && !d && !v) {
|
|
1661
|
+
lt.current.push({
|
|
1662
|
+
label: b,
|
|
1663
|
+
value: y
|
|
1664
|
+
});
|
|
1665
|
+
S = lt.current.length - 1;
|
|
1666
|
+
}
|
|
1667
|
+
// Format the Menu.Item
|
|
1668
|
+
var C = (0, e.cloneElement)(c, {
|
|
1669
|
+
elementRef: r(w, h),
|
|
1670
|
+
key: c.key || s,
|
|
1671
|
+
onClick: Ft,
|
|
1672
|
+
onKeyDown: g ? function(e) {
|
|
1673
|
+
return Kt(e, S);
|
|
1674
|
+
} : undefined,
|
|
1675
|
+
selected: m,
|
|
1676
|
+
multiple: _,
|
|
1677
|
+
role: "option"
|
|
1678
|
+
});
|
|
1679
|
+
if (h) {
|
|
1680
|
+
i = true;
|
|
1681
|
+
}
|
|
1682
|
+
if (Yt && Yt.indexOf(y) >= 0) {
|
|
1683
|
+
if (a === 0) {
|
|
1684
|
+
u.splice(a, 0, t().createElement(f.Divider, {
|
|
1685
|
+
key: "topDivider"
|
|
1686
|
+
}));
|
|
1687
|
+
l = true;
|
|
1688
|
+
}
|
|
1689
|
+
u.splice(a, 0, C);
|
|
1690
|
+
a += 1;
|
|
1691
|
+
} else {
|
|
1692
|
+
u.push(C);
|
|
1693
|
+
}
|
|
1694
|
+
return u;
|
|
1695
|
+
}), []);
|
|
1696
|
+
// In multiple mode, add missing items
|
|
1697
|
+
if (_) {
|
|
1698
|
+
Y()(Jt, (function(e) {
|
|
1699
|
+
var o = X()(u, (function(t) {
|
|
1700
|
+
return Et(t) && t.props && t.props.value === e;
|
|
1701
|
+
}));
|
|
1702
|
+
if (!o) {
|
|
1703
|
+
if (e === Te) {
|
|
1704
|
+
n = true;
|
|
1705
|
+
}
|
|
1706
|
+
var i = Yt && Yt.indexOf(e) >= 0;
|
|
1707
|
+
var c = Yt.length;
|
|
1708
|
+
if (a === 0) {
|
|
1709
|
+
u.splice(0, 0, t().createElement(f.Divider, {
|
|
1710
|
+
key: "topDivider"
|
|
1711
|
+
}));
|
|
1712
|
+
a += 1;
|
|
1713
|
+
l = true;
|
|
1714
|
+
}
|
|
1715
|
+
var s = String(e);
|
|
1716
|
+
var p = It(e, s);
|
|
1717
|
+
u.splice(i ? 0 : c + 1, 0, t().createElement(C, {
|
|
1718
|
+
elementRef: r(p),
|
|
1719
|
+
label: s,
|
|
1720
|
+
value: e,
|
|
1721
|
+
key: "missing-value-".concat(e),
|
|
1722
|
+
onClick: Ft,
|
|
1723
|
+
multiple: _,
|
|
1724
|
+
selected: true
|
|
1725
|
+
}));
|
|
1726
|
+
if (i) {
|
|
1727
|
+
a += 1;
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
1730
|
+
}));
|
|
1731
|
+
}
|
|
1732
|
+
var d = O === "controlled";
|
|
1733
|
+
// Filter the items
|
|
1734
|
+
var v = (0, we.stringToKeywords)(Te);
|
|
1735
|
+
u = d ? u : u.filter((function(e) {
|
|
1736
|
+
if (Et(e)) {
|
|
1737
|
+
return (0, we.testPhrase)(e.props.label, v);
|
|
1738
|
+
}
|
|
1739
|
+
return true;
|
|
1740
|
+
// Keep all headers and non-interactive options
|
|
1741
|
+
})).map((function(t) {
|
|
1742
|
+
if (!Et(t)) {
|
|
1743
|
+
return t;
|
|
1744
|
+
}
|
|
1745
|
+
// highlight matched text
|
|
1746
|
+
var r = v && (0, we.keywordLocations)(t.props.label, v);
|
|
1747
|
+
|
|
1748
|
+
return (0, e.cloneElement)(t, {
|
|
1749
|
+
matchRanges: r || undefined
|
|
1750
|
+
});
|
|
1751
|
+
}));
|
|
1752
|
+
// Add the option to add the new value
|
|
1753
|
+
if (c && !n && Te) {
|
|
1754
|
+
var b = l ? a + 1 : a;
|
|
1755
|
+
var y = "".concat(Te, " (new value)");
|
|
1756
|
+
var m = It(Te, y);
|
|
1757
|
+
u.splice(b, 0, t().createElement(C, {
|
|
1758
|
+
elementRef: r(m),
|
|
1759
|
+
label: y,
|
|
1760
|
+
value: Te,
|
|
1761
|
+
key: "newValue",
|
|
1762
|
+
multiple: _,
|
|
1763
|
+
onClick: Ft
|
|
1764
|
+
}));
|
|
1765
|
+
}
|
|
1766
|
+
// When selectAll is a menu item, add an offset so that activeItem accounts for the extra selectAll option.
|
|
1767
|
+
var h = te === "checkbox" && _ && u.length > 1 ? 1 : 0;
|
|
1768
|
+
var g = true;
|
|
1769
|
+
// Highlight the selected Items and remove hidden
|
|
1770
|
+
u = u.reduce((function(t, r) {
|
|
1771
|
+
// ignore Dividers & Headings
|
|
1772
|
+
if (!Et(r)) {
|
|
1773
|
+
t.push(r);
|
|
1774
|
+
return t;
|
|
1775
|
+
}
|
|
1776
|
+
// Ignore any hidden items
|
|
1777
|
+
if (r.props && r.props.hidden) {
|
|
1778
|
+
return t;
|
|
1779
|
+
}
|
|
1780
|
+
if (r.props.selected && !r.props.disabled && bt.current == null) {
|
|
1781
|
+
bt.current = pt.current;
|
|
1782
|
+
}
|
|
1783
|
+
var n = h === Ee;
|
|
1784
|
+
h += 1;
|
|
1785
|
+
pt.current += 1;
|
|
1786
|
+
mt.current += r.props.selected ? 1 : 0;
|
|
1787
|
+
if (r.key !== "newValue" && !r.props.disabled && !r.props.selected) {
|
|
1788
|
+
g = false;
|
|
1789
|
+
}
|
|
1790
|
+
if (!n || !Fe) {
|
|
1791
|
+
t.push(r);
|
|
1792
|
+
return t;
|
|
1793
|
+
}
|
|
1794
|
+
if (!r.props.disabled) {
|
|
1795
|
+
ut.current = r.props.value;
|
|
1796
|
+
}
|
|
1797
|
+
var o = (0, e.cloneElement)(r, {
|
|
1798
|
+
active: n,
|
|
1799
|
+
elementRef: Wt,
|
|
1800
|
+
id: ke
|
|
1801
|
+
});
|
|
1802
|
+
t.push(o);
|
|
1803
|
+
return t;
|
|
1804
|
+
}), []);
|
|
1805
|
+
ht.current = mt.current === 0 && "none" || g && "all" || "some";
|
|
1806
|
+
// add select all option
|
|
1807
|
+
if (te === "checkbox" && _ && pt.current > 0) {
|
|
1808
|
+
var w;
|
|
1809
|
+
if (ht.current === "all") {
|
|
1810
|
+
if (Te === "") {
|
|
1811
|
+
w = (0, s._)("Clear all");
|
|
1812
|
+
} else {
|
|
1813
|
+
w = (0, s._)("Clear all matches");
|
|
1814
|
+
}
|
|
1815
|
+
} else if (Te === "") {
|
|
1816
|
+
w = (0, s._)("Select all");
|
|
1817
|
+
} else {
|
|
1818
|
+
w = (0, s._)("Select all matches");
|
|
1819
|
+
}
|
|
1820
|
+
if (Ee === 0 && Fe) {
|
|
1821
|
+
ut.current = "selectAll";
|
|
1822
|
+
}
|
|
1823
|
+
u.unshift( t().createElement(Ne, {
|
|
1824
|
+
key: "select-all-option",
|
|
1825
|
+
active: Ee === 0,
|
|
1826
|
+
changedToggle: !!ce,
|
|
1827
|
+
elementRef: Wt,
|
|
1828
|
+
id: Ee === 0 ? ke : undefined,
|
|
1829
|
+
onClick: ht.current === "all" ? Dt : Vt,
|
|
1830
|
+
selectAllLabel: w,
|
|
1831
|
+
selected: ht.current === "all" || ht.current !== "none" && "some",
|
|
1832
|
+
totalCount: Jt.length,
|
|
1833
|
+
tabIndex: -1
|
|
1834
|
+
}), t().createElement(f.Divider, {
|
|
1835
|
+
key: "selectAllDivider"
|
|
1836
|
+
}));
|
|
1837
|
+
}
|
|
1838
|
+
dt.current = u.reduce((function(e, t) {
|
|
1839
|
+
if (Et(t)) {
|
|
1840
|
+
e.push(t.props.value);
|
|
1841
|
+
}
|
|
1842
|
+
return e;
|
|
1843
|
+
}), []);
|
|
1844
|
+
At = u.some((function(e) {
|
|
1845
|
+
return Et(e);
|
|
1846
|
+
}));
|
|
1847
|
+
return u;
|
|
1848
|
+
}), [ Ee, ke, o, c, p, Jt, O, Te, Wt, Dt, Ft, Kt, Ut, Vt, P, _, Yt, N, te, Fe, ce ]);
|
|
1849
|
+
var er = function e(r) {
|
|
1850
|
+
var n = r.anchorWidth, o = r.maxHeight, l = r.placement;
|
|
1851
|
+
var i = jt({
|
|
1852
|
+
anchorWidth: n,
|
|
1853
|
+
isMultiple: _,
|
|
1939
1854
|
maxHeight: o,
|
|
1940
|
-
menuStyle:
|
|
1855
|
+
menuStyle: T
|
|
1941
1856
|
});
|
|
1942
|
-
var u =
|
|
1857
|
+
var u = Jt.length > 0 && !Qt && !O ? 0 : undefined;
|
|
1943
1858
|
var c = {
|
|
1944
|
-
"aria-multiselectable":
|
|
1945
|
-
childrenStart: !!
|
|
1946
|
-
activeItemId:
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1859
|
+
"aria-multiselectable": _ || undefined,
|
|
1860
|
+
childrenStart: !!O && t().createElement(_t, {
|
|
1861
|
+
activeItemId: ke,
|
|
1862
|
+
filterA11yId: wt,
|
|
1863
|
+
filterKeyword: Te,
|
|
1864
|
+
hasChildren: At,
|
|
1865
|
+
inputId: x,
|
|
1866
|
+
inputRef: j,
|
|
1867
|
+
menuListboxId: xe,
|
|
1868
|
+
multiple: _,
|
|
1869
|
+
onClearAll: Dt,
|
|
1870
|
+
onSelectAll: Vt,
|
|
1871
|
+
onTextBlur: zt,
|
|
1872
|
+
onTextChange: Ht,
|
|
1873
|
+
onTextFocus: $t,
|
|
1874
|
+
onTextKeyDown: Lt,
|
|
1875
|
+
optionSelection: ht,
|
|
1876
|
+
placement: l,
|
|
1877
|
+
selectAllAppearance: te,
|
|
1878
|
+
textHasFocus: Fe
|
|
1963
1879
|
}),
|
|
1964
|
-
focusMode:
|
|
1965
|
-
isLoading:
|
|
1966
|
-
menuId:
|
|
1967
|
-
onScrollBottom:
|
|
1968
|
-
placement:
|
|
1969
|
-
noOptionsMessage:
|
|
1970
|
-
footerMessage:
|
|
1971
|
-
animateLoading:
|
|
1972
|
-
loadingMessage:
|
|
1973
|
-
onScroll:
|
|
1880
|
+
focusMode: O ? "never" : undefined,
|
|
1881
|
+
isLoading: P,
|
|
1882
|
+
menuId: xe,
|
|
1883
|
+
onScrollBottom: N ? Nt : undefined,
|
|
1884
|
+
placement: l !== null && l !== void 0 ? l : undefined,
|
|
1885
|
+
noOptionsMessage: q,
|
|
1886
|
+
footerMessage: w,
|
|
1887
|
+
animateLoading: a,
|
|
1888
|
+
loadingMessage: R,
|
|
1889
|
+
onScroll: D,
|
|
1974
1890
|
style: i,
|
|
1975
1891
|
tabIndex: u
|
|
1976
1892
|
};
|
|
1977
|
-
if (
|
|
1893
|
+
if (ie) {
|
|
1978
1894
|
|
|
1979
|
-
return t().createElement(
|
|
1980
|
-
virtualization:
|
|
1981
|
-
}, c),
|
|
1895
|
+
return t().createElement(de.VirtualizedResultsMenu, ct({
|
|
1896
|
+
virtualization: ie
|
|
1897
|
+
}, c), Zt);
|
|
1982
1898
|
}
|
|
1983
1899
|
|
|
1984
|
-
return t().createElement(
|
|
1900
|
+
return t().createElement(ve(), c, Zt);
|
|
1985
1901
|
};
|
|
1986
1902
|
|
|
1987
|
-
return t().createElement(
|
|
1988
|
-
closeReasons:
|
|
1989
|
-
inputId:
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
1903
|
+
return t().createElement(se(), {
|
|
1904
|
+
closeReasons: Pt,
|
|
1905
|
+
inputId: x,
|
|
1906
|
+
"aria-labelledby": wt,
|
|
1907
|
+
toggle: t().createElement(qt, ct({
|
|
1908
|
+
appearance: i,
|
|
1909
|
+
append: u,
|
|
1910
|
+
currentValues: St(),
|
|
1911
|
+
"data-test": _ ? "multiselect" : "select",
|
|
1912
|
+
describedBy: y,
|
|
1913
|
+
disabled: m,
|
|
1914
|
+
elementRef: h,
|
|
1915
|
+
error: g,
|
|
1916
|
+
inline: S,
|
|
1917
|
+
labelText: I,
|
|
1918
|
+
labelledBy: E,
|
|
1919
|
+
multiple: _,
|
|
1920
|
+
onClick: F,
|
|
1921
|
+
placeholder: W,
|
|
1922
|
+
prefixLabel: U,
|
|
1923
|
+
prepend: G,
|
|
1924
|
+
required: $,
|
|
1925
|
+
suffixLabel: ne,
|
|
1926
|
+
toggle: ce,
|
|
1927
|
+
toggleContent: pe
|
|
1928
|
+
}, be), p),
|
|
1929
|
+
onRequestOpen: kt,
|
|
1930
|
+
onRequestClose: xt,
|
|
1931
|
+
open: qe,
|
|
2015
1932
|
openWithArrowKeys: true,
|
|
2016
|
-
repositionMode:
|
|
2017
|
-
defaultPlacement:
|
|
2018
|
-
canCoverAnchor:
|
|
2019
|
-
ref:
|
|
1933
|
+
repositionMode: Q,
|
|
1934
|
+
defaultPlacement: O ? v : undefined,
|
|
1935
|
+
canCoverAnchor: ot().innerHeight < 500,
|
|
1936
|
+
ref: Gt,
|
|
2020
1937
|
retainFocus: false,
|
|
2021
|
-
takeFocus:
|
|
2022
|
-
},
|
|
2023
|
-
}
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
/* harmony default export */ const
|
|
1938
|
+
takeFocus: Jt.length === 0 || Jt.length > 0 && !Qt || !!O
|
|
1939
|
+
}, er);
|
|
1940
|
+
}
|
|
1941
|
+
Vt.propTypes = kt;
|
|
1942
|
+
Vt.componentType = "SelectBase";
|
|
1943
|
+
Vt.Option = C;
|
|
1944
|
+
Vt.Divider = f.Divider;
|
|
1945
|
+
Vt.Heading = f.Heading;
|
|
1946
|
+
/* harmony default export */ const Dt = Vt;
|
|
2030
1947
|
// CONCATENATED MODULE: ./src/Multiselect/Compact.tsx
|
|
2031
|
-
function
|
|
1948
|
+
function Nt(e) {
|
|
2032
1949
|
"@babel/helpers - typeof";
|
|
2033
|
-
return
|
|
1950
|
+
return Nt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
2034
1951
|
return typeof e;
|
|
2035
1952
|
} : function(e) {
|
|
2036
1953
|
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
2037
|
-
},
|
|
1954
|
+
}, Nt(e);
|
|
2038
1955
|
}
|
|
2039
|
-
function
|
|
2040
|
-
return
|
|
1956
|
+
function Lt() {
|
|
1957
|
+
return Lt = Object.assign ? Object.assign.bind() : function(e) {
|
|
2041
1958
|
for (var t = 1; t < arguments.length; t++) {
|
|
2042
|
-
var
|
|
2043
|
-
for (var
|
|
2044
|
-
({}).hasOwnProperty.call(
|
|
1959
|
+
var r = arguments[t];
|
|
1960
|
+
for (var n in r) {
|
|
1961
|
+
({}).hasOwnProperty.call(r, n) && (e[n] = r[n]);
|
|
2045
1962
|
}
|
|
2046
1963
|
}
|
|
2047
1964
|
return e;
|
|
2048
|
-
},
|
|
1965
|
+
}, Lt.apply(null, arguments);
|
|
2049
1966
|
}
|
|
2050
|
-
function
|
|
1967
|
+
function Ft(e, t) {
|
|
2051
1968
|
if (null == e) return {};
|
|
2052
|
-
var
|
|
1969
|
+
var r, n, o = Kt(e, t);
|
|
2053
1970
|
if (Object.getOwnPropertySymbols) {
|
|
2054
1971
|
var a = Object.getOwnPropertySymbols(e);
|
|
2055
|
-
for (
|
|
2056
|
-
|
|
1972
|
+
for (n = 0; n < a.length; n++) {
|
|
1973
|
+
r = a[n], t.includes(r) || {}.propertyIsEnumerable.call(e, r) && (o[r] = e[r]);
|
|
2057
1974
|
}
|
|
2058
1975
|
}
|
|
2059
1976
|
return o;
|
|
2060
1977
|
}
|
|
2061
|
-
function
|
|
1978
|
+
function Kt(e, t) {
|
|
2062
1979
|
if (null == e) return {};
|
|
2063
|
-
var
|
|
2064
|
-
for (var
|
|
2065
|
-
if ({}.hasOwnProperty.call(e,
|
|
2066
|
-
if (t.includes(
|
|
2067
|
-
n
|
|
1980
|
+
var r = {};
|
|
1981
|
+
for (var n in e) {
|
|
1982
|
+
if ({}.hasOwnProperty.call(e, n)) {
|
|
1983
|
+
if (t.includes(n)) continue;
|
|
1984
|
+
r[n] = e[n];
|
|
2068
1985
|
}
|
|
2069
1986
|
}
|
|
2070
|
-
return
|
|
1987
|
+
return r;
|
|
2071
1988
|
}
|
|
2072
|
-
function
|
|
1989
|
+
function Ht(e, t) {
|
|
2073
1990
|
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
2074
1991
|
}
|
|
2075
|
-
function
|
|
2076
|
-
for (var
|
|
2077
|
-
var
|
|
2078
|
-
|
|
2079
|
-
Object.defineProperty(e,
|
|
1992
|
+
function $t(e, t) {
|
|
1993
|
+
for (var r = 0; r < t.length; r++) {
|
|
1994
|
+
var n = t[r];
|
|
1995
|
+
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
|
|
1996
|
+
Object.defineProperty(e, er(n.key), n);
|
|
2080
1997
|
}
|
|
2081
1998
|
}
|
|
2082
|
-
function
|
|
2083
|
-
return t &&
|
|
1999
|
+
function zt(e, t, r) {
|
|
2000
|
+
return t && $t(e.prototype, t), r && $t(e, r), Object.defineProperty(e, "prototype", {
|
|
2084
2001
|
writable: !1
|
|
2085
2002
|
}), e;
|
|
2086
2003
|
}
|
|
2087
|
-
function
|
|
2004
|
+
function Wt(e, t) {
|
|
2088
2005
|
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
|
|
2089
2006
|
e.prototype = Object.create(t && t.prototype, {
|
|
2090
2007
|
constructor: {
|
|
@@ -2094,69 +2011,69 @@
|
|
|
2094
2011
|
}
|
|
2095
2012
|
}), Object.defineProperty(e, "prototype", {
|
|
2096
2013
|
writable: !1
|
|
2097
|
-
}), t &&
|
|
2014
|
+
}), t && Ut(e, t);
|
|
2098
2015
|
}
|
|
2099
|
-
function
|
|
2100
|
-
return
|
|
2016
|
+
function Ut(e, t) {
|
|
2017
|
+
return Ut = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
|
|
2101
2018
|
return e.__proto__ = t, e;
|
|
2102
|
-
},
|
|
2019
|
+
}, Ut(e, t);
|
|
2103
2020
|
}
|
|
2104
|
-
function
|
|
2105
|
-
var t =
|
|
2021
|
+
function Gt(e) {
|
|
2022
|
+
var t = Qt();
|
|
2106
2023
|
return function() {
|
|
2107
|
-
var
|
|
2024
|
+
var r, n = Yt(e);
|
|
2108
2025
|
if (t) {
|
|
2109
|
-
var o =
|
|
2110
|
-
|
|
2111
|
-
} else
|
|
2112
|
-
return
|
|
2026
|
+
var o = Yt(this).constructor;
|
|
2027
|
+
r = Reflect.construct(n, arguments, o);
|
|
2028
|
+
} else r = n.apply(this, arguments);
|
|
2029
|
+
return Jt(this, r);
|
|
2113
2030
|
};
|
|
2114
2031
|
}
|
|
2115
|
-
function
|
|
2116
|
-
if (t && ("object" ==
|
|
2032
|
+
function Jt(e, t) {
|
|
2033
|
+
if (t && ("object" == Nt(t) || "function" == typeof t)) return t;
|
|
2117
2034
|
if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
|
|
2118
|
-
return
|
|
2035
|
+
return Xt(e);
|
|
2119
2036
|
}
|
|
2120
|
-
function
|
|
2037
|
+
function Xt(e) {
|
|
2121
2038
|
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
2122
2039
|
return e;
|
|
2123
2040
|
}
|
|
2124
|
-
function
|
|
2041
|
+
function Qt() {
|
|
2125
2042
|
try {
|
|
2126
2043
|
var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
|
|
2127
2044
|
} catch (e) {}
|
|
2128
|
-
return (
|
|
2045
|
+
return (Qt = function t() {
|
|
2129
2046
|
return !!e;
|
|
2130
2047
|
})();
|
|
2131
2048
|
}
|
|
2132
|
-
function
|
|
2133
|
-
return
|
|
2049
|
+
function Yt(e) {
|
|
2050
|
+
return Yt = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
|
|
2134
2051
|
return e.__proto__ || Object.getPrototypeOf(e);
|
|
2135
|
-
},
|
|
2052
|
+
}, Yt(e);
|
|
2136
2053
|
}
|
|
2137
|
-
function
|
|
2138
|
-
return (t =
|
|
2139
|
-
value:
|
|
2054
|
+
function Zt(e, t, r) {
|
|
2055
|
+
return (t = er(t)) in e ? Object.defineProperty(e, t, {
|
|
2056
|
+
value: r,
|
|
2140
2057
|
enumerable: !0,
|
|
2141
2058
|
configurable: !0,
|
|
2142
2059
|
writable: !0
|
|
2143
|
-
}) : e[t] =
|
|
2144
|
-
}
|
|
2145
|
-
function
|
|
2146
|
-
var t =
|
|
2147
|
-
return "symbol" ==
|
|
2148
|
-
}
|
|
2149
|
-
function
|
|
2150
|
-
if ("object" !=
|
|
2151
|
-
var
|
|
2152
|
-
if (void 0 !==
|
|
2153
|
-
var
|
|
2154
|
-
if ("object" !=
|
|
2060
|
+
}) : e[t] = r, e;
|
|
2061
|
+
}
|
|
2062
|
+
function er(e) {
|
|
2063
|
+
var t = tr(e, "string");
|
|
2064
|
+
return "symbol" == Nt(t) ? t : t + "";
|
|
2065
|
+
}
|
|
2066
|
+
function tr(e, t) {
|
|
2067
|
+
if ("object" != Nt(e) || !e) return e;
|
|
2068
|
+
var r = e[Symbol.toPrimitive];
|
|
2069
|
+
if (void 0 !== r) {
|
|
2070
|
+
var n = r.call(e, t || "default");
|
|
2071
|
+
if ("object" != Nt(n)) return n;
|
|
2155
2072
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2156
2073
|
}
|
|
2157
2074
|
return ("string" === t ? String : Number)(e);
|
|
2158
2075
|
}
|
|
2159
|
-
var
|
|
2076
|
+
var rr = {
|
|
2160
2077
|
allowNewValues: a().bool,
|
|
2161
2078
|
animateLoading: a().bool,
|
|
2162
2079
|
children: a().node,
|
|
@@ -2193,7 +2110,7 @@
|
|
|
2193
2110
|
/** @private */
|
|
2194
2111
|
virtualization: a().number
|
|
2195
2112
|
};
|
|
2196
|
-
var
|
|
2113
|
+
var nr = {
|
|
2197
2114
|
allowNewValues: false,
|
|
2198
2115
|
animateLoading: false,
|
|
2199
2116
|
defaultPlacement: "vertical",
|
|
@@ -2207,18 +2124,18 @@
|
|
|
2207
2124
|
tabConfirmsNewValue: false
|
|
2208
2125
|
};
|
|
2209
2126
|
// TS: not typed controlled/uncontrolled, handled by Multiselect wrapper component
|
|
2210
|
-
var
|
|
2211
|
-
|
|
2212
|
-
var
|
|
2127
|
+
var or = function(r) {
|
|
2128
|
+
Wt(o, r);
|
|
2129
|
+
var n = Gt(o);
|
|
2213
2130
|
function o() {
|
|
2214
|
-
|
|
2215
|
-
return
|
|
2131
|
+
Ht(this, o);
|
|
2132
|
+
return n.apply(this, arguments);
|
|
2216
2133
|
}
|
|
2217
|
-
|
|
2134
|
+
zt(o, [ {
|
|
2218
2135
|
key: "render",
|
|
2219
2136
|
// @docs-props-type CompactPropsBase
|
|
2220
|
-
value: function
|
|
2221
|
-
var
|
|
2137
|
+
value: function r() {
|
|
2138
|
+
var n = this.props, o = n.defaultValues, a = n.children, l = n.controlledFilter, i = n.filter, u = n.values, c = Ft(n, [ "defaultValues", "children", "controlledFilter", "filter", "values" ]);
|
|
2222
2139
|
var s = true;
|
|
2223
2140
|
if (i != null) {
|
|
2224
2141
|
s = i;
|
|
@@ -2228,9 +2145,13 @@
|
|
|
2228
2145
|
}
|
|
2229
2146
|
var f = {
|
|
2230
2147
|
children: e.Children.toArray(a).map((function(e) {
|
|
2231
|
-
if (
|
|
2148
|
+
if (Et(e)) {
|
|
2149
|
+
var r;
|
|
2150
|
+
var n = (r = e.key) !== null && r !== void 0 ? r : "".concat(e.props.label, "-").concat(e.props.value);
|
|
2232
2151
|
|
|
2233
|
-
return t().createElement(
|
|
2152
|
+
return t().createElement(C, Lt({
|
|
2153
|
+
key: n
|
|
2154
|
+
}, e.props, {
|
|
2234
2155
|
multiple: true
|
|
2235
2156
|
}));
|
|
2236
2157
|
}
|
|
@@ -2245,253 +2166,231 @@
|
|
|
2245
2166
|
f.values = u;
|
|
2246
2167
|
}
|
|
2247
2168
|
|
|
2248
|
-
return t().createElement(
|
|
2169
|
+
return t().createElement(Dt, Lt({}, c, f, {
|
|
2249
2170
|
multiple: true
|
|
2250
2171
|
}));
|
|
2251
2172
|
}
|
|
2252
2173
|
} ]);
|
|
2253
2174
|
return o;
|
|
2254
2175
|
}(e.Component);
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
/* harmony default export */ const
|
|
2176
|
+
Zt(or, "propTypes", rr);
|
|
2177
|
+
Zt(or, "defaultProps", nr);
|
|
2178
|
+
Zt(or, "Option", W);
|
|
2179
|
+
Zt(or, "Divider", f.Divider);
|
|
2180
|
+
Zt(or, "Heading", f.Heading);
|
|
2181
|
+
/* harmony default export */ const ar = or;
|
|
2261
2182
|
// CONCATENATED MODULE: external "lodash/defer"
|
|
2262
|
-
const
|
|
2263
|
-
var
|
|
2183
|
+
const lr = require("lodash/defer");
|
|
2184
|
+
var ir = r.n(lr);
|
|
2264
2185
|
// CONCATENATED MODULE: external "lodash/extend"
|
|
2265
|
-
const
|
|
2266
|
-
var
|
|
2186
|
+
const ur = require("lodash/extend");
|
|
2187
|
+
var cr = r.n(ur);
|
|
2267
2188
|
// CONCATENATED MODULE: external "lodash/get"
|
|
2268
|
-
const
|
|
2269
|
-
var
|
|
2189
|
+
const sr = require("lodash/get");
|
|
2190
|
+
var fr = r.n(sr);
|
|
2270
2191
|
// CONCATENATED MODULE: external "lodash/isString"
|
|
2271
|
-
const
|
|
2272
|
-
var
|
|
2192
|
+
const pr = require("lodash/isString");
|
|
2193
|
+
var dr = r.n(pr);
|
|
2273
2194
|
// CONCATENATED MODULE: external "lodash/isUndefined"
|
|
2274
|
-
const
|
|
2275
|
-
var
|
|
2195
|
+
const vr = require("lodash/isUndefined");
|
|
2196
|
+
var br = r.n(vr);
|
|
2276
2197
|
// CONCATENATED MODULE: external "lodash/keys"
|
|
2277
|
-
const
|
|
2278
|
-
var
|
|
2198
|
+
const yr = require("lodash/keys");
|
|
2199
|
+
var mr = r.n(yr);
|
|
2279
2200
|
// CONCATENATED MODULE: external "lodash/last"
|
|
2280
|
-
const
|
|
2281
|
-
var
|
|
2201
|
+
const hr = require("lodash/last");
|
|
2202
|
+
var gr = r.n(hr);
|
|
2282
2203
|
// CONCATENATED MODULE: external "lodash/pickBy"
|
|
2283
|
-
const
|
|
2284
|
-
var
|
|
2204
|
+
const Or = require("lodash/pickBy");
|
|
2205
|
+
var wr = r.n(Or);
|
|
2285
2206
|
// CONCATENATED MODULE: external "@splunk/react-ui/Chip"
|
|
2286
|
-
const
|
|
2287
|
-
var
|
|
2207
|
+
const Sr = require("@splunk/react-ui/Chip");
|
|
2208
|
+
var Cr = r.n(Sr);
|
|
2288
2209
|
// CONCATENATED MODULE: external "@splunk/react-ui/Popover"
|
|
2289
|
-
const
|
|
2290
|
-
var
|
|
2291
|
-
// CONCATENATED MODULE: external "@splunk/react-ui/ScreenReaderContent"
|
|
2292
|
-
const Rn = require("@splunk/react-ui/ScreenReaderContent");
|
|
2293
|
-
var Vn = n.n(Rn);
|
|
2210
|
+
const kr = require("@splunk/react-ui/Popover");
|
|
2211
|
+
var xr = r.n(kr);
|
|
2294
2212
|
// CONCATENATED MODULE: external "@splunk/ui-utils/format"
|
|
2295
|
-
const
|
|
2213
|
+
const jr = require("@splunk/ui-utils/format");
|
|
2296
2214
|
// CONCATENATED MODULE: external "@splunk/react-ui/Box"
|
|
2297
|
-
const
|
|
2298
|
-
var
|
|
2215
|
+
const Pr = require("@splunk/react-ui/Box");
|
|
2216
|
+
var Er = r.n(Pr);
|
|
2299
2217
|
// CONCATENATED MODULE: ./src/Multiselect/NormalStyles.ts
|
|
2300
|
-
var
|
|
2218
|
+
var Ir = Fe()(Er()).withConfig({
|
|
2301
2219
|
displayName: "NormalStyles__StyledBox",
|
|
2302
2220
|
componentId: "sc-1uwwpco-0"
|
|
2303
|
-
})([ "border-radius:", ";align-items:", ";flex-wrap:wrap;min-height:", ";max-height:300px;overflow-y:auto;border:1px solid ", ";padding:", ";", " ", " ", " ", " ", " &[data-inline]{width:400px;}[data-inline='true'] + &{margin-left:", "}" ],
|
|
2304
|
-
|
|
2221
|
+
})([ "border-radius:", ";align-items:", ";flex-wrap:wrap;min-height:", ";max-height:300px;overflow-y:auto;border:1px solid ", ";padding:", ";", " ", " ", " ", " ", " &[data-inline]{width:400px;}[data-inline='true'] + &{margin-left:", "}" ], Ee.variables.borderRadius, (0,
|
|
2222
|
+
Ee.pick)({
|
|
2305
2223
|
enterprise: "flex-start",
|
|
2306
2224
|
prisma: "center"
|
|
2307
|
-
}),
|
|
2225
|
+
}), Ee.variables.inputHeight, (0, Ee.pick)({
|
|
2308
2226
|
enterprise: {
|
|
2309
|
-
light:
|
|
2310
|
-
dark:
|
|
2227
|
+
light: Ee.variables.gray60,
|
|
2228
|
+
dark: Ee.variables.borderColor
|
|
2311
2229
|
},
|
|
2312
|
-
prisma:
|
|
2313
|
-
}), (0,
|
|
2230
|
+
prisma: Ee.variables.interactiveColorBorder
|
|
2231
|
+
}), (0, Ee.pick)({
|
|
2314
2232
|
enterprise: "2px 0 0 2px",
|
|
2315
2233
|
prisma: "2px"
|
|
2316
|
-
}), (0,
|
|
2234
|
+
}), (0, Ee.pick)({
|
|
2317
2235
|
enterprise: {
|
|
2318
|
-
light: (0,
|
|
2319
|
-
dark: (0,
|
|
2236
|
+
light: (0, Le.css)([ "background-color:", ";" ], Ee.variables.white),
|
|
2237
|
+
dark: (0, Le.css)([ "background-color:", ";" ], Ee.variables.gray22)
|
|
2320
2238
|
}
|
|
2321
2239
|
}), (function(e) {
|
|
2322
2240
|
var t = e.$hasfocus;
|
|
2323
|
-
return t && (0,
|
|
2324
|
-
enterprise: (0,
|
|
2325
|
-
prisma: (0,
|
|
2241
|
+
return t && (0, Ee.pick)({
|
|
2242
|
+
enterprise: (0, Le.css)([ "box-shadow:", ";" ], Ee.variables.focusShadow),
|
|
2243
|
+
prisma: (0, Le.css)([ "border-color:", ";" ], Ee.variables.focusColor)
|
|
2326
2244
|
});
|
|
2327
2245
|
}), (function(e) {
|
|
2328
2246
|
var t = e.$error;
|
|
2329
|
-
return t && (0,
|
|
2247
|
+
return t && (0, Le.css)([ "border-color:", ";color:", ";" ], Ee.variables.accentColorNegative, Ee.variables.accentColorNegative);
|
|
2330
2248
|
}), (function(e) {
|
|
2331
|
-
var t = e.$disabled,
|
|
2332
|
-
return t ? (0,
|
|
2249
|
+
var t = e.$disabled, r = e.$hasfocus;
|
|
2250
|
+
return t ? (0, Ee.pick)({
|
|
2333
2251
|
enterprise: {
|
|
2334
|
-
light: (0,
|
|
2335
|
-
dark: (0,
|
|
2252
|
+
light: (0, Le.css)([ "background-color:", ";border-color:", ";cursor:not-allowed;" ], Ee.variables.gray96, Ee.variables.gray92),
|
|
2253
|
+
dark: (0, Le.css)([ "background-color:", ";border-color:", ";cursor:not-allowed;" ], Ee.variables.gray22, Ee.variables.gray30)
|
|
2336
2254
|
},
|
|
2337
|
-
prisma: (0,
|
|
2338
|
-
}) : !
|
|
2339
|
-
enterprise:
|
|
2340
|
-
prisma:
|
|
2255
|
+
prisma: (0, Le.css)([ "border-color:", ";cursor:not-allowed;" ], Ee.variables.interactiveColorBorderDisabled)
|
|
2256
|
+
}) : !r && (0, Le.css)([ "&:hover{border-color:", ";}" ], (0, Ee.pick)({
|
|
2257
|
+
enterprise: Ee.variables.borderColor,
|
|
2258
|
+
prisma: Ee.variables.interactiveColorBorderHover
|
|
2341
2259
|
}));
|
|
2342
2260
|
}), (function(e) {
|
|
2343
2261
|
var t = e.$popoverOpen;
|
|
2344
|
-
return t && (0,
|
|
2345
|
-
}),
|
|
2346
|
-
var
|
|
2262
|
+
return t && (0, Le.css)([ "position:relative;z-index:calc(", " - 2);" ], Ee.variables.zindexFixedNavbar);
|
|
2263
|
+
}), Ee.variables.spacingSmall);
|
|
2264
|
+
var Rr = Fe().span.withConfig({
|
|
2347
2265
|
displayName: "NormalStyles__StyledButtonsWrapper",
|
|
2348
2266
|
componentId: "sc-1uwwpco-1"
|
|
2349
2267
|
})([ "display:contents;" ]);
|
|
2350
|
-
var
|
|
2268
|
+
var Mr = Fe().input.withConfig({
|
|
2351
2269
|
displayName: "NormalStyles__StyledInput",
|
|
2352
2270
|
componentId: "sc-1uwwpco-2"
|
|
2353
|
-
})([ "", ";flex:1 0 auto;max-width:100%;line-height:12px;", "" ],
|
|
2354
|
-
|
|
2271
|
+
})([ "", ";flex:1 0 auto;max-width:100%;line-height:12px;", "" ], Ee.mixins.reset("block"), (0,
|
|
2272
|
+
Ee.pick)({
|
|
2355
2273
|
enterprise: {
|
|
2356
|
-
comfortable: (0,
|
|
2357
|
-
compact: (0,
|
|
2274
|
+
comfortable: (0, Le.css)([ "padding:", ";" ], Ee.variables.spacingXSmall),
|
|
2275
|
+
compact: (0, Le.css)([ "padding:3px;" ])
|
|
2358
2276
|
},
|
|
2359
2277
|
prisma: {
|
|
2360
|
-
comfortable: (0,
|
|
2361
|
-
compact: (0,
|
|
2278
|
+
comfortable: (0, Le.css)([ "padding:7px 10px;" ]),
|
|
2279
|
+
compact: (0, Le.css)([ "padding:3px;" ])
|
|
2362
2280
|
}
|
|
2363
2281
|
}));
|
|
2364
|
-
var
|
|
2282
|
+
var Tr = Fe().div.withConfig({
|
|
2365
2283
|
displayName: "NormalStyles__StyledOverlay",
|
|
2366
2284
|
componentId: "sc-1uwwpco-3"
|
|
2367
2285
|
})([ "", "" ], (function(e) {
|
|
2368
2286
|
var t = e.$popoveropen;
|
|
2369
|
-
return t && (0,
|
|
2287
|
+
return t && (0, Le.css)([ "position:fixed;top:0;left:0;width:100%;height:100%;z-index:calc(", " - 2);" ], Ee.variables.zindexFixedNavbar);
|
|
2370
2288
|
}));
|
|
2371
|
-
// CONCATENATED MODULE: ./src/utils/updateReactRef.ts
|
|
2372
|
-
/**
|
|
2373
|
-
* Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
|
|
2374
|
-
*
|
|
2375
|
-
* @param ref - The React callback or object ref. Can be `null` or `undefined`.
|
|
2376
|
-
* @param current - The new value of the ref.
|
|
2377
|
-
*/
|
|
2378
|
-
function Kn(e, t) {
|
|
2379
|
-
if (e) {
|
|
2380
|
-
if (typeof e === "function") {
|
|
2381
|
-
e(t);
|
|
2382
|
-
} else {
|
|
2383
|
-
// the public signature of this util uses React.Ref<T> to mirror the way React types refs.
|
|
2384
|
-
// the intention here is to signal "we will take care of setting 'current', not you".
|
|
2385
|
-
e.current = t;
|
|
2386
|
-
// eslint-disable-line no-param-reassign
|
|
2387
|
-
}
|
|
2388
|
-
}
|
|
2389
|
-
}
|
|
2390
2289
|
// CONCATENATED MODULE: ./src/Multiselect/Normal.tsx
|
|
2391
|
-
function
|
|
2290
|
+
function _r(e) {
|
|
2392
2291
|
"@babel/helpers - typeof";
|
|
2393
|
-
return
|
|
2292
|
+
return _r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
2394
2293
|
return typeof e;
|
|
2395
2294
|
} : function(e) {
|
|
2396
2295
|
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
2397
|
-
},
|
|
2296
|
+
}, _r(e);
|
|
2398
2297
|
}
|
|
2399
|
-
function
|
|
2400
|
-
return
|
|
2298
|
+
function Ar(e) {
|
|
2299
|
+
return Dr(e) || Vr(e) || qr(e) || Br();
|
|
2401
2300
|
}
|
|
2402
|
-
function
|
|
2301
|
+
function Br() {
|
|
2403
2302
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2404
2303
|
}
|
|
2405
|
-
function
|
|
2304
|
+
function qr(e, t) {
|
|
2406
2305
|
if (e) {
|
|
2407
|
-
if ("string" == typeof e) return
|
|
2408
|
-
var
|
|
2409
|
-
return "Object" ===
|
|
2306
|
+
if ("string" == typeof e) return Nr(e, t);
|
|
2307
|
+
var r = {}.toString.call(e).slice(8, -1);
|
|
2308
|
+
return "Object" === r && e.constructor && (r = e.constructor.name), "Map" === r || "Set" === r ? Array.from(e) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? Nr(e, t) : void 0;
|
|
2410
2309
|
}
|
|
2411
2310
|
}
|
|
2412
|
-
function
|
|
2311
|
+
function Vr(e) {
|
|
2413
2312
|
if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"]) return Array.from(e);
|
|
2414
2313
|
}
|
|
2415
|
-
function
|
|
2416
|
-
if (Array.isArray(e)) return
|
|
2314
|
+
function Dr(e) {
|
|
2315
|
+
if (Array.isArray(e)) return Nr(e);
|
|
2417
2316
|
}
|
|
2418
|
-
function
|
|
2317
|
+
function Nr(e, t) {
|
|
2419
2318
|
(null == t || t > e.length) && (t = e.length);
|
|
2420
|
-
for (var
|
|
2421
|
-
r
|
|
2319
|
+
for (var r = 0, n = Array(t); r < t; r++) {
|
|
2320
|
+
n[r] = e[r];
|
|
2422
2321
|
}
|
|
2423
|
-
return
|
|
2322
|
+
return n;
|
|
2424
2323
|
}
|
|
2425
|
-
function
|
|
2426
|
-
var
|
|
2324
|
+
function Lr(e, t) {
|
|
2325
|
+
var r = Object.keys(e);
|
|
2427
2326
|
if (Object.getOwnPropertySymbols) {
|
|
2428
|
-
var
|
|
2429
|
-
t && (
|
|
2327
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
2328
|
+
t && (n = n.filter((function(t) {
|
|
2430
2329
|
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
2431
|
-
}))),
|
|
2330
|
+
}))), r.push.apply(r, n);
|
|
2432
2331
|
}
|
|
2433
|
-
return
|
|
2332
|
+
return r;
|
|
2434
2333
|
}
|
|
2435
|
-
function
|
|
2334
|
+
function Fr(e) {
|
|
2436
2335
|
for (var t = 1; t < arguments.length; t++) {
|
|
2437
|
-
var
|
|
2438
|
-
t % 2 ?
|
|
2439
|
-
|
|
2440
|
-
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(
|
|
2441
|
-
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(
|
|
2336
|
+
var r = null != arguments[t] ? arguments[t] : {};
|
|
2337
|
+
t % 2 ? Lr(Object(r), !0).forEach((function(t) {
|
|
2338
|
+
tn(e, t, r[t]);
|
|
2339
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Lr(Object(r)).forEach((function(t) {
|
|
2340
|
+
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(r, t));
|
|
2442
2341
|
}));
|
|
2443
2342
|
}
|
|
2444
2343
|
return e;
|
|
2445
2344
|
}
|
|
2446
|
-
function
|
|
2345
|
+
function Kr(e, t) {
|
|
2447
2346
|
if (null == e) return {};
|
|
2448
|
-
var
|
|
2347
|
+
var r, n, o = Hr(e, t);
|
|
2449
2348
|
if (Object.getOwnPropertySymbols) {
|
|
2450
2349
|
var a = Object.getOwnPropertySymbols(e);
|
|
2451
|
-
for (
|
|
2452
|
-
|
|
2350
|
+
for (n = 0; n < a.length; n++) {
|
|
2351
|
+
r = a[n], t.includes(r) || {}.propertyIsEnumerable.call(e, r) && (o[r] = e[r]);
|
|
2453
2352
|
}
|
|
2454
2353
|
}
|
|
2455
2354
|
return o;
|
|
2456
2355
|
}
|
|
2457
|
-
function
|
|
2356
|
+
function Hr(e, t) {
|
|
2458
2357
|
if (null == e) return {};
|
|
2459
|
-
var
|
|
2460
|
-
for (var
|
|
2461
|
-
if ({}.hasOwnProperty.call(e,
|
|
2462
|
-
if (t.includes(
|
|
2463
|
-
n
|
|
2358
|
+
var r = {};
|
|
2359
|
+
for (var n in e) {
|
|
2360
|
+
if ({}.hasOwnProperty.call(e, n)) {
|
|
2361
|
+
if (t.includes(n)) continue;
|
|
2362
|
+
r[n] = e[n];
|
|
2464
2363
|
}
|
|
2465
2364
|
}
|
|
2466
|
-
return
|
|
2365
|
+
return r;
|
|
2467
2366
|
}
|
|
2468
|
-
function
|
|
2469
|
-
return
|
|
2367
|
+
function $r() {
|
|
2368
|
+
return $r = Object.assign ? Object.assign.bind() : function(e) {
|
|
2470
2369
|
for (var t = 1; t < arguments.length; t++) {
|
|
2471
|
-
var
|
|
2472
|
-
for (var
|
|
2473
|
-
({}).hasOwnProperty.call(
|
|
2370
|
+
var r = arguments[t];
|
|
2371
|
+
for (var n in r) {
|
|
2372
|
+
({}).hasOwnProperty.call(r, n) && (e[n] = r[n]);
|
|
2474
2373
|
}
|
|
2475
2374
|
}
|
|
2476
2375
|
return e;
|
|
2477
|
-
},
|
|
2376
|
+
}, $r.apply(null, arguments);
|
|
2478
2377
|
}
|
|
2479
|
-
function
|
|
2378
|
+
function zr(e, t) {
|
|
2480
2379
|
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
2481
2380
|
}
|
|
2482
|
-
function
|
|
2483
|
-
for (var
|
|
2484
|
-
var
|
|
2485
|
-
|
|
2486
|
-
Object.defineProperty(e,
|
|
2381
|
+
function Wr(e, t) {
|
|
2382
|
+
for (var r = 0; r < t.length; r++) {
|
|
2383
|
+
var n = t[r];
|
|
2384
|
+
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
|
|
2385
|
+
Object.defineProperty(e, rn(n.key), n);
|
|
2487
2386
|
}
|
|
2488
2387
|
}
|
|
2489
|
-
function
|
|
2490
|
-
return t &&
|
|
2388
|
+
function Ur(e, t, r) {
|
|
2389
|
+
return t && Wr(e.prototype, t), r && Wr(e, r), Object.defineProperty(e, "prototype", {
|
|
2491
2390
|
writable: !1
|
|
2492
2391
|
}), e;
|
|
2493
2392
|
}
|
|
2494
|
-
function
|
|
2393
|
+
function Gr(e, t) {
|
|
2495
2394
|
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
|
|
2496
2395
|
e.prototype = Object.create(t && t.prototype, {
|
|
2497
2396
|
constructor: {
|
|
@@ -2501,69 +2400,69 @@
|
|
|
2501
2400
|
}
|
|
2502
2401
|
}), Object.defineProperty(e, "prototype", {
|
|
2503
2402
|
writable: !1
|
|
2504
|
-
}), t &&
|
|
2403
|
+
}), t && Jr(e, t);
|
|
2505
2404
|
}
|
|
2506
|
-
function
|
|
2507
|
-
return
|
|
2405
|
+
function Jr(e, t) {
|
|
2406
|
+
return Jr = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
|
|
2508
2407
|
return e.__proto__ = t, e;
|
|
2509
|
-
},
|
|
2408
|
+
}, Jr(e, t);
|
|
2510
2409
|
}
|
|
2511
|
-
function
|
|
2512
|
-
var t =
|
|
2410
|
+
function Xr(e) {
|
|
2411
|
+
var t = Zr();
|
|
2513
2412
|
return function() {
|
|
2514
|
-
var
|
|
2413
|
+
var r, n = en(e);
|
|
2515
2414
|
if (t) {
|
|
2516
|
-
var o =
|
|
2517
|
-
|
|
2518
|
-
} else
|
|
2519
|
-
return
|
|
2415
|
+
var o = en(this).constructor;
|
|
2416
|
+
r = Reflect.construct(n, arguments, o);
|
|
2417
|
+
} else r = n.apply(this, arguments);
|
|
2418
|
+
return Qr(this, r);
|
|
2520
2419
|
};
|
|
2521
2420
|
}
|
|
2522
|
-
function
|
|
2523
|
-
if (t && ("object" ==
|
|
2421
|
+
function Qr(e, t) {
|
|
2422
|
+
if (t && ("object" == _r(t) || "function" == typeof t)) return t;
|
|
2524
2423
|
if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
|
|
2525
|
-
return
|
|
2424
|
+
return Yr(e);
|
|
2526
2425
|
}
|
|
2527
|
-
function
|
|
2426
|
+
function Yr(e) {
|
|
2528
2427
|
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
2529
2428
|
return e;
|
|
2530
2429
|
}
|
|
2531
|
-
function
|
|
2430
|
+
function Zr() {
|
|
2532
2431
|
try {
|
|
2533
2432
|
var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
|
|
2534
2433
|
} catch (e) {}
|
|
2535
|
-
return (
|
|
2434
|
+
return (Zr = function t() {
|
|
2536
2435
|
return !!e;
|
|
2537
2436
|
})();
|
|
2538
2437
|
}
|
|
2539
|
-
function
|
|
2540
|
-
return
|
|
2438
|
+
function en(e) {
|
|
2439
|
+
return en = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
|
|
2541
2440
|
return e.__proto__ || Object.getPrototypeOf(e);
|
|
2542
|
-
},
|
|
2441
|
+
}, en(e);
|
|
2543
2442
|
}
|
|
2544
|
-
function
|
|
2545
|
-
return (t =
|
|
2546
|
-
value:
|
|
2443
|
+
function tn(e, t, r) {
|
|
2444
|
+
return (t = rn(t)) in e ? Object.defineProperty(e, t, {
|
|
2445
|
+
value: r,
|
|
2547
2446
|
enumerable: !0,
|
|
2548
2447
|
configurable: !0,
|
|
2549
2448
|
writable: !0
|
|
2550
|
-
}) : e[t] =
|
|
2551
|
-
}
|
|
2552
|
-
function
|
|
2553
|
-
var t =
|
|
2554
|
-
return "symbol" ==
|
|
2555
|
-
}
|
|
2556
|
-
function
|
|
2557
|
-
if ("object" !=
|
|
2558
|
-
var
|
|
2559
|
-
if (void 0 !==
|
|
2560
|
-
var
|
|
2561
|
-
if ("object" !=
|
|
2449
|
+
}) : e[t] = r, e;
|
|
2450
|
+
}
|
|
2451
|
+
function rn(e) {
|
|
2452
|
+
var t = nn(e, "string");
|
|
2453
|
+
return "symbol" == _r(t) ? t : t + "";
|
|
2454
|
+
}
|
|
2455
|
+
function nn(e, t) {
|
|
2456
|
+
if ("object" != _r(e) || !e) return e;
|
|
2457
|
+
var r = e[Symbol.toPrimitive];
|
|
2458
|
+
if (void 0 !== r) {
|
|
2459
|
+
var n = r.call(e, t || "default");
|
|
2460
|
+
if ("object" != _r(n)) return n;
|
|
2562
2461
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2563
2462
|
}
|
|
2564
2463
|
return ("string" === t ? String : Number)(e);
|
|
2565
2464
|
}
|
|
2566
|
-
var
|
|
2465
|
+
var on = {
|
|
2567
2466
|
allowNewValues: a().bool,
|
|
2568
2467
|
animateLoading: a().bool,
|
|
2569
2468
|
children: a().node,
|
|
@@ -2598,7 +2497,7 @@
|
|
|
2598
2497
|
useClickawayOverlay: a().bool,
|
|
2599
2498
|
values: a().array
|
|
2600
2499
|
};
|
|
2601
|
-
var
|
|
2500
|
+
var an = {
|
|
2602
2501
|
allowNewValues: false,
|
|
2603
2502
|
animateLoading: false,
|
|
2604
2503
|
defaultPlacement: "vertical",
|
|
@@ -2611,38 +2510,38 @@
|
|
|
2611
2510
|
tabConfirmsNewValue: false,
|
|
2612
2511
|
useClickawayOverlay: false
|
|
2613
2512
|
};
|
|
2614
|
-
var
|
|
2513
|
+
var ln = re()((function(e) {
|
|
2615
2514
|
return {
|
|
2616
2515
|
flexBasis: e,
|
|
2617
2516
|
width: e
|
|
2618
2517
|
};
|
|
2619
2518
|
}));
|
|
2620
|
-
var
|
|
2621
|
-
var t = e.anchorWidth,
|
|
2622
|
-
return
|
|
2623
|
-
maxHeight:
|
|
2519
|
+
var un = re()((function(e) {
|
|
2520
|
+
var t = e.anchorWidth, r = e.maxHeight, n = e.menuStyle;
|
|
2521
|
+
return cr()({
|
|
2522
|
+
maxHeight: r,
|
|
2624
2523
|
overflow: "auto",
|
|
2625
2524
|
width: Math.max(t !== null && t !== void 0 ? t : 0, 200)
|
|
2626
|
-
},
|
|
2525
|
+
}, n);
|
|
2627
2526
|
}));
|
|
2628
2527
|
// TS: not typed controlled/uncontrolled, handled by Multiselect wrapper component
|
|
2629
|
-
var
|
|
2630
|
-
|
|
2631
|
-
var
|
|
2528
|
+
var cn = function(r) {
|
|
2529
|
+
Gr(o, r);
|
|
2530
|
+
var n = Xr(o);
|
|
2632
2531
|
// @docs-props-type NormalPropsBase
|
|
2633
|
-
function o(
|
|
2532
|
+
function o(r) {
|
|
2634
2533
|
var a;
|
|
2635
|
-
|
|
2636
|
-
a =
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2534
|
+
zr(this, o);
|
|
2535
|
+
a = n.call(this, r);
|
|
2536
|
+
tn(Yr(a), "activeItemId", void 0);
|
|
2537
|
+
tn(Yr(a), "activeValue", void 0);
|
|
2538
|
+
tn(Yr(a), "availableOptionCount", void 0);
|
|
2539
|
+
tn(Yr(a), "children", void 0);
|
|
2540
|
+
tn(Yr(a), "controlledExternally", void 0);
|
|
2541
|
+
tn(Yr(a), "input", null);
|
|
2542
|
+
tn(Yr(a), "popoverId", void 0);
|
|
2543
|
+
tn(Yr(a), "previousActiveIndex", null);
|
|
2544
|
+
tn(Yr(a), "handleClick", (function() {
|
|
2646
2545
|
if (a.state.hasFocus) {
|
|
2647
2546
|
a.open({
|
|
2648
2547
|
resetFilterKeyword: false
|
|
@@ -2652,14 +2551,14 @@
|
|
|
2652
2551
|
(e = a.input) === null || e === void 0 ? void 0 : e.focus();
|
|
2653
2552
|
}
|
|
2654
2553
|
}));
|
|
2655
|
-
|
|
2656
|
-
var
|
|
2657
|
-
|
|
2658
|
-
return a.removeValue(e,
|
|
2554
|
+
tn(Yr(a), "handleRequestRemove", (function(e, t) {
|
|
2555
|
+
var r = t.value;
|
|
2556
|
+
ir()((function() {
|
|
2557
|
+
return a.removeValue(e, r);
|
|
2659
2558
|
}));
|
|
2660
2559
|
// allow the event to bubble before removing.
|
|
2661
2560
|
}));
|
|
2662
|
-
|
|
2561
|
+
tn(Yr(a), "open", (function(e) {
|
|
2663
2562
|
var t = e.resetFilterKeyword;
|
|
2664
2563
|
a.setState((function(e) {
|
|
2665
2564
|
return {
|
|
@@ -2672,10 +2571,10 @@
|
|
|
2672
2571
|
(e = (t = a.props).onOpen) === null || e === void 0 ? void 0 : e.call(t);
|
|
2673
2572
|
}));
|
|
2674
2573
|
}));
|
|
2675
|
-
|
|
2574
|
+
tn(Yr(a), "handleInputFocus", (function(e) {
|
|
2676
2575
|
if (a.state.filterKeyword !== "") {
|
|
2677
|
-
var t,
|
|
2678
|
-
(t = (
|
|
2576
|
+
var t, r;
|
|
2577
|
+
(t = (r = a.props).onFilterChange) === null || t === void 0 ? void 0 : t.call(r, e, {
|
|
2679
2578
|
keyword: ""
|
|
2680
2579
|
});
|
|
2681
2580
|
}
|
|
@@ -2683,12 +2582,12 @@
|
|
|
2683
2582
|
resetFilterKeyword: true
|
|
2684
2583
|
});
|
|
2685
2584
|
}));
|
|
2686
|
-
|
|
2687
|
-
var
|
|
2585
|
+
tn(Yr(a), "handleInputKeyDown", (function(t) {
|
|
2586
|
+
var r, n;
|
|
2688
2587
|
var o = a.props, l = o.children, i = o.onScrollBottom, u = o.tabConfirmsNewValue;
|
|
2689
|
-
var c = (0,
|
|
2588
|
+
var c = (0, Ce.keycode)(t.nativeEvent);
|
|
2690
2589
|
if (c === "tab" && a.state.open) {
|
|
2691
|
-
if (u && !
|
|
2590
|
+
if (u && !br()(a.activeValue) && a.availableOptionCount <= 1) {
|
|
2692
2591
|
var s;
|
|
2693
2592
|
t.preventDefault();
|
|
2694
2593
|
a.addValue(t, a.activeValue);
|
|
@@ -2751,54 +2650,54 @@
|
|
|
2751
2650
|
});
|
|
2752
2651
|
}
|
|
2753
2652
|
}
|
|
2754
|
-
if (c === "enter" && !
|
|
2653
|
+
if (c === "enter" && !br()(a.activeValue) && a.state.open) {
|
|
2755
2654
|
a.addValue(t, a.activeValue);
|
|
2756
2655
|
}
|
|
2757
|
-
if (c === "backspace" && ((
|
|
2758
|
-
a.removeValue(t,
|
|
2656
|
+
if (c === "backspace" && ((r = a.input) === null || r === void 0 ? void 0 : r.value) === "" && ((n = a.getCurrentValues()) === null || n === void 0 ? void 0 : n.length)) {
|
|
2657
|
+
a.removeValue(t, gr()(a.getCurrentValues()));
|
|
2759
2658
|
}
|
|
2760
2659
|
}));
|
|
2761
|
-
|
|
2762
|
-
var t,
|
|
2660
|
+
tn(Yr(a), "handleInputChange", (function(e) {
|
|
2661
|
+
var t, r;
|
|
2763
2662
|
a.setState({
|
|
2764
2663
|
filterKeyword: e.target.value,
|
|
2765
2664
|
open: true,
|
|
2766
2665
|
activeIndex: 0
|
|
2767
2666
|
});
|
|
2768
|
-
(t = (
|
|
2667
|
+
(t = (r = a.props).onFilterChange) === null || t === void 0 ? void 0 : t.call(r, e, {
|
|
2769
2668
|
keyword: e.target.value
|
|
2770
2669
|
});
|
|
2771
2670
|
}));
|
|
2772
|
-
|
|
2773
|
-
var
|
|
2774
|
-
var
|
|
2671
|
+
tn(Yr(a), "handleMenuOptionClick", (function(e, t) {
|
|
2672
|
+
var r;
|
|
2673
|
+
var n = t.value;
|
|
2775
2674
|
e.stopPropagation();
|
|
2776
|
-
a.addValue(e,
|
|
2777
|
-
(
|
|
2675
|
+
a.addValue(e, n);
|
|
2676
|
+
(r = a.input) === null || r === void 0 ? void 0 : r.focus();
|
|
2778
2677
|
}));
|
|
2779
|
-
|
|
2678
|
+
tn(Yr(a), "handleInputBlur", (function(e) {
|
|
2780
2679
|
var t = document.getElementById(a.popoverId);
|
|
2781
|
-
var
|
|
2680
|
+
var r = e.relatedTarget || document.activeElement;
|
|
2782
2681
|
// IE11 doesn't support relatedTarget but sets activeElement
|
|
2783
|
-
var
|
|
2682
|
+
var n = t && r && t.contains(r);
|
|
2784
2683
|
// TS: target as Node is an unsafe assumption
|
|
2785
2684
|
a.setState((function(e) {
|
|
2786
2685
|
return {
|
|
2787
|
-
filterKeyword:
|
|
2686
|
+
filterKeyword: n ? e.filterKeyword : "",
|
|
2788
2687
|
hasFocus: false
|
|
2789
2688
|
};
|
|
2790
2689
|
}));
|
|
2791
|
-
if (!
|
|
2690
|
+
if (!n) {
|
|
2792
2691
|
var o, l;
|
|
2793
2692
|
(o = (l = a.props).onFilterChange) === null || o === void 0 ? void 0 : o.call(l, e, {
|
|
2794
2693
|
keyword: ""
|
|
2795
2694
|
});
|
|
2796
2695
|
}
|
|
2797
2696
|
}));
|
|
2798
|
-
|
|
2697
|
+
tn(Yr(a), "handleRequestClose", (function(e) {
|
|
2799
2698
|
var t;
|
|
2800
|
-
var
|
|
2801
|
-
if (
|
|
2699
|
+
var r = e.reason, n = e.event;
|
|
2700
|
+
if (r === "escapeKey" || r === "offScreen" || r === "clickAway" && n !== undefined && !((t = a.state.el) === null || t === void 0 ? void 0 : t.contains(n.target))) {
|
|
2802
2701
|
a.setState({
|
|
2803
2702
|
open: false
|
|
2804
2703
|
}, (function() {
|
|
@@ -2807,68 +2706,68 @@
|
|
|
2807
2706
|
(e = (t = a.props).onClose) === null || e === void 0 ? void 0 : e.call(t);
|
|
2808
2707
|
}));
|
|
2809
2708
|
}
|
|
2810
|
-
if (
|
|
2709
|
+
if (r === "escapeKey") {
|
|
2811
2710
|
var o;
|
|
2812
2711
|
(o = a.input) === null || o === void 0 ? void 0 : o.focus();
|
|
2813
2712
|
}
|
|
2814
2713
|
}));
|
|
2815
|
-
|
|
2714
|
+
tn(Yr(a), "handleScrollBottom", (function(e) {
|
|
2816
2715
|
if (a.state.open && !a.props.isLoadingOptions) {
|
|
2817
|
-
var t,
|
|
2818
|
-
(t = (
|
|
2716
|
+
var t, r;
|
|
2717
|
+
(t = (r = a.props).onScrollBottom) === null || t === void 0 ? void 0 : t.call(r, e);
|
|
2819
2718
|
a.setState({
|
|
2820
2719
|
loadingMoreMessage: "".concat(a.availableOptionCount, " options, loading more options")
|
|
2821
2720
|
});
|
|
2822
2721
|
}
|
|
2823
2722
|
}));
|
|
2824
|
-
|
|
2723
|
+
tn(Yr(a), "handleMount", (function(e) {
|
|
2825
2724
|
a.setState({
|
|
2826
2725
|
el: e
|
|
2827
2726
|
});
|
|
2828
|
-
|
|
2727
|
+
x(a.props.elementRef, e);
|
|
2829
2728
|
}));
|
|
2830
|
-
|
|
2729
|
+
tn(Yr(a), "handleInputMount", (function(e) {
|
|
2831
2730
|
a.input = e;
|
|
2832
|
-
|
|
2731
|
+
x(a.props.inputRef, e);
|
|
2833
2732
|
}));
|
|
2834
|
-
|
|
2733
|
+
tn(Yr(a), "handleActiveOptionMount", (function(e) {
|
|
2835
2734
|
if (a.previousActiveIndex !== a.state.activeIndex) {
|
|
2836
2735
|
e === null || e === void 0 ? void 0 : e.scrollIntoViewIfNeeded();
|
|
2837
2736
|
}
|
|
2838
2737
|
}));
|
|
2839
|
-
|
|
2840
|
-
var
|
|
2841
|
-
var l =
|
|
2842
|
-
anchorWidth:
|
|
2843
|
-
maxHeight:
|
|
2738
|
+
tn(Yr(a), "renderMenu", (function(e) {
|
|
2739
|
+
var r = e.anchorWidth, n = e.maxHeight, o = e.placement;
|
|
2740
|
+
var l = un({
|
|
2741
|
+
anchorWidth: r,
|
|
2742
|
+
maxHeight: n,
|
|
2844
2743
|
menuStyle: a.props.menuStyle
|
|
2845
2744
|
});
|
|
2846
2745
|
|
|
2847
|
-
return t().createElement(
|
|
2746
|
+
return t().createElement(ve(), $r({
|
|
2848
2747
|
focusMode: "never",
|
|
2849
2748
|
placement: o !== null && o !== void 0 ? o : undefined,
|
|
2850
2749
|
isLoading: a.props.isLoadingOptions,
|
|
2851
2750
|
onScrollBottom: a.props.onScrollBottom ? a.handleScrollBottom : undefined
|
|
2852
|
-
},
|
|
2751
|
+
}, oe()(a.props, "noOptionsMessage", "footerMessage", "animateLoading", "loadingMessage", "onScroll"), {
|
|
2853
2752
|
style: l
|
|
2854
2753
|
}), a.children);
|
|
2855
2754
|
}));
|
|
2856
|
-
|
|
2755
|
+
tn(Yr(a), "getSelectedItemsContent", (function(e) {
|
|
2857
2756
|
return e.map((function(e) {
|
|
2858
|
-
var
|
|
2757
|
+
var r = e;
|
|
2859
2758
|
// TS: faking props here
|
|
2860
|
-
var
|
|
2861
|
-
if (
|
|
2862
|
-
var o =
|
|
2759
|
+
var n = r.props;
|
|
2760
|
+
if (n != null) {
|
|
2761
|
+
var o = n.children, a = n.label, l = n.value;
|
|
2863
2762
|
|
|
2864
2763
|
return t().createElement("span", {
|
|
2865
2764
|
key: l.toString()
|
|
2866
|
-
}, o || a, (0,
|
|
2765
|
+
}, o || a, (0, jr.sprintf)((0, s._)(" selected")));
|
|
2867
2766
|
}
|
|
2868
2767
|
|
|
2869
2768
|
return t().createElement("span", {
|
|
2870
|
-
key: (0,
|
|
2871
|
-
}, t().createElement(t().Fragment, null,
|
|
2769
|
+
key: (0, Se.createGUID)()
|
|
2770
|
+
}, t().createElement(t().Fragment, null, r, (0, jr.sprintf)((0, s._)(" selected"))));
|
|
2872
2771
|
}));
|
|
2873
2772
|
}));
|
|
2874
2773
|
a.state = {
|
|
@@ -2877,24 +2776,24 @@
|
|
|
2877
2776
|
filterKeyword: "",
|
|
2878
2777
|
hasFocus: false,
|
|
2879
2778
|
open: false,
|
|
2880
|
-
values:
|
|
2779
|
+
values: r.defaultValues || [],
|
|
2881
2780
|
loadingMoreMessage: ""
|
|
2882
2781
|
};
|
|
2883
2782
|
a.availableOptionCount = 0;
|
|
2884
2783
|
a.children = [];
|
|
2885
|
-
a.controlledExternally = i()(
|
|
2886
|
-
a.activeItemId = (0,
|
|
2887
|
-
a.popoverId = (0,
|
|
2784
|
+
a.controlledExternally = i()(r, "values");
|
|
2785
|
+
a.activeItemId = (0, Se.createDOMID)("active-item");
|
|
2786
|
+
a.popoverId = (0, Se.createDOMID)("popover");
|
|
2888
2787
|
if (false) {}
|
|
2889
2788
|
if (false) {}
|
|
2890
2789
|
return a;
|
|
2891
2790
|
}
|
|
2892
|
-
|
|
2791
|
+
Ur(o, [ {
|
|
2893
2792
|
key: "componentDidUpdate",
|
|
2894
|
-
value: function e(t,
|
|
2793
|
+
value: function e(t, r) {
|
|
2895
2794
|
if (false) {}
|
|
2896
2795
|
if (false) {}
|
|
2897
|
-
this.previousActiveIndex =
|
|
2796
|
+
this.previousActiveIndex = r.activeIndex;
|
|
2898
2797
|
if (this.isControlled() && t.values !== this.props.values) {
|
|
2899
2798
|
// eslint-disable-next-line react/no-did-update-set-state
|
|
2900
2799
|
this.setState({
|
|
@@ -2926,12 +2825,12 @@
|
|
|
2926
2825
|
}
|
|
2927
2826
|
}, {
|
|
2928
2827
|
key: "addValue",
|
|
2929
|
-
value: function e(t,
|
|
2930
|
-
var
|
|
2828
|
+
value: function e(t, r) {
|
|
2829
|
+
var n, o, a;
|
|
2931
2830
|
if (!this.state.open) {
|
|
2932
2831
|
return;
|
|
2933
2832
|
}
|
|
2934
|
-
var l = ((
|
|
2833
|
+
var l = ((n = this.getCurrentValues()) !== null && n !== void 0 ? n : []).concat([ r ]);
|
|
2935
2834
|
var i = this.props.name;
|
|
2936
2835
|
if (!this.isControlled()) {
|
|
2937
2836
|
this.setState({
|
|
@@ -2948,39 +2847,39 @@
|
|
|
2948
2847
|
}
|
|
2949
2848
|
}, {
|
|
2950
2849
|
key: "removeValue",
|
|
2951
|
-
value: function e(t,
|
|
2952
|
-
var
|
|
2953
|
-
var a =
|
|
2850
|
+
value: function e(t, r) {
|
|
2851
|
+
var n, o;
|
|
2852
|
+
var a = ue()(this.getCurrentValues(), r);
|
|
2954
2853
|
var l = this.props.name;
|
|
2955
2854
|
if (!this.isControlled()) {
|
|
2956
2855
|
this.setState({
|
|
2957
2856
|
values: a
|
|
2958
2857
|
});
|
|
2959
2858
|
}
|
|
2960
|
-
(
|
|
2859
|
+
(n = (o = this.props).onChange) === null || n === void 0 ? void 0 : n.call(o, t, {
|
|
2961
2860
|
values: a,
|
|
2962
2861
|
name: l
|
|
2963
2862
|
});
|
|
2964
2863
|
}
|
|
2965
2864
|
}, {
|
|
2966
2865
|
key: "renderButtons",
|
|
2967
|
-
value: function e(
|
|
2968
|
-
var
|
|
2866
|
+
value: function e(r) {
|
|
2867
|
+
var n = this;
|
|
2969
2868
|
// selectedItems may contain items or unmatched values at this point
|
|
2970
|
-
return
|
|
2971
|
-
var
|
|
2869
|
+
return r.map((function(e) {
|
|
2870
|
+
var r = e;
|
|
2972
2871
|
// TS: faking props here
|
|
2973
|
-
var o =
|
|
2872
|
+
var o = r.props;
|
|
2974
2873
|
if (o != null) {
|
|
2975
2874
|
var a = o.children, l = o.icon, i = o.label, u = o.selectedAppearance, c = o.selectedBackgroundColor, s = o.selectedForegroundColor, f = o.value;
|
|
2976
2875
|
|
|
2977
|
-
return t().createElement(
|
|
2876
|
+
return t().createElement(Cr(), {
|
|
2978
2877
|
"aria-selected": true,
|
|
2979
|
-
disabled:
|
|
2878
|
+
disabled: n.props.disabled,
|
|
2980
2879
|
icon: l,
|
|
2981
2880
|
key: f.toString(),
|
|
2982
2881
|
"data-test": "selected-option",
|
|
2983
|
-
onRequestRemove:
|
|
2882
|
+
onRequestRemove: n.handleRequestRemove,
|
|
2984
2883
|
role: "option",
|
|
2985
2884
|
value: f,
|
|
2986
2885
|
appearance: u,
|
|
@@ -2989,63 +2888,63 @@
|
|
|
2989
2888
|
}, a || i);
|
|
2990
2889
|
}
|
|
2991
2890
|
|
|
2992
|
-
return t().createElement(
|
|
2891
|
+
return t().createElement(Cr(), {
|
|
2993
2892
|
"aria-selected": true,
|
|
2994
|
-
disabled:
|
|
2995
|
-
key: (0,
|
|
2893
|
+
disabled: n.props.disabled,
|
|
2894
|
+
key: (0, Se.createGUID)(),
|
|
2996
2895
|
"data-test": "selected-option",
|
|
2997
|
-
onRequestRemove:
|
|
2896
|
+
onRequestRemove: n.handleRequestRemove,
|
|
2998
2897
|
role: "option",
|
|
2999
|
-
value:
|
|
3000
|
-
}, t().createElement(t().Fragment, null,
|
|
2898
|
+
value: r
|
|
2899
|
+
}, t().createElement(t().Fragment, null, r));
|
|
3001
2900
|
}));
|
|
3002
2901
|
}
|
|
3003
2902
|
// eslint-disable-next-line react/no-unused-class-component-methods
|
|
3004
2903
|
}, {
|
|
3005
2904
|
key: "render",
|
|
3006
|
-
value: function
|
|
3007
|
-
var
|
|
3008
|
-
var a = this.props, l = a.allowNewValues, u = a.children, f = a.controlledFilter, p = a.defaultPlacement, d = a.describedBy, v = a.disabled, b = a.error, y = a.inline, m = a.inputId, h = a.labelledBy, g = a.placeholder, O = a.required, w = a.repositionMode,
|
|
3009
|
-
var k =
|
|
2905
|
+
value: function r() {
|
|
2906
|
+
var n, o = this;
|
|
2907
|
+
var a = this.props, l = a.allowNewValues, u = a.children, f = a.controlledFilter, p = a.defaultPlacement, d = a.describedBy, v = a.disabled, b = a.error, y = a.inline, m = a.inputId, h = a.labelledBy, g = a.placeholder, O = a.required, w = a.repositionMode, S = a.useClickawayOverlay, C = Kr(a, [ "allowNewValues", "children", "controlledFilter", "defaultPlacement", "describedBy", "disabled", "error", "inline", "inputId", "labelledBy", "placeholder", "required", "repositionMode", "useClickawayOverlay" ]);
|
|
2908
|
+
var k = Fr(Fr({}, wr()(C, (function(e, t) {
|
|
3010
2909
|
return t === "role" || t.indexOf("aria-") === 0;
|
|
3011
2910
|
}))), {}, {
|
|
3012
2911
|
"aria-describedby": d,
|
|
3013
2912
|
"aria-labelledby": h,
|
|
3014
2913
|
"aria-invalid": b || undefined
|
|
3015
2914
|
});
|
|
3016
|
-
var x =
|
|
2915
|
+
var x = Fr({}, wr()(C, (function(e, t) {
|
|
3017
2916
|
return t === "aria-label" || t === "aria-describedby";
|
|
3018
2917
|
})));
|
|
3019
|
-
var j = (
|
|
3020
|
-
var
|
|
3021
|
-
var
|
|
2918
|
+
var j = (n = this.getCurrentValues()) !== null && n !== void 0 ? n : [];
|
|
2919
|
+
var P = j.slice(0);
|
|
2920
|
+
var E = j.indexOf(this.state.filterKeyword) >= 0;
|
|
3022
2921
|
// Map Options to selected values
|
|
3023
2922
|
if (j && j.length) {
|
|
3024
2923
|
e.Children.toArray(u).filter(e.isValidElement).filter((function(e) {
|
|
3025
|
-
return e.type ===
|
|
2924
|
+
return e.type === W;
|
|
3026
2925
|
})).forEach((function(e) {
|
|
3027
|
-
if (e.type ===
|
|
2926
|
+
if (e.type === W) {
|
|
3028
2927
|
var t = j.indexOf(e.props.value);
|
|
3029
2928
|
if (t !== -1) {
|
|
3030
|
-
|
|
2929
|
+
P[t] = e;
|
|
3031
2930
|
}
|
|
3032
2931
|
}
|
|
3033
2932
|
}));
|
|
3034
2933
|
}
|
|
3035
2934
|
// Filter the items
|
|
3036
|
-
var
|
|
3037
|
-
var
|
|
3038
|
-
if (
|
|
3039
|
-
return (0,
|
|
2935
|
+
var I = (0, we.stringToKeywords)(this.state.filterKeyword);
|
|
2936
|
+
var R = f ? e.Children.toArray(u) : e.Children.toArray(u).filter((function(e) {
|
|
2937
|
+
if (fr()(e, [ "props", "label" ], false)) {
|
|
2938
|
+
return (0, we.testPhrase)(e.props.label, I);
|
|
3040
2939
|
}
|
|
3041
2940
|
return true;
|
|
3042
2941
|
// Keep all headers and non-interactive options
|
|
3043
2942
|
}));
|
|
3044
2943
|
this.availableOptionCount = 0;
|
|
3045
2944
|
this.activeValue = undefined;
|
|
3046
|
-
this.children = e.Children.map(
|
|
3047
|
-
var
|
|
3048
|
-
if (!
|
|
2945
|
+
this.children = e.Children.map(R, (function(t, r) {
|
|
2946
|
+
var n = t.props;
|
|
2947
|
+
if (!n || !i()(n, "value")) {
|
|
3049
2948
|
// ignore Headings and Dividers
|
|
3050
2949
|
return t;
|
|
3051
2950
|
}
|
|
@@ -3053,7 +2952,7 @@
|
|
|
3053
2952
|
var l = a.props, u = l.children, c = l.label, s = l.matchRanges, p = l.value;
|
|
3054
2953
|
// find out if the search string exactly matches a value
|
|
3055
2954
|
if (p === o.state.filterKeyword) {
|
|
3056
|
-
|
|
2955
|
+
E = true;
|
|
3057
2956
|
}
|
|
3058
2957
|
// remove items that are already selected
|
|
3059
2958
|
var d = j.indexOf(p);
|
|
@@ -3061,12 +2960,12 @@
|
|
|
3061
2960
|
return null;
|
|
3062
2961
|
}
|
|
3063
2962
|
// highlight matched text
|
|
3064
|
-
var v = u === undefined ||
|
|
3065
|
-
var b = v && !f && !s &&
|
|
2963
|
+
var v = u === undefined || dr()(u);
|
|
2964
|
+
var b = v && !f && !s && I && (0, we.keywordLocations)(c, I);
|
|
3066
2965
|
// clone item
|
|
3067
2966
|
var y = (0, e.cloneElement)(a, {
|
|
3068
2967
|
// eslint-disable-next-line react/no-array-index-key
|
|
3069
|
-
key:
|
|
2968
|
+
key: r,
|
|
3070
2969
|
onClick: o.handleMenuOptionClick,
|
|
3071
2970
|
matchRanges: v && (s || b) || undefined
|
|
3072
2971
|
});
|
|
@@ -3075,8 +2974,8 @@
|
|
|
3075
2974
|
return e !== null;
|
|
3076
2975
|
}));
|
|
3077
2976
|
// Add the option to add the new value
|
|
3078
|
-
if (l && !
|
|
3079
|
-
this.children.unshift( t().createElement(
|
|
2977
|
+
if (l && !E && this.state.filterKeyword) {
|
|
2978
|
+
this.children.unshift( t().createElement(W, {
|
|
3080
2979
|
label: "".concat(this.state.filterKeyword),
|
|
3081
2980
|
description: (0, s._)("(New value)"),
|
|
3082
2981
|
descriptionPosition: "right",
|
|
@@ -3088,22 +2987,22 @@
|
|
|
3088
2987
|
if (this.state.open) {
|
|
3089
2988
|
// highlight the selected Item
|
|
3090
2989
|
this.children = e.Children.map(this.children, (function(t) {
|
|
3091
|
-
var
|
|
3092
|
-
if (!
|
|
2990
|
+
var r = t.props;
|
|
2991
|
+
if (!r || !i()(r, "value")) {
|
|
3093
2992
|
// ignore Headings and Dividers
|
|
3094
2993
|
return t;
|
|
3095
2994
|
}
|
|
3096
|
-
var
|
|
3097
|
-
var a =
|
|
2995
|
+
var n = t;
|
|
2996
|
+
var a = n.props, l = a.disabled, u = a.value;
|
|
3098
2997
|
var c = o.availableOptionCount === o.state.activeIndex;
|
|
3099
2998
|
o.availableOptionCount += 1;
|
|
3100
2999
|
if (!c) {
|
|
3101
|
-
return
|
|
3000
|
+
return n;
|
|
3102
3001
|
}
|
|
3103
3002
|
if (!l) {
|
|
3104
3003
|
o.activeValue = u;
|
|
3105
3004
|
}
|
|
3106
|
-
var s = (0, e.cloneElement)(
|
|
3005
|
+
var s = (0, e.cloneElement)(n, {
|
|
3107
3006
|
active: c,
|
|
3108
3007
|
id: o.activeItemId,
|
|
3109
3008
|
ref: o.handleActiveOptionMount
|
|
@@ -3111,14 +3010,14 @@
|
|
|
3111
3010
|
return s;
|
|
3112
3011
|
}));
|
|
3113
3012
|
}
|
|
3114
|
-
var
|
|
3013
|
+
var M = ln("".concat(this.state.filterKeyword.length * .8, "em"));
|
|
3115
3014
|
|
|
3116
|
-
return t().createElement(t().Fragment, null, t().createElement(
|
|
3015
|
+
return t().createElement(t().Fragment, null, t().createElement(Ir, $r({
|
|
3117
3016
|
key: "control",
|
|
3118
3017
|
"data-test-values": JSON.stringify(j),
|
|
3119
3018
|
inline: y,
|
|
3120
3019
|
$hasfocus: this.state.hasFocus
|
|
3121
|
-
}, c().apply(void 0, [
|
|
3020
|
+
}, c().apply(void 0, [ C, "animateLoading", "controlledFilter", "defaultValues", "footerMessage", "inputRef", "isLoadingOptions", "labelledBy", "menuStyle", "noOptionsMessage", "onChange", "onFilterChange", "onScroll", "onScrollBottom", "onClose", "onOpen", "values", "useClickawayOverlay" ].concat(Ar(mr()(k)))), {
|
|
3122
3021
|
onClick: v ? undefined : this.handleClick,
|
|
3123
3022
|
$disabled: v,
|
|
3124
3023
|
$error: b,
|
|
@@ -3129,11 +3028,11 @@
|
|
|
3129
3028
|
role: "group",
|
|
3130
3029
|
"aria-disabled": v || undefined,
|
|
3131
3030
|
"aria-labelledby": h
|
|
3132
|
-
}, x), t().createElement(
|
|
3031
|
+
}, x), t().createElement(Rr, {
|
|
3133
3032
|
role: "listbox",
|
|
3134
3033
|
"aria-invalid": b,
|
|
3135
3034
|
"aria-multiselectable": "true"
|
|
3136
|
-
}, this.renderButtons(
|
|
3035
|
+
}, this.renderButtons(P)), !v && t().createElement(Mr, $r({
|
|
3137
3036
|
role: "combobox",
|
|
3138
3037
|
"data-test": "textbox",
|
|
3139
3038
|
id: m,
|
|
@@ -3147,7 +3046,7 @@
|
|
|
3147
3046
|
autoComplete: "off",
|
|
3148
3047
|
autoCorrect: "off",
|
|
3149
3048
|
spellCheck: false,
|
|
3150
|
-
style:
|
|
3049
|
+
style: M,
|
|
3151
3050
|
placeholder: j.length ? "" : g,
|
|
3152
3051
|
required: O,
|
|
3153
3052
|
"aria-activedescendant": this.state.open && this.availableOptionCount > 0 ? this.activeItemId : undefined,
|
|
@@ -3156,7 +3055,7 @@
|
|
|
3156
3055
|
"aria-owns": this.state.open ? this.popoverId : undefined,
|
|
3157
3056
|
"aria-expanded": this.state.open,
|
|
3158
3057
|
"aria-haspopup": true
|
|
3159
|
-
}, k)), t().createElement(
|
|
3058
|
+
}, k)), t().createElement(xr(), {
|
|
3160
3059
|
open: this.state.open && !!this.state.el,
|
|
3161
3060
|
autoCloseWhenOffScreen: true,
|
|
3162
3061
|
anchor: this.state.el,
|
|
@@ -3165,63 +3064,63 @@
|
|
|
3165
3064
|
defaultPlacement: p,
|
|
3166
3065
|
repositionMode: w,
|
|
3167
3066
|
id: this.popoverId
|
|
3168
|
-
}, this.renderMenu)), t().createElement(
|
|
3067
|
+
}, this.renderMenu)), t().createElement(he(), {
|
|
3169
3068
|
role: "status",
|
|
3170
3069
|
"aria-relevant": "text"
|
|
3171
|
-
}, this.state.loadingMoreMessage),
|
|
3070
|
+
}, this.state.loadingMoreMessage), S && this.state.open ? t().createElement(Tr, {
|
|
3172
3071
|
key: "overlay",
|
|
3173
3072
|
$popoveropen: this.state.open,
|
|
3174
3073
|
"data-test": "overlay"
|
|
3175
|
-
}) : null, t().createElement(
|
|
3074
|
+
}) : null, t().createElement(he(), {
|
|
3176
3075
|
role: "alert",
|
|
3177
3076
|
"aria-relevant": "additions"
|
|
3178
|
-
}, this.getSelectedItemsContent(
|
|
3077
|
+
}, this.getSelectedItemsContent(P)));
|
|
3179
3078
|
}
|
|
3180
3079
|
} ]);
|
|
3181
3080
|
return o;
|
|
3182
3081
|
}(e.Component);
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
/* harmony default export */ const
|
|
3082
|
+
tn(cn, "propTypes", on);
|
|
3083
|
+
tn(cn, "defaultProps", an);
|
|
3084
|
+
tn(cn, "Option", W);
|
|
3085
|
+
tn(cn, "Divider", f.Divider);
|
|
3086
|
+
tn(cn, "Heading", f.Heading);
|
|
3087
|
+
/* harmony default export */ const sn = cn;
|
|
3189
3088
|
// CONCATENATED MODULE: ./src/Multiselect/Multiselect.tsx
|
|
3190
|
-
function
|
|
3089
|
+
function fn(e) {
|
|
3191
3090
|
"@babel/helpers - typeof";
|
|
3192
|
-
return
|
|
3091
|
+
return fn = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
3193
3092
|
return typeof e;
|
|
3194
3093
|
} : function(e) {
|
|
3195
3094
|
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
3196
|
-
},
|
|
3095
|
+
}, fn(e);
|
|
3197
3096
|
}
|
|
3198
|
-
function
|
|
3199
|
-
return
|
|
3097
|
+
function pn() {
|
|
3098
|
+
return pn = Object.assign ? Object.assign.bind() : function(e) {
|
|
3200
3099
|
for (var t = 1; t < arguments.length; t++) {
|
|
3201
|
-
var
|
|
3202
|
-
for (var
|
|
3203
|
-
({}).hasOwnProperty.call(
|
|
3100
|
+
var r = arguments[t];
|
|
3101
|
+
for (var n in r) {
|
|
3102
|
+
({}).hasOwnProperty.call(r, n) && (e[n] = r[n]);
|
|
3204
3103
|
}
|
|
3205
3104
|
}
|
|
3206
3105
|
return e;
|
|
3207
|
-
},
|
|
3106
|
+
}, pn.apply(null, arguments);
|
|
3208
3107
|
}
|
|
3209
|
-
function
|
|
3108
|
+
function dn(e, t) {
|
|
3210
3109
|
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
3211
3110
|
}
|
|
3212
|
-
function
|
|
3213
|
-
for (var
|
|
3214
|
-
var
|
|
3215
|
-
|
|
3216
|
-
Object.defineProperty(e,
|
|
3111
|
+
function vn(e, t) {
|
|
3112
|
+
for (var r = 0; r < t.length; r++) {
|
|
3113
|
+
var n = t[r];
|
|
3114
|
+
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
|
|
3115
|
+
Object.defineProperty(e, kn(n.key), n);
|
|
3217
3116
|
}
|
|
3218
3117
|
}
|
|
3219
|
-
function
|
|
3220
|
-
return t &&
|
|
3118
|
+
function bn(e, t, r) {
|
|
3119
|
+
return t && vn(e.prototype, t), r && vn(e, r), Object.defineProperty(e, "prototype", {
|
|
3221
3120
|
writable: !1
|
|
3222
3121
|
}), e;
|
|
3223
3122
|
}
|
|
3224
|
-
function
|
|
3123
|
+
function yn(e, t) {
|
|
3225
3124
|
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
|
|
3226
3125
|
e.prototype = Object.create(t && t.prototype, {
|
|
3227
3126
|
constructor: {
|
|
@@ -3231,71 +3130,71 @@
|
|
|
3231
3130
|
}
|
|
3232
3131
|
}), Object.defineProperty(e, "prototype", {
|
|
3233
3132
|
writable: !1
|
|
3234
|
-
}), t &&
|
|
3133
|
+
}), t && mn(e, t);
|
|
3235
3134
|
}
|
|
3236
|
-
function
|
|
3237
|
-
return
|
|
3135
|
+
function mn(e, t) {
|
|
3136
|
+
return mn = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
|
|
3238
3137
|
return e.__proto__ = t, e;
|
|
3239
|
-
},
|
|
3138
|
+
}, mn(e, t);
|
|
3240
3139
|
}
|
|
3241
|
-
function
|
|
3242
|
-
var t =
|
|
3140
|
+
function hn(e) {
|
|
3141
|
+
var t = wn();
|
|
3243
3142
|
return function() {
|
|
3244
|
-
var
|
|
3143
|
+
var r, n = Sn(e);
|
|
3245
3144
|
if (t) {
|
|
3246
|
-
var o =
|
|
3247
|
-
|
|
3248
|
-
} else
|
|
3249
|
-
return
|
|
3145
|
+
var o = Sn(this).constructor;
|
|
3146
|
+
r = Reflect.construct(n, arguments, o);
|
|
3147
|
+
} else r = n.apply(this, arguments);
|
|
3148
|
+
return gn(this, r);
|
|
3250
3149
|
};
|
|
3251
3150
|
}
|
|
3252
|
-
function
|
|
3253
|
-
if (t && ("object" ==
|
|
3151
|
+
function gn(e, t) {
|
|
3152
|
+
if (t && ("object" == fn(t) || "function" == typeof t)) return t;
|
|
3254
3153
|
if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
|
|
3255
|
-
return
|
|
3154
|
+
return On(e);
|
|
3256
3155
|
}
|
|
3257
|
-
function
|
|
3156
|
+
function On(e) {
|
|
3258
3157
|
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
3259
3158
|
return e;
|
|
3260
3159
|
}
|
|
3261
|
-
function
|
|
3160
|
+
function wn() {
|
|
3262
3161
|
try {
|
|
3263
3162
|
var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
|
|
3264
3163
|
} catch (e) {}
|
|
3265
|
-
return (
|
|
3164
|
+
return (wn = function t() {
|
|
3266
3165
|
return !!e;
|
|
3267
3166
|
})();
|
|
3268
3167
|
}
|
|
3269
|
-
function
|
|
3270
|
-
return
|
|
3168
|
+
function Sn(e) {
|
|
3169
|
+
return Sn = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
|
|
3271
3170
|
return e.__proto__ || Object.getPrototypeOf(e);
|
|
3272
|
-
},
|
|
3171
|
+
}, Sn(e);
|
|
3273
3172
|
}
|
|
3274
|
-
function
|
|
3275
|
-
return (t =
|
|
3276
|
-
value:
|
|
3173
|
+
function Cn(e, t, r) {
|
|
3174
|
+
return (t = kn(t)) in e ? Object.defineProperty(e, t, {
|
|
3175
|
+
value: r,
|
|
3277
3176
|
enumerable: !0,
|
|
3278
3177
|
configurable: !0,
|
|
3279
3178
|
writable: !0
|
|
3280
|
-
}) : e[t] =
|
|
3281
|
-
}
|
|
3282
|
-
function
|
|
3283
|
-
var t =
|
|
3284
|
-
return "symbol" ==
|
|
3285
|
-
}
|
|
3286
|
-
function
|
|
3287
|
-
if ("object" !=
|
|
3288
|
-
var
|
|
3289
|
-
if (void 0 !==
|
|
3290
|
-
var
|
|
3291
|
-
if ("object" !=
|
|
3179
|
+
}) : e[t] = r, e;
|
|
3180
|
+
}
|
|
3181
|
+
function kn(e) {
|
|
3182
|
+
var t = xn(e, "string");
|
|
3183
|
+
return "symbol" == fn(t) ? t : t + "";
|
|
3184
|
+
}
|
|
3185
|
+
function xn(e, t) {
|
|
3186
|
+
if ("object" != fn(e) || !e) return e;
|
|
3187
|
+
var r = e[Symbol.toPrimitive];
|
|
3188
|
+
if (void 0 !== r) {
|
|
3189
|
+
var n = r.call(e, t || "default");
|
|
3190
|
+
if ("object" != fn(n)) return n;
|
|
3292
3191
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
3293
3192
|
}
|
|
3294
3193
|
return ("string" === t ? String : Number)(e);
|
|
3295
3194
|
}
|
|
3296
3195
|
/** @public */
|
|
3297
3196
|
/** @public */
|
|
3298
|
-
/** @public */ var
|
|
3197
|
+
/** @public */ var jn = {
|
|
3299
3198
|
allowNewValues: a().bool,
|
|
3300
3199
|
animateLoading: a().bool,
|
|
3301
3200
|
children: a().node,
|
|
@@ -3334,7 +3233,7 @@
|
|
|
3334
3233
|
/** @private */
|
|
3335
3234
|
virtualization: a().number
|
|
3336
3235
|
};
|
|
3337
|
-
var
|
|
3236
|
+
var Pn = {
|
|
3338
3237
|
allowNewValues: false,
|
|
3339
3238
|
animateLoading: false,
|
|
3340
3239
|
compact: false,
|
|
@@ -3349,45 +3248,45 @@
|
|
|
3349
3248
|
tabConfirmsNewValue: false,
|
|
3350
3249
|
useClickawayOverlay: false
|
|
3351
3250
|
};
|
|
3352
|
-
function
|
|
3251
|
+
function En(e) {
|
|
3353
3252
|
return (e === null || e === void 0 ? void 0 : e.compact) === true;
|
|
3354
3253
|
}
|
|
3355
|
-
var
|
|
3356
|
-
|
|
3357
|
-
var
|
|
3358
|
-
function
|
|
3359
|
-
|
|
3360
|
-
return
|
|
3254
|
+
var In = function(e) {
|
|
3255
|
+
yn(n, e);
|
|
3256
|
+
var r = hn(n);
|
|
3257
|
+
function n() {
|
|
3258
|
+
dn(this, n);
|
|
3259
|
+
return r.apply(this, arguments);
|
|
3361
3260
|
}
|
|
3362
|
-
|
|
3261
|
+
bn(n, [ {
|
|
3363
3262
|
key: "render",
|
|
3364
3263
|
// @docs-props-type MultiselectPropsBase
|
|
3365
3264
|
// TODO: SUI-3402, this can be removed when ControlGroup no longer needs to inspect componentType
|
|
3366
3265
|
value: function e() {
|
|
3367
|
-
if (
|
|
3266
|
+
if (En(this.props)) {
|
|
3368
3267
|
|
|
3369
|
-
return t().createElement(
|
|
3268
|
+
return t().createElement(ar, pn({
|
|
3370
3269
|
"data-test": "multiselect"
|
|
3371
3270
|
}, c()(this.props, "compact")));
|
|
3372
3271
|
}
|
|
3373
3272
|
if (false) {}
|
|
3374
3273
|
if (false) {}
|
|
3375
3274
|
|
|
3376
|
-
return t().createElement(
|
|
3275
|
+
return t().createElement(sn, pn({
|
|
3377
3276
|
"data-test": "multiselect"
|
|
3378
3277
|
}, c()(this.props, "compact")));
|
|
3379
3278
|
}
|
|
3380
3279
|
} ]);
|
|
3381
|
-
return
|
|
3280
|
+
return n;
|
|
3382
3281
|
}(e.Component);
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
/* harmony default export */ const
|
|
3282
|
+
Cn(In, "propTypes", jn);
|
|
3283
|
+
Cn(In, "defaultProps", Pn);
|
|
3284
|
+
Cn(In, "componentType", "Multiselect");
|
|
3285
|
+
Cn(In, "Option", W);
|
|
3286
|
+
Cn(In, "Heading", f.Heading);
|
|
3287
|
+
Cn(In, "Divider", f.Divider);
|
|
3288
|
+
/* harmony default export */ const Rn = In;
|
|
3390
3289
|
}) // CONCATENATED MODULE: ./src/Multiselect/index.ts
|
|
3391
3290
|
();
|
|
3392
|
-
module.exports =
|
|
3291
|
+
module.exports = n;
|
|
3393
3292
|
/******/})();
|