@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/Select.js
CHANGED
|
@@ -6,10 +6,13 @@
|
|
|
6
6
|
/***/ (e, t, n) => {
|
|
7
7
|
// EXPORTS
|
|
8
8
|
n.d(t, {
|
|
9
|
-
default: () => /* reexport */
|
|
9
|
+
default: () => /* reexport */ i
|
|
10
10
|
});
|
|
11
11
|
// EXTERNAL MODULE: external "react"
|
|
12
12
|
var r = n(9497);
|
|
13
|
+
// EXTERNAL MODULE: external "lodash/has"
|
|
14
|
+
var o = n(5919);
|
|
15
|
+
var l = n.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, r.useRef)(
|
|
27
|
-
var f = (0, r.useRef)(t);
|
|
27
|
+
function a(e) {
|
|
28
|
+
var t = e.componentProps, n = e.componentName, o = n === void 0 ? "this component" : n, a = e.defaultValuePropName, i = a === void 0 ? "defaultValue" : a, u = e.valuePropName, c = u === void 0 ? "value" : u;
|
|
29
|
+
var s = (0, r.useRef)(l()(t, c));
|
|
30
|
+
var f = (0, r.useRef)(t[i]);
|
|
28
31
|
(0, r.useEffect)((function() {
|
|
29
32
|
if (false) {}
|
|
30
|
-
}), [
|
|
33
|
+
}), [ o, t, i, c ]);
|
|
31
34
|
(0, r.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 = a;
|
|
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");
|
|
@@ -127,10 +134,10 @@
|
|
|
127
134
|
n.r(r);
|
|
128
135
|
// EXPORTS
|
|
129
136
|
n.d(r, {
|
|
130
|
-
Divider: () => /* reexport */
|
|
131
|
-
Heading: () => /* reexport */
|
|
132
|
-
Option: () => /* reexport */
|
|
133
|
-
default: () => /* reexport */
|
|
137
|
+
Divider: () => /* reexport */ T.Divider,
|
|
138
|
+
Heading: () => /* reexport */ T.Heading,
|
|
139
|
+
Option: () => /* reexport */ Mt,
|
|
140
|
+
default: () => /* reexport */ tn
|
|
134
141
|
});
|
|
135
142
|
// EXTERNAL MODULE: external "react"
|
|
136
143
|
var e = n(9497);
|
|
@@ -138,8 +145,8 @@
|
|
|
138
145
|
// CONCATENATED MODULE: external "prop-types"
|
|
139
146
|
const o = require("prop-types");
|
|
140
147
|
var l = n.n(o);
|
|
141
|
-
//
|
|
142
|
-
|
|
148
|
+
// EXTERNAL MODULE: external "lodash/has"
|
|
149
|
+
var a = n(5919);
|
|
143
150
|
var i = n.n(a);
|
|
144
151
|
// CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
|
|
145
152
|
const u = require("@splunk/ui-utils/i18n");
|
|
@@ -162,70 +169,73 @@
|
|
|
162
169
|
const g = require("lodash/pick");
|
|
163
170
|
var O = n.n(g);
|
|
164
171
|
// CONCATENATED MODULE: external "lodash/uniq"
|
|
165
|
-
const
|
|
166
|
-
var
|
|
172
|
+
const S = require("lodash/uniq");
|
|
173
|
+
var C = n.n(S);
|
|
167
174
|
// CONCATENATED MODULE: external "lodash/without"
|
|
168
|
-
const
|
|
169
|
-
var
|
|
175
|
+
const k = require("lodash/without");
|
|
176
|
+
var w = n.n(k);
|
|
170
177
|
// CONCATENATED MODULE: external "@splunk/react-ui/Dropdown"
|
|
171
178
|
const x = require("@splunk/react-ui/Dropdown");
|
|
172
179
|
var j = n.n(x);
|
|
173
180
|
// CONCATENATED MODULE: external "@splunk/react-ui/Link"
|
|
174
|
-
const
|
|
175
|
-
var
|
|
181
|
+
const P = require("@splunk/react-ui/Link");
|
|
182
|
+
var E = n.n(P);
|
|
176
183
|
// CONCATENATED MODULE: external "@splunk/react-ui/Menu"
|
|
177
|
-
const
|
|
184
|
+
const T = require("@splunk/react-ui/Menu");
|
|
178
185
|
// CONCATENATED MODULE: external "@splunk/react-ui/ResultsMenu"
|
|
179
|
-
const
|
|
180
|
-
var
|
|
186
|
+
const R = require("@splunk/react-ui/ResultsMenu");
|
|
187
|
+
var A = n.n(R);
|
|
181
188
|
// CONCATENATED MODULE: external "@splunk/react-ui/Text"
|
|
182
189
|
const _ = require("@splunk/react-ui/Text");
|
|
183
|
-
var
|
|
190
|
+
var I = n.n(_);
|
|
191
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/ScreenReaderContent"
|
|
192
|
+
const M = require("@splunk/react-ui/ScreenReaderContent");
|
|
193
|
+
var L = n.n(M);
|
|
184
194
|
// CONCATENATED MODULE: external "@splunk/react-ui/usePrevious"
|
|
185
|
-
const
|
|
186
|
-
var
|
|
195
|
+
const q = require("@splunk/react-ui/usePrevious");
|
|
196
|
+
var D = n.n(q);
|
|
187
197
|
// CONCATENATED MODULE: external "@splunk/ui-utils/filter"
|
|
188
|
-
const
|
|
198
|
+
const B = require("@splunk/ui-utils/filter");
|
|
189
199
|
// CONCATENATED MODULE: external "@splunk/ui-utils/id"
|
|
190
|
-
const
|
|
200
|
+
const V = require("@splunk/ui-utils/id");
|
|
191
201
|
// CONCATENATED MODULE: external "@splunk/ui-utils/keyboard"
|
|
192
|
-
const
|
|
202
|
+
const N = require("@splunk/ui-utils/keyboard");
|
|
193
203
|
// CONCATENATED MODULE: external "@splunk/react-icons/CaretSmallDown"
|
|
194
|
-
const
|
|
195
|
-
var N = n.n(D);
|
|
196
|
-
// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/Caret"
|
|
197
|
-
const K = require("@splunk/react-icons/enterprise/Caret");
|
|
204
|
+
const K = require("@splunk/react-icons/CaretSmallDown");
|
|
198
205
|
var F = n.n(K);
|
|
206
|
+
// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/Caret"
|
|
207
|
+
const H = require("@splunk/react-icons/enterprise/Caret");
|
|
208
|
+
var z = n.n(H);
|
|
199
209
|
// CONCATENATED MODULE: external "@splunk/themes"
|
|
200
|
-
const
|
|
210
|
+
const $ = require("@splunk/themes");
|
|
201
211
|
// CONCATENATED MODULE: ./src/Select/icons/CaretSmallDown.tsx
|
|
202
|
-
var
|
|
203
|
-
var n = (0,
|
|
204
|
-
var o = r ? t().createElement(
|
|
212
|
+
var W = function e() {
|
|
213
|
+
var n = (0, $.useSplunkTheme)(), r = n.isEnterprise;
|
|
214
|
+
var o = r ? t().createElement(z(), {
|
|
205
215
|
screenReaderText: null,
|
|
206
216
|
hideDefaultTooltip: true,
|
|
207
217
|
size: .5
|
|
208
|
-
}) : t().createElement(
|
|
218
|
+
}) : t().createElement(F(), null);
|
|
209
219
|
return o;
|
|
210
220
|
};
|
|
211
|
-
/* harmony default export */ const
|
|
221
|
+
/* harmony default export */ const U = W;
|
|
212
222
|
// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/Search"
|
|
213
|
-
const
|
|
214
|
-
var U = n.n(W);
|
|
215
|
-
// CONCATENATED MODULE: external "@splunk/react-icons/Magnifier"
|
|
216
|
-
const J = require("@splunk/react-icons/Magnifier");
|
|
223
|
+
const J = require("@splunk/react-icons/enterprise/Search");
|
|
217
224
|
var X = n.n(J);
|
|
225
|
+
// CONCATENATED MODULE: external "@splunk/react-icons/Magnifier"
|
|
226
|
+
const G = require("@splunk/react-icons/Magnifier");
|
|
227
|
+
var Q = n.n(G);
|
|
218
228
|
// CONCATENATED MODULE: ./src/Select/icons/Search.tsx
|
|
219
|
-
var
|
|
220
|
-
var n = (0,
|
|
229
|
+
var Y = function e() {
|
|
230
|
+
var n = (0, $.useSplunkTheme)(), r = n.isEnterprise, o = n.isCompact;
|
|
221
231
|
var l = (0, u._)("Search");
|
|
222
232
|
var a = o ? "20px" : "24px";
|
|
223
|
-
var i = r ? t().createElement(
|
|
233
|
+
var i = r ? t().createElement(X(), {
|
|
224
234
|
role: "presentation",
|
|
225
235
|
size: "16px",
|
|
226
236
|
screenReaderText: l,
|
|
227
237
|
hideDefaultTooltip: true
|
|
228
|
-
}) : t().createElement(
|
|
238
|
+
}) : t().createElement(Q(), {
|
|
229
239
|
role: "presentation",
|
|
230
240
|
"aria-label": l,
|
|
231
241
|
width: a,
|
|
@@ -233,18 +243,18 @@
|
|
|
233
243
|
});
|
|
234
244
|
return i;
|
|
235
245
|
};
|
|
236
|
-
/* harmony default export */ const
|
|
246
|
+
/* harmony default export */ const Z = Y;
|
|
237
247
|
// CONCATENATED MODULE: ./src/Select/OptionBase.tsx
|
|
238
|
-
function
|
|
248
|
+
function ee(e) {
|
|
239
249
|
"@babel/helpers - typeof";
|
|
240
|
-
return
|
|
250
|
+
return ee = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
241
251
|
return typeof e;
|
|
242
252
|
} : function(e) {
|
|
243
253
|
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
244
|
-
},
|
|
254
|
+
}, ee(e);
|
|
245
255
|
}
|
|
246
|
-
function
|
|
247
|
-
return
|
|
256
|
+
function te() {
|
|
257
|
+
return te = Object.assign ? Object.assign.bind() : function(e) {
|
|
248
258
|
for (var t = 1; t < arguments.length; t++) {
|
|
249
259
|
var n = arguments[t];
|
|
250
260
|
for (var r in n) {
|
|
@@ -252,124 +262,81 @@
|
|
|
252
262
|
}
|
|
253
263
|
}
|
|
254
264
|
return e;
|
|
255
|
-
},
|
|
265
|
+
}, te.apply(null, arguments);
|
|
256
266
|
}
|
|
257
|
-
function
|
|
258
|
-
|
|
259
|
-
var n, r, o = te(e, t);
|
|
267
|
+
function ne(e, t) {
|
|
268
|
+
var n = Object.keys(e);
|
|
260
269
|
if (Object.getOwnPropertySymbols) {
|
|
261
|
-
var
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
return o;
|
|
267
|
-
}
|
|
268
|
-
function te(e, t) {
|
|
269
|
-
if (null == e) return {};
|
|
270
|
-
var n = {};
|
|
271
|
-
for (var r in e) {
|
|
272
|
-
if ({}.hasOwnProperty.call(e, r)) {
|
|
273
|
-
if (t.includes(r)) continue;
|
|
274
|
-
n[r] = e[r];
|
|
275
|
-
}
|
|
270
|
+
var r = Object.getOwnPropertySymbols(e);
|
|
271
|
+
t && (r = r.filter((function(t) {
|
|
272
|
+
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
273
|
+
}))), n.push.apply(n, r);
|
|
276
274
|
}
|
|
277
275
|
return n;
|
|
278
276
|
}
|
|
279
|
-
function
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
277
|
+
function re(e) {
|
|
278
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
279
|
+
var n = null != arguments[t] ? arguments[t] : {};
|
|
280
|
+
t % 2 ? ne(Object(n), !0).forEach((function(t) {
|
|
281
|
+
oe(e, t, n[t]);
|
|
282
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : ne(Object(n)).forEach((function(t) {
|
|
283
|
+
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
284
|
+
}));
|
|
287
285
|
}
|
|
288
|
-
}
|
|
289
|
-
function oe(e, t, n) {
|
|
290
|
-
return t && re(e.prototype, t), n && re(e, n), Object.defineProperty(e, "prototype", {
|
|
291
|
-
writable: !1
|
|
292
|
-
}), e;
|
|
293
|
-
}
|
|
294
|
-
function le(e, t) {
|
|
295
|
-
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
|
|
296
|
-
e.prototype = Object.create(t && t.prototype, {
|
|
297
|
-
constructor: {
|
|
298
|
-
value: e,
|
|
299
|
-
writable: !0,
|
|
300
|
-
configurable: !0
|
|
301
|
-
}
|
|
302
|
-
}), Object.defineProperty(e, "prototype", {
|
|
303
|
-
writable: !1
|
|
304
|
-
}), t && ae(e, t);
|
|
305
|
-
}
|
|
306
|
-
function ae(e, t) {
|
|
307
|
-
return ae = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
|
|
308
|
-
return e.__proto__ = t, e;
|
|
309
|
-
}, ae(e, t);
|
|
310
|
-
}
|
|
311
|
-
function ie(e) {
|
|
312
|
-
var t = se();
|
|
313
|
-
return function() {
|
|
314
|
-
var n, r = fe(e);
|
|
315
|
-
if (t) {
|
|
316
|
-
var o = fe(this).constructor;
|
|
317
|
-
n = Reflect.construct(r, arguments, o);
|
|
318
|
-
} else n = r.apply(this, arguments);
|
|
319
|
-
return ue(this, n);
|
|
320
|
-
};
|
|
321
|
-
}
|
|
322
|
-
function ue(e, t) {
|
|
323
|
-
if (t && ("object" == Y(t) || "function" == typeof t)) return t;
|
|
324
|
-
if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
|
|
325
|
-
return ce(e);
|
|
326
|
-
}
|
|
327
|
-
function ce(e) {
|
|
328
|
-
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
329
286
|
return e;
|
|
330
287
|
}
|
|
331
|
-
function
|
|
332
|
-
|
|
333
|
-
var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
|
|
334
|
-
} catch (e) {}
|
|
335
|
-
return (se = function t() {
|
|
336
|
-
return !!e;
|
|
337
|
-
})();
|
|
338
|
-
}
|
|
339
|
-
function fe(e) {
|
|
340
|
-
return fe = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
|
|
341
|
-
return e.__proto__ || Object.getPrototypeOf(e);
|
|
342
|
-
}, fe(e);
|
|
343
|
-
}
|
|
344
|
-
function pe(e, t, n) {
|
|
345
|
-
return (t = de(t)) in e ? Object.defineProperty(e, t, {
|
|
288
|
+
function oe(e, t, n) {
|
|
289
|
+
return (t = le(t)) in e ? Object.defineProperty(e, t, {
|
|
346
290
|
value: n,
|
|
347
291
|
enumerable: !0,
|
|
348
292
|
configurable: !0,
|
|
349
293
|
writable: !0
|
|
350
294
|
}) : e[t] = n, e;
|
|
351
295
|
}
|
|
352
|
-
function
|
|
353
|
-
var t =
|
|
354
|
-
return "symbol" ==
|
|
296
|
+
function le(e) {
|
|
297
|
+
var t = ae(e, "string");
|
|
298
|
+
return "symbol" == ee(t) ? t : t + "";
|
|
355
299
|
}
|
|
356
|
-
function
|
|
357
|
-
if ("object" !=
|
|
300
|
+
function ae(e, t) {
|
|
301
|
+
if ("object" != ee(e) || !e) return e;
|
|
358
302
|
var n = e[Symbol.toPrimitive];
|
|
359
303
|
if (void 0 !== n) {
|
|
360
304
|
var r = n.call(e, t || "default");
|
|
361
|
-
if ("object" !=
|
|
305
|
+
if ("object" != ee(r)) return r;
|
|
362
306
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
363
307
|
}
|
|
364
308
|
return ("string" === t ? String : Number)(e);
|
|
365
309
|
}
|
|
366
|
-
|
|
310
|
+
function ie(e, t) {
|
|
311
|
+
if (null == e) return {};
|
|
312
|
+
var n, r, o = ue(e, t);
|
|
313
|
+
if (Object.getOwnPropertySymbols) {
|
|
314
|
+
var l = Object.getOwnPropertySymbols(e);
|
|
315
|
+
for (r = 0; r < l.length; r++) {
|
|
316
|
+
n = l[r], t.includes(n) || {}.propertyIsEnumerable.call(e, n) && (o[n] = e[n]);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
return o;
|
|
320
|
+
}
|
|
321
|
+
function ue(e, t) {
|
|
322
|
+
if (null == e) return {};
|
|
323
|
+
var n = {};
|
|
324
|
+
for (var r in e) {
|
|
325
|
+
if ({}.hasOwnProperty.call(e, r)) {
|
|
326
|
+
if (t.includes(r)) continue;
|
|
327
|
+
n[r] = e[r];
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
return n;
|
|
331
|
+
}
|
|
332
|
+
var ce = {
|
|
367
333
|
/** @private */
|
|
368
334
|
active: l().bool,
|
|
369
335
|
children: l().node,
|
|
370
336
|
description: l().string,
|
|
371
337
|
descriptionPosition: l().oneOf([ "right", "bottom" ]),
|
|
372
338
|
disabled: l().bool,
|
|
339
|
+
elementRef: l().oneOfType([ l().func, l().object ]),
|
|
373
340
|
hidden: l().bool,
|
|
374
341
|
icon: l().node,
|
|
375
342
|
label: l().string.isRequired,
|
|
@@ -390,88 +357,43 @@
|
|
|
390
357
|
truncate: l().bool,
|
|
391
358
|
value: l().oneOfType([ l().string, l().number, l().bool ]).isRequired
|
|
392
359
|
};
|
|
393
|
-
var me = {
|
|
394
|
-
descriptionPosition: "bottom",
|
|
395
|
-
disabled: false,
|
|
396
|
-
multiple: false,
|
|
397
|
-
role: "option",
|
|
398
|
-
selected: false,
|
|
399
|
-
truncate: false
|
|
400
|
-
};
|
|
401
360
|
/**
|
|
402
|
-
* An option within a `Multiselect`.
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
for (var t = arguments.length, o = new Array(t), l = 0; l < t; l++) {
|
|
412
|
-
o[l] = arguments[l];
|
|
413
|
-
}
|
|
414
|
-
e = n.call.apply(n, [ this ].concat(o));
|
|
415
|
-
pe(ce(e), "c", null);
|
|
416
|
-
pe(ce(e), "handleClick", (function(t) {
|
|
417
|
-
var n = e.props, r = n.onClick, o = n.value, l = n.disabled;
|
|
418
|
-
if (!l) {
|
|
419
|
-
r === null || r === void 0 ? void 0 : r(t, {
|
|
420
|
-
value: o
|
|
421
|
-
});
|
|
422
|
-
}
|
|
423
|
-
}));
|
|
424
|
-
pe(ce(e), "handleMount", (function(t) {
|
|
425
|
-
e.c = t;
|
|
426
|
-
}));
|
|
427
|
-
return e;
|
|
428
|
-
}
|
|
429
|
-
// @docs-props-type OptionPropsBase
|
|
430
|
-
oe(r, [ {
|
|
431
|
-
key: "scrollIntoViewIfNeeded",
|
|
432
|
-
// eslint-disable-next-line react/no-unused-class-component-methods
|
|
433
|
-
value: function e() {
|
|
434
|
-
var t;
|
|
435
|
-
(t = this.c) === null || t === void 0 ? void 0 : t.scrollIntoViewIfNeeded();
|
|
436
|
-
}
|
|
437
|
-
/**
|
|
438
|
-
* Place focus on the button.
|
|
439
|
-
*/
|
|
440
|
-
// eslint-disable-next-line react/no-unused-class-component-methods
|
|
441
|
-
}, {
|
|
442
|
-
key: "focus",
|
|
443
|
-
value: function e() {
|
|
444
|
-
var t;
|
|
445
|
-
(t = this.c) === null || t === void 0 ? void 0 : t.focus();
|
|
446
|
-
}
|
|
447
|
-
}, {
|
|
448
|
-
key: "render",
|
|
449
|
-
value: function e() {
|
|
450
|
-
var n = this.props, r = n.value, o = n.children, l = n.label, a = n.multiple, i = n.role, u = n.icon, c = ee(n, [ "value", "children", "label", "multiple", "role", "icon" ]);
|
|
451
|
-
var s = r.toString();
|
|
452
|
-
|
|
453
|
-
return t().createElement(A.Item, Z({
|
|
454
|
-
"data-test-value": r,
|
|
455
|
-
"data-test": "option",
|
|
456
|
-
ref: this.handleMount
|
|
457
|
-
}, c, {
|
|
458
|
-
selectable: true,
|
|
459
|
-
selectableAppearance: a ? "checkbox" : "checkmark",
|
|
460
|
-
onClick: this.handleClick,
|
|
461
|
-
role: i,
|
|
462
|
-
value: s,
|
|
463
|
-
startAdornment: u
|
|
464
|
-
}), o || l);
|
|
361
|
+
* An option within a `Multiselect`.
|
|
362
|
+
*/ function se(n) {
|
|
363
|
+
var r = n.children, o = n.descriptionPosition, l = o === void 0 ? "bottom" : o, a = n.disabled, i = n.elementRef, u = n.icon, c = n.label, s = n.multiple, f = n.onClick, p = n.role, d = p === void 0 ? "option" : p, v = n.value, b = ie(n, [ "children", "descriptionPosition", "disabled", "elementRef", "icon", "label", "multiple", "onClick", "role", "value" ]);
|
|
364
|
+
// @docs-props-type OptionPropsBase
|
|
365
|
+
var m = (0, e.useCallback)((function(e) {
|
|
366
|
+
if (!a) {
|
|
367
|
+
f === null || f === void 0 ? void 0 : f(e, {
|
|
368
|
+
value: v
|
|
369
|
+
});
|
|
465
370
|
}
|
|
466
|
-
} ]);
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
371
|
+
}), [ a, f, v ]);
|
|
372
|
+
var y = v.toString();
|
|
373
|
+
var h = re({
|
|
374
|
+
descriptionPosition: l,
|
|
375
|
+
disabled: a
|
|
376
|
+
}, b);
|
|
377
|
+
|
|
378
|
+
return t().createElement(T.Item, te({
|
|
379
|
+
"data-test-value": v,
|
|
380
|
+
"data-test": "option",
|
|
381
|
+
elementRef: i
|
|
382
|
+
}, h, {
|
|
383
|
+
selectable: true,
|
|
384
|
+
selectableAppearance: s ? "checkbox" : "checkmark",
|
|
385
|
+
startAdornment: u,
|
|
386
|
+
onClick: m,
|
|
387
|
+
role: d,
|
|
388
|
+
value: y
|
|
389
|
+
}), r || c);
|
|
390
|
+
}
|
|
391
|
+
se.propTypes = ce;
|
|
392
|
+
se.type = T.Item;
|
|
393
|
+
// For components to distinguish if their children are Options or Headings/Dividers
|
|
394
|
+
/* harmony default export */ const fe = se;
|
|
473
395
|
// CONCATENATED MODULE: ./src/Select/SelectAllOption.tsx
|
|
474
|
-
var
|
|
396
|
+
var pe = {
|
|
475
397
|
active: l().bool,
|
|
476
398
|
changedToggle: l().bool,
|
|
477
399
|
elementRef: l().oneOfType([ l().func, l().object ]),
|
|
@@ -481,13 +403,14 @@
|
|
|
481
403
|
selected: l().oneOf([ false, true, "some" ]),
|
|
482
404
|
totalCount: l().number
|
|
483
405
|
};
|
|
484
|
-
|
|
485
|
-
var
|
|
406
|
+
function de(e) {
|
|
407
|
+
var n = e.active, r = e.elementRef, o = e.id, l = e.onClick, a = e.selectAllLabel, i = e.totalCount, u = e.changedToggle, c = e.selected;
|
|
486
408
|
// When toggle is changed the total count is not displayed anymore so the count is now shown in the Select all menu item
|
|
487
409
|
var s = u ? " (".concat(i === null || i === void 0 ? void 0 : i.toString(), ")") : "";
|
|
488
410
|
|
|
489
|
-
return t().createElement(
|
|
490
|
-
active:
|
|
411
|
+
return t().createElement(fe, {
|
|
412
|
+
active: n,
|
|
413
|
+
elementRef: r,
|
|
491
414
|
"aria-keyshortcuts": "Control+A",
|
|
492
415
|
"data-test": "select-all",
|
|
493
416
|
description: "".concat(s, " Ctrl-a"),
|
|
@@ -497,23 +420,22 @@
|
|
|
497
420
|
label: a,
|
|
498
421
|
multiple: true,
|
|
499
422
|
onClick: l,
|
|
500
|
-
ref: n,
|
|
501
423
|
role: "menuitemcheckbox",
|
|
502
424
|
selected: c,
|
|
503
425
|
tabIndex: -1,
|
|
504
426
|
value: "selectAll"
|
|
505
427
|
});
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
/* harmony default export */ const
|
|
428
|
+
}
|
|
429
|
+
de.propTypes = pe;
|
|
430
|
+
/* harmony default export */ const ve = de;
|
|
509
431
|
// CONCATENATED MODULE: external "styled-components"
|
|
510
|
-
const
|
|
511
|
-
var
|
|
432
|
+
const be = require("styled-components");
|
|
433
|
+
var me = n.n(be);
|
|
512
434
|
// CONCATENATED MODULE: external "@splunk/react-ui/Button"
|
|
513
|
-
const
|
|
514
|
-
var
|
|
435
|
+
const ye = require("@splunk/react-ui/Button");
|
|
436
|
+
var he = n.n(ye);
|
|
515
437
|
// CONCATENATED MODULE: ./src/Select/SelectBaseStyles.ts
|
|
516
|
-
var
|
|
438
|
+
var ge = me()(he()).withConfig({
|
|
517
439
|
displayName: "SelectBaseStyles__StyledButton",
|
|
518
440
|
componentId: "sc-16cj7sk-0"
|
|
519
441
|
})([ "&[data-inline]{width:", ";}", "" ], (function(e) {
|
|
@@ -523,76 +445,76 @@
|
|
|
523
445
|
var t = e.$multiple;
|
|
524
446
|
return !t && "flex-grow: 0;";
|
|
525
447
|
}));
|
|
526
|
-
var
|
|
448
|
+
var Oe = me().span.withConfig({
|
|
527
449
|
displayName: "SelectBaseStyles__StyledLinkIcon",
|
|
528
450
|
componentId: "sc-16cj7sk-1"
|
|
529
451
|
})([ "padding-right:2px;" ]);
|
|
530
|
-
var
|
|
452
|
+
var Se = me().span.withConfig({
|
|
531
453
|
displayName: "SelectBaseStyles__StyledLinkCaret",
|
|
532
454
|
componentId: "sc-16cj7sk-2"
|
|
533
455
|
})([ "padding-left:2px;" ]);
|
|
534
|
-
var
|
|
456
|
+
var Ce = me().div.withConfig({
|
|
535
457
|
displayName: "SelectBaseStyles__StyledFilter",
|
|
536
458
|
componentId: "sc-16cj7sk-3"
|
|
537
|
-
})([ "padding:", ";min-width:160px;" ], (0,
|
|
459
|
+
})([ "padding:", ";min-width:160px;" ], (0, $.pick)({
|
|
538
460
|
enterprise: "8px",
|
|
539
461
|
prisma: "10px 16px"
|
|
540
462
|
}));
|
|
541
|
-
var
|
|
463
|
+
var ke = me().span.withConfig({
|
|
542
464
|
displayName: "SelectBaseStyles__StyledSearchIconWrapper",
|
|
543
465
|
componentId: "sc-16cj7sk-4"
|
|
544
|
-
})([ "color:", ";pointer-events:none;padding:", ";" ], (0,
|
|
466
|
+
})([ "color:", ";pointer-events:none;padding:", ";" ], (0, $.pick)({
|
|
545
467
|
enterprise: {
|
|
546
|
-
light:
|
|
547
|
-
dark:
|
|
468
|
+
light: $.variables.gray60,
|
|
469
|
+
dark: $.variables.white
|
|
548
470
|
},
|
|
549
|
-
prisma:
|
|
550
|
-
}), (0,
|
|
471
|
+
prisma: $.variables.contentColorMuted
|
|
472
|
+
}), (0, $.pick)({
|
|
551
473
|
comfortable: "0 8px",
|
|
552
474
|
compact: "0 6px"
|
|
553
475
|
}));
|
|
554
|
-
var
|
|
476
|
+
var we = me().span.withConfig({
|
|
555
477
|
displayName: "SelectBaseStyles__StyledCount",
|
|
556
478
|
componentId: "sc-16cj7sk-5"
|
|
557
|
-
})([ "padding-right:", ";" ],
|
|
558
|
-
var
|
|
479
|
+
})([ "padding-right:", ";" ], $.variables.spacingXSmall);
|
|
480
|
+
var xe = me()(E()).withConfig({
|
|
559
481
|
displayName: "SelectBaseStyles__StyledControlsLink",
|
|
560
482
|
componentId: "sc-16cj7sk-6"
|
|
561
483
|
})([ "margin-right:20px;", ";" ], (function(e) {
|
|
562
484
|
var t = e.$disabled;
|
|
563
|
-
return t && (0,
|
|
485
|
+
return t && (0, be.css)([ "color:", ";" ], $.variables.contentColorDisabled);
|
|
564
486
|
}));
|
|
565
|
-
var
|
|
487
|
+
var je = me().div.withConfig({
|
|
566
488
|
displayName: "SelectBaseStyles__StyledToggleAllControls",
|
|
567
489
|
componentId: "sc-16cj7sk-7"
|
|
568
|
-
})([ "padding:", ";", "" ], (0,
|
|
490
|
+
})([ "padding:", ";", "" ], (0, $.pick)({
|
|
569
491
|
enterprise: "5px 8px",
|
|
570
492
|
prisma: "10px 16px"
|
|
571
|
-
}), (0,
|
|
493
|
+
}), (0, $.pickVariant)("$placement", {
|
|
572
494
|
above: {
|
|
573
|
-
enterprise: (0,
|
|
574
|
-
prisma: (0,
|
|
495
|
+
enterprise: (0, be.css)([ "border-top:", ";" ], $.variables.border),
|
|
496
|
+
prisma: (0, be.css)([ "border-top:1px solid ", ";" ], $.variables.neutral200)
|
|
575
497
|
},
|
|
576
498
|
below: {
|
|
577
|
-
enterprise: (0,
|
|
578
|
-
prisma: (0,
|
|
499
|
+
enterprise: (0, be.css)([ "border-bottom:", ";" ], $.variables.border),
|
|
500
|
+
prisma: (0, be.css)([ "border-bottom:1px solid ", ";" ], $.variables.neutral200)
|
|
579
501
|
}
|
|
580
502
|
}));
|
|
581
503
|
// EXTERNAL MODULE: ./src/useControlled/index.ts + 1 modules
|
|
582
|
-
var
|
|
504
|
+
var Pe = n(2907);
|
|
583
505
|
// CONCATENATED MODULE: ./src/utils/fuzzyMatch.ts
|
|
584
506
|
// A utility for matching keyboard characters to list values
|
|
585
|
-
var
|
|
507
|
+
var Ee = function e(t, n) {
|
|
586
508
|
return t ? t.label.charAt(n).toLowerCase() : "";
|
|
587
509
|
};
|
|
588
|
-
var
|
|
510
|
+
var Te = function e(t, n) {
|
|
589
511
|
if (!t.length) {
|
|
590
512
|
return t;
|
|
591
513
|
}
|
|
592
514
|
var r = null;
|
|
593
515
|
var o = false;
|
|
594
516
|
var l = t.filter((function(e) {
|
|
595
|
-
var t =
|
|
517
|
+
var t = Ee(e, n.index);
|
|
596
518
|
if (t === n.value) {
|
|
597
519
|
o = true;
|
|
598
520
|
return true;
|
|
@@ -600,7 +522,7 @@
|
|
|
600
522
|
// If we haven't found a match yet, keep track of the next closest match.
|
|
601
523
|
// Secondary matching looks for the closest character of a higher value, and failing that, closest of a lower value.
|
|
602
524
|
if (!o) {
|
|
603
|
-
var l =
|
|
525
|
+
var l = Ee(r, n.index);
|
|
604
526
|
if (!l) {
|
|
605
527
|
r = e;
|
|
606
528
|
} else if (t > n.value) {
|
|
@@ -617,9 +539,27 @@
|
|
|
617
539
|
}));
|
|
618
540
|
return l.length === 0 && r ? [ r ] : l;
|
|
619
541
|
};
|
|
542
|
+
// CONCATENATED MODULE: ./src/utils/scrollIntoViewIfNeeded.ts
|
|
543
|
+
// A utility that attempts to move an element into view by scrolling it's derived parent.
|
|
544
|
+
var Re = function e(t) {
|
|
545
|
+
if (!t) {
|
|
546
|
+
return;
|
|
547
|
+
}
|
|
548
|
+
var n = t.offsetParent;
|
|
549
|
+
if (!n) {
|
|
550
|
+
return;
|
|
551
|
+
}
|
|
552
|
+
// Below the bottom of the container.
|
|
553
|
+
if (n.scrollTop + n.clientHeight < t.offsetTop + t.clientHeight) {
|
|
554
|
+
n.scrollTop = t.offsetTop + t.clientHeight - n.clientHeight;
|
|
555
|
+
// Above the top of the container.
|
|
556
|
+
} else if (n.scrollTop > t.offsetTop) {
|
|
557
|
+
n.scrollTop = t.offsetTop;
|
|
558
|
+
}
|
|
559
|
+
};
|
|
620
560
|
// CONCATENATED MODULE: ./src/utils/ssrDocument.ts
|
|
621
561
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
622
|
-
var
|
|
562
|
+
var Ae = {
|
|
623
563
|
body: {
|
|
624
564
|
appendChild: function e() {
|
|
625
565
|
return [];
|
|
@@ -673,14 +613,14 @@
|
|
|
673
613
|
search: ""
|
|
674
614
|
}
|
|
675
615
|
};
|
|
676
|
-
function
|
|
677
|
-
var e = typeof document !== "undefined" ? document :
|
|
616
|
+
function _e() {
|
|
617
|
+
var e = typeof document !== "undefined" ? document : Ae;
|
|
678
618
|
return e;
|
|
679
619
|
}
|
|
680
620
|
// CONCATENATED MODULE: ./src/utils/ssrWindow.ts
|
|
681
621
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
682
|
-
var
|
|
683
|
-
document:
|
|
622
|
+
var Ie = {
|
|
623
|
+
document: Ae,
|
|
684
624
|
navigator: {
|
|
685
625
|
userAgent: ""
|
|
686
626
|
},
|
|
@@ -734,25 +674,25 @@
|
|
|
734
674
|
clearTimeout(t);
|
|
735
675
|
}
|
|
736
676
|
};
|
|
737
|
-
function
|
|
738
|
-
var e = typeof window !== "undefined" ? window :
|
|
677
|
+
function Me() {
|
|
678
|
+
var e = typeof window !== "undefined" ? window : Ie;
|
|
739
679
|
return e;
|
|
740
680
|
}
|
|
741
681
|
// CONCATENATED MODULE: ./src/Select/SelectBase.tsx
|
|
742
|
-
function
|
|
743
|
-
return
|
|
682
|
+
function Le(e) {
|
|
683
|
+
return Be(e) || De(e) || Fe(e) || qe();
|
|
744
684
|
}
|
|
745
|
-
function
|
|
685
|
+
function qe() {
|
|
746
686
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
747
687
|
}
|
|
748
|
-
function
|
|
688
|
+
function De(e) {
|
|
749
689
|
if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"]) return Array.from(e);
|
|
750
690
|
}
|
|
751
|
-
function
|
|
752
|
-
if (Array.isArray(e)) return
|
|
691
|
+
function Be(e) {
|
|
692
|
+
if (Array.isArray(e)) return He(e);
|
|
753
693
|
}
|
|
754
|
-
function
|
|
755
|
-
return
|
|
694
|
+
function Ve() {
|
|
695
|
+
return Ve = Object.assign ? Object.assign.bind() : function(e) {
|
|
756
696
|
for (var t = 1; t < arguments.length; t++) {
|
|
757
697
|
var n = arguments[t];
|
|
758
698
|
for (var r in n) {
|
|
@@ -760,29 +700,29 @@
|
|
|
760
700
|
}
|
|
761
701
|
}
|
|
762
702
|
return e;
|
|
763
|
-
},
|
|
703
|
+
}, Ve.apply(null, arguments);
|
|
764
704
|
}
|
|
765
|
-
function
|
|
766
|
-
return
|
|
705
|
+
function Ne(e, t) {
|
|
706
|
+
return $e(e) || ze(e, t) || Fe(e, t) || Ke();
|
|
767
707
|
}
|
|
768
|
-
function
|
|
708
|
+
function Ke() {
|
|
769
709
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
770
710
|
}
|
|
771
|
-
function
|
|
711
|
+
function Fe(e, t) {
|
|
772
712
|
if (e) {
|
|
773
|
-
if ("string" == typeof e) return
|
|
713
|
+
if ("string" == typeof e) return He(e, t);
|
|
774
714
|
var n = {}.toString.call(e).slice(8, -1);
|
|
775
|
-
return "Object" === n && e.constructor && (n = e.constructor.name), "Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ?
|
|
715
|
+
return "Object" === n && e.constructor && (n = e.constructor.name), "Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? He(e, t) : void 0;
|
|
776
716
|
}
|
|
777
717
|
}
|
|
778
|
-
function
|
|
718
|
+
function He(e, t) {
|
|
779
719
|
(null == t || t > e.length) && (t = e.length);
|
|
780
720
|
for (var n = 0, r = Array(t); n < t; n++) {
|
|
781
721
|
r[n] = e[n];
|
|
782
722
|
}
|
|
783
723
|
return r;
|
|
784
724
|
}
|
|
785
|
-
function
|
|
725
|
+
function ze(e, t) {
|
|
786
726
|
var n = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
|
|
787
727
|
if (null != n) {
|
|
788
728
|
var r, o, l, a, i = [], u = !0, c = !1;
|
|
@@ -804,12 +744,12 @@
|
|
|
804
744
|
return i;
|
|
805
745
|
}
|
|
806
746
|
}
|
|
807
|
-
function
|
|
747
|
+
function $e(e) {
|
|
808
748
|
if (Array.isArray(e)) return e;
|
|
809
749
|
}
|
|
810
|
-
function
|
|
750
|
+
function We(e, t) {
|
|
811
751
|
if (null == e) return {};
|
|
812
|
-
var n, r, o =
|
|
752
|
+
var n, r, o = Ue(e, t);
|
|
813
753
|
if (Object.getOwnPropertySymbols) {
|
|
814
754
|
var l = Object.getOwnPropertySymbols(e);
|
|
815
755
|
for (r = 0; r < l.length; r++) {
|
|
@@ -818,7 +758,7 @@
|
|
|
818
758
|
}
|
|
819
759
|
return o;
|
|
820
760
|
}
|
|
821
|
-
function
|
|
761
|
+
function Ue(e, t) {
|
|
822
762
|
if (null == e) return {};
|
|
823
763
|
var n = {};
|
|
824
764
|
for (var r in e) {
|
|
@@ -829,15 +769,15 @@
|
|
|
829
769
|
}
|
|
830
770
|
return n;
|
|
831
771
|
}
|
|
832
|
-
function
|
|
772
|
+
function Je(e) {
|
|
833
773
|
"@babel/helpers - typeof";
|
|
834
|
-
return
|
|
774
|
+
return Je = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
835
775
|
return typeof e;
|
|
836
776
|
} : function(e) {
|
|
837
777
|
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
838
|
-
},
|
|
778
|
+
}, Je(e);
|
|
839
779
|
}
|
|
840
|
-
function
|
|
780
|
+
function Xe(e, t) {
|
|
841
781
|
var n = Object.keys(e);
|
|
842
782
|
if (Object.getOwnPropertySymbols) {
|
|
843
783
|
var r = Object.getOwnPropertySymbols(e);
|
|
@@ -847,40 +787,40 @@
|
|
|
847
787
|
}
|
|
848
788
|
return n;
|
|
849
789
|
}
|
|
850
|
-
function
|
|
790
|
+
function Ge(e) {
|
|
851
791
|
for (var t = 1; t < arguments.length; t++) {
|
|
852
792
|
var n = null != arguments[t] ? arguments[t] : {};
|
|
853
|
-
t % 2 ?
|
|
854
|
-
|
|
855
|
-
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) :
|
|
793
|
+
t % 2 ? Xe(Object(n), !0).forEach((function(t) {
|
|
794
|
+
Qe(e, t, n[t]);
|
|
795
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Xe(Object(n)).forEach((function(t) {
|
|
856
796
|
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
857
797
|
}));
|
|
858
798
|
}
|
|
859
799
|
return e;
|
|
860
800
|
}
|
|
861
|
-
function
|
|
862
|
-
return (t =
|
|
801
|
+
function Qe(e, t, n) {
|
|
802
|
+
return (t = Ye(t)) in e ? Object.defineProperty(e, t, {
|
|
863
803
|
value: n,
|
|
864
804
|
enumerable: !0,
|
|
865
805
|
configurable: !0,
|
|
866
806
|
writable: !0
|
|
867
807
|
}) : e[t] = n, e;
|
|
868
808
|
}
|
|
869
|
-
function
|
|
870
|
-
var t =
|
|
871
|
-
return "symbol" ==
|
|
809
|
+
function Ye(e) {
|
|
810
|
+
var t = Ze(e, "string");
|
|
811
|
+
return "symbol" == Je(t) ? t : t + "";
|
|
872
812
|
}
|
|
873
|
-
function
|
|
874
|
-
if ("object" !=
|
|
813
|
+
function Ze(e, t) {
|
|
814
|
+
if ("object" != Je(e) || !e) return e;
|
|
875
815
|
var n = e[Symbol.toPrimitive];
|
|
876
816
|
if (void 0 !== n) {
|
|
877
817
|
var r = n.call(e, t || "default");
|
|
878
|
-
if ("object" !=
|
|
818
|
+
if ("object" != Je(r)) return r;
|
|
879
819
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
880
820
|
}
|
|
881
821
|
return ("string" === t ? String : Number)(e);
|
|
882
822
|
}
|
|
883
|
-
var
|
|
823
|
+
var et = {
|
|
884
824
|
allowKeyMatching: l().bool,
|
|
885
825
|
allowNewValues: l().bool,
|
|
886
826
|
animateLoading: l().bool,
|
|
@@ -929,296 +869,84 @@
|
|
|
929
869
|
/** @private. */
|
|
930
870
|
virtualization: l().number
|
|
931
871
|
};
|
|
932
|
-
var
|
|
872
|
+
var tt = h()((function(e) {
|
|
933
873
|
return [ e ];
|
|
934
874
|
}));
|
|
935
875
|
// preserve separate widths for single vs. multi mode
|
|
936
|
-
var
|
|
876
|
+
var nt = h()((function(e) {
|
|
937
877
|
var t = e.anchorWidth, n = e.isMultiple, r = e.maxHeight, o = e.menuStyle;
|
|
938
|
-
return n ?
|
|
878
|
+
return n ? Ge({
|
|
939
879
|
width: Math.max(t !== null && t !== void 0 ? t : 0, 200),
|
|
940
880
|
maxHeight: r
|
|
941
|
-
}, o) :
|
|
881
|
+
}, o) : Ge({
|
|
942
882
|
minWidth: t !== null && t !== void 0 ? t : undefined,
|
|
943
883
|
maxWidth: Math.max(t !== null && t !== void 0 ? t : 0, 300),
|
|
944
884
|
maxHeight: r
|
|
945
885
|
}, o);
|
|
946
886
|
}));
|
|
947
|
-
var
|
|
948
|
-
function
|
|
887
|
+
var rt = [ "clickAway", "escapeKey", "offScreen", "tabKey", "toggleClick" ];
|
|
888
|
+
function ot(e) {
|
|
949
889
|
return e && i()(e.props, "value");
|
|
950
890
|
}
|
|
951
|
-
function
|
|
952
|
-
return "".concat(
|
|
953
|
-
}
|
|
954
|
-
var
|
|
955
|
-
var
|
|
956
|
-
var
|
|
957
|
-
var
|
|
958
|
-
var r = n.activeItemId, o = n.
|
|
959
|
-
var
|
|
960
|
-
var
|
|
891
|
+
function lt(e, t) {
|
|
892
|
+
return "".concat(Je(e), "-").concat(e, "-").concat(t);
|
|
893
|
+
}
|
|
894
|
+
var at = [ "append", "error", "prepend" ];
|
|
895
|
+
var it = (0, u._)("No matches");
|
|
896
|
+
var ut = (0, u._)("Select...");
|
|
897
|
+
var ct = function e(n) {
|
|
898
|
+
var r = n.activeItemId, o = n.filterA11yId, l = n.filterKeyword, a = n.hasChildren, i = n.inputId, c = n.inputRef, s = n.menuListboxId, f = n.multiple, p = n.onClearAll, d = n.onSelectAll, v = n.onTextBlur, b = n.onTextChange, m = n.onTextFocus, y = n.onTextKeyDown, h = n.optionSelection, g = n.placement, O = n.selectAllAppearance, S = n.textHasFocus;
|
|
899
|
+
var C = (0, u._)("Select all options".concat(h.current === "all" ? " disabled" : ""));
|
|
900
|
+
var k = (0, u._)("Clear all options".concat(h.current === "none" ? " disabled" : ""));
|
|
961
901
|
// only visually disable these as opposed to fully disabling to avoid losing keyboard focus - see SUI-2731
|
|
962
|
-
var
|
|
963
|
-
$placement:
|
|
902
|
+
var w = t().createElement(je, {
|
|
903
|
+
$placement: g,
|
|
964
904
|
key: "selectAll"
|
|
965
|
-
}, t().createElement(
|
|
966
|
-
$disabled:
|
|
967
|
-
"aria-label":
|
|
968
|
-
onClick:
|
|
905
|
+
}, t().createElement(xe, {
|
|
906
|
+
$disabled: h.current === "all",
|
|
907
|
+
"aria-label": C,
|
|
908
|
+
onClick: d,
|
|
969
909
|
"data-test": "select-all"
|
|
970
|
-
},
|
|
971
|
-
$disabled:
|
|
972
|
-
"aria-label":
|
|
973
|
-
onClick:
|
|
910
|
+
}, l ? (0, u._)("Select all Matches") : (0, u._)("Select all")), t().createElement(xe, {
|
|
911
|
+
$disabled: h.current === "none",
|
|
912
|
+
"aria-label": k,
|
|
913
|
+
onClick: p,
|
|
974
914
|
"data-test": "clear-all"
|
|
975
|
-
},
|
|
915
|
+
}, l ? (0, u._)("Clear all Matches") : (0, u._)("Clear all")));
|
|
976
916
|
|
|
977
917
|
return t().createElement("div", {
|
|
978
918
|
key: "controls"
|
|
979
|
-
}, t().createElement(
|
|
919
|
+
}, o && t().createElement(L(), {
|
|
920
|
+
id: o
|
|
921
|
+
}, (0, u._)("Type to filter")), t().createElement(Ce, {
|
|
980
922
|
key: "filter",
|
|
981
923
|
"data-test": "filter"
|
|
982
|
-
}, t().createElement(
|
|
983
|
-
value:
|
|
924
|
+
}, t().createElement(I(), {
|
|
925
|
+
value: l,
|
|
984
926
|
autoCapitalize: "off",
|
|
985
927
|
autoComplete: "off",
|
|
986
928
|
autoCorrect: "off",
|
|
987
929
|
spellCheck: false,
|
|
988
|
-
onChange:
|
|
989
|
-
onKeyDown:
|
|
990
|
-
onFocus:
|
|
991
|
-
onBlur:
|
|
930
|
+
onChange: b,
|
|
931
|
+
onKeyDown: y,
|
|
932
|
+
onFocus: m,
|
|
933
|
+
onBlur: v,
|
|
992
934
|
placeholder: (0, u._)("filter"),
|
|
993
935
|
role: "combobox",
|
|
994
936
|
"aria-expanded": "true",
|
|
995
|
-
"aria-controls":
|
|
996
|
-
"aria-owns":
|
|
937
|
+
"aria-controls": s,
|
|
938
|
+
"aria-owns": a ? r : undefined,
|
|
997
939
|
"aria-label": (0, u._)("Filter"),
|
|
998
940
|
"aria-autocomplete": "list",
|
|
999
|
-
"aria-activedescendant":
|
|
1000
|
-
inputRef:
|
|
1001
|
-
inputId:
|
|
941
|
+
"aria-activedescendant": S && a ? r : undefined,
|
|
942
|
+
inputRef: c,
|
|
943
|
+
inputId: i,
|
|
1002
944
|
canClear: true,
|
|
1003
|
-
startAdornment: t().createElement(
|
|
1004
|
-
})),
|
|
945
|
+
startAdornment: t().createElement(ke, null, t().createElement(Z, null))
|
|
946
|
+
})), f && a && O === "buttongroup" && w);
|
|
1005
947
|
};
|
|
1006
|
-
var
|
|
1007
|
-
var
|
|
1008
|
-
var o = r.activeIndex, l = r.activeItemId, a = r.allowKeyMatching, i = r.allowNewValues, c = r.availableMatchOptions, s = r.availableOptionCount, f = r.children, d = r.currentValues, b = r.filter, m = r.filterKeyword, y = r.firstSelectedOptionIndex, h = r.isLoadingOptions, g = r.multiple, O = r.newTopValues, w = r.onActiveOptionMount, S = r.onClearAll, C = r.onClick, k = r.onKeyDown, x = r.onOptionMount, j = r.onScrollBottom, E = r.onSelectAll, P = r.optionSelection, T = r.selectAllAppearance, I = r.selectedOptionCount, _ = r.setActiveValue, M = r.setAvailableMatchOptions, R = r.setAvailableOptionCount, L = r.setDisplayedValues, q = r.setFirstSelectedOptionIndex, B = r.setOptionSelection, D = r.setSelectedOptionCount, N = r.textHasFocus, K = r.toggle;
|
|
1009
|
-
R(0);
|
|
1010
|
-
q(undefined);
|
|
1011
|
-
D(0);
|
|
1012
|
-
_(undefined);
|
|
1013
|
-
M([]);
|
|
1014
|
-
var F;
|
|
1015
|
-
var H = 0;
|
|
1016
|
-
var z = false;
|
|
1017
|
-
// used to avoid overwriting the selected item ref in multiple mode
|
|
1018
|
-
var $;
|
|
1019
|
-
var W = e.Children.toArray(f).reduce((function(n, r, o) {
|
|
1020
|
-
// ignore Headings and Dividers
|
|
1021
|
-
if (!st(r)) {
|
|
1022
|
-
n.push(r);
|
|
1023
|
-
return n;
|
|
1024
|
-
}
|
|
1025
|
-
var l = r.props, i = l.disabled, u = l.hidden, s = l.label, f = l.value;
|
|
1026
|
-
// Find out if the search string exactly matches a value
|
|
1027
|
-
if (f === m) {
|
|
1028
|
-
F = true;
|
|
1029
|
-
}
|
|
1030
|
-
var p = d && d.indexOf(f) >= 0;
|
|
1031
|
-
var v = !!p && !i && !$;
|
|
1032
|
-
var y = a && !g && !b && !h && !j;
|
|
1033
|
-
var w = ft(f, s);
|
|
1034
|
-
var S = -1;
|
|
1035
|
-
if (y && !i && !u) {
|
|
1036
|
-
c.current.push({
|
|
1037
|
-
label: s,
|
|
1038
|
-
value: f
|
|
1039
|
-
});
|
|
1040
|
-
S = c.current.length - 1;
|
|
1041
|
-
}
|
|
1042
|
-
// Format the Menu.Item
|
|
1043
|
-
var E = (0, e.cloneElement)(r, {
|
|
1044
|
-
key: r.key || o,
|
|
1045
|
-
onClick: C,
|
|
1046
|
-
onKeyDown: y ? function(e) {
|
|
1047
|
-
return k(e, S);
|
|
1048
|
-
} : undefined,
|
|
1049
|
-
selected: p,
|
|
1050
|
-
multiple: g,
|
|
1051
|
-
role: "option",
|
|
1052
|
-
ref: function e(t) {
|
|
1053
|
-
return x(t, w, v);
|
|
1054
|
-
}
|
|
1055
|
-
});
|
|
1056
|
-
if (v) {
|
|
1057
|
-
$ = true;
|
|
1058
|
-
}
|
|
1059
|
-
if (O && O.indexOf(f) >= 0) {
|
|
1060
|
-
if (H === 0) {
|
|
1061
|
-
n.splice(H, 0, t().createElement(A.Divider, {
|
|
1062
|
-
key: "topDivider"
|
|
1063
|
-
}));
|
|
1064
|
-
z = true;
|
|
1065
|
-
}
|
|
1066
|
-
n.splice(H, 0, E);
|
|
1067
|
-
H += 1;
|
|
1068
|
-
} else {
|
|
1069
|
-
n.push(E);
|
|
1070
|
-
}
|
|
1071
|
-
return n;
|
|
1072
|
-
}), []);
|
|
1073
|
-
// In multiple mode, add missing items
|
|
1074
|
-
if (g) {
|
|
1075
|
-
v()(d, (function(e) {
|
|
1076
|
-
var n = p()(W, (function(t) {
|
|
1077
|
-
return st(t) && t.props && t.props.value === e;
|
|
1078
|
-
}));
|
|
1079
|
-
if (!n) {
|
|
1080
|
-
if (e === m) {
|
|
1081
|
-
F = true;
|
|
1082
|
-
}
|
|
1083
|
-
var r = O && O.indexOf(e) >= 0;
|
|
1084
|
-
var o = O.length;
|
|
1085
|
-
if (H === 0) {
|
|
1086
|
-
W.splice(0, 0, t().createElement(A.Divider, {
|
|
1087
|
-
key: "topDivider"
|
|
1088
|
-
}));
|
|
1089
|
-
H += 1;
|
|
1090
|
-
z = true;
|
|
1091
|
-
}
|
|
1092
|
-
W.splice(r ? 0 : o + 1, 0, t().createElement(he, {
|
|
1093
|
-
label: String(e),
|
|
1094
|
-
value: e,
|
|
1095
|
-
key: "missing-value-".concat(e),
|
|
1096
|
-
onClick: C,
|
|
1097
|
-
multiple: g,
|
|
1098
|
-
selected: true
|
|
1099
|
-
}));
|
|
1100
|
-
if (r) {
|
|
1101
|
-
H += 1;
|
|
1102
|
-
}
|
|
1103
|
-
}
|
|
1104
|
-
}));
|
|
1105
|
-
}
|
|
1106
|
-
var U = b === "controlled";
|
|
1107
|
-
// Filter the items
|
|
1108
|
-
var J = (0, V.stringToKeywords)(m);
|
|
1109
|
-
W = U ? W : W.filter((function(e) {
|
|
1110
|
-
if (st(e)) {
|
|
1111
|
-
return (0, V.testPhrase)(e.props.label, J);
|
|
1112
|
-
}
|
|
1113
|
-
return true;
|
|
1114
|
-
// Keep all headers and non-interactive options
|
|
1115
|
-
})).map((function(t) {
|
|
1116
|
-
if (!st(t)) {
|
|
1117
|
-
return t;
|
|
1118
|
-
}
|
|
1119
|
-
// highlight matched text
|
|
1120
|
-
var n = J && (0, V.keywordLocations)(t.props.label, J);
|
|
1121
|
-
|
|
1122
|
-
return (0, e.cloneElement)(t, {
|
|
1123
|
-
matchRanges: n || undefined
|
|
1124
|
-
});
|
|
1125
|
-
}));
|
|
1126
|
-
// Add the option to add the new value
|
|
1127
|
-
if (i && !F && m) {
|
|
1128
|
-
var X = z ? H + 1 : H;
|
|
1129
|
-
W.splice(X, 0, t().createElement(he, {
|
|
1130
|
-
label: "".concat(m, " (new value)"),
|
|
1131
|
-
value: m,
|
|
1132
|
-
key: "newValue",
|
|
1133
|
-
multiple: g,
|
|
1134
|
-
onClick: C
|
|
1135
|
-
}));
|
|
1136
|
-
}
|
|
1137
|
-
// When selectAll is a menu item, add an offset so that activeItem accounts for the extra selectAll option.
|
|
1138
|
-
var G = T === "checkbox" && g && W.length > 1 ? 1 : 0;
|
|
1139
|
-
var Q = true;
|
|
1140
|
-
// Highlight the selected Items and remove hidden
|
|
1141
|
-
W = W.reduce((function(t, n) {
|
|
1142
|
-
// ignore Dividers & Headings
|
|
1143
|
-
if (!st(n)) {
|
|
1144
|
-
t.push(n);
|
|
1145
|
-
return t;
|
|
1146
|
-
}
|
|
1147
|
-
// Ignore any hidden items
|
|
1148
|
-
if (n.props && n.props.hidden) {
|
|
1149
|
-
return t;
|
|
1150
|
-
}
|
|
1151
|
-
if (n.props.selected && !n.props.disabled && y.current == null) {
|
|
1152
|
-
q(s.current);
|
|
1153
|
-
}
|
|
1154
|
-
var r = G === o;
|
|
1155
|
-
G += 1;
|
|
1156
|
-
R(s.current + 1);
|
|
1157
|
-
D(I.current + (n.props.selected ? 1 : 0));
|
|
1158
|
-
if (n.key !== "newValue" && !n.props.disabled && !n.props.selected) {
|
|
1159
|
-
Q = false;
|
|
1160
|
-
}
|
|
1161
|
-
if (!r || !N) {
|
|
1162
|
-
t.push(n);
|
|
1163
|
-
return t;
|
|
1164
|
-
}
|
|
1165
|
-
if (!n.props.disabled) {
|
|
1166
|
-
_(n.props.value);
|
|
1167
|
-
}
|
|
1168
|
-
var a = (0, e.cloneElement)(n, {
|
|
1169
|
-
active: r,
|
|
1170
|
-
id: l,
|
|
1171
|
-
ref: w
|
|
1172
|
-
});
|
|
1173
|
-
t.push(a);
|
|
1174
|
-
return t;
|
|
1175
|
-
}), []);
|
|
1176
|
-
B(I.current === 0 && "none" || Q && "all" || "some");
|
|
1177
|
-
// add select all option
|
|
1178
|
-
if (T === "checkbox" && g && s.current > 0) {
|
|
1179
|
-
var Y;
|
|
1180
|
-
if (P.current === "all") {
|
|
1181
|
-
if (m === "") {
|
|
1182
|
-
Y = (0, u._)("Clear all");
|
|
1183
|
-
} else {
|
|
1184
|
-
Y = (0, u._)("Clear all matches");
|
|
1185
|
-
}
|
|
1186
|
-
} else if (m === "") {
|
|
1187
|
-
Y = (0, u._)("Select all");
|
|
1188
|
-
} else {
|
|
1189
|
-
Y = (0, u._)("Select all matches");
|
|
1190
|
-
}
|
|
1191
|
-
if (o === 0 && N) {
|
|
1192
|
-
_("selectAll");
|
|
1193
|
-
}
|
|
1194
|
-
W.unshift( t().createElement(we, {
|
|
1195
|
-
active: o === 0,
|
|
1196
|
-
changedToggle: !!K,
|
|
1197
|
-
id: o === 0 ? l : undefined,
|
|
1198
|
-
onClick: P.current === "all" ? S : E,
|
|
1199
|
-
selectAllLabel: Y,
|
|
1200
|
-
selected: P.current === "all" || P.current !== "none" && "some",
|
|
1201
|
-
totalCount: d.length,
|
|
1202
|
-
tabIndex: -1,
|
|
1203
|
-
ref: w
|
|
1204
|
-
}), t().createElement(A.Divider, {
|
|
1205
|
-
key: "selectAllDivider"
|
|
1206
|
-
}));
|
|
1207
|
-
}
|
|
1208
|
-
L(W.reduce((function(e, t) {
|
|
1209
|
-
if (st(t)) {
|
|
1210
|
-
e.push(t.props.value);
|
|
1211
|
-
}
|
|
1212
|
-
return e;
|
|
1213
|
-
}), []));
|
|
1214
|
-
mt = W.some((function(e) {
|
|
1215
|
-
return st(e);
|
|
1216
|
-
}));
|
|
1217
|
-
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
1218
|
-
|
|
1219
|
-
return t().createElement(t().Fragment, null, W);
|
|
1220
|
-
};
|
|
1221
|
-
var ht = function e(t) {
|
|
948
|
+
var st = false;
|
|
949
|
+
var ft = function e(t) {
|
|
1222
950
|
var n = t.prefixLabel, r = t.label, o = t.suffixLabel;
|
|
1223
951
|
var l = r;
|
|
1224
952
|
if (n) {
|
|
@@ -1229,219 +957,201 @@
|
|
|
1229
957
|
}
|
|
1230
958
|
return l;
|
|
1231
959
|
};
|
|
1232
|
-
function
|
|
1233
|
-
var r = n.appearance, o = n.append, l = n.children, a = n.currentValues, i = a === void 0 ? [] : a, c = n.describedBy, s = n.disabled, f = n.elementRef, d = n.error, v = n.inline, b = n.labelText, m = n.labelledBy, y = n.multiple, h = n.onClick, g = n.placeholder,
|
|
1234
|
-
var A;
|
|
960
|
+
function pt(n) {
|
|
961
|
+
var r = n.appearance, o = n.append, l = n.children, a = n.currentValues, i = a === void 0 ? [] : a, c = n.describedBy, s = n.disabled, f = n.elementRef, d = n.error, v = n.inline, b = n.labelText, m = n.labelledBy, y = n.multiple, h = n.onClick, g = n.placeholder, S = n.prefixLabel, C = n.prepend, k = n.required, w = n.suffixLabel, x = n.toggle, j = n.toggleContent, P = We(n, [ "appearance", "append", "children", "currentValues", "describedBy", "disabled", "elementRef", "error", "inline", "labelText", "labelledBy", "multiple", "onClick", "placeholder", "prefixLabel", "prepend", "required", "suffixLabel", "toggle", "toggleContent" ]);
|
|
1235
962
|
var T;
|
|
1236
|
-
var
|
|
963
|
+
var R;
|
|
964
|
+
var A = [];
|
|
1237
965
|
// Generate buttonLabels
|
|
1238
966
|
var _ = e.Children.toArray(l);
|
|
1239
|
-
var
|
|
967
|
+
var I = i.reduce((function(e, t, n, r) {
|
|
1240
968
|
var o = p()(_, (function(e) {
|
|
1241
|
-
return
|
|
969
|
+
return ot(e) && e.props.value === t;
|
|
1242
970
|
}));
|
|
1243
971
|
if (o) {
|
|
1244
972
|
var l = o.props, a = l.children, c = l.icon, s = l.label;
|
|
1245
973
|
var f = j !== "optionLabel" && a ? a : s;
|
|
1246
974
|
e.push(f);
|
|
1247
|
-
|
|
975
|
+
A.push(s);
|
|
1248
976
|
// if not in multiple mode, add the icon
|
|
1249
977
|
if (!y && i.length === 1) {
|
|
1250
|
-
|
|
978
|
+
T = c;
|
|
1251
979
|
}
|
|
1252
980
|
} else if (y) {
|
|
1253
981
|
// only add values that don't match an option in "multiple" mode to preserve old behaviour
|
|
1254
982
|
e.push(t);
|
|
1255
|
-
|
|
983
|
+
A.push(t.toString());
|
|
1256
984
|
}
|
|
1257
985
|
if (n < r.length - 1) {
|
|
1258
986
|
e.push((0, u._)(", "));
|
|
1259
|
-
|
|
987
|
+
A.push((0, u._)(", "));
|
|
1260
988
|
}
|
|
1261
989
|
return e;
|
|
1262
990
|
}), []);
|
|
1263
|
-
|
|
991
|
+
R = I;
|
|
1264
992
|
// only apply prefix / suffix if the label is not empty
|
|
1265
|
-
if (
|
|
993
|
+
if (R.length > 0) {
|
|
1266
994
|
// If there's more than one item selected, read out the selected total
|
|
1267
995
|
// rather than reading out each selected item
|
|
1268
|
-
|
|
1269
|
-
prefixLabel:
|
|
1270
|
-
label:
|
|
1271
|
-
suffixLabel:
|
|
996
|
+
A = ft({
|
|
997
|
+
prefixLabel: S,
|
|
998
|
+
label: R.length > 1 ? [ "".concat(i.length, " items selected") ] : A,
|
|
999
|
+
suffixLabel: w
|
|
1272
1000
|
});
|
|
1273
|
-
|
|
1274
|
-
prefixLabel:
|
|
1275
|
-
label:
|
|
1276
|
-
suffixLabel:
|
|
1001
|
+
R = ft({
|
|
1002
|
+
prefixLabel: S,
|
|
1003
|
+
label: R,
|
|
1004
|
+
suffixLabel: w
|
|
1277
1005
|
});
|
|
1278
1006
|
}
|
|
1279
1007
|
// single <Select> behaviour is to show the placeholder if all parts of the label
|
|
1280
1008
|
// are empty strings so we replicate this behaviour here
|
|
1281
|
-
if (
|
|
1009
|
+
if (R.length === 0 || !y && R.every((function(e) {
|
|
1282
1010
|
return e === "";
|
|
1283
1011
|
}))) {
|
|
1284
|
-
|
|
1285
|
-
|
|
1012
|
+
R = tt(g);
|
|
1013
|
+
A = R;
|
|
1286
1014
|
}
|
|
1287
|
-
var
|
|
1015
|
+
var M = Object.keys(P).includes("aria-labelledby");
|
|
1016
|
+
var L = Ge({
|
|
1288
1017
|
"aria-describedby": c,
|
|
1289
|
-
"aria-label": "".concat(b ? "".concat(b, ", ") : "").concat(
|
|
1018
|
+
"aria-label": m || M ? undefined : "".concat(b ? "".concat(b, ", ") : "").concat(A.join("")),
|
|
1019
|
+
// aria-labelledby takes precedence over aria-label, so existence of both is redundant
|
|
1290
1020
|
"aria-labelledby": m,
|
|
1291
|
-
|
|
1292
|
-
"aria-required": C,
|
|
1021
|
+
"aria-required": k,
|
|
1293
1022
|
"data-select-appearance": r,
|
|
1294
1023
|
append: o,
|
|
1295
|
-
prepend:
|
|
1024
|
+
prepend: C,
|
|
1296
1025
|
onClick: h,
|
|
1297
1026
|
role: "combobox",
|
|
1298
1027
|
disabled: s,
|
|
1299
1028
|
elementRef: f,
|
|
1300
1029
|
error: d
|
|
1301
|
-
},
|
|
1030
|
+
}, P);
|
|
1302
1031
|
if (y) {
|
|
1303
|
-
|
|
1032
|
+
L["data-test-values"] = JSON.stringify(i);
|
|
1304
1033
|
} else {
|
|
1305
|
-
var
|
|
1306
|
-
|
|
1034
|
+
var q = Ne(i, 1), D = q[0];
|
|
1035
|
+
L["data-test-value"] = D;
|
|
1307
1036
|
}
|
|
1308
1037
|
if (x) {
|
|
1309
1038
|
|
|
1310
|
-
return (0, e.cloneElement)(x,
|
|
1039
|
+
return (0, e.cloneElement)(x, L);
|
|
1311
1040
|
}
|
|
1312
1041
|
if (r === "link") {
|
|
1313
1042
|
|
|
1314
|
-
return t().createElement(
|
|
1043
|
+
return t().createElement(E(), Ve({}, L, {
|
|
1315
1044
|
"data-select-appearance": "link"
|
|
1316
|
-
}), !!
|
|
1045
|
+
}), !!T && t().createElement(Oe, null, T), R || g, t().createElement(Se, null, t().createElement(U, null)));
|
|
1317
1046
|
}
|
|
1318
1047
|
|
|
1319
|
-
return t().createElement(
|
|
1048
|
+
return t().createElement(ge, Ve({}, L, {
|
|
1320
1049
|
$multiple: y,
|
|
1321
1050
|
appearance: r,
|
|
1322
|
-
label:
|
|
1051
|
+
label: R,
|
|
1323
1052
|
error: d,
|
|
1324
|
-
icon:
|
|
1053
|
+
icon: T,
|
|
1325
1054
|
inline: v,
|
|
1326
1055
|
isMenu: true,
|
|
1327
1056
|
onClick: h
|
|
1328
|
-
}, O()(
|
|
1057
|
+
}, O()(P, at)), !!i.length && y && t().createElement(we, {
|
|
1329
1058
|
"data-role": "count"
|
|
1330
1059
|
}, "(", i.length, ")"));
|
|
1331
1060
|
}
|
|
1332
|
-
|
|
1333
|
-
function
|
|
1334
|
-
var r;
|
|
1335
|
-
var o = n.allowKeyMatching, l = o === void 0 ? true : o, a = n.animateLoading, i = n.appearance, u = i === void 0 ? "toggle" : i, c = n.append, s = n.allowNewValues, f = n.children, d = n.defaultPlacement, v = d === void 0 ? "vertical" : d, b = n.defaultValues, y = n.describedBy, h = n.disabled, g = n.elementRef, O = n.error, w = n.filter, C = n.footerMessage, x = n.inline, E = n.inputId, P = n.inputRef, A = n.isLoadingOptions, _ = n.labelledBy, M = n.labelText, R = n.loadingMessage, V = n.menuStyle, D = V === void 0 ? {} : V, N = n.multiple, K = n.name, F = n.noOptionsMessage, H = F === void 0 ? dt : F, z = n.onChange, $ = n.onScroll, W = n.onScrollBottom, U = n.onFilterChange, J = n.onClick, X = n.onClose, G = n.onOpen, Q = n.required, Y = n.placeholder, Z = Y === void 0 ? vt : Y, ee = n.prefixLabel, te = n.prepend, ne = n.repositionMode, re = ne === void 0 ? "flip" : ne, oe = n.selectAllAppearance, le = oe === void 0 ? "buttongroup" : oe, ae = n.showSelectedValuesFirst, ie = n.suffixLabel, ue = n.tabConfirmsNewValue, ce = n.values, se = n.virtualization, fe = n.toggle, pe = n.toggleContent, de = pe === void 0 ? "optionChildren" : pe, ve = Ye(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" ]);
|
|
1061
|
+
pt[x.legacyRefMode] = true;
|
|
1062
|
+
function dt(n) {
|
|
1063
|
+
var r = n.allowKeyMatching, o = r === void 0 ? true : r, l = n.animateLoading, a = n.appearance, i = a === void 0 ? "toggle" : a, c = n.append, s = n.allowNewValues, f = n.children, d = n.defaultPlacement, b = d === void 0 ? "vertical" : d, y = n.defaultValues, h = n.describedBy, g = n.disabled, O = n.elementRef, S = n.error, k = n.filter, x = n.footerMessage, P = n.inline, E = n.inputId, _ = n.inputRef, I = n.isLoadingOptions, M = n.labelledBy, L = n.labelText, q = n.loadingMessage, K = n.menuStyle, F = K === void 0 ? {} : K, H = n.multiple, z = n.name, $ = n.noOptionsMessage, W = $ === void 0 ? it : $, U = n.onChange, J = n.onScroll, X = n.onScrollBottom, G = n.onFilterChange, Q = n.onClick, Y = n.onClose, Z = n.onOpen, ee = n.required, te = n.placeholder, ne = te === void 0 ? ut : te, re = n.prefixLabel, oe = n.prepend, le = n.repositionMode, ae = le === void 0 ? "flip" : le, ie = n.selectAllAppearance, ue = ie === void 0 ? "buttongroup" : ie, ce = n.showSelectedValuesFirst, se = n.suffixLabel, pe = n.tabConfirmsNewValue, de = n.values, be = n.virtualization, me = n.toggle, ye = n.toggleContent, he = ye === void 0 ? "optionChildren" : ye, ge = We(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" ]);
|
|
1336
1064
|
// @docs-props-type SelectBasePropsBase
|
|
1337
|
-
var
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1065
|
+
var Oe = (0, Pe["default"])({
|
|
1066
|
+
componentName: "SelectBase",
|
|
1067
|
+
/* eslint-disable-next-line prefer-rest-params */
|
|
1068
|
+
componentProps: arguments[0],
|
|
1069
|
+
// see SUI-7028
|
|
1070
|
+
defaultValuePropName: "defaultValues",
|
|
1071
|
+
valuePropName: "values"
|
|
1341
1072
|
});
|
|
1342
1073
|
// states
|
|
1343
|
-
var
|
|
1074
|
+
var Se = (0, e.useState)((function() {
|
|
1344
1075
|
return {
|
|
1345
|
-
activeItemId: (0,
|
|
1346
|
-
menuListboxId: (0,
|
|
1076
|
+
activeItemId: (0, V.createDOMID)("active-item"),
|
|
1077
|
+
menuListboxId: (0, V.createDOMID)("menu-listbox")
|
|
1347
1078
|
};
|
|
1348
|
-
})),
|
|
1349
|
-
var
|
|
1350
|
-
var
|
|
1351
|
-
var
|
|
1352
|
-
var
|
|
1353
|
-
var
|
|
1354
|
-
var
|
|
1079
|
+
})), Ce = Ne(Se, 1), ke = Ce[0], we = ke.activeItemId, xe = ke.menuListboxId;
|
|
1080
|
+
var je = (0, e.useState)(0), Ee = Ne(je, 2), Ae = Ee[0], _e = Ee[1];
|
|
1081
|
+
var Ie = (0, e.useState)(""), qe = Ne(Ie, 2), De = qe[0], Be = qe[1];
|
|
1082
|
+
var Ke = (0, e.useState)(false), Fe = Ne(Ke, 2), He = Fe[0], ze = Fe[1];
|
|
1083
|
+
var $e = (0, e.useState)(false), Ue = Ne($e, 2), Je = Ue[0], Xe = Ue[1];
|
|
1084
|
+
var Ge = (0, e.useState)([]), Qe = Ne(Ge, 2), Ye = Qe[0], Ze = Qe[1];
|
|
1085
|
+
var et = (0, e.useState)(y || []), tt = Ne(et, 2), at = tt[0], ft = tt[1];
|
|
1355
1086
|
// previous state
|
|
1356
|
-
var
|
|
1087
|
+
var dt = D()(Ae);
|
|
1357
1088
|
// refs
|
|
1358
|
-
var
|
|
1359
|
-
var
|
|
1360
|
-
var
|
|
1361
|
-
var
|
|
1362
|
-
var
|
|
1363
|
-
var
|
|
1364
|
-
var lt = (0, e.useRef)();
|
|
1365
|
-
var at = (0, e.useRef)({});
|
|
1366
|
-
var it = (0, e.useRef)(0);
|
|
1367
|
-
var pt = (0, e.useRef)([]);
|
|
1368
|
-
var ht = (0, e.useRef)(null);
|
|
1089
|
+
var vt = (0, e.useRef)(null);
|
|
1090
|
+
var bt = (0, e.useRef)(null);
|
|
1091
|
+
var mt = (0, e.useRef)(null);
|
|
1092
|
+
var yt = (0, e.useRef)([]);
|
|
1093
|
+
var ht = (0, e.useRef)([]);
|
|
1094
|
+
var gt = (0, e.useRef)(dt);
|
|
1369
1095
|
var Ot = (0, e.useRef)();
|
|
1370
|
-
var
|
|
1371
|
-
var
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
var
|
|
1377
|
-
|
|
1378
|
-
};
|
|
1379
|
-
var xt = function e(t) {
|
|
1380
|
-
wt.current = t;
|
|
1381
|
-
};
|
|
1382
|
-
var jt = function e(t) {
|
|
1383
|
-
lt.current = t;
|
|
1384
|
-
};
|
|
1385
|
-
var Et = function e(t) {
|
|
1386
|
-
rt.current = t;
|
|
1387
|
-
};
|
|
1388
|
-
var Pt = function e(t) {
|
|
1389
|
-
St.current = t;
|
|
1390
|
-
};
|
|
1391
|
-
var At = function e(t) {
|
|
1392
|
-
pt.current = t;
|
|
1393
|
-
};
|
|
1096
|
+
var St = (0, e.useRef)({});
|
|
1097
|
+
var Ct = (0, e.useRef)(0);
|
|
1098
|
+
var kt = (0, e.useRef)([]);
|
|
1099
|
+
var wt = (0, e.useRef)(null);
|
|
1100
|
+
var xt = (0, e.useRef)();
|
|
1101
|
+
var jt = (0, e.useRef)(0);
|
|
1102
|
+
var Pt = (0, e.useRef)("none");
|
|
1103
|
+
var Et = (0, e.useState)(k ? (0, V.createDOMID)("filter") : undefined), Tt = Ne(Et, 1), Rt = Tt[0];
|
|
1394
1104
|
(0, e.useEffect)((function() {
|
|
1395
1105
|
if (false) {}
|
|
1396
|
-
}), [
|
|
1397
|
-
var
|
|
1398
|
-
var e =
|
|
1399
|
-
return
|
|
1400
|
-
}), [
|
|
1401
|
-
var
|
|
1106
|
+
}), [ i, c, S, oe ]);
|
|
1107
|
+
var At = (0, e.useCallback)((function() {
|
|
1108
|
+
var e = Oe ? de : at;
|
|
1109
|
+
return H || e == null ? e : e.slice(0, 1);
|
|
1110
|
+
}), [ Oe, H, de, at ]);
|
|
1111
|
+
var _t = (0, e.useCallback)((function() {
|
|
1402
1112
|
var e;
|
|
1403
1113
|
// in non-multiple mode, don't move values to the top of the list
|
|
1404
|
-
return
|
|
1405
|
-
}), [
|
|
1406
|
-
var
|
|
1407
|
-
var t =
|
|
1408
|
-
|
|
1409
|
-
|
|
1114
|
+
return H && ce !== "never" ? (e = At()) !== null && e !== void 0 ? e : [] : [];
|
|
1115
|
+
}), [ At, H, ce ]);
|
|
1116
|
+
var It = (0, e.useCallback)((function(e) {
|
|
1117
|
+
var t = De;
|
|
1118
|
+
ze(true);
|
|
1119
|
+
Ze(_t());
|
|
1410
1120
|
// SUI-3234: preserve existing behavior difference between <Select> and <Multiselect.Compact>
|
|
1411
|
-
if (
|
|
1412
|
-
|
|
1121
|
+
if (H) {
|
|
1122
|
+
Be("");
|
|
1413
1123
|
}
|
|
1414
|
-
if (t !==
|
|
1415
|
-
|
|
1416
|
-
keyword:
|
|
1124
|
+
if (t !== De) {
|
|
1125
|
+
G === null || G === void 0 ? void 0 : G(e, {
|
|
1126
|
+
keyword: De
|
|
1417
1127
|
});
|
|
1418
1128
|
}
|
|
1419
|
-
}), [
|
|
1129
|
+
}), [ De, _t, H, G ]);
|
|
1420
1130
|
(0, e.useEffect)((function() {
|
|
1421
|
-
if (
|
|
1422
|
-
|
|
1423
|
-
if (
|
|
1424
|
-
|
|
1131
|
+
if (He) {
|
|
1132
|
+
Z === null || Z === void 0 ? void 0 : Z();
|
|
1133
|
+
if (wt.current && !k) {
|
|
1134
|
+
wt.current.focus();
|
|
1425
1135
|
} else {
|
|
1426
1136
|
var e;
|
|
1427
|
-
|
|
1137
|
+
_e((e = xt.current) !== null && e !== void 0 ? e : 0);
|
|
1428
1138
|
}
|
|
1429
1139
|
}
|
|
1430
|
-
}), [
|
|
1140
|
+
}), [ Z, He, Ye, De, k ]);
|
|
1431
1141
|
var Mt = (0, e.useCallback)((function() {
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
}), [
|
|
1437
|
-
var
|
|
1142
|
+
ze(false);
|
|
1143
|
+
_e(0);
|
|
1144
|
+
gt.current = null;
|
|
1145
|
+
Y === null || Y === void 0 ? void 0 : Y();
|
|
1146
|
+
}), [ Y ]);
|
|
1147
|
+
var Lt = (0, e.useCallback)((function(e, t) {
|
|
1438
1148
|
var n;
|
|
1439
|
-
var r = (n =
|
|
1149
|
+
var r = (n = At()) !== null && n !== void 0 ? n : [];
|
|
1440
1150
|
var o = r.indexOf(t);
|
|
1441
1151
|
var l;
|
|
1442
|
-
if (
|
|
1152
|
+
if (H) {
|
|
1443
1153
|
if (o >= 0) {
|
|
1444
|
-
l = [].concat(
|
|
1154
|
+
l = [].concat(Le(r.slice(0, o)), Le(r.slice(o + 1)));
|
|
1445
1155
|
} else {
|
|
1446
1156
|
l = r.concat([ t ]);
|
|
1447
1157
|
}
|
|
@@ -1449,14 +1159,14 @@
|
|
|
1449
1159
|
// non-multiple mode must always have a value
|
|
1450
1160
|
l = [ t ];
|
|
1451
1161
|
}
|
|
1452
|
-
var a = !
|
|
1162
|
+
var a = !Oe;
|
|
1453
1163
|
if (a) {
|
|
1454
|
-
|
|
1164
|
+
ft(l);
|
|
1455
1165
|
}
|
|
1456
|
-
if (
|
|
1166
|
+
if (H) {
|
|
1457
1167
|
// in uncontrolled multiple mode, keep the menu open
|
|
1458
1168
|
if (a) {
|
|
1459
|
-
|
|
1169
|
+
ze(true);
|
|
1460
1170
|
}
|
|
1461
1171
|
} else {
|
|
1462
1172
|
var i;
|
|
@@ -1465,127 +1175,127 @@
|
|
|
1465
1175
|
Mt({
|
|
1466
1176
|
reason: "contentClick"
|
|
1467
1177
|
});
|
|
1468
|
-
(i =
|
|
1178
|
+
(i = vt.current) === null || i === void 0 ? void 0 : i.focus();
|
|
1469
1179
|
}
|
|
1470
|
-
|
|
1180
|
+
U === null || U === void 0 ? void 0 : U(e, {
|
|
1471
1181
|
values: l,
|
|
1472
|
-
name:
|
|
1182
|
+
name: z,
|
|
1473
1183
|
reason: "valueToggle"
|
|
1474
1184
|
});
|
|
1475
|
-
}), [
|
|
1476
|
-
var
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
if (
|
|
1480
|
-
clearTimeout(
|
|
1185
|
+
}), [ At, Mt, Oe, H, z, U ]);
|
|
1186
|
+
var qt = function e() {
|
|
1187
|
+
bt.current = null;
|
|
1188
|
+
yt.current = [];
|
|
1189
|
+
if (mt.current) {
|
|
1190
|
+
clearTimeout(mt.current);
|
|
1481
1191
|
}
|
|
1482
1192
|
};
|
|
1483
|
-
var
|
|
1193
|
+
var Dt = (0, e.useCallback)((function(e) {
|
|
1484
1194
|
var n;
|
|
1485
1195
|
// this doesn't make sense if we can't select multiple values
|
|
1486
|
-
if (!
|
|
1196
|
+
if (!H) {
|
|
1487
1197
|
return;
|
|
1488
1198
|
}
|
|
1489
|
-
var r = (n =
|
|
1490
|
-
var o =
|
|
1199
|
+
var r = (n = At()) !== null && n !== void 0 ? n : [];
|
|
1200
|
+
var o = C()(r.concat(kt.current));
|
|
1491
1201
|
o = t().Children.toArray(f).filter((function(e) {
|
|
1492
|
-
return
|
|
1202
|
+
return ot(e) && m()(o, e.props.value) && (!e.props.disabled || m()(r, e.props.value));
|
|
1493
1203
|
})).map((function(e) {
|
|
1494
1204
|
return e.props.value;
|
|
1495
1205
|
}));
|
|
1496
|
-
if (!
|
|
1497
|
-
|
|
1206
|
+
if (!Oe) {
|
|
1207
|
+
ft(o);
|
|
1498
1208
|
}
|
|
1499
|
-
|
|
1209
|
+
U === null || U === void 0 ? void 0 : U(e, {
|
|
1500
1210
|
values: o,
|
|
1501
|
-
name:
|
|
1211
|
+
name: z,
|
|
1502
1212
|
reason: "selectAll"
|
|
1503
1213
|
});
|
|
1504
|
-
}), [ f,
|
|
1505
|
-
var
|
|
1214
|
+
}), [ f, At, Oe, H, z, U ]);
|
|
1215
|
+
var Bt = (0, e.useCallback)((function(e) {
|
|
1506
1216
|
var n;
|
|
1507
1217
|
// this doesn't make sense if we can't select multiple values
|
|
1508
|
-
if (!
|
|
1218
|
+
if (!H) {
|
|
1509
1219
|
return;
|
|
1510
1220
|
}
|
|
1511
|
-
var r = (n =
|
|
1512
|
-
var o =
|
|
1221
|
+
var r = (n = At()) !== null && n !== void 0 ? n : [];
|
|
1222
|
+
var o = w().apply(void 0, [ r ].concat(Le(kt.current)));
|
|
1513
1223
|
// this will unselect all selected values unless those values are disabled or hidden by the filter
|
|
1514
1224
|
var l = t().Children.toArray(f).filter((function(e) {
|
|
1515
|
-
return
|
|
1225
|
+
return ot(e) && (m()(r, e.props.value) && e.props.disabled || m()(o, e.props.value));
|
|
1516
1226
|
})).map((function(e) {
|
|
1517
1227
|
return e.props.value;
|
|
1518
1228
|
}));
|
|
1519
|
-
if (!
|
|
1520
|
-
|
|
1229
|
+
if (!Oe) {
|
|
1230
|
+
ft(l);
|
|
1521
1231
|
}
|
|
1522
|
-
|
|
1232
|
+
U === null || U === void 0 ? void 0 : U(e, {
|
|
1523
1233
|
values: l,
|
|
1524
|
-
name:
|
|
1234
|
+
name: z,
|
|
1525
1235
|
reason: "clearAll"
|
|
1526
1236
|
});
|
|
1527
|
-
}), [ f,
|
|
1528
|
-
var
|
|
1529
|
-
if (
|
|
1530
|
-
|
|
1237
|
+
}), [ f, At, Oe, H, z, U ]);
|
|
1238
|
+
var Vt = (0, e.useCallback)((function(e) {
|
|
1239
|
+
if (He && !I) {
|
|
1240
|
+
X === null || X === void 0 ? void 0 : X(e);
|
|
1531
1241
|
}
|
|
1532
|
-
}), [
|
|
1533
|
-
var
|
|
1534
|
-
var n = (0,
|
|
1242
|
+
}), [ He, I, X ]);
|
|
1243
|
+
var Nt = (0, e.useCallback)((function(t) {
|
|
1244
|
+
var n = (0, N.keycode)(t.nativeEvent);
|
|
1535
1245
|
if (n === "tab") {
|
|
1536
|
-
if (
|
|
1246
|
+
if (pe && Ot.current && Ct.current <= 1) {
|
|
1537
1247
|
t.preventDefault();
|
|
1538
|
-
|
|
1248
|
+
Lt(t, Ot.current);
|
|
1539
1249
|
}
|
|
1540
1250
|
}
|
|
1541
1251
|
if (t.shiftKey || t.metaKey || t.ctrlKey) {
|
|
1542
1252
|
if (n === "a" && (t.ctrlKey || t.metaKey)) {
|
|
1543
1253
|
// handle control + A
|
|
1544
|
-
if (
|
|
1545
|
-
|
|
1254
|
+
if (Pt.current === "all") {
|
|
1255
|
+
Bt(t);
|
|
1546
1256
|
} else {
|
|
1547
|
-
|
|
1257
|
+
Dt(t);
|
|
1548
1258
|
}
|
|
1549
1259
|
}
|
|
1550
1260
|
return;
|
|
1551
1261
|
}
|
|
1552
1262
|
if (n === "down") {
|
|
1553
1263
|
t.preventDefault();
|
|
1554
|
-
|
|
1555
|
-
if (f &&
|
|
1264
|
+
_e(Math.min(Ae + 1, ue === "checkbox" ? Ct.current : Ct.current - 1));
|
|
1265
|
+
if (f && X) {
|
|
1556
1266
|
var r;
|
|
1557
|
-
var o = e.Children.toArray(f).length - (2 + ((r =
|
|
1558
|
-
if (
|
|
1559
|
-
|
|
1267
|
+
var o = e.Children.toArray(f).length - (2 + ((r = At()) !== null && r !== void 0 ? r : []).length);
|
|
1268
|
+
if (Ae === o) {
|
|
1269
|
+
Vt(t);
|
|
1560
1270
|
}
|
|
1561
1271
|
}
|
|
1562
1272
|
}
|
|
1563
1273
|
if (n === "up") {
|
|
1564
1274
|
t.preventDefault();
|
|
1565
|
-
|
|
1275
|
+
_e(Math.max(Ae - 1, 0));
|
|
1566
1276
|
}
|
|
1567
|
-
if (n === "enter" &&
|
|
1568
|
-
if (
|
|
1569
|
-
if (
|
|
1570
|
-
|
|
1277
|
+
if (n === "enter" && Ot.current && He) {
|
|
1278
|
+
if (Ot.current === "selectAll") {
|
|
1279
|
+
if (Pt.current === "all") {
|
|
1280
|
+
Bt(t);
|
|
1571
1281
|
} else {
|
|
1572
|
-
|
|
1282
|
+
Dt(t);
|
|
1573
1283
|
}
|
|
1574
1284
|
} else {
|
|
1575
1285
|
t.preventDefault();
|
|
1576
|
-
|
|
1286
|
+
Lt(t, Ot.current);
|
|
1577
1287
|
}
|
|
1578
1288
|
}
|
|
1579
|
-
}), [
|
|
1580
|
-
var
|
|
1289
|
+
}), [ Ae, f, At, Bt, Vt, Dt, X, He, ue, pe, Lt ]);
|
|
1290
|
+
var Kt = (0, e.useCallback)((function(e, t) {
|
|
1581
1291
|
var n = t.value;
|
|
1582
1292
|
e.preventDefault();
|
|
1583
|
-
if (!
|
|
1293
|
+
if (!He) {
|
|
1584
1294
|
return;
|
|
1585
1295
|
}
|
|
1586
|
-
|
|
1587
|
-
}), [
|
|
1588
|
-
var
|
|
1296
|
+
Lt(e, n);
|
|
1297
|
+
}), [ He, Lt ]);
|
|
1298
|
+
var Ft = (0, e.useCallback)((function(e, t) {
|
|
1589
1299
|
var n = e.nativeEvent.key;
|
|
1590
1300
|
// Checking for a single character to avoid complications from double-byte languages and emojis.
|
|
1591
1301
|
if (n.length === 1) {
|
|
@@ -1594,227 +1304,435 @@
|
|
|
1594
1304
|
index: 0,
|
|
1595
1305
|
value: n
|
|
1596
1306
|
};
|
|
1597
|
-
if (!
|
|
1307
|
+
if (!bt.current) {
|
|
1598
1308
|
if (n === " ") {
|
|
1599
|
-
|
|
1309
|
+
qt();
|
|
1600
1310
|
return;
|
|
1601
1311
|
}
|
|
1602
|
-
r =
|
|
1603
|
-
} else if (
|
|
1604
|
-
o.index =
|
|
1605
|
-
r =
|
|
1312
|
+
r = Te(ht.current, o);
|
|
1313
|
+
} else if (yt.current.length > 1) {
|
|
1314
|
+
o.index = bt.current.index + 1;
|
|
1315
|
+
r = Te(yt.current, o);
|
|
1606
1316
|
}
|
|
1607
1317
|
if (r.length) {
|
|
1608
|
-
var l
|
|
1318
|
+
var l;
|
|
1319
|
+
var a = 0;
|
|
1609
1320
|
// If the active option is a first character match, cycle to the next matching option.
|
|
1610
1321
|
if (o.index === 0 && r.length > 1) {
|
|
1611
|
-
var
|
|
1612
|
-
if (
|
|
1613
|
-
|
|
1322
|
+
var i = r.indexOf(ht.current[t]);
|
|
1323
|
+
if (i >= 0) {
|
|
1324
|
+
a = i === r.length - 1 ? 0 : i + 1;
|
|
1614
1325
|
}
|
|
1615
1326
|
}
|
|
1616
|
-
var
|
|
1617
|
-
var
|
|
1618
|
-
var
|
|
1619
|
-
|
|
1620
|
-
var f;
|
|
1621
|
-
(f = s.focus) === null || f === void 0 ? void 0 : f.call(s);
|
|
1622
|
-
}
|
|
1327
|
+
var u = r[a];
|
|
1328
|
+
var c = u.value, s = u.label;
|
|
1329
|
+
var f = St.current[lt(c, s)];
|
|
1330
|
+
f === null || f === void 0 ? void 0 : (l = f.focus) === null || l === void 0 ? void 0 : l.call(f);
|
|
1623
1331
|
}
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
if (
|
|
1627
|
-
clearTimeout(
|
|
1332
|
+
yt.current = r;
|
|
1333
|
+
bt.current = o;
|
|
1334
|
+
if (mt.current) {
|
|
1335
|
+
clearTimeout(mt.current);
|
|
1628
1336
|
}
|
|
1629
|
-
|
|
1337
|
+
mt.current = setTimeout(qt, 500);
|
|
1630
1338
|
e.preventDefault();
|
|
1631
1339
|
e.stopPropagation();
|
|
1632
1340
|
}
|
|
1633
1341
|
}), []);
|
|
1634
|
-
var
|
|
1342
|
+
var Ht = (0, e.useCallback)((function(e, t) {
|
|
1635
1343
|
var n = t.value;
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1344
|
+
Be(n);
|
|
1345
|
+
ze(true);
|
|
1346
|
+
_e(0);
|
|
1347
|
+
G === null || G === void 0 ? void 0 : G(e, {
|
|
1640
1348
|
keyword: n
|
|
1641
1349
|
});
|
|
1642
|
-
}), [
|
|
1643
|
-
var Ht = (0, e.useCallback)((function() {
|
|
1644
|
-
Be(true);
|
|
1645
|
-
}), []);
|
|
1350
|
+
}), [ G ]);
|
|
1646
1351
|
var zt = (0, e.useCallback)((function() {
|
|
1647
|
-
|
|
1352
|
+
Xe(true);
|
|
1648
1353
|
}), []);
|
|
1649
|
-
var $t = (0, e.useCallback)((function(
|
|
1650
|
-
|
|
1651
|
-
|
|
1354
|
+
var $t = (0, e.useCallback)((function() {
|
|
1355
|
+
Xe(false);
|
|
1356
|
+
}), []);
|
|
1357
|
+
var Wt = (0, e.useCallback)((function(e) {
|
|
1358
|
+
if (gt.current !== Ae) {
|
|
1359
|
+
Re(e);
|
|
1652
1360
|
}
|
|
1653
|
-
}), [
|
|
1654
|
-
var
|
|
1361
|
+
}), [ Ae ]);
|
|
1362
|
+
var Ut = (0, e.useCallback)((function(e, t, n) {
|
|
1655
1363
|
if (n) {
|
|
1656
|
-
|
|
1364
|
+
wt.current = e;
|
|
1657
1365
|
}
|
|
1658
1366
|
if (e == null) {
|
|
1659
|
-
delete
|
|
1367
|
+
delete St.current[t];
|
|
1660
1368
|
} else {
|
|
1661
|
-
|
|
1369
|
+
St.current[t] = e;
|
|
1662
1370
|
}
|
|
1663
|
-
}), []);
|
|
1664
|
-
var
|
|
1665
|
-
|
|
1666
|
-
}), [
|
|
1667
|
-
var
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1371
|
+
}), [ St ]);
|
|
1372
|
+
var Jt = (0, e.useCallback)((function(e) {
|
|
1373
|
+
vt.current = e;
|
|
1374
|
+
}), [ vt ]);
|
|
1375
|
+
var Xt = (0, e.useMemo)((function() {
|
|
1376
|
+
var e;
|
|
1377
|
+
return (e = At()) !== null && e !== void 0 ? e : [];
|
|
1378
|
+
}), [ At ]);
|
|
1379
|
+
var Gt = e.Children.toArray(f);
|
|
1380
|
+
var Qt = Xt.some((function(e) {
|
|
1381
|
+
var t = p()(Gt, (function(t) {
|
|
1382
|
+
return ot(t) && t.props.value === e;
|
|
1672
1383
|
}));
|
|
1673
1384
|
return t && !t.props.disabled;
|
|
1674
1385
|
}));
|
|
1675
|
-
var
|
|
1676
|
-
var
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1386
|
+
var Yt = ce === "immediately" ? _t() : Ye;
|
|
1387
|
+
var Zt = (0, e.useMemo)((function() {
|
|
1388
|
+
Ct.current = 0;
|
|
1389
|
+
xt.current = undefined;
|
|
1390
|
+
jt.current = 0;
|
|
1391
|
+
Ot.current = undefined;
|
|
1392
|
+
ht.current = [];
|
|
1393
|
+
var n = function e(t, n) {
|
|
1394
|
+
return function(e) {
|
|
1395
|
+
return Ut(e, t, n);
|
|
1396
|
+
};
|
|
1397
|
+
};
|
|
1398
|
+
var r;
|
|
1399
|
+
var l = 0;
|
|
1400
|
+
var a = false;
|
|
1401
|
+
// used to avoid overwriting the selected item ref in multiple mode
|
|
1402
|
+
var i;
|
|
1403
|
+
var c = e.Children.toArray(f).reduce((function(u, c, s) {
|
|
1404
|
+
// ignore Headings and Dividers
|
|
1405
|
+
if (!ot(c)) {
|
|
1406
|
+
u.push(c);
|
|
1407
|
+
return u;
|
|
1408
|
+
}
|
|
1409
|
+
var f = c.props, p = f.disabled, d = f.hidden, v = f.label, b = f.value;
|
|
1410
|
+
// Find out if the search string exactly matches a value
|
|
1411
|
+
if (b === De) {
|
|
1412
|
+
r = true;
|
|
1413
|
+
}
|
|
1414
|
+
var m = Xt && Xt.indexOf(b) >= 0;
|
|
1415
|
+
var y = !!m && !p && !i;
|
|
1416
|
+
var h = o && !H && !k && !I && !X;
|
|
1417
|
+
var g = lt(b, v);
|
|
1418
|
+
var O = -1;
|
|
1419
|
+
if (h && !p && !d) {
|
|
1420
|
+
ht.current.push({
|
|
1421
|
+
label: v,
|
|
1422
|
+
value: b
|
|
1423
|
+
});
|
|
1424
|
+
O = ht.current.length - 1;
|
|
1425
|
+
}
|
|
1426
|
+
// Format the Menu.Item
|
|
1427
|
+
var S = (0, e.cloneElement)(c, {
|
|
1428
|
+
elementRef: n(g, y),
|
|
1429
|
+
key: c.key || s,
|
|
1430
|
+
onClick: Kt,
|
|
1431
|
+
onKeyDown: h ? function(e) {
|
|
1432
|
+
return Ft(e, O);
|
|
1433
|
+
} : undefined,
|
|
1434
|
+
selected: m,
|
|
1435
|
+
multiple: H,
|
|
1436
|
+
role: "option"
|
|
1437
|
+
});
|
|
1438
|
+
if (y) {
|
|
1439
|
+
i = true;
|
|
1440
|
+
}
|
|
1441
|
+
if (Yt && Yt.indexOf(b) >= 0) {
|
|
1442
|
+
if (l === 0) {
|
|
1443
|
+
u.splice(l, 0, t().createElement(T.Divider, {
|
|
1444
|
+
key: "topDivider"
|
|
1445
|
+
}));
|
|
1446
|
+
a = true;
|
|
1447
|
+
}
|
|
1448
|
+
u.splice(l, 0, S);
|
|
1449
|
+
l += 1;
|
|
1450
|
+
} else {
|
|
1451
|
+
u.push(S);
|
|
1452
|
+
}
|
|
1453
|
+
return u;
|
|
1454
|
+
}), []);
|
|
1455
|
+
// In multiple mode, add missing items
|
|
1456
|
+
if (H) {
|
|
1457
|
+
v()(Xt, (function(e) {
|
|
1458
|
+
var o = p()(c, (function(t) {
|
|
1459
|
+
return ot(t) && t.props && t.props.value === e;
|
|
1460
|
+
}));
|
|
1461
|
+
if (!o) {
|
|
1462
|
+
if (e === De) {
|
|
1463
|
+
r = true;
|
|
1464
|
+
}
|
|
1465
|
+
var i = Yt && Yt.indexOf(e) >= 0;
|
|
1466
|
+
var u = Yt.length;
|
|
1467
|
+
if (l === 0) {
|
|
1468
|
+
c.splice(0, 0, t().createElement(T.Divider, {
|
|
1469
|
+
key: "topDivider"
|
|
1470
|
+
}));
|
|
1471
|
+
l += 1;
|
|
1472
|
+
a = true;
|
|
1473
|
+
}
|
|
1474
|
+
var s = String(e);
|
|
1475
|
+
var f = lt(e, s);
|
|
1476
|
+
c.splice(i ? 0 : u + 1, 0, t().createElement(fe, {
|
|
1477
|
+
elementRef: n(f),
|
|
1478
|
+
label: s,
|
|
1479
|
+
value: e,
|
|
1480
|
+
key: "missing-value-".concat(e),
|
|
1481
|
+
onClick: Kt,
|
|
1482
|
+
multiple: H,
|
|
1483
|
+
selected: true
|
|
1484
|
+
}));
|
|
1485
|
+
if (i) {
|
|
1486
|
+
l += 1;
|
|
1487
|
+
}
|
|
1488
|
+
}
|
|
1489
|
+
}));
|
|
1490
|
+
}
|
|
1491
|
+
var d = k === "controlled";
|
|
1492
|
+
// Filter the items
|
|
1493
|
+
var b = (0, B.stringToKeywords)(De);
|
|
1494
|
+
c = d ? c : c.filter((function(e) {
|
|
1495
|
+
if (ot(e)) {
|
|
1496
|
+
return (0, B.testPhrase)(e.props.label, b);
|
|
1497
|
+
}
|
|
1498
|
+
return true;
|
|
1499
|
+
// Keep all headers and non-interactive options
|
|
1500
|
+
})).map((function(t) {
|
|
1501
|
+
if (!ot(t)) {
|
|
1502
|
+
return t;
|
|
1503
|
+
}
|
|
1504
|
+
// highlight matched text
|
|
1505
|
+
var n = b && (0, B.keywordLocations)(t.props.label, b);
|
|
1506
|
+
|
|
1507
|
+
return (0, e.cloneElement)(t, {
|
|
1508
|
+
matchRanges: n || undefined
|
|
1509
|
+
});
|
|
1510
|
+
}));
|
|
1511
|
+
// Add the option to add the new value
|
|
1512
|
+
if (s && !r && De) {
|
|
1513
|
+
var m = a ? l + 1 : l;
|
|
1514
|
+
var y = "".concat(De, " (new value)");
|
|
1515
|
+
var h = lt(De, y);
|
|
1516
|
+
c.splice(m, 0, t().createElement(fe, {
|
|
1517
|
+
elementRef: n(h),
|
|
1518
|
+
label: y,
|
|
1519
|
+
value: De,
|
|
1520
|
+
key: "newValue",
|
|
1521
|
+
multiple: H,
|
|
1522
|
+
onClick: Kt
|
|
1523
|
+
}));
|
|
1524
|
+
}
|
|
1525
|
+
// When selectAll is a menu item, add an offset so that activeItem accounts for the extra selectAll option.
|
|
1526
|
+
var g = ue === "checkbox" && H && c.length > 1 ? 1 : 0;
|
|
1527
|
+
var O = true;
|
|
1528
|
+
// Highlight the selected Items and remove hidden
|
|
1529
|
+
c = c.reduce((function(t, n) {
|
|
1530
|
+
// ignore Dividers & Headings
|
|
1531
|
+
if (!ot(n)) {
|
|
1532
|
+
t.push(n);
|
|
1533
|
+
return t;
|
|
1534
|
+
}
|
|
1535
|
+
// Ignore any hidden items
|
|
1536
|
+
if (n.props && n.props.hidden) {
|
|
1537
|
+
return t;
|
|
1538
|
+
}
|
|
1539
|
+
if (n.props.selected && !n.props.disabled && xt.current == null) {
|
|
1540
|
+
xt.current = Ct.current;
|
|
1541
|
+
}
|
|
1542
|
+
var r = g === Ae;
|
|
1543
|
+
g += 1;
|
|
1544
|
+
Ct.current += 1;
|
|
1545
|
+
jt.current += n.props.selected ? 1 : 0;
|
|
1546
|
+
if (n.key !== "newValue" && !n.props.disabled && !n.props.selected) {
|
|
1547
|
+
O = false;
|
|
1548
|
+
}
|
|
1549
|
+
if (!r || !Je) {
|
|
1550
|
+
t.push(n);
|
|
1551
|
+
return t;
|
|
1552
|
+
}
|
|
1553
|
+
if (!n.props.disabled) {
|
|
1554
|
+
Ot.current = n.props.value;
|
|
1555
|
+
}
|
|
1556
|
+
var o = (0, e.cloneElement)(n, {
|
|
1557
|
+
active: r,
|
|
1558
|
+
elementRef: Wt,
|
|
1559
|
+
id: we
|
|
1560
|
+
});
|
|
1561
|
+
t.push(o);
|
|
1562
|
+
return t;
|
|
1563
|
+
}), []);
|
|
1564
|
+
Pt.current = jt.current === 0 && "none" || O && "all" || "some";
|
|
1565
|
+
// add select all option
|
|
1566
|
+
if (ue === "checkbox" && H && Ct.current > 0) {
|
|
1567
|
+
var S;
|
|
1568
|
+
if (Pt.current === "all") {
|
|
1569
|
+
if (De === "") {
|
|
1570
|
+
S = (0, u._)("Clear all");
|
|
1571
|
+
} else {
|
|
1572
|
+
S = (0, u._)("Clear all matches");
|
|
1573
|
+
}
|
|
1574
|
+
} else if (De === "") {
|
|
1575
|
+
S = (0, u._)("Select all");
|
|
1576
|
+
} else {
|
|
1577
|
+
S = (0, u._)("Select all matches");
|
|
1578
|
+
}
|
|
1579
|
+
if (Ae === 0 && Je) {
|
|
1580
|
+
Ot.current = "selectAll";
|
|
1581
|
+
}
|
|
1582
|
+
c.unshift( t().createElement(ve, {
|
|
1583
|
+
key: "select-all-option",
|
|
1584
|
+
active: Ae === 0,
|
|
1585
|
+
changedToggle: !!me,
|
|
1586
|
+
elementRef: Wt,
|
|
1587
|
+
id: Ae === 0 ? we : undefined,
|
|
1588
|
+
onClick: Pt.current === "all" ? Bt : Dt,
|
|
1589
|
+
selectAllLabel: S,
|
|
1590
|
+
selected: Pt.current === "all" || Pt.current !== "none" && "some",
|
|
1591
|
+
totalCount: Xt.length,
|
|
1592
|
+
tabIndex: -1
|
|
1593
|
+
}), t().createElement(T.Divider, {
|
|
1594
|
+
key: "selectAllDivider"
|
|
1595
|
+
}));
|
|
1596
|
+
}
|
|
1597
|
+
kt.current = c.reduce((function(e, t) {
|
|
1598
|
+
if (ot(t)) {
|
|
1599
|
+
e.push(t.props.value);
|
|
1600
|
+
}
|
|
1601
|
+
return e;
|
|
1602
|
+
}), []);
|
|
1603
|
+
st = c.some((function(e) {
|
|
1604
|
+
return ot(e);
|
|
1605
|
+
}));
|
|
1606
|
+
return c;
|
|
1607
|
+
}), [ Ae, we, o, s, f, Xt, k, De, Wt, Bt, Kt, Ft, Ut, Dt, I, H, Yt, X, ue, Je, me ]);
|
|
1608
|
+
var en = function e(n) {
|
|
1609
|
+
var r = n.anchorWidth, o = n.maxHeight, a = n.placement;
|
|
1610
|
+
var i = nt({
|
|
1714
1611
|
anchorWidth: r,
|
|
1715
|
-
isMultiple:
|
|
1612
|
+
isMultiple: H,
|
|
1716
1613
|
maxHeight: o,
|
|
1717
|
-
menuStyle:
|
|
1614
|
+
menuStyle: F
|
|
1718
1615
|
});
|
|
1719
|
-
var u =
|
|
1616
|
+
var u = Xt.length > 0 && !Qt && !k ? 0 : undefined;
|
|
1720
1617
|
var c = {
|
|
1721
|
-
"aria-multiselectable":
|
|
1722
|
-
childrenStart: !!
|
|
1723
|
-
activeItemId:
|
|
1724
|
-
|
|
1725
|
-
|
|
1618
|
+
"aria-multiselectable": H || undefined,
|
|
1619
|
+
childrenStart: !!k && t().createElement(ct, {
|
|
1620
|
+
activeItemId: we,
|
|
1621
|
+
filterA11yId: Rt,
|
|
1622
|
+
filterKeyword: De,
|
|
1623
|
+
hasChildren: st,
|
|
1726
1624
|
inputId: E,
|
|
1727
|
-
inputRef:
|
|
1728
|
-
menuListboxId:
|
|
1729
|
-
multiple:
|
|
1730
|
-
onClearAll:
|
|
1731
|
-
onSelectAll:
|
|
1732
|
-
onTextBlur:
|
|
1733
|
-
onTextChange:
|
|
1734
|
-
onTextFocus:
|
|
1735
|
-
onTextKeyDown:
|
|
1736
|
-
optionSelection:
|
|
1737
|
-
placement:
|
|
1738
|
-
selectAllAppearance:
|
|
1739
|
-
textHasFocus:
|
|
1625
|
+
inputRef: _,
|
|
1626
|
+
menuListboxId: xe,
|
|
1627
|
+
multiple: H,
|
|
1628
|
+
onClearAll: Bt,
|
|
1629
|
+
onSelectAll: Dt,
|
|
1630
|
+
onTextBlur: $t,
|
|
1631
|
+
onTextChange: Ht,
|
|
1632
|
+
onTextFocus: zt,
|
|
1633
|
+
onTextKeyDown: Nt,
|
|
1634
|
+
optionSelection: Pt,
|
|
1635
|
+
placement: a,
|
|
1636
|
+
selectAllAppearance: ue,
|
|
1637
|
+
textHasFocus: Je
|
|
1740
1638
|
}),
|
|
1741
|
-
focusMode:
|
|
1742
|
-
isLoading:
|
|
1743
|
-
menuId:
|
|
1744
|
-
onScrollBottom:
|
|
1745
|
-
placement:
|
|
1746
|
-
noOptionsMessage:
|
|
1747
|
-
footerMessage:
|
|
1748
|
-
animateLoading:
|
|
1749
|
-
loadingMessage:
|
|
1750
|
-
onScroll:
|
|
1639
|
+
focusMode: k ? "never" : undefined,
|
|
1640
|
+
isLoading: I,
|
|
1641
|
+
menuId: xe,
|
|
1642
|
+
onScrollBottom: X ? Vt : undefined,
|
|
1643
|
+
placement: a !== null && a !== void 0 ? a : undefined,
|
|
1644
|
+
noOptionsMessage: W,
|
|
1645
|
+
footerMessage: x,
|
|
1646
|
+
animateLoading: l,
|
|
1647
|
+
loadingMessage: q,
|
|
1648
|
+
onScroll: J,
|
|
1751
1649
|
style: i,
|
|
1752
1650
|
tabIndex: u
|
|
1753
1651
|
};
|
|
1754
|
-
if (
|
|
1652
|
+
if (be) {
|
|
1755
1653
|
|
|
1756
|
-
return t().createElement(
|
|
1757
|
-
virtualization:
|
|
1758
|
-
}, c),
|
|
1654
|
+
return t().createElement(R.VirtualizedResultsMenu, Ve({
|
|
1655
|
+
virtualization: be
|
|
1656
|
+
}, c), Zt);
|
|
1759
1657
|
}
|
|
1760
1658
|
|
|
1761
|
-
return t().createElement(
|
|
1659
|
+
return t().createElement(A(), c, Zt);
|
|
1762
1660
|
};
|
|
1763
1661
|
|
|
1764
1662
|
return t().createElement(j(), {
|
|
1765
|
-
closeReasons:
|
|
1663
|
+
closeReasons: rt,
|
|
1766
1664
|
inputId: E,
|
|
1767
|
-
|
|
1768
|
-
|
|
1665
|
+
"aria-labelledby": Rt,
|
|
1666
|
+
toggle: t().createElement(pt, Ve({
|
|
1667
|
+
appearance: i,
|
|
1769
1668
|
append: c,
|
|
1770
|
-
currentValues:
|
|
1771
|
-
"data-test":
|
|
1772
|
-
describedBy:
|
|
1773
|
-
disabled:
|
|
1774
|
-
elementRef:
|
|
1775
|
-
error:
|
|
1776
|
-
inline:
|
|
1777
|
-
labelText:
|
|
1778
|
-
labelledBy:
|
|
1779
|
-
multiple:
|
|
1780
|
-
onClick:
|
|
1781
|
-
placeholder:
|
|
1782
|
-
prefixLabel:
|
|
1783
|
-
prepend:
|
|
1784
|
-
required:
|
|
1785
|
-
suffixLabel:
|
|
1786
|
-
toggle:
|
|
1787
|
-
toggleContent:
|
|
1788
|
-
},
|
|
1789
|
-
onRequestOpen:
|
|
1669
|
+
currentValues: At(),
|
|
1670
|
+
"data-test": H ? "multiselect" : "select",
|
|
1671
|
+
describedBy: h,
|
|
1672
|
+
disabled: g,
|
|
1673
|
+
elementRef: O,
|
|
1674
|
+
error: S,
|
|
1675
|
+
inline: P,
|
|
1676
|
+
labelText: L,
|
|
1677
|
+
labelledBy: M,
|
|
1678
|
+
multiple: H,
|
|
1679
|
+
onClick: Q,
|
|
1680
|
+
placeholder: ne,
|
|
1681
|
+
prefixLabel: re,
|
|
1682
|
+
prepend: oe,
|
|
1683
|
+
required: ee,
|
|
1684
|
+
suffixLabel: se,
|
|
1685
|
+
toggle: me,
|
|
1686
|
+
toggleContent: he
|
|
1687
|
+
}, ge), f),
|
|
1688
|
+
onRequestOpen: It,
|
|
1790
1689
|
onRequestClose: Mt,
|
|
1791
|
-
open:
|
|
1690
|
+
open: He,
|
|
1792
1691
|
openWithArrowKeys: true,
|
|
1793
|
-
repositionMode:
|
|
1794
|
-
defaultPlacement:
|
|
1795
|
-
canCoverAnchor:
|
|
1796
|
-
ref:
|
|
1692
|
+
repositionMode: ae,
|
|
1693
|
+
defaultPlacement: k ? b : undefined,
|
|
1694
|
+
canCoverAnchor: Me().innerHeight < 500,
|
|
1695
|
+
ref: Jt,
|
|
1797
1696
|
retainFocus: false,
|
|
1798
|
-
takeFocus:
|
|
1799
|
-
},
|
|
1800
|
-
}
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
/* harmony default export */ const
|
|
1697
|
+
takeFocus: Xt.length === 0 || Xt.length > 0 && !Qt || !!k
|
|
1698
|
+
}, en);
|
|
1699
|
+
}
|
|
1700
|
+
dt.propTypes = et;
|
|
1701
|
+
dt.componentType = "SelectBase";
|
|
1702
|
+
dt.Option = fe;
|
|
1703
|
+
dt.Divider = T.Divider;
|
|
1704
|
+
dt.Heading = T.Heading;
|
|
1705
|
+
/* harmony default export */ const vt = dt;
|
|
1706
|
+
// CONCATENATED MODULE: ./src/utils/updateReactRef.ts
|
|
1707
|
+
/**
|
|
1708
|
+
* Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
|
|
1709
|
+
*
|
|
1710
|
+
* @param ref - The React callback or object ref. Can be `null` or `undefined`.
|
|
1711
|
+
* @param current - The new value of the ref.
|
|
1712
|
+
*/
|
|
1713
|
+
function bt(e, t) {
|
|
1714
|
+
if (e) {
|
|
1715
|
+
if (typeof e === "function") {
|
|
1716
|
+
e(t);
|
|
1717
|
+
} else {
|
|
1718
|
+
// the public signature of this util uses React.Ref<T> to mirror the way React types refs.
|
|
1719
|
+
// the intention here is to signal "we will take care of setting 'current', not you".
|
|
1720
|
+
e.current = t;
|
|
1721
|
+
// eslint-disable-line no-param-reassign
|
|
1722
|
+
}
|
|
1723
|
+
}
|
|
1724
|
+
}
|
|
1807
1725
|
// CONCATENATED MODULE: ./src/Select/Option.tsx
|
|
1808
|
-
function
|
|
1726
|
+
function mt(e) {
|
|
1809
1727
|
"@babel/helpers - typeof";
|
|
1810
|
-
return
|
|
1728
|
+
return mt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
1811
1729
|
return typeof e;
|
|
1812
1730
|
} : function(e) {
|
|
1813
1731
|
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
1814
|
-
},
|
|
1732
|
+
}, mt(e);
|
|
1815
1733
|
}
|
|
1816
|
-
function
|
|
1817
|
-
return
|
|
1734
|
+
function yt() {
|
|
1735
|
+
return yt = Object.assign ? Object.assign.bind() : function(e) {
|
|
1818
1736
|
for (var t = 1; t < arguments.length; t++) {
|
|
1819
1737
|
var n = arguments[t];
|
|
1820
1738
|
for (var r in n) {
|
|
@@ -1822,24 +1740,24 @@
|
|
|
1822
1740
|
}
|
|
1823
1741
|
}
|
|
1824
1742
|
return e;
|
|
1825
|
-
},
|
|
1743
|
+
}, yt.apply(null, arguments);
|
|
1826
1744
|
}
|
|
1827
|
-
function
|
|
1745
|
+
function ht(e, t) {
|
|
1828
1746
|
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
1829
1747
|
}
|
|
1830
|
-
function
|
|
1748
|
+
function gt(e, t) {
|
|
1831
1749
|
for (var n = 0; n < t.length; n++) {
|
|
1832
1750
|
var r = t[n];
|
|
1833
1751
|
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0),
|
|
1834
|
-
Object.defineProperty(e,
|
|
1752
|
+
Object.defineProperty(e, Tt(r.key), r);
|
|
1835
1753
|
}
|
|
1836
1754
|
}
|
|
1837
|
-
function
|
|
1838
|
-
return t &&
|
|
1755
|
+
function Ot(e, t, n) {
|
|
1756
|
+
return t && gt(e.prototype, t), n && gt(e, n), Object.defineProperty(e, "prototype", {
|
|
1839
1757
|
writable: !1
|
|
1840
1758
|
}), e;
|
|
1841
1759
|
}
|
|
1842
|
-
function
|
|
1760
|
+
function St(e, t) {
|
|
1843
1761
|
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
|
|
1844
1762
|
e.prototype = Object.create(t && t.prototype, {
|
|
1845
1763
|
constructor: {
|
|
@@ -1849,75 +1767,76 @@
|
|
|
1849
1767
|
}
|
|
1850
1768
|
}), Object.defineProperty(e, "prototype", {
|
|
1851
1769
|
writable: !1
|
|
1852
|
-
}), t &&
|
|
1770
|
+
}), t && Ct(e, t);
|
|
1853
1771
|
}
|
|
1854
|
-
function
|
|
1855
|
-
return
|
|
1772
|
+
function Ct(e, t) {
|
|
1773
|
+
return Ct = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
|
|
1856
1774
|
return e.__proto__ = t, e;
|
|
1857
|
-
},
|
|
1775
|
+
}, Ct(e, t);
|
|
1858
1776
|
}
|
|
1859
|
-
function
|
|
1860
|
-
var t =
|
|
1777
|
+
function kt(e) {
|
|
1778
|
+
var t = jt();
|
|
1861
1779
|
return function() {
|
|
1862
|
-
var n, r =
|
|
1780
|
+
var n, r = Pt(e);
|
|
1863
1781
|
if (t) {
|
|
1864
|
-
var o =
|
|
1782
|
+
var o = Pt(this).constructor;
|
|
1865
1783
|
n = Reflect.construct(r, arguments, o);
|
|
1866
1784
|
} else n = r.apply(this, arguments);
|
|
1867
|
-
return
|
|
1785
|
+
return wt(this, n);
|
|
1868
1786
|
};
|
|
1869
1787
|
}
|
|
1870
|
-
function
|
|
1871
|
-
if (t && ("object" ==
|
|
1788
|
+
function wt(e, t) {
|
|
1789
|
+
if (t && ("object" == mt(t) || "function" == typeof t)) return t;
|
|
1872
1790
|
if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
|
|
1873
|
-
return
|
|
1791
|
+
return xt(e);
|
|
1874
1792
|
}
|
|
1875
|
-
function
|
|
1793
|
+
function xt(e) {
|
|
1876
1794
|
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1877
1795
|
return e;
|
|
1878
1796
|
}
|
|
1879
|
-
function
|
|
1797
|
+
function jt() {
|
|
1880
1798
|
try {
|
|
1881
1799
|
var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
|
|
1882
1800
|
} catch (e) {}
|
|
1883
|
-
return (
|
|
1801
|
+
return (jt = function t() {
|
|
1884
1802
|
return !!e;
|
|
1885
1803
|
})();
|
|
1886
1804
|
}
|
|
1887
|
-
function
|
|
1888
|
-
return
|
|
1805
|
+
function Pt(e) {
|
|
1806
|
+
return Pt = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
|
|
1889
1807
|
return e.__proto__ || Object.getPrototypeOf(e);
|
|
1890
|
-
},
|
|
1808
|
+
}, Pt(e);
|
|
1891
1809
|
}
|
|
1892
|
-
function
|
|
1893
|
-
return (t =
|
|
1810
|
+
function Et(e, t, n) {
|
|
1811
|
+
return (t = Tt(t)) in e ? Object.defineProperty(e, t, {
|
|
1894
1812
|
value: n,
|
|
1895
1813
|
enumerable: !0,
|
|
1896
1814
|
configurable: !0,
|
|
1897
1815
|
writable: !0
|
|
1898
1816
|
}) : e[t] = n, e;
|
|
1899
1817
|
}
|
|
1900
|
-
function
|
|
1901
|
-
var t =
|
|
1902
|
-
return "symbol" ==
|
|
1818
|
+
function Tt(e) {
|
|
1819
|
+
var t = Rt(e, "string");
|
|
1820
|
+
return "symbol" == mt(t) ? t : t + "";
|
|
1903
1821
|
}
|
|
1904
|
-
function
|
|
1905
|
-
if ("object" !=
|
|
1822
|
+
function Rt(e, t) {
|
|
1823
|
+
if ("object" != mt(e) || !e) return e;
|
|
1906
1824
|
var n = e[Symbol.toPrimitive];
|
|
1907
1825
|
if (void 0 !== n) {
|
|
1908
1826
|
var r = n.call(e, t || "default");
|
|
1909
|
-
if ("object" !=
|
|
1827
|
+
if ("object" != mt(r)) return r;
|
|
1910
1828
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1911
1829
|
}
|
|
1912
1830
|
return ("string" === t ? String : Number)(e);
|
|
1913
1831
|
}
|
|
1914
|
-
var
|
|
1832
|
+
var At = {
|
|
1915
1833
|
/** @private */
|
|
1916
1834
|
active: l().bool,
|
|
1917
1835
|
children: l().node,
|
|
1918
1836
|
description: l().string,
|
|
1919
1837
|
descriptionPosition: l().oneOf([ "right", "bottom" ]),
|
|
1920
1838
|
disabled: l().bool,
|
|
1839
|
+
elementRef: l().oneOfType([ l().func, l().object ]),
|
|
1921
1840
|
hidden: l().bool,
|
|
1922
1841
|
icon: l().node,
|
|
1923
1842
|
label: l().string.isRequired,
|
|
@@ -1934,7 +1853,7 @@
|
|
|
1934
1853
|
truncate: l().bool,
|
|
1935
1854
|
value: l().oneOfType([ l().string, l().number, l().bool ]).isRequired
|
|
1936
1855
|
};
|
|
1937
|
-
var
|
|
1856
|
+
var _t = {
|
|
1938
1857
|
active: false,
|
|
1939
1858
|
descriptionPosition: "bottom",
|
|
1940
1859
|
disabled: false,
|
|
@@ -1946,29 +1865,29 @@
|
|
|
1946
1865
|
* An option within a `Select`. This inherits from
|
|
1947
1866
|
* [PureComponent](https://reactjs.org/docs/react-api.html#reactpurecomponent)
|
|
1948
1867
|
* so any elements passed to it must also be pure.
|
|
1949
|
-
*/ var
|
|
1950
|
-
|
|
1951
|
-
var n =
|
|
1868
|
+
*/ var It = function(e) {
|
|
1869
|
+
St(r, e);
|
|
1870
|
+
var n = kt(r);
|
|
1952
1871
|
function r() {
|
|
1953
1872
|
var e;
|
|
1954
|
-
|
|
1955
|
-
for (var
|
|
1956
|
-
|
|
1957
|
-
}
|
|
1958
|
-
e = n.call.apply(n, [ this ].concat(
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
e.
|
|
1873
|
+
ht(this, r);
|
|
1874
|
+
for (var o = arguments.length, l = new Array(o), a = 0; a < o; a++) {
|
|
1875
|
+
l[a] = arguments[a];
|
|
1876
|
+
}
|
|
1877
|
+
e = n.call.apply(n, [ this ].concat(l));
|
|
1878
|
+
Et(xt(e), "optionBaseRef", t().createRef());
|
|
1879
|
+
Et(xt(e), "handleMount", (function(t) {
|
|
1880
|
+
bt(e.props.elementRef, t);
|
|
1881
|
+
bt(e.optionBaseRef, t);
|
|
1962
1882
|
}));
|
|
1963
1883
|
return e;
|
|
1964
1884
|
}
|
|
1965
1885
|
// @docs-props-type OptionPropsBase
|
|
1966
|
-
|
|
1886
|
+
Ot(r, [ {
|
|
1967
1887
|
key: "scrollIntoViewIfNeeded",
|
|
1968
1888
|
// eslint-disable-next-line react/no-unused-class-component-methods
|
|
1969
1889
|
value: function e() {
|
|
1970
|
-
|
|
1971
|
-
(t = this.c) === null || t === void 0 ? void 0 : t.scrollIntoViewIfNeeded();
|
|
1890
|
+
Re(this.optionBaseRef.current);
|
|
1972
1891
|
}
|
|
1973
1892
|
/**
|
|
1974
1893
|
* Place focus on the button.
|
|
@@ -1977,35 +1896,35 @@
|
|
|
1977
1896
|
}, {
|
|
1978
1897
|
key: "focus",
|
|
1979
1898
|
value: function e() {
|
|
1980
|
-
var t;
|
|
1981
|
-
(t = this.
|
|
1899
|
+
var t, n;
|
|
1900
|
+
(t = this.optionBaseRef) === null || t === void 0 ? void 0 : (n = t.current) === null || n === void 0 ? void 0 : n.focus();
|
|
1982
1901
|
}
|
|
1983
1902
|
}, {
|
|
1984
1903
|
key: "render",
|
|
1985
1904
|
value: function e() {
|
|
1986
1905
|
|
|
1987
|
-
return t().createElement(
|
|
1988
|
-
|
|
1989
|
-
|
|
1906
|
+
return t().createElement(fe, yt({}, this.props, {
|
|
1907
|
+
elementRef: this.handleMount,
|
|
1908
|
+
multiple: false
|
|
1990
1909
|
}), this.props.children || this.props.label);
|
|
1991
1910
|
}
|
|
1992
1911
|
} ]);
|
|
1993
1912
|
return r;
|
|
1994
1913
|
}(e.PureComponent);
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
/* harmony default export */ const
|
|
1914
|
+
Et(It, "propTypes", At);
|
|
1915
|
+
Et(It, "defaultProps", _t);
|
|
1916
|
+
/* harmony default export */ const Mt = It;
|
|
1998
1917
|
// CONCATENATED MODULE: ./src/Select/Select.tsx
|
|
1999
|
-
function
|
|
1918
|
+
function Lt(e) {
|
|
2000
1919
|
"@babel/helpers - typeof";
|
|
2001
|
-
return
|
|
1920
|
+
return Lt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
2002
1921
|
return typeof e;
|
|
2003
1922
|
} : function(e) {
|
|
2004
1923
|
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
2005
|
-
},
|
|
1924
|
+
}, Lt(e);
|
|
2006
1925
|
}
|
|
2007
|
-
function
|
|
2008
|
-
return
|
|
1926
|
+
function qt() {
|
|
1927
|
+
return qt = Object.assign ? Object.assign.bind() : function(e) {
|
|
2009
1928
|
for (var t = 1; t < arguments.length; t++) {
|
|
2010
1929
|
var n = arguments[t];
|
|
2011
1930
|
for (var r in n) {
|
|
@@ -2013,11 +1932,11 @@
|
|
|
2013
1932
|
}
|
|
2014
1933
|
}
|
|
2015
1934
|
return e;
|
|
2016
|
-
},
|
|
1935
|
+
}, qt.apply(null, arguments);
|
|
2017
1936
|
}
|
|
2018
|
-
function
|
|
1937
|
+
function Dt(e, t) {
|
|
2019
1938
|
if (null == e) return {};
|
|
2020
|
-
var n, r, o =
|
|
1939
|
+
var n, r, o = Bt(e, t);
|
|
2021
1940
|
if (Object.getOwnPropertySymbols) {
|
|
2022
1941
|
var l = Object.getOwnPropertySymbols(e);
|
|
2023
1942
|
for (r = 0; r < l.length; r++) {
|
|
@@ -2026,7 +1945,7 @@
|
|
|
2026
1945
|
}
|
|
2027
1946
|
return o;
|
|
2028
1947
|
}
|
|
2029
|
-
function
|
|
1948
|
+
function Bt(e, t) {
|
|
2030
1949
|
if (null == e) return {};
|
|
2031
1950
|
var n = {};
|
|
2032
1951
|
for (var r in e) {
|
|
@@ -2037,22 +1956,22 @@
|
|
|
2037
1956
|
}
|
|
2038
1957
|
return n;
|
|
2039
1958
|
}
|
|
2040
|
-
function
|
|
1959
|
+
function Vt(e, t) {
|
|
2041
1960
|
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
2042
1961
|
}
|
|
2043
|
-
function
|
|
1962
|
+
function Nt(e, t) {
|
|
2044
1963
|
for (var n = 0; n < t.length; n++) {
|
|
2045
1964
|
var r = t[n];
|
|
2046
1965
|
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0),
|
|
2047
|
-
Object.defineProperty(e,
|
|
1966
|
+
Object.defineProperty(e, Gt(r.key), r);
|
|
2048
1967
|
}
|
|
2049
1968
|
}
|
|
2050
|
-
function
|
|
2051
|
-
return t &&
|
|
1969
|
+
function Kt(e, t, n) {
|
|
1970
|
+
return t && Nt(e.prototype, t), n && Nt(e, n), Object.defineProperty(e, "prototype", {
|
|
2052
1971
|
writable: !1
|
|
2053
1972
|
}), e;
|
|
2054
1973
|
}
|
|
2055
|
-
function
|
|
1974
|
+
function Ft(e, t) {
|
|
2056
1975
|
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
|
|
2057
1976
|
e.prototype = Object.create(t && t.prototype, {
|
|
2058
1977
|
constructor: {
|
|
@@ -2062,64 +1981,64 @@
|
|
|
2062
1981
|
}
|
|
2063
1982
|
}), Object.defineProperty(e, "prototype", {
|
|
2064
1983
|
writable: !1
|
|
2065
|
-
}), t &&
|
|
1984
|
+
}), t && Ht(e, t);
|
|
2066
1985
|
}
|
|
2067
|
-
function
|
|
2068
|
-
return
|
|
1986
|
+
function Ht(e, t) {
|
|
1987
|
+
return Ht = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
|
|
2069
1988
|
return e.__proto__ = t, e;
|
|
2070
|
-
},
|
|
1989
|
+
}, Ht(e, t);
|
|
2071
1990
|
}
|
|
2072
|
-
function
|
|
2073
|
-
var t =
|
|
1991
|
+
function zt(e) {
|
|
1992
|
+
var t = Ut();
|
|
2074
1993
|
return function() {
|
|
2075
|
-
var n, r =
|
|
1994
|
+
var n, r = Jt(e);
|
|
2076
1995
|
if (t) {
|
|
2077
|
-
var o =
|
|
1996
|
+
var o = Jt(this).constructor;
|
|
2078
1997
|
n = Reflect.construct(r, arguments, o);
|
|
2079
1998
|
} else n = r.apply(this, arguments);
|
|
2080
|
-
return
|
|
1999
|
+
return $t(this, n);
|
|
2081
2000
|
};
|
|
2082
2001
|
}
|
|
2083
|
-
function
|
|
2084
|
-
if (t && ("object" ==
|
|
2002
|
+
function $t(e, t) {
|
|
2003
|
+
if (t && ("object" == Lt(t) || "function" == typeof t)) return t;
|
|
2085
2004
|
if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
|
|
2086
|
-
return
|
|
2005
|
+
return Wt(e);
|
|
2087
2006
|
}
|
|
2088
|
-
function
|
|
2007
|
+
function Wt(e) {
|
|
2089
2008
|
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
2090
2009
|
return e;
|
|
2091
2010
|
}
|
|
2092
|
-
function
|
|
2011
|
+
function Ut() {
|
|
2093
2012
|
try {
|
|
2094
2013
|
var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
|
|
2095
2014
|
} catch (e) {}
|
|
2096
|
-
return (
|
|
2015
|
+
return (Ut = function t() {
|
|
2097
2016
|
return !!e;
|
|
2098
2017
|
})();
|
|
2099
2018
|
}
|
|
2100
|
-
function
|
|
2101
|
-
return
|
|
2019
|
+
function Jt(e) {
|
|
2020
|
+
return Jt = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
|
|
2102
2021
|
return e.__proto__ || Object.getPrototypeOf(e);
|
|
2103
|
-
},
|
|
2022
|
+
}, Jt(e);
|
|
2104
2023
|
}
|
|
2105
|
-
function
|
|
2106
|
-
return (t =
|
|
2024
|
+
function Xt(e, t, n) {
|
|
2025
|
+
return (t = Gt(t)) in e ? Object.defineProperty(e, t, {
|
|
2107
2026
|
value: n,
|
|
2108
2027
|
enumerable: !0,
|
|
2109
2028
|
configurable: !0,
|
|
2110
2029
|
writable: !0
|
|
2111
2030
|
}) : e[t] = n, e;
|
|
2112
2031
|
}
|
|
2113
|
-
function
|
|
2114
|
-
var t =
|
|
2115
|
-
return "symbol" ==
|
|
2032
|
+
function Gt(e) {
|
|
2033
|
+
var t = Qt(e, "string");
|
|
2034
|
+
return "symbol" == Lt(t) ? t : t + "";
|
|
2116
2035
|
}
|
|
2117
|
-
function
|
|
2118
|
-
if ("object" !=
|
|
2036
|
+
function Qt(e, t) {
|
|
2037
|
+
if ("object" != Lt(e) || !e) return e;
|
|
2119
2038
|
var n = e[Symbol.toPrimitive];
|
|
2120
2039
|
if (void 0 !== n) {
|
|
2121
2040
|
var r = n.call(e, t || "default");
|
|
2122
|
-
if ("object" !=
|
|
2041
|
+
if ("object" != Lt(r)) return r;
|
|
2123
2042
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2124
2043
|
}
|
|
2125
2044
|
return ("string" === t ? String : Number)(e);
|
|
@@ -2127,7 +2046,7 @@
|
|
|
2127
2046
|
/* eslint-disable max-classes-per-file */
|
|
2128
2047
|
/** @public */
|
|
2129
2048
|
/** @public */
|
|
2130
|
-
/** @public */ var
|
|
2049
|
+
/** @public */ var Yt = {
|
|
2131
2050
|
allowKeyMatching: l().bool,
|
|
2132
2051
|
animateLoading: l().bool,
|
|
2133
2052
|
appearance: l().oneOf([ "default", "link", "primary", "pill", "toggle", "flat", "subtle" ]),
|
|
@@ -2168,7 +2087,7 @@
|
|
|
2168
2087
|
/** @private. */
|
|
2169
2088
|
virtualization: l().number
|
|
2170
2089
|
};
|
|
2171
|
-
var
|
|
2090
|
+
var Zt = {
|
|
2172
2091
|
allowKeyMatching: true,
|
|
2173
2092
|
animateLoading: false,
|
|
2174
2093
|
appearance: "toggle",
|
|
@@ -2186,13 +2105,13 @@
|
|
|
2186
2105
|
prepend: false,
|
|
2187
2106
|
toggleContent: "optionChildren"
|
|
2188
2107
|
};
|
|
2189
|
-
var
|
|
2190
|
-
|
|
2191
|
-
var n =
|
|
2108
|
+
var en = function(e) {
|
|
2109
|
+
Ft(r, e);
|
|
2110
|
+
var n = zt(r);
|
|
2192
2111
|
// @docs-props-type SelectPropsBase
|
|
2193
2112
|
function r(e) {
|
|
2194
2113
|
var t;
|
|
2195
|
-
|
|
2114
|
+
Vt(this, r);
|
|
2196
2115
|
t = n.call(this, e);
|
|
2197
2116
|
var o = {};
|
|
2198
2117
|
// wrap defaultValue in an array once to avoid failing <SelectBase>'s defaultValues comparison check
|
|
@@ -2210,7 +2129,7 @@
|
|
|
2210
2129
|
if (false) {}
|
|
2211
2130
|
return t;
|
|
2212
2131
|
}
|
|
2213
|
-
|
|
2132
|
+
Kt(r, [ {
|
|
2214
2133
|
key: "componentDidUpdate",
|
|
2215
2134
|
value: function e(t) {
|
|
2216
2135
|
if (false) {}
|
|
@@ -2218,7 +2137,7 @@
|
|
|
2218
2137
|
}, {
|
|
2219
2138
|
key: "render",
|
|
2220
2139
|
value: function e() {
|
|
2221
|
-
var n = this.props, r = n.defaultValue, o = n.onChange, l = n.value, a =
|
|
2140
|
+
var n = this.props, r = n.defaultValue, o = n.onChange, l = n.value, a = Dt(n, [ "defaultValue", "onChange", "value" ]);
|
|
2222
2141
|
var u = {
|
|
2223
2142
|
onChange: function e(t, n) {
|
|
2224
2143
|
var r = n.name, l = n.values;
|
|
@@ -2240,19 +2159,19 @@
|
|
|
2240
2159
|
u.defaultValues = this.state.defaultValues;
|
|
2241
2160
|
}
|
|
2242
2161
|
|
|
2243
|
-
return t().createElement(
|
|
2162
|
+
return t().createElement(vt, qt({}, a, u, {
|
|
2244
2163
|
multiple: false
|
|
2245
2164
|
}));
|
|
2246
2165
|
}
|
|
2247
2166
|
} ]);
|
|
2248
2167
|
return r;
|
|
2249
2168
|
}(e.Component);
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
/* harmony default export */ const
|
|
2169
|
+
Xt(en, "propTypes", Yt);
|
|
2170
|
+
Xt(en, "defaultProps", Zt);
|
|
2171
|
+
Xt(en, "Option", Mt);
|
|
2172
|
+
Xt(en, "Heading", T.Heading);
|
|
2173
|
+
Xt(en, "Divider", T.Divider);
|
|
2174
|
+
/* harmony default export */ const tn = en;
|
|
2256
2175
|
}) // CONCATENATED MODULE: ./src/Select/index.ts
|
|
2257
2176
|
();
|
|
2258
2177
|
module.exports = r;
|