@splunk/react-ui 5.5.0 → 5.6.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/AnchorMenu.d.ts +2 -0
- package/AnchorMenu.js +286 -0
- package/Badge.d.ts +2 -0
- package/CHANGELOG.md +15 -0
- package/Multiselect.js +84 -78
- package/SelectBase.js +932 -899
- package/Slider.js +234 -181
- package/TransitionOpen.js +46 -47
- package/cypress/support/commands.ts +40 -0
- package/cypress/support/component.ts +1 -1
- package/cypress/support/index.d.ts +22 -0
- package/package.json +3 -3
- package/types/src/AnchorMenu/AnchorMenu.d.ts +36 -0
- package/types/src/AnchorMenu/AnchorMenuContext.d.ts +6 -0
- package/types/src/AnchorMenu/Item.d.ts +35 -0
- package/types/src/AnchorMenu/docs/examples/Basic.d.ts +6 -0
- package/types/src/AnchorMenu/index.d.ts +3 -0
- package/types/src/Menu/Item.d.ts +1 -1
- package/types/src/Multiselect/Compact.d.ts +7 -0
- package/types/src/Multiselect/Multiselect.d.ts +7 -0
- package/types/src/SelectBase/SelectBase.d.ts +8 -1
- package/types/src/Slider/Slider.d.ts +7 -1
- package/types/src/Switch/Switch.d.ts +1 -1
package/SelectBase.js
CHANGED
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
/******/ /* webpack/runtime/compat get default export */
|
|
9
9
|
/******/ (() => {
|
|
10
10
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
11
|
-
/******/ e.n =
|
|
12
|
-
/******/ var t =
|
|
13
|
-
/******/ () =>
|
|
14
|
-
/******/ : () =>
|
|
11
|
+
/******/ e.n = r => {
|
|
12
|
+
/******/ var t = r && r.__esModule ?
|
|
13
|
+
/******/ () => r["default"]
|
|
14
|
+
/******/ : () => r
|
|
15
15
|
/******/;
|
|
16
16
|
e.d(t, {
|
|
17
17
|
a: t
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
/******/ /* webpack/runtime/define property getters */
|
|
24
24
|
/******/ (() => {
|
|
25
25
|
/******/ // define getter functions for harmony exports
|
|
26
|
-
/******/ e.d = (
|
|
27
|
-
/******/ for (var
|
|
28
|
-
/******/ if (e.o(t,
|
|
29
|
-
/******/ Object.defineProperty(
|
|
26
|
+
/******/ e.d = (r, t) => {
|
|
27
|
+
/******/ for (var n in t) {
|
|
28
|
+
/******/ if (e.o(t, n) && !e.o(r, n)) {
|
|
29
|
+
/******/ Object.defineProperty(r, n, {
|
|
30
30
|
enumerable: true,
|
|
31
|
-
get: t[
|
|
31
|
+
get: t[n]
|
|
32
32
|
});
|
|
33
33
|
/******/ }
|
|
34
34
|
/******/ }
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
/******/
|
|
38
38
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
39
39
|
/******/ (() => {
|
|
40
|
-
/******/ e.o = (e,
|
|
40
|
+
/******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r)
|
|
41
41
|
/******/;
|
|
42
42
|
})();
|
|
43
43
|
/******/
|
|
@@ -56,207 +56,192 @@
|
|
|
56
56
|
/******/ };
|
|
57
57
|
/******/ })();
|
|
58
58
|
/******/
|
|
59
|
-
/************************************************************************/ var
|
|
59
|
+
/************************************************************************/ var r = {};
|
|
60
60
|
// ESM COMPAT FLAG
|
|
61
|
-
e.r(
|
|
61
|
+
e.r(r);
|
|
62
62
|
// EXPORTS
|
|
63
|
-
e.d(
|
|
64
|
-
Controls: () => /* reexport */
|
|
65
|
-
Divider: () => /* reexport */
|
|
66
|
-
Heading: () => /* reexport */
|
|
67
|
-
Option: () => /* reexport */
|
|
68
|
-
SelectAllOption: () => /* reexport */
|
|
69
|
-
default: () => /* reexport */
|
|
70
|
-
isOption: () => /* reexport */
|
|
63
|
+
e.d(r, {
|
|
64
|
+
Controls: () => /* reexport */ sr,
|
|
65
|
+
Divider: () => /* reexport */ w.Divider,
|
|
66
|
+
Heading: () => /* reexport */ w.Heading,
|
|
67
|
+
Option: () => /* reexport */ U,
|
|
68
|
+
SelectAllOption: () => /* reexport */ oe,
|
|
69
|
+
default: () => /* reexport */ mr,
|
|
70
|
+
isOption: () => /* reexport */ tr
|
|
71
71
|
});
|
|
72
72
|
// CONCATENATED MODULE: external "react"
|
|
73
73
|
const t = require("react");
|
|
74
|
-
var
|
|
74
|
+
var n = e.n(t);
|
|
75
75
|
// CONCATENATED MODULE: external "lodash/castArray"
|
|
76
76
|
const l = require("lodash/castArray");
|
|
77
77
|
var a = e.n(l);
|
|
78
|
-
// CONCATENATED MODULE: external "lodash/find"
|
|
79
|
-
const o = require("lodash/find");
|
|
80
|
-
var i = e.n(o);
|
|
81
|
-
// CONCATENATED MODULE: external "lodash/forEachRight"
|
|
82
|
-
const u = require("lodash/forEachRight");
|
|
83
|
-
var c = e.n(u);
|
|
84
78
|
// CONCATENATED MODULE: external "lodash/has"
|
|
85
|
-
const
|
|
86
|
-
var
|
|
87
|
-
// CONCATENATED MODULE: external "lodash/includes"
|
|
88
|
-
const d = require("lodash/includes");
|
|
89
|
-
var p = e.n(d);
|
|
79
|
+
const o = require("lodash/has");
|
|
80
|
+
var i = e.n(o);
|
|
90
81
|
// CONCATENATED MODULE: external "lodash/memoize"
|
|
91
|
-
const
|
|
92
|
-
var
|
|
82
|
+
const u = require("lodash/memoize");
|
|
83
|
+
var c = e.n(u);
|
|
93
84
|
// CONCATENATED MODULE: external "lodash/pick"
|
|
94
|
-
const
|
|
95
|
-
var
|
|
96
|
-
// CONCATENATED MODULE: external "lodash/uniq"
|
|
97
|
-
const g = require("lodash/uniq");
|
|
98
|
-
var h = e.n(g);
|
|
99
|
-
// CONCATENATED MODULE: external "lodash/without"
|
|
100
|
-
const O = require("lodash/without");
|
|
101
|
-
var S = e.n(O);
|
|
85
|
+
const s = require("lodash/pick");
|
|
86
|
+
var f = e.n(s);
|
|
102
87
|
// CONCATENATED MODULE: external "prop-types"
|
|
103
|
-
const
|
|
104
|
-
var
|
|
88
|
+
const d = require("prop-types");
|
|
89
|
+
var p = e.n(d);
|
|
105
90
|
// CONCATENATED MODULE: external "@splunk/react-icons/CaretSmallDown"
|
|
106
|
-
const
|
|
107
|
-
var
|
|
91
|
+
const v = require("@splunk/react-icons/CaretSmallDown");
|
|
92
|
+
var b = e.n(v);
|
|
108
93
|
// CONCATENATED MODULE: external "@splunk/react-icons/Magnifier"
|
|
109
|
-
const
|
|
110
|
-
var
|
|
94
|
+
const m = require("@splunk/react-icons/Magnifier");
|
|
95
|
+
var y = e.n(m);
|
|
111
96
|
// CONCATENATED MODULE: external "@splunk/react-ui/Dropdown"
|
|
112
|
-
const
|
|
113
|
-
var
|
|
97
|
+
const g = require("@splunk/react-ui/Dropdown");
|
|
98
|
+
var h = e.n(g);
|
|
114
99
|
// CONCATENATED MODULE: external "@splunk/react-ui/Link"
|
|
115
|
-
const
|
|
116
|
-
var
|
|
100
|
+
const S = require("@splunk/react-ui/Link");
|
|
101
|
+
var O = e.n(S);
|
|
117
102
|
// CONCATENATED MODULE: external "@splunk/react-ui/Menu"
|
|
118
|
-
const
|
|
103
|
+
const w = require("@splunk/react-ui/Menu");
|
|
119
104
|
// CONCATENATED MODULE: external "@splunk/react-ui/ResultsMenu"
|
|
120
|
-
const
|
|
121
|
-
var
|
|
105
|
+
const C = require("@splunk/react-ui/ResultsMenu");
|
|
106
|
+
var k = e.n(C);
|
|
122
107
|
// CONCATENATED MODULE: external "@splunk/react-ui/ScreenReaderContent"
|
|
123
|
-
const
|
|
124
|
-
var
|
|
108
|
+
const x = require("@splunk/react-ui/ScreenReaderContent");
|
|
109
|
+
var j = e.n(x);
|
|
125
110
|
// CONCATENATED MODULE: external "@splunk/react-ui/Text"
|
|
126
|
-
const
|
|
127
|
-
var
|
|
111
|
+
const P = require("@splunk/react-ui/Text");
|
|
112
|
+
var E = e.n(P);
|
|
128
113
|
// CONCATENATED MODULE: external "@splunk/react-ui/useControlled"
|
|
129
|
-
const
|
|
130
|
-
var
|
|
114
|
+
const A = require("@splunk/react-ui/useControlled");
|
|
115
|
+
var L = e.n(A);
|
|
131
116
|
// CONCATENATED MODULE: external "@splunk/react-ui/usePrevious"
|
|
132
|
-
const
|
|
133
|
-
var
|
|
117
|
+
const I = require("@splunk/react-ui/usePrevious");
|
|
118
|
+
var R = e.n(I);
|
|
134
119
|
// CONCATENATED MODULE: external "@splunk/ui-utils/filter"
|
|
135
|
-
const
|
|
120
|
+
const M = require("@splunk/ui-utils/filter");
|
|
136
121
|
// CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
|
|
137
|
-
const
|
|
122
|
+
const q = require("@splunk/ui-utils/i18n");
|
|
138
123
|
// CONCATENATED MODULE: external "@splunk/ui-utils/id"
|
|
139
|
-
const
|
|
124
|
+
const T = require("@splunk/ui-utils/id");
|
|
140
125
|
// CONCATENATED MODULE: external "@splunk/ui-utils/scroll"
|
|
141
|
-
const
|
|
126
|
+
const D = require("@splunk/ui-utils/scroll");
|
|
142
127
|
// CONCATENATED MODULE: ./src/SelectBase/OptionBase.tsx
|
|
143
|
-
function
|
|
128
|
+
function _(e) {
|
|
144
129
|
"@babel/helpers - typeof";
|
|
145
|
-
return
|
|
130
|
+
return _ = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
146
131
|
return typeof e;
|
|
147
132
|
} : function(e) {
|
|
148
133
|
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
149
|
-
},
|
|
134
|
+
}, _(e);
|
|
150
135
|
}
|
|
151
|
-
function
|
|
152
|
-
return
|
|
153
|
-
for (var
|
|
154
|
-
var t = arguments[
|
|
155
|
-
for (var
|
|
156
|
-
({}).hasOwnProperty.call(t,
|
|
136
|
+
function B() {
|
|
137
|
+
return B = Object.assign ? Object.assign.bind() : function(e) {
|
|
138
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
139
|
+
var t = arguments[r];
|
|
140
|
+
for (var n in t) {
|
|
141
|
+
({}).hasOwnProperty.call(t, n) && (e[n] = t[n]);
|
|
157
142
|
}
|
|
158
143
|
}
|
|
159
144
|
return e;
|
|
160
|
-
},
|
|
145
|
+
}, B.apply(null, arguments);
|
|
161
146
|
}
|
|
162
|
-
function
|
|
147
|
+
function N(e, r) {
|
|
163
148
|
var t = Object.keys(e);
|
|
164
149
|
if (Object.getOwnPropertySymbols) {
|
|
165
|
-
var
|
|
166
|
-
|
|
167
|
-
return Object.getOwnPropertyDescriptor(e,
|
|
168
|
-
}))), t.push.apply(t,
|
|
150
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
151
|
+
r && (n = n.filter((function(r) {
|
|
152
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
153
|
+
}))), t.push.apply(t, n);
|
|
169
154
|
}
|
|
170
155
|
return t;
|
|
171
156
|
}
|
|
172
|
-
function
|
|
173
|
-
for (var
|
|
174
|
-
var t = null != arguments[
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) :
|
|
178
|
-
Object.defineProperty(e,
|
|
157
|
+
function V(e) {
|
|
158
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
159
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
160
|
+
r % 2 ? N(Object(t), !0).forEach((function(r) {
|
|
161
|
+
F(e, r, t[r]);
|
|
162
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : N(Object(t)).forEach((function(r) {
|
|
163
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
179
164
|
}));
|
|
180
165
|
}
|
|
181
166
|
return e;
|
|
182
167
|
}
|
|
183
|
-
function
|
|
184
|
-
return (
|
|
168
|
+
function F(e, r, t) {
|
|
169
|
+
return (r = K(r)) in e ? Object.defineProperty(e, r, {
|
|
185
170
|
value: t,
|
|
186
171
|
enumerable: !0,
|
|
187
172
|
configurable: !0,
|
|
188
173
|
writable: !0
|
|
189
|
-
}) : e[
|
|
174
|
+
}) : e[r] = t, e;
|
|
190
175
|
}
|
|
191
|
-
function
|
|
192
|
-
var
|
|
193
|
-
return "symbol" ==
|
|
176
|
+
function K(e) {
|
|
177
|
+
var r = H(e, "string");
|
|
178
|
+
return "symbol" == _(r) ? r : r + "";
|
|
194
179
|
}
|
|
195
|
-
function
|
|
196
|
-
if ("object" !=
|
|
180
|
+
function H(e, r) {
|
|
181
|
+
if ("object" != _(e) || !e) return e;
|
|
197
182
|
var t = e[Symbol.toPrimitive];
|
|
198
183
|
if (void 0 !== t) {
|
|
199
|
-
var
|
|
200
|
-
if ("object" !=
|
|
184
|
+
var n = t.call(e, r || "default");
|
|
185
|
+
if ("object" != _(n)) return n;
|
|
201
186
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
202
187
|
}
|
|
203
|
-
return ("string" ===
|
|
188
|
+
return ("string" === r ? String : Number)(e);
|
|
204
189
|
}
|
|
205
|
-
function
|
|
190
|
+
function z(e, r) {
|
|
206
191
|
if (null == e) return {};
|
|
207
|
-
var t,
|
|
192
|
+
var t, n, l = W(e, r);
|
|
208
193
|
if (Object.getOwnPropertySymbols) {
|
|
209
194
|
var a = Object.getOwnPropertySymbols(e);
|
|
210
|
-
for (
|
|
211
|
-
t = a[
|
|
195
|
+
for (n = 0; n < a.length; n++) {
|
|
196
|
+
t = a[n], -1 === r.indexOf(t) && {}.propertyIsEnumerable.call(e, t) && (l[t] = e[t]);
|
|
212
197
|
}
|
|
213
198
|
}
|
|
214
199
|
return l;
|
|
215
200
|
}
|
|
216
|
-
function
|
|
201
|
+
function W(e, r) {
|
|
217
202
|
if (null == e) return {};
|
|
218
203
|
var t = {};
|
|
219
|
-
for (var
|
|
220
|
-
if ({}.hasOwnProperty.call(e,
|
|
221
|
-
if (-1 !==
|
|
222
|
-
t[
|
|
204
|
+
for (var n in e) {
|
|
205
|
+
if ({}.hasOwnProperty.call(e, n)) {
|
|
206
|
+
if (-1 !== r.indexOf(n)) continue;
|
|
207
|
+
t[n] = e[n];
|
|
223
208
|
}
|
|
224
209
|
}
|
|
225
210
|
return t;
|
|
226
211
|
}
|
|
227
|
-
var
|
|
212
|
+
var $ = {
|
|
228
213
|
/** @private */
|
|
229
|
-
active:
|
|
230
|
-
children:
|
|
231
|
-
description:
|
|
232
|
-
descriptionPosition:
|
|
233
|
-
disabled:
|
|
234
|
-
elementRef:
|
|
235
|
-
endAdornment:
|
|
236
|
-
hidden:
|
|
237
|
-
icon:
|
|
238
|
-
label:
|
|
214
|
+
active: p().bool,
|
|
215
|
+
children: p().node,
|
|
216
|
+
description: p().string,
|
|
217
|
+
descriptionPosition: p().oneOf([ "right", "bottom" ]),
|
|
218
|
+
disabled: p().bool,
|
|
219
|
+
elementRef: p().oneOfType([ p().func, p().object ]),
|
|
220
|
+
endAdornment: p().node,
|
|
221
|
+
hidden: p().bool,
|
|
222
|
+
icon: p().node,
|
|
223
|
+
label: p().string.isRequired,
|
|
239
224
|
/**
|
|
240
225
|
* @private Passed down from <BaseSelect>
|
|
241
226
|
*/
|
|
242
|
-
multiple:
|
|
243
|
-
matchRanges:
|
|
244
|
-
start:
|
|
245
|
-
end:
|
|
227
|
+
multiple: p().bool,
|
|
228
|
+
matchRanges: p().arrayOf(p().shape({
|
|
229
|
+
start: p().number.isRequired,
|
|
230
|
+
end: p().number.isRequired
|
|
246
231
|
})),
|
|
247
232
|
/** @private */
|
|
248
|
-
onClick:
|
|
233
|
+
onClick: p().func,
|
|
249
234
|
/** @private */
|
|
250
|
-
role:
|
|
235
|
+
role: p().oneOf([ "menuitemcheckbox", "option" ]),
|
|
251
236
|
/** @private */
|
|
252
|
-
selected:
|
|
253
|
-
truncate:
|
|
254
|
-
value:
|
|
237
|
+
selected: p().oneOfType([ p().bool, p().oneOf([ "some" ]) ]),
|
|
238
|
+
truncate: p().bool,
|
|
239
|
+
value: p().oneOfType([ p().string, p().number, p().bool ]).isRequired
|
|
255
240
|
};
|
|
256
241
|
/**
|
|
257
242
|
* An option within a `Multiselect`.
|
|
258
|
-
*/ function
|
|
259
|
-
var
|
|
243
|
+
*/ function X(e) {
|
|
244
|
+
var r = e.children, l = e.descriptionPosition, a = l === void 0 ? "bottom" : l, o = e.disabled, i = e.elementRef, u = e.endAdornment, c = e.icon, s = e.label, f = e.multiple, d = e.onClick, p = e.role, v = p === void 0 ? "option" : p, b = e.value, m = z(e, [ "children", "descriptionPosition", "disabled", "elementRef", "endAdornment", "icon", "label", "multiple", "onClick", "role", "value" ]);
|
|
260
245
|
// @docs-props-type OptionPropsBase
|
|
261
246
|
var y = (0, t.useCallback)((function(e) {
|
|
262
247
|
if (!o) {
|
|
@@ -266,12 +251,12 @@
|
|
|
266
251
|
}
|
|
267
252
|
}), [ o, d, b ]);
|
|
268
253
|
var g = b.toString();
|
|
269
|
-
var h =
|
|
254
|
+
var h = V({
|
|
270
255
|
descriptionPosition: a,
|
|
271
256
|
disabled: o ? "disabled" : undefined
|
|
272
257
|
}, m);
|
|
273
258
|
|
|
274
|
-
return
|
|
259
|
+
return n().createElement(w.Item, B({
|
|
275
260
|
"data-test-value": b,
|
|
276
261
|
"data-test": "option",
|
|
277
262
|
elementRef: i,
|
|
@@ -283,110 +268,110 @@
|
|
|
283
268
|
onClick: y,
|
|
284
269
|
role: v,
|
|
285
270
|
value: g
|
|
286
|
-
}),
|
|
271
|
+
}), r || s);
|
|
287
272
|
}
|
|
288
|
-
|
|
289
|
-
|
|
273
|
+
X.propTypes = $;
|
|
274
|
+
X.type = w.Item;
|
|
290
275
|
// For components to distinguish if their children are Options or Headings/Dividers
|
|
291
|
-
/* harmony default export */ const
|
|
276
|
+
/* harmony default export */ const U = X;
|
|
292
277
|
// CONCATENATED MODULE: ./src/SelectBase/SelectAllOption.tsx
|
|
293
|
-
function
|
|
278
|
+
function J(e) {
|
|
294
279
|
"@babel/helpers - typeof";
|
|
295
|
-
return
|
|
280
|
+
return J = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
296
281
|
return typeof e;
|
|
297
282
|
} : function(e) {
|
|
298
283
|
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
299
|
-
},
|
|
284
|
+
}, J(e);
|
|
300
285
|
}
|
|
301
|
-
function
|
|
302
|
-
return
|
|
303
|
-
for (var
|
|
304
|
-
var t = arguments[
|
|
305
|
-
for (var
|
|
306
|
-
({}).hasOwnProperty.call(t,
|
|
286
|
+
function G() {
|
|
287
|
+
return G = Object.assign ? Object.assign.bind() : function(e) {
|
|
288
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
289
|
+
var t = arguments[r];
|
|
290
|
+
for (var n in t) {
|
|
291
|
+
({}).hasOwnProperty.call(t, n) && (e[n] = t[n]);
|
|
307
292
|
}
|
|
308
293
|
}
|
|
309
294
|
return e;
|
|
310
|
-
},
|
|
295
|
+
}, G.apply(null, arguments);
|
|
311
296
|
}
|
|
312
|
-
function
|
|
297
|
+
function Q(e, r) {
|
|
313
298
|
if (null == e) return {};
|
|
314
|
-
var t,
|
|
299
|
+
var t, n, l = Y(e, r);
|
|
315
300
|
if (Object.getOwnPropertySymbols) {
|
|
316
301
|
var a = Object.getOwnPropertySymbols(e);
|
|
317
|
-
for (
|
|
318
|
-
t = a[
|
|
302
|
+
for (n = 0; n < a.length; n++) {
|
|
303
|
+
t = a[n], -1 === r.indexOf(t) && {}.propertyIsEnumerable.call(e, t) && (l[t] = e[t]);
|
|
319
304
|
}
|
|
320
305
|
}
|
|
321
306
|
return l;
|
|
322
307
|
}
|
|
323
|
-
function
|
|
308
|
+
function Y(e, r) {
|
|
324
309
|
if (null == e) return {};
|
|
325
310
|
var t = {};
|
|
326
|
-
for (var
|
|
327
|
-
if ({}.hasOwnProperty.call(e,
|
|
328
|
-
if (-1 !==
|
|
329
|
-
t[
|
|
311
|
+
for (var n in e) {
|
|
312
|
+
if ({}.hasOwnProperty.call(e, n)) {
|
|
313
|
+
if (-1 !== r.indexOf(n)) continue;
|
|
314
|
+
t[n] = e[n];
|
|
330
315
|
}
|
|
331
316
|
}
|
|
332
317
|
return t;
|
|
333
318
|
}
|
|
334
|
-
function
|
|
319
|
+
function Z(e, r) {
|
|
335
320
|
var t = Object.keys(e);
|
|
336
321
|
if (Object.getOwnPropertySymbols) {
|
|
337
|
-
var
|
|
338
|
-
|
|
339
|
-
return Object.getOwnPropertyDescriptor(e,
|
|
340
|
-
}))), t.push.apply(t,
|
|
322
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
323
|
+
r && (n = n.filter((function(r) {
|
|
324
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
325
|
+
}))), t.push.apply(t, n);
|
|
341
326
|
}
|
|
342
327
|
return t;
|
|
343
328
|
}
|
|
344
|
-
function
|
|
345
|
-
for (var
|
|
346
|
-
var t = null != arguments[
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) :
|
|
350
|
-
Object.defineProperty(e,
|
|
329
|
+
function ee(e) {
|
|
330
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
331
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
332
|
+
r % 2 ? Z(Object(t), !0).forEach((function(r) {
|
|
333
|
+
re(e, r, t[r]);
|
|
334
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : Z(Object(t)).forEach((function(r) {
|
|
335
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
351
336
|
}));
|
|
352
337
|
}
|
|
353
338
|
return e;
|
|
354
339
|
}
|
|
355
|
-
function
|
|
356
|
-
return (
|
|
340
|
+
function re(e, r, t) {
|
|
341
|
+
return (r = te(r)) in e ? Object.defineProperty(e, r, {
|
|
357
342
|
value: t,
|
|
358
343
|
enumerable: !0,
|
|
359
344
|
configurable: !0,
|
|
360
345
|
writable: !0
|
|
361
|
-
}) : e[
|
|
346
|
+
}) : e[r] = t, e;
|
|
362
347
|
}
|
|
363
|
-
function
|
|
364
|
-
var
|
|
365
|
-
return "symbol" ==
|
|
348
|
+
function te(e) {
|
|
349
|
+
var r = ne(e, "string");
|
|
350
|
+
return "symbol" == J(r) ? r : r + "";
|
|
366
351
|
}
|
|
367
|
-
function
|
|
368
|
-
if ("object" !=
|
|
352
|
+
function ne(e, r) {
|
|
353
|
+
if ("object" != J(e) || !e) return e;
|
|
369
354
|
var t = e[Symbol.toPrimitive];
|
|
370
355
|
if (void 0 !== t) {
|
|
371
|
-
var
|
|
372
|
-
if ("object" !=
|
|
356
|
+
var n = t.call(e, r || "default");
|
|
357
|
+
if ("object" != J(n)) return n;
|
|
373
358
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
374
359
|
}
|
|
375
|
-
return ("string" ===
|
|
360
|
+
return ("string" === r ? String : Number)(e);
|
|
376
361
|
}
|
|
377
|
-
var
|
|
378
|
-
totalCount:
|
|
362
|
+
var le = ee(ee({}, U.propTypes), {}, {
|
|
363
|
+
totalCount: p().number,
|
|
379
364
|
// unlike OptionBase, there's a default value for this prop
|
|
380
|
-
value:
|
|
365
|
+
value: p().string
|
|
381
366
|
});
|
|
382
|
-
function
|
|
383
|
-
var
|
|
367
|
+
function ae(e) {
|
|
368
|
+
var r = e.active, t = e.elementRef, l = e.id, a = e.label, o = e.onClick, i = e.selected, u = e.totalCount, c = e.value, s = c === void 0 ? "selectAll" : c, f = Q(e, [ "active", "elementRef", "id", "label", "onClick", "selected", "totalCount", "value" ]);
|
|
384
369
|
// @docs-props-type SelectAllOptionPropsBase
|
|
385
370
|
// When toggle is changed the total count is not displayed anymore so the count is now shown in the Select all menu item
|
|
386
371
|
var d = u != null ? " (".concat(u === null || u === void 0 ? void 0 : u.toString(), ")") : "";
|
|
387
372
|
|
|
388
|
-
return
|
|
389
|
-
active:
|
|
373
|
+
return n().createElement(U, G({
|
|
374
|
+
active: r,
|
|
390
375
|
elementRef: t,
|
|
391
376
|
"aria-keyshortcuts": "Control+A",
|
|
392
377
|
"data-test": "select-all",
|
|
@@ -402,101 +387,101 @@
|
|
|
402
387
|
value: s
|
|
403
388
|
}, f));
|
|
404
389
|
}
|
|
405
|
-
|
|
406
|
-
/* harmony default export */ const
|
|
390
|
+
ae.propTypes = le;
|
|
391
|
+
/* harmony default export */ const oe = ae;
|
|
407
392
|
// CONCATENATED MODULE: external "styled-components"
|
|
408
|
-
const
|
|
409
|
-
var
|
|
393
|
+
const ie = require("styled-components");
|
|
394
|
+
var ue = e.n(ie);
|
|
410
395
|
// CONCATENATED MODULE: external "@splunk/react-ui/Button"
|
|
411
|
-
const
|
|
412
|
-
var
|
|
396
|
+
const ce = require("@splunk/react-ui/Button");
|
|
397
|
+
var se = e.n(ce);
|
|
413
398
|
// CONCATENATED MODULE: external "@splunk/react-ui/Divider"
|
|
414
|
-
const
|
|
415
|
-
var
|
|
399
|
+
const fe = require("@splunk/react-ui/Divider");
|
|
400
|
+
var de = e.n(fe);
|
|
416
401
|
// CONCATENATED MODULE: external "@splunk/themes"
|
|
417
|
-
const
|
|
402
|
+
const pe = require("@splunk/themes");
|
|
418
403
|
// CONCATENATED MODULE: ./src/SelectBase/SelectBaseStyles.ts
|
|
419
|
-
var
|
|
404
|
+
var ve = ue()(se()).withConfig({
|
|
420
405
|
displayName: "SelectBaseStyles__StyledButton",
|
|
421
406
|
componentId: "sc-1lmonqb-0"
|
|
422
407
|
})([ "&[data-inline]{width:", ";}", "" ], (function(e) {
|
|
423
|
-
var
|
|
424
|
-
return
|
|
408
|
+
var r = e.$multiple;
|
|
409
|
+
return r ? "400px" : "auto";
|
|
425
410
|
}), (function(e) {
|
|
426
|
-
var
|
|
427
|
-
return !
|
|
411
|
+
var r = e.$multiple;
|
|
412
|
+
return !r && "flex-grow: 0;";
|
|
428
413
|
}));
|
|
429
|
-
var
|
|
414
|
+
var be = ue().span.withConfig({
|
|
430
415
|
displayName: "SelectBaseStyles__StyledLinkIcon",
|
|
431
416
|
componentId: "sc-1lmonqb-1"
|
|
432
|
-
})([ "padding-right:", ";" ],
|
|
433
|
-
var
|
|
417
|
+
})([ "padding-right:", ";" ], pe.variables.spacingXSmall);
|
|
418
|
+
var me = ue().span.withConfig({
|
|
434
419
|
displayName: "SelectBaseStyles__StyledLinkCaret",
|
|
435
420
|
componentId: "sc-1lmonqb-2"
|
|
436
|
-
})([ "padding-left:", ";" ],
|
|
437
|
-
var
|
|
421
|
+
})([ "padding-left:", ";" ], pe.variables.spacingXSmall);
|
|
422
|
+
var ye = ue().div.withConfig({
|
|
438
423
|
displayName: "SelectBaseStyles__StyledFilter",
|
|
439
424
|
componentId: "sc-1lmonqb-3"
|
|
440
|
-
})([ "padding:", " ", " ", ";min-width:160px;" ],
|
|
441
|
-
var
|
|
425
|
+
})([ "padding:", " ", " ", ";min-width:160px;" ], pe.variables.spacingLarge, pe.variables.spacingLarge, pe.variables.spacingSmall);
|
|
426
|
+
var ge = ue().span.withConfig({
|
|
442
427
|
displayName: "SelectBaseStyles__StyledCount",
|
|
443
428
|
componentId: "sc-1lmonqb-4"
|
|
444
|
-
})([ "padding-right:", ";" ],
|
|
445
|
-
var
|
|
429
|
+
})([ "padding-right:", ";" ], pe.variables.spacingXSmall);
|
|
430
|
+
var he = ue()(O()).withConfig({
|
|
446
431
|
displayName: "SelectBaseStyles__StyledControlsLink",
|
|
447
432
|
componentId: "sc-1lmonqb-5"
|
|
448
433
|
})([ "", ";" ], (function(e) {
|
|
449
|
-
var
|
|
450
|
-
return
|
|
434
|
+
var r = e.$disabled;
|
|
435
|
+
return r && (0, ie.css)([ "color:", ";" ], pe.variables.contentColorDisabled);
|
|
451
436
|
}));
|
|
452
|
-
var
|
|
437
|
+
var Se = ue().div.withConfig({
|
|
453
438
|
displayName: "SelectBaseStyles__StyledToggleAllControls",
|
|
454
439
|
componentId: "sc-1lmonqb-6"
|
|
455
|
-
})([ "", ";gap:", ";padding:", " ", " ", ";" ],
|
|
456
|
-
var
|
|
440
|
+
})([ "", ";gap:", ";padding:", " ", " ", ";" ], pe.mixins.reset("flex"), pe.variables.spacingMedium, pe.variables.spacingXSmall, pe.variables.spacingLarge, pe.variables.spacingSmall);
|
|
441
|
+
var Oe = ue()(de()).withConfig({
|
|
457
442
|
displayName: "SelectBaseStyles__StyledControlsDivider",
|
|
458
443
|
componentId: "sc-1lmonqb-7"
|
|
459
|
-
})([ "border-color:", ";" ],
|
|
444
|
+
})([ "border-color:", ";" ], pe.variables.borderColor);
|
|
460
445
|
// CONCATENATED MODULE: ./src/utils/fuzzyMatch.ts
|
|
461
446
|
// A utility for matching keyboard characters to list values
|
|
462
|
-
var
|
|
463
|
-
return
|
|
447
|
+
var we = function e(r, t) {
|
|
448
|
+
return r ? r.label.charAt(t).toLowerCase() : "";
|
|
464
449
|
};
|
|
465
|
-
var
|
|
466
|
-
if (!
|
|
467
|
-
return
|
|
450
|
+
var Ce = function e(r, t) {
|
|
451
|
+
if (!r.length) {
|
|
452
|
+
return r;
|
|
468
453
|
}
|
|
469
|
-
var
|
|
454
|
+
var n = null;
|
|
470
455
|
var l = false;
|
|
471
|
-
var a =
|
|
472
|
-
var
|
|
473
|
-
if (
|
|
456
|
+
var a = r.filter((function(e) {
|
|
457
|
+
var r = we(e, t.index);
|
|
458
|
+
if (r === t.value) {
|
|
474
459
|
l = true;
|
|
475
460
|
return true;
|
|
476
461
|
}
|
|
477
462
|
// If we haven't found a match yet, keep track of the next closest match.
|
|
478
463
|
// Secondary matching looks for the closest character of a higher value, and failing that, closest of a lower value.
|
|
479
464
|
if (!l) {
|
|
480
|
-
var a =
|
|
465
|
+
var a = we(n, t.index);
|
|
481
466
|
if (!a) {
|
|
482
|
-
|
|
483
|
-
} else if (
|
|
467
|
+
n = e;
|
|
468
|
+
} else if (r > t.value) {
|
|
484
469
|
if (a < t.value) {
|
|
485
|
-
|
|
486
|
-
} else if (a >
|
|
487
|
-
|
|
470
|
+
n = e;
|
|
471
|
+
} else if (a > r) {
|
|
472
|
+
n = e;
|
|
488
473
|
}
|
|
489
|
-
} else if (
|
|
490
|
-
|
|
474
|
+
} else if (r > a) {
|
|
475
|
+
n = e;
|
|
491
476
|
}
|
|
492
477
|
}
|
|
493
478
|
return false;
|
|
494
479
|
}));
|
|
495
|
-
return a.length === 0 &&
|
|
480
|
+
return a.length === 0 && n ? [ n ] : a;
|
|
496
481
|
};
|
|
497
482
|
// CONCATENATED MODULE: ./src/utils/ssrDocument.ts
|
|
498
483
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
499
|
-
var
|
|
484
|
+
var ke = {
|
|
500
485
|
body: {
|
|
501
486
|
appendChild: function e() {
|
|
502
487
|
return [];
|
|
@@ -550,16 +535,16 @@
|
|
|
550
535
|
search: ""
|
|
551
536
|
}
|
|
552
537
|
};
|
|
553
|
-
function
|
|
554
|
-
var e = typeof document !== "undefined" ? document :
|
|
538
|
+
function xe() {
|
|
539
|
+
var e = typeof document !== "undefined" ? document : ke;
|
|
555
540
|
return e;
|
|
556
541
|
}
|
|
557
|
-
var
|
|
558
|
-
/* harmony default export */ const
|
|
542
|
+
var je = xe();
|
|
543
|
+
/* harmony default export */ const Pe = /* unused pure expression or super */ null && je;
|
|
559
544
|
// CONCATENATED MODULE: ./src/utils/ssrWindow.ts
|
|
560
545
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
561
|
-
var
|
|
562
|
-
document:
|
|
546
|
+
var Ee = {
|
|
547
|
+
document: ke,
|
|
563
548
|
navigator: {
|
|
564
549
|
userAgent: ""
|
|
565
550
|
},
|
|
@@ -599,26 +584,26 @@
|
|
|
599
584
|
matchMedia: function e() {
|
|
600
585
|
return {};
|
|
601
586
|
},
|
|
602
|
-
requestAnimationFrame: function e(
|
|
587
|
+
requestAnimationFrame: function e(r) {
|
|
603
588
|
if (typeof setTimeout === "undefined") {
|
|
604
|
-
|
|
589
|
+
r();
|
|
605
590
|
return null;
|
|
606
591
|
}
|
|
607
|
-
return setTimeout(
|
|
592
|
+
return setTimeout(r, 0);
|
|
608
593
|
},
|
|
609
|
-
cancelAnimationFrame: function e(
|
|
594
|
+
cancelAnimationFrame: function e(r) {
|
|
610
595
|
if (typeof setTimeout === "undefined") {
|
|
611
596
|
return;
|
|
612
597
|
}
|
|
613
|
-
clearTimeout(
|
|
598
|
+
clearTimeout(r);
|
|
614
599
|
}
|
|
615
600
|
};
|
|
616
|
-
function
|
|
617
|
-
var e = typeof window !== "undefined" ? window :
|
|
601
|
+
function Ae() {
|
|
602
|
+
var e = typeof window !== "undefined" ? window : Ee;
|
|
618
603
|
return e;
|
|
619
604
|
}
|
|
620
|
-
var
|
|
621
|
-
/* harmony default export */ const
|
|
605
|
+
var Le = Ae();
|
|
606
|
+
/* harmony default export */ const Ie = /* unused pure expression or super */ null && Le;
|
|
622
607
|
// CONCATENATED MODULE: ./src/utils/updateReactRef.ts
|
|
623
608
|
/**
|
|
624
609
|
* Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
|
|
@@ -626,71 +611,71 @@
|
|
|
626
611
|
* @param ref - The React callback or object ref. Can be `null` or `undefined`.
|
|
627
612
|
* @param current - The new value of the ref.
|
|
628
613
|
*/
|
|
629
|
-
function
|
|
614
|
+
function Re(e, r) {
|
|
630
615
|
if (e) {
|
|
631
616
|
if (typeof e === "function") {
|
|
632
|
-
e(
|
|
617
|
+
e(r);
|
|
633
618
|
} else {
|
|
634
619
|
// the public signature of this util uses React.Ref<T> to mirror the way React types refs.
|
|
635
620
|
// the intention here is to signal "we will take care of setting 'current', not you".
|
|
636
|
-
e.current =
|
|
621
|
+
e.current = r;
|
|
637
622
|
// eslint-disable-line no-param-reassign
|
|
638
623
|
}
|
|
639
624
|
}
|
|
640
625
|
}
|
|
641
626
|
// CONCATENATED MODULE: ./src/SelectBase/SelectBase.tsx
|
|
642
|
-
function
|
|
643
|
-
return
|
|
627
|
+
function Me(e) {
|
|
628
|
+
return De(e) || Te(e) || Ve(e) || qe();
|
|
644
629
|
}
|
|
645
|
-
function
|
|
630
|
+
function qe() {
|
|
646
631
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
647
632
|
}
|
|
648
|
-
function
|
|
633
|
+
function Te(e) {
|
|
649
634
|
if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"]) return Array.from(e);
|
|
650
635
|
}
|
|
651
|
-
function
|
|
652
|
-
if (Array.isArray(e)) return
|
|
636
|
+
function De(e) {
|
|
637
|
+
if (Array.isArray(e)) return Fe(e);
|
|
653
638
|
}
|
|
654
|
-
function
|
|
655
|
-
return
|
|
656
|
-
for (var
|
|
657
|
-
var t = arguments[
|
|
658
|
-
for (var
|
|
659
|
-
({}).hasOwnProperty.call(t,
|
|
639
|
+
function _e() {
|
|
640
|
+
return _e = Object.assign ? Object.assign.bind() : function(e) {
|
|
641
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
642
|
+
var t = arguments[r];
|
|
643
|
+
for (var n in t) {
|
|
644
|
+
({}).hasOwnProperty.call(t, n) && (e[n] = t[n]);
|
|
660
645
|
}
|
|
661
646
|
}
|
|
662
647
|
return e;
|
|
663
|
-
},
|
|
648
|
+
}, _e.apply(null, arguments);
|
|
664
649
|
}
|
|
665
|
-
function
|
|
666
|
-
return
|
|
650
|
+
function Be(e, r) {
|
|
651
|
+
return He(e) || Ke(e, r) || Ve(e, r) || Ne();
|
|
667
652
|
}
|
|
668
|
-
function
|
|
653
|
+
function Ne() {
|
|
669
654
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
670
655
|
}
|
|
671
|
-
function
|
|
656
|
+
function Ve(e, r) {
|
|
672
657
|
if (e) {
|
|
673
|
-
if ("string" == typeof e) return
|
|
658
|
+
if ("string" == typeof e) return Fe(e, r);
|
|
674
659
|
var t = {}.toString.call(e).slice(8, -1);
|
|
675
|
-
return "Object" === t && e.constructor && (t = e.constructor.name), "Map" === t || "Set" === t ? Array.from(e) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ?
|
|
660
|
+
return "Object" === t && e.constructor && (t = e.constructor.name), "Map" === t || "Set" === t ? Array.from(e) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? Fe(e, r) : void 0;
|
|
676
661
|
}
|
|
677
662
|
}
|
|
678
|
-
function
|
|
679
|
-
(null ==
|
|
680
|
-
for (var t = 0,
|
|
681
|
-
|
|
663
|
+
function Fe(e, r) {
|
|
664
|
+
(null == r || r > e.length) && (r = e.length);
|
|
665
|
+
for (var t = 0, n = Array(r); t < r; t++) {
|
|
666
|
+
n[t] = e[t];
|
|
682
667
|
}
|
|
683
|
-
return
|
|
668
|
+
return n;
|
|
684
669
|
}
|
|
685
|
-
function
|
|
670
|
+
function Ke(e, r) {
|
|
686
671
|
var t = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
|
|
687
672
|
if (null != t) {
|
|
688
|
-
var
|
|
673
|
+
var n, l, a, o, i = [], u = !0, c = !1;
|
|
689
674
|
try {
|
|
690
|
-
if (a = (t = t.call(e)).next, 0 ===
|
|
675
|
+
if (a = (t = t.call(e)).next, 0 === r) {
|
|
691
676
|
if (Object(t) !== t) return;
|
|
692
677
|
u = !1;
|
|
693
|
-
} else for (;!(u = (
|
|
678
|
+
} else for (;!(u = (n = a.call(t)).done) && (i.push(n.value), i.length !== r); u = !0) {
|
|
694
679
|
}
|
|
695
680
|
} catch (e) {
|
|
696
681
|
c = !0, l = e;
|
|
@@ -704,188 +689,192 @@
|
|
|
704
689
|
return i;
|
|
705
690
|
}
|
|
706
691
|
}
|
|
707
|
-
function
|
|
692
|
+
function He(e) {
|
|
708
693
|
if (Array.isArray(e)) return e;
|
|
709
694
|
}
|
|
710
|
-
function
|
|
695
|
+
function ze(e, r) {
|
|
711
696
|
if (null == e) return {};
|
|
712
|
-
var t,
|
|
697
|
+
var t, n, l = We(e, r);
|
|
713
698
|
if (Object.getOwnPropertySymbols) {
|
|
714
699
|
var a = Object.getOwnPropertySymbols(e);
|
|
715
|
-
for (
|
|
716
|
-
t = a[
|
|
700
|
+
for (n = 0; n < a.length; n++) {
|
|
701
|
+
t = a[n], -1 === r.indexOf(t) && {}.propertyIsEnumerable.call(e, t) && (l[t] = e[t]);
|
|
717
702
|
}
|
|
718
703
|
}
|
|
719
704
|
return l;
|
|
720
705
|
}
|
|
721
|
-
function
|
|
706
|
+
function We(e, r) {
|
|
722
707
|
if (null == e) return {};
|
|
723
708
|
var t = {};
|
|
724
|
-
for (var
|
|
725
|
-
if ({}.hasOwnProperty.call(e,
|
|
726
|
-
if (-1 !==
|
|
727
|
-
t[
|
|
709
|
+
for (var n in e) {
|
|
710
|
+
if ({}.hasOwnProperty.call(e, n)) {
|
|
711
|
+
if (-1 !== r.indexOf(n)) continue;
|
|
712
|
+
t[n] = e[n];
|
|
728
713
|
}
|
|
729
714
|
}
|
|
730
715
|
return t;
|
|
731
716
|
}
|
|
732
|
-
function
|
|
717
|
+
function $e(e) {
|
|
733
718
|
"@babel/helpers - typeof";
|
|
734
|
-
return
|
|
719
|
+
return $e = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
735
720
|
return typeof e;
|
|
736
721
|
} : function(e) {
|
|
737
722
|
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
738
|
-
},
|
|
723
|
+
}, $e(e);
|
|
739
724
|
}
|
|
740
|
-
function
|
|
725
|
+
function Xe(e, r) {
|
|
741
726
|
var t = Object.keys(e);
|
|
742
727
|
if (Object.getOwnPropertySymbols) {
|
|
743
|
-
var
|
|
744
|
-
|
|
745
|
-
return Object.getOwnPropertyDescriptor(e,
|
|
746
|
-
}))), t.push.apply(t,
|
|
728
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
729
|
+
r && (n = n.filter((function(r) {
|
|
730
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
731
|
+
}))), t.push.apply(t, n);
|
|
747
732
|
}
|
|
748
733
|
return t;
|
|
749
734
|
}
|
|
750
|
-
function
|
|
751
|
-
for (var
|
|
752
|
-
var t = null != arguments[
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) :
|
|
756
|
-
Object.defineProperty(e,
|
|
735
|
+
function Ue(e) {
|
|
736
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
737
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
738
|
+
r % 2 ? Xe(Object(t), !0).forEach((function(r) {
|
|
739
|
+
Je(e, r, t[r]);
|
|
740
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : Xe(Object(t)).forEach((function(r) {
|
|
741
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
757
742
|
}));
|
|
758
743
|
}
|
|
759
744
|
return e;
|
|
760
745
|
}
|
|
761
|
-
function
|
|
762
|
-
return (
|
|
746
|
+
function Je(e, r, t) {
|
|
747
|
+
return (r = Ge(r)) in e ? Object.defineProperty(e, r, {
|
|
763
748
|
value: t,
|
|
764
749
|
enumerable: !0,
|
|
765
750
|
configurable: !0,
|
|
766
751
|
writable: !0
|
|
767
|
-
}) : e[
|
|
752
|
+
}) : e[r] = t, e;
|
|
768
753
|
}
|
|
769
|
-
function
|
|
770
|
-
var
|
|
771
|
-
return "symbol" ==
|
|
754
|
+
function Ge(e) {
|
|
755
|
+
var r = Qe(e, "string");
|
|
756
|
+
return "symbol" == $e(r) ? r : r + "";
|
|
772
757
|
}
|
|
773
|
-
function
|
|
774
|
-
if ("object" !=
|
|
758
|
+
function Qe(e, r) {
|
|
759
|
+
if ("object" != $e(e) || !e) return e;
|
|
775
760
|
var t = e[Symbol.toPrimitive];
|
|
776
761
|
if (void 0 !== t) {
|
|
777
|
-
var
|
|
778
|
-
if ("object" !=
|
|
762
|
+
var n = t.call(e, r || "default");
|
|
763
|
+
if ("object" != $e(n)) return n;
|
|
779
764
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
780
765
|
}
|
|
781
|
-
return ("string" ===
|
|
766
|
+
return ("string" === r ? String : Number)(e);
|
|
782
767
|
}
|
|
783
|
-
var
|
|
784
|
-
allowKeyMatching:
|
|
785
|
-
allowNewValues:
|
|
786
|
-
animateLoading:
|
|
787
|
-
appearance:
|
|
788
|
-
append:
|
|
789
|
-
children:
|
|
790
|
-
defaultPlacement:
|
|
791
|
-
defaultValues:
|
|
792
|
-
describedBy:
|
|
793
|
-
disabled:
|
|
794
|
-
elementRef:
|
|
795
|
-
error:
|
|
796
|
-
filter:
|
|
797
|
-
footerMessage:
|
|
798
|
-
inline:
|
|
799
|
-
inputId:
|
|
800
|
-
inputRef:
|
|
801
|
-
isLoadingOptions:
|
|
802
|
-
labelledBy:
|
|
803
|
-
labelText:
|
|
804
|
-
loadingMessage:
|
|
805
|
-
menuStyle: w().object,
|
|
806
|
-
multiple: w().bool,
|
|
807
|
-
name: w().string,
|
|
808
|
-
noOptionsMessage: w().node,
|
|
809
|
-
onChange: w().func,
|
|
810
|
-
onClick: w().func,
|
|
811
|
-
onClose: w().func,
|
|
812
|
-
onFilterChange: w().func,
|
|
813
|
-
onOpen: w().func,
|
|
814
|
-
onScroll: w().func,
|
|
815
|
-
onScrollBottom: w().func,
|
|
768
|
+
var Ye = {
|
|
769
|
+
allowKeyMatching: p().bool,
|
|
770
|
+
allowNewValues: p().bool,
|
|
771
|
+
animateLoading: p().bool,
|
|
772
|
+
appearance: p().oneOf([ "default", "link", "subtle" ]),
|
|
773
|
+
append: p().bool,
|
|
774
|
+
children: p().node,
|
|
775
|
+
defaultPlacement: p().oneOf([ "above", "below", "vertical" ]),
|
|
776
|
+
defaultValues: p().array,
|
|
777
|
+
describedBy: p().string,
|
|
778
|
+
disabled: p().bool,
|
|
779
|
+
elementRef: p().oneOfType([ p().func, p().object ]),
|
|
780
|
+
error: p().bool,
|
|
781
|
+
filter: p().oneOf([ false, true, "controlled" ]),
|
|
782
|
+
footerMessage: p().node,
|
|
783
|
+
inline: p().bool,
|
|
784
|
+
inputId: p().string,
|
|
785
|
+
inputRef: p().oneOfType([ p().func, p().object ]),
|
|
786
|
+
isLoadingOptions: p().bool,
|
|
787
|
+
labelledBy: p().string,
|
|
788
|
+
labelText: p().string,
|
|
789
|
+
loadingMessage: p().node,
|
|
816
790
|
/** @private. */
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
791
|
+
maxLabelItems: p().number,
|
|
792
|
+
menuStyle: p().object,
|
|
793
|
+
multiple: p().bool,
|
|
794
|
+
name: p().string,
|
|
795
|
+
noOptionsMessage: p().node,
|
|
796
|
+
onChange: p().func,
|
|
797
|
+
onClick: p().func,
|
|
798
|
+
onClose: p().func,
|
|
799
|
+
onFilterChange: p().func,
|
|
800
|
+
onOpen: p().func,
|
|
801
|
+
onScroll: p().func,
|
|
802
|
+
onScrollBottom: p().func,
|
|
829
803
|
/** @private. */
|
|
830
|
-
|
|
804
|
+
required: p().bool,
|
|
805
|
+
placeholder: p().string,
|
|
806
|
+
prefixLabel: p().string,
|
|
807
|
+
prepend: p().bool,
|
|
808
|
+
repositionMode: p().oneOf([ "none", "flip" ]),
|
|
809
|
+
selectAllAppearance: p().oneOf([ "buttongroup", "checkbox", "none" ]),
|
|
810
|
+
showSelectedValuesFirst: p().oneOf([ "nextOpen", "immediately", "never" ]),
|
|
811
|
+
suffixLabel: p().string,
|
|
812
|
+
tabConfirmsNewValue: p().bool,
|
|
813
|
+
toggle: p().node,
|
|
814
|
+
toggleContent: p().oneOf([ "optionChildren", "optionLabel" ]),
|
|
815
|
+
values: p().array,
|
|
816
|
+
/** @private. */
|
|
817
|
+
virtualization: p().number
|
|
831
818
|
};
|
|
832
|
-
var
|
|
819
|
+
var Ze = c()((function(e) {
|
|
833
820
|
return [ e ];
|
|
834
821
|
}));
|
|
835
822
|
// preserve separate widths for single vs. multi mode
|
|
836
|
-
var
|
|
837
|
-
var
|
|
838
|
-
return t ?
|
|
839
|
-
width: Math.max(
|
|
840
|
-
maxHeight:
|
|
841
|
-
}, l) :
|
|
842
|
-
minWidth:
|
|
843
|
-
maxWidth: Math.max(
|
|
844
|
-
maxHeight:
|
|
823
|
+
var er = c()((function(e) {
|
|
824
|
+
var r = e.anchorWidth, t = e.isMultiple, n = e.maxHeight, l = e.menuStyle;
|
|
825
|
+
return t ? Ue({
|
|
826
|
+
width: Math.max(r !== null && r !== void 0 ? r : 0, 200),
|
|
827
|
+
maxHeight: n
|
|
828
|
+
}, l) : Ue({
|
|
829
|
+
minWidth: r !== null && r !== void 0 ? r : undefined,
|
|
830
|
+
maxWidth: Math.max(r !== null && r !== void 0 ? r : 0, 300),
|
|
831
|
+
maxHeight: n
|
|
845
832
|
}, l);
|
|
846
833
|
}));
|
|
847
|
-
var
|
|
848
|
-
function
|
|
849
|
-
return e &&
|
|
834
|
+
var rr = [ "clickAway", "escapeKey", "offScreen", "tabKey", "toggleClick" ];
|
|
835
|
+
function tr(e) {
|
|
836
|
+
return e && i()(e.props, "value");
|
|
850
837
|
}
|
|
851
|
-
function
|
|
852
|
-
return "".concat(
|
|
838
|
+
function nr(e, r) {
|
|
839
|
+
return "".concat($e(e), "-").concat(e, "-").concat(r);
|
|
853
840
|
}
|
|
854
|
-
var
|
|
855
|
-
var
|
|
856
|
-
var
|
|
857
|
-
var
|
|
858
|
-
var
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
var
|
|
841
|
+
var lr = [ "append", "error", "prepend" ];
|
|
842
|
+
var ar = (0, q._)("No matches");
|
|
843
|
+
var or = (0, q._)("Select...");
|
|
844
|
+
var ir = 30;
|
|
845
|
+
var ur = {};
|
|
846
|
+
var cr = n().createElement(y(), null);
|
|
847
|
+
var sr = function e(r) {
|
|
848
|
+
var t = r.activeItemId, l = r.filterA11yId, a = r.filterKeyword, o = r.hasChildren, i = r.inputId, u = r.inputRef, c = r.menuListboxId, s = r.multiple, f = r.onClearAll, d = r.onSelectAll, p = r.onTextBlur, v = r.onTextChange, b = r.onTextFocus, m = r.onTextKeyDown, y = r.optionSelection, g = r.placement, h = r.selectAllAppearance, S = r.textHasFocus;
|
|
849
|
+
var O = (0, q._)("Select all options".concat(y.current === "all" ? " disabled" : ""));
|
|
850
|
+
var w = (0, q._)("Clear all options".concat(y.current === "none" ? " disabled" : ""));
|
|
862
851
|
// only visually disable these as opposed to fully disabling to avoid losing keyboard focus - see SUI-2731
|
|
863
|
-
var
|
|
852
|
+
var C = n().createElement(Se, {
|
|
864
853
|
key: "selectAll"
|
|
865
|
-
},
|
|
854
|
+
}, n().createElement(he, {
|
|
866
855
|
disabled: y.current === "all",
|
|
867
856
|
appearance: "standalone",
|
|
868
|
-
"aria-label":
|
|
857
|
+
"aria-label": O,
|
|
869
858
|
onClick: d,
|
|
870
859
|
"data-test": "select-all",
|
|
871
860
|
tag: "button"
|
|
872
|
-
}, a ? (0,
|
|
861
|
+
}, a ? (0, q._)("Select all Matches") : (0, q._)("Select all")), n().createElement(he, {
|
|
873
862
|
disabled: y.current === "none",
|
|
874
863
|
appearance: "standalone",
|
|
875
|
-
"aria-label":
|
|
864
|
+
"aria-label": w,
|
|
876
865
|
onClick: f,
|
|
877
866
|
"data-test": "clear-all",
|
|
878
867
|
tag: "button"
|
|
879
|
-
}, a ? (0,
|
|
868
|
+
}, a ? (0, q._)("Clear all Matches") : (0, q._)("Clear all")));
|
|
880
869
|
|
|
881
|
-
return
|
|
870
|
+
return n().createElement("div", {
|
|
882
871
|
key: "controls"
|
|
883
|
-
}, l &&
|
|
872
|
+
}, l && n().createElement(j(), {
|
|
884
873
|
id: l
|
|
885
|
-
}, (0,
|
|
874
|
+
}, (0, q._)("Type to filter")), g === "above" && n().createElement(Oe, null), n().createElement(ye, {
|
|
886
875
|
key: "filter",
|
|
887
876
|
"data-test": "filter"
|
|
888
|
-
},
|
|
877
|
+
}, n().createElement(E(), {
|
|
889
878
|
value: a,
|
|
890
879
|
autoCapitalize: "off",
|
|
891
880
|
autoComplete: "off",
|
|
@@ -895,23 +884,23 @@
|
|
|
895
884
|
onKeyDown: m,
|
|
896
885
|
onFocus: b,
|
|
897
886
|
onBlur: p,
|
|
898
|
-
placeholder: (0,
|
|
887
|
+
placeholder: (0, q._)("Filter"),
|
|
899
888
|
role: "combobox",
|
|
900
889
|
"aria-expanded": "true",
|
|
901
890
|
"aria-controls": c,
|
|
902
|
-
"aria-owns":
|
|
903
|
-
"aria-label": (0,
|
|
891
|
+
"aria-owns": S && o ? t : undefined,
|
|
892
|
+
"aria-label": (0, q._)("Filter"),
|
|
904
893
|
"aria-autocomplete": "list",
|
|
905
|
-
"aria-activedescendant":
|
|
894
|
+
"aria-activedescendant": S && o ? t : undefined,
|
|
906
895
|
inputRef: u,
|
|
907
896
|
inputId: i,
|
|
908
897
|
canClear: true,
|
|
909
|
-
startAdornment:
|
|
910
|
-
})), s && o && h === "buttongroup" &&
|
|
898
|
+
startAdornment: cr
|
|
899
|
+
})), s && o && h === "buttongroup" && C, g === "below" && n().createElement(Oe, null));
|
|
911
900
|
};
|
|
912
|
-
var
|
|
913
|
-
var t =
|
|
914
|
-
var o =
|
|
901
|
+
var fr = function e(r) {
|
|
902
|
+
var t = r.prefixLabel, n = r.label, l = r.suffixLabel;
|
|
903
|
+
var o = n;
|
|
915
904
|
if (t) {
|
|
916
905
|
o = [ "".concat(t, ": ") ].concat(o);
|
|
917
906
|
}
|
|
@@ -920,117 +909,141 @@
|
|
|
920
909
|
}
|
|
921
910
|
return o;
|
|
922
911
|
};
|
|
923
|
-
var
|
|
924
|
-
|
|
925
|
-
var
|
|
926
|
-
var
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
912
|
+
var dr = [];
|
|
913
|
+
var pr = n().forwardRef((function(e, r) {
|
|
914
|
+
var l = e.appearance, a = l === void 0 ? "default" : l, o = e.append, i = e.children, u = e.currentValues, c = u === void 0 ? dr : u, s = e.describedBy, d = e.disabled, p = e.elementRef, v = e.error, m = e.inline, y = e.labelText, g = e.labelledBy, h = e.multiple, S = e.onClick, w = e.placeholder, C = e.prefixLabel, k = e.prepend, x = e.required, j = e.suffixLabel, P = e.toggle, E = e.toggleContent, A = e.maxLabelItems, L = A === void 0 ? ir : A, I = ze(e, [ "appearance", "append", "children", "currentValues", "describedBy", "disabled", "elementRef", "error", "inline", "labelText", "labelledBy", "multiple", "onClick", "placeholder", "prefixLabel", "prepend", "required", "suffixLabel", "toggle", "toggleContent", "maxLabelItems" ]);
|
|
915
|
+
var R = (0, t.useMemo)((function() {
|
|
916
|
+
var e = t.Children.toArray(i);
|
|
917
|
+
var r = new Map;
|
|
918
|
+
for (var n = 0; n < e.length; n += 1) {
|
|
919
|
+
var l = e[n];
|
|
920
|
+
if (tr(l)) {
|
|
921
|
+
r.set(l.props.value, l);
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
return r;
|
|
925
|
+
}), [ i ]);
|
|
926
|
+
var M = (0, t.useMemo)((function() {
|
|
927
|
+
var e = {
|
|
928
|
+
icon: null,
|
|
929
|
+
label: [],
|
|
930
|
+
ariaLabel: []
|
|
931
|
+
};
|
|
932
|
+
var r = h && c.length > L ? Math.max(1, L) : c.length;
|
|
933
|
+
for (var t = 0; t < r; t += 1) {
|
|
934
|
+
var n = c[t];
|
|
935
|
+
var l = R.get(n);
|
|
936
|
+
if (l) {
|
|
937
|
+
var a = l.props, o = a.children, i = a.icon, u = a.label;
|
|
938
|
+
var s = E !== "optionLabel" && o ? o : u;
|
|
939
|
+
e.label.push(s);
|
|
940
|
+
e.ariaLabel.push(u);
|
|
941
|
+
// if not in multiple mode, add the icon
|
|
942
|
+
if (!h && c.length === 1) {
|
|
943
|
+
e.icon = i;
|
|
944
|
+
}
|
|
945
|
+
} else if (h) {
|
|
946
|
+
// only add values that don't match an option in "multiple" mode to preserve old behaviour
|
|
947
|
+
e.label.push(n);
|
|
948
|
+
e.ariaLabel.push(n.toString());
|
|
942
949
|
}
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
950
|
+
if (t < r - 1) {
|
|
951
|
+
e.label.push((0, q._)(", "));
|
|
952
|
+
e.ariaLabel.push((0, q._)(", "));
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
if (h && c.length > r && e.label.length) {
|
|
956
|
+
// add visual ellipsis to ensure truncation is shown
|
|
957
|
+
e.label.push((0, q._)("..."));
|
|
958
|
+
}
|
|
959
|
+
// only apply prefix / suffix if the label is not empty
|
|
960
|
+
if (e.label.length > 0) {
|
|
961
|
+
// If there's more than one item selected, read out the selected total
|
|
962
|
+
// rather than reading out each selected item
|
|
963
|
+
e.ariaLabel = fr({
|
|
964
|
+
prefixLabel: C,
|
|
965
|
+
label: e.label.length > 1 ? [ "".concat(c.length, " items selected") ] : e.ariaLabel,
|
|
966
|
+
suffixLabel: j
|
|
967
|
+
});
|
|
968
|
+
e.label = fr({
|
|
969
|
+
prefixLabel: C,
|
|
970
|
+
label: e.label,
|
|
971
|
+
suffixLabel: j
|
|
972
|
+
});
|
|
947
973
|
}
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
974
|
+
// single <Select> behaviour is to show the placeholder if all parts of the label
|
|
975
|
+
// are empty strings so we replicate this behaviour here
|
|
976
|
+
if (!e.label.length || !h && e.label.every((function(e) {
|
|
977
|
+
return e === "";
|
|
978
|
+
}))) {
|
|
979
|
+
e.label = Ze(w);
|
|
980
|
+
e.ariaLabel = e.label;
|
|
951
981
|
}
|
|
952
982
|
return e;
|
|
953
|
-
}), []);
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
// rather than reading out each selected item
|
|
959
|
-
T = On({
|
|
960
|
-
prefixLabel: C,
|
|
961
|
-
label: I.length > 1 ? [ "".concat(s.length, " items selected") ] : T,
|
|
962
|
-
suffixLabel: j
|
|
963
|
-
});
|
|
964
|
-
I = On({
|
|
965
|
-
prefixLabel: C,
|
|
966
|
-
label: I,
|
|
967
|
-
suffixLabel: j
|
|
968
|
-
});
|
|
969
|
-
}
|
|
970
|
-
// single <Select> behaviour is to show the placeholder if all parts of the label
|
|
971
|
-
// are empty strings so we replicate this behaviour here
|
|
972
|
-
if (I.length === 0 || !h && I.every((function(e) {
|
|
973
|
-
return e === "";
|
|
974
|
-
}))) {
|
|
975
|
-
I = sn(S);
|
|
976
|
-
T = I;
|
|
977
|
-
}
|
|
978
|
-
var M = Object.keys(A).includes("aria-labelledby");
|
|
979
|
-
var _ = ln({
|
|
980
|
-
"aria-describedby": f,
|
|
981
|
-
"aria-label": g || M ? undefined : "".concat(m ? "".concat(m, ", ") : "").concat(T.join("")),
|
|
983
|
+
}), [ c, L, h, R, w, C, j, E ]), T = M.label, D = M.ariaLabel, _ = M.icon;
|
|
984
|
+
var B = "aria-labelledby" in I;
|
|
985
|
+
var N = Ue({
|
|
986
|
+
"aria-describedby": s,
|
|
987
|
+
"aria-label": g || B ? undefined : "".concat(y ? "".concat(y, ", ") : "").concat(D.join("")),
|
|
982
988
|
// aria-labelledby takes precedence over aria-label, so existence of both is redundant
|
|
983
989
|
"aria-labelledby": g,
|
|
984
|
-
"aria-required":
|
|
990
|
+
"aria-required": x,
|
|
985
991
|
"data-select-appearance": a,
|
|
986
992
|
append: o,
|
|
987
|
-
prepend:
|
|
988
|
-
onClick:
|
|
993
|
+
prepend: k,
|
|
994
|
+
onClick: S,
|
|
989
995
|
role: "combobox",
|
|
990
996
|
disabled: d ? "disabled" : undefined,
|
|
991
997
|
elementRef: p,
|
|
992
998
|
error: v,
|
|
993
|
-
ref:
|
|
994
|
-
},
|
|
999
|
+
ref: r
|
|
1000
|
+
}, I);
|
|
995
1001
|
if (h) {
|
|
996
|
-
|
|
1002
|
+
N["data-test-values"] = JSON.stringify(c);
|
|
997
1003
|
} else {
|
|
998
|
-
var
|
|
999
|
-
|
|
1004
|
+
var V = Be(c, 1), F = V[0];
|
|
1005
|
+
N["data-test-value"] = F;
|
|
1000
1006
|
}
|
|
1001
1007
|
if (P) {
|
|
1002
1008
|
|
|
1003
|
-
return (0, t.cloneElement)(P,
|
|
1009
|
+
return (0, t.cloneElement)(P, N);
|
|
1004
1010
|
}
|
|
1005
1011
|
if (a === "link") {
|
|
1006
1012
|
|
|
1007
|
-
return
|
|
1013
|
+
return n().createElement(O(), _e({
|
|
1008
1014
|
tag: "button",
|
|
1009
1015
|
appearance: "standalone"
|
|
1010
|
-
},
|
|
1016
|
+
}, N, {
|
|
1011
1017
|
"data-select-appearance": "link"
|
|
1012
|
-
}), !!
|
|
1018
|
+
}), !!_ && n().createElement(be, null, _), T || w, n().createElement(me, null, n().createElement(b(), null)));
|
|
1013
1019
|
}
|
|
1014
1020
|
// Using Button's secondary appearance as Select's default appearance.
|
|
1015
|
-
var
|
|
1021
|
+
var K = a === "default" ? "secondary" : a;
|
|
1016
1022
|
|
|
1017
|
-
return
|
|
1023
|
+
return n().createElement(ve, _e({}, N, {
|
|
1018
1024
|
$multiple: h,
|
|
1019
|
-
appearance:
|
|
1020
|
-
label:
|
|
1025
|
+
appearance: K,
|
|
1026
|
+
label: T,
|
|
1021
1027
|
error: v,
|
|
1022
|
-
icon:
|
|
1023
|
-
inline:
|
|
1028
|
+
icon: _,
|
|
1029
|
+
inline: m,
|
|
1024
1030
|
isMenu: true,
|
|
1025
|
-
onClick:
|
|
1026
|
-
},
|
|
1031
|
+
onClick: S
|
|
1032
|
+
}, f()(I, lr)), !!c.length && h && n().createElement(ge, {
|
|
1027
1033
|
"data-role": "count"
|
|
1028
|
-
}, "(",
|
|
1034
|
+
}, "(", c.length, ")"));
|
|
1029
1035
|
}));
|
|
1030
|
-
function
|
|
1031
|
-
var
|
|
1036
|
+
function vr(e) {
|
|
1037
|
+
var r = e.currentValues, t = e.multiple;
|
|
1038
|
+
if (t || !(r === null || r === void 0 ? void 0 : r.length)) {
|
|
1039
|
+
return r !== null && r !== void 0 ? r : [];
|
|
1040
|
+
}
|
|
1041
|
+
return [ r[0] ];
|
|
1042
|
+
}
|
|
1043
|
+
function br(e) {
|
|
1044
|
+
var r = e.allowKeyMatching, l = r === void 0 ? true : r, a = e.animateLoading, o = e.appearance, i = o === void 0 ? "default" : o, u = e.append, c = e.allowNewValues, s = e.children, f = e.defaultPlacement, d = f === void 0 ? "vertical" : f, p = e.defaultValues, v = e.describedBy, b = e.disabled, m = e.elementRef, y = e.error, g = e.filter, S = e.footerMessage, O = e.inline, x = e.inputId, j = e.inputRef, P = e.isLoadingOptions, E = e.labelledBy, A = e.labelText, I = e.loadingMessage, _ = e.menuStyle, B = _ === void 0 ? ur : _, N = e.multiple, V = e.name, F = e.noOptionsMessage, K = F === void 0 ? ar : F, H = e.onChange, z = e.onScroll, W = e.onScrollBottom, $ = e.onFilterChange, X = e.onClick, J = e.onClose, G = e.onOpen, Q = e.required, Y = e.placeholder, Z = Y === void 0 ? or : Y, ee = e.prefixLabel, re = e.prepend, te = e.repositionMode, ne = te === void 0 ? "flip" : te, le = e.selectAllAppearance, ae = le === void 0 ? "buttongroup" : le, ie = e.showSelectedValuesFirst, ue = e.suffixLabel, ce = e.tabConfirmsNewValue, se = e.values, fe = e.virtualization, de = e.toggle, pe = e.toggleContent, ve = pe === void 0 ? "optionChildren" : pe, be = e.maxLabelItems, me = be === void 0 ? ir : be, ye = ze(e, [ "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", "maxLabelItems" ]);
|
|
1032
1045
|
// @docs-props-type SelectBasePropsBase
|
|
1033
|
-
var
|
|
1046
|
+
var ge = L()({
|
|
1034
1047
|
componentName: "SelectBase",
|
|
1035
1048
|
/* eslint-disable-next-line prefer-rest-params */
|
|
1036
1049
|
componentProps: arguments[0],
|
|
@@ -1039,643 +1052,663 @@
|
|
|
1039
1052
|
valuePropName: "values"
|
|
1040
1053
|
});
|
|
1041
1054
|
// states
|
|
1042
|
-
var
|
|
1055
|
+
var he = (0, t.useState)((function() {
|
|
1043
1056
|
return {
|
|
1044
|
-
activeItemId: (0,
|
|
1045
|
-
menuListboxId: (0,
|
|
1057
|
+
activeItemId: (0, T.createDOMID)("active-item"),
|
|
1058
|
+
menuListboxId: (0, T.createDOMID)("menu-listbox")
|
|
1046
1059
|
};
|
|
1047
|
-
})),
|
|
1048
|
-
var
|
|
1049
|
-
var
|
|
1050
|
-
var
|
|
1051
|
-
var
|
|
1052
|
-
var
|
|
1053
|
-
var
|
|
1060
|
+
})), Se = Be(he, 1), Oe = Se[0], we = Oe.activeItemId, ke = Oe.menuListboxId;
|
|
1061
|
+
var xe = (0, t.useState)(0), je = Be(xe, 2), Pe = je[0], Ee = je[1];
|
|
1062
|
+
var Le = (0, t.useState)(""), Ie = Be(Le, 2), qe = Ie[0], Te = Ie[1];
|
|
1063
|
+
var De = (0, t.useState)(false), Ne = Be(De, 2), Ve = Ne[0], Fe = Ne[1];
|
|
1064
|
+
var Ke = (0, t.useState)(false), He = Be(Ke, 2), We = He[0], $e = He[1];
|
|
1065
|
+
var Xe = (0, t.useState)([]), Ue = Be(Xe, 2), Je = Ue[0], Ge = Ue[1];
|
|
1066
|
+
var Qe = (0, t.useState)(p || []), Ye = Be(Qe, 2), Ze = Ye[0], lr = Ye[1];
|
|
1054
1067
|
// previous state
|
|
1055
|
-
var
|
|
1068
|
+
var cr = R()(Pe);
|
|
1056
1069
|
// refs
|
|
1057
|
-
var
|
|
1058
|
-
var
|
|
1059
|
-
var
|
|
1060
|
-
var
|
|
1061
|
-
var
|
|
1062
|
-
var
|
|
1063
|
-
var
|
|
1064
|
-
var
|
|
1065
|
-
var
|
|
1066
|
-
var
|
|
1067
|
-
var
|
|
1068
|
-
var
|
|
1069
|
-
var
|
|
1070
|
-
var
|
|
1071
|
-
var
|
|
1070
|
+
var fr = (0, t.useRef)(null);
|
|
1071
|
+
var dr = (0, t.useRef)(null);
|
|
1072
|
+
var br = (0, t.useRef)(null);
|
|
1073
|
+
var mr = (0, t.useRef)([]);
|
|
1074
|
+
var yr = (0, t.useRef)([]);
|
|
1075
|
+
var gr = (0, t.useRef)(cr);
|
|
1076
|
+
var hr = (0, t.useRef)();
|
|
1077
|
+
var Sr = (0, t.useRef)({});
|
|
1078
|
+
var Or = (0, t.useRef)(0);
|
|
1079
|
+
var wr = (0, t.useRef)([]);
|
|
1080
|
+
var Cr = (0, t.useRef)(null);
|
|
1081
|
+
var kr = (0, t.useRef)();
|
|
1082
|
+
var xr = (0, t.useRef)(0);
|
|
1083
|
+
var jr = (0, t.useRef)("none");
|
|
1084
|
+
var Pr = (0, t.useState)(g ? (0, T.createDOMID)("filter") : undefined), Er = Be(Pr, 1), Ar = Er[0];
|
|
1072
1085
|
(0, t.useEffect)((function() {
|
|
1073
1086
|
if (false) {}
|
|
1074
|
-
}), [
|
|
1075
|
-
var
|
|
1076
|
-
var e =
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1087
|
+
}), [ i, u, y, re ]);
|
|
1088
|
+
var Lr = (0, t.useMemo)((function() {
|
|
1089
|
+
var e = n().Children.toArray(s);
|
|
1090
|
+
var r = new Map;
|
|
1091
|
+
for (var t = 0; t < e.length; t += 1) {
|
|
1092
|
+
var l = e[t];
|
|
1093
|
+
if (tr(l)) {
|
|
1094
|
+
r.set(l.props.value, l);
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
return [ e, r ];
|
|
1098
|
+
}), [ s ]), Ir = Be(Lr, 2), Rr = Ir[0], Mr = Ir[1];
|
|
1099
|
+
var qr = vr({
|
|
1100
|
+
currentValues: ge ? se : Ze,
|
|
1101
|
+
multiple: N
|
|
1102
|
+
});
|
|
1103
|
+
// mutable object reference to currentValues to permit idempotent callbacks
|
|
1104
|
+
var Tr = (0, t.useRef)(null);
|
|
1105
|
+
Tr.current = qr;
|
|
1106
|
+
var Dr = (0, t.useCallback)((function() {
|
|
1081
1107
|
// in non-multiple mode, don't move values to the top of the list
|
|
1082
|
-
|
|
1083
|
-
}), [
|
|
1084
|
-
var
|
|
1085
|
-
var
|
|
1086
|
-
|
|
1087
|
-
|
|
1108
|
+
return N && ie !== "never" ? Tr.current : [];
|
|
1109
|
+
}), [ N, ie ]);
|
|
1110
|
+
var _r = (0, t.useCallback)((function(e) {
|
|
1111
|
+
var r = qe;
|
|
1112
|
+
Fe(true);
|
|
1113
|
+
Ge(Dr());
|
|
1088
1114
|
// SUI-3234: preserve existing behavior difference between <Select> and <Multiselect.Compact>
|
|
1089
|
-
if (
|
|
1090
|
-
|
|
1115
|
+
if (N) {
|
|
1116
|
+
Te("");
|
|
1091
1117
|
}
|
|
1092
|
-
if (
|
|
1093
|
-
|
|
1094
|
-
keyword:
|
|
1118
|
+
if (r !== qe) {
|
|
1119
|
+
$ === null || $ === void 0 ? void 0 : $(e, {
|
|
1120
|
+
keyword: qe
|
|
1095
1121
|
});
|
|
1096
1122
|
}
|
|
1097
|
-
}), [
|
|
1123
|
+
}), [ qe, Dr, N, $ ]);
|
|
1098
1124
|
(0, t.useEffect)((function() {
|
|
1099
|
-
if (
|
|
1100
|
-
|
|
1101
|
-
if (
|
|
1102
|
-
|
|
1125
|
+
if (Ve) {
|
|
1126
|
+
G === null || G === void 0 ? void 0 : G();
|
|
1127
|
+
if (Cr.current && !g) {
|
|
1128
|
+
Cr.current.focus();
|
|
1103
1129
|
} else {
|
|
1104
1130
|
var e;
|
|
1105
|
-
|
|
1131
|
+
Ee((e = kr.current) !== null && e !== void 0 ? e : 0);
|
|
1106
1132
|
}
|
|
1107
1133
|
}
|
|
1108
|
-
}), [
|
|
1109
|
-
var
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
}), [
|
|
1115
|
-
var
|
|
1116
|
-
var t;
|
|
1117
|
-
var
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
if (l >= 0) {
|
|
1122
|
-
a = [].concat(He(r.slice(0, l)), He(r.slice(l + 1)));
|
|
1134
|
+
}), [ G, Ve, Je, qe, g ]);
|
|
1135
|
+
var Br = (0, t.useCallback)((function() {
|
|
1136
|
+
Fe(false);
|
|
1137
|
+
Ee(0);
|
|
1138
|
+
gr.current = null;
|
|
1139
|
+
J === null || J === void 0 ? void 0 : J();
|
|
1140
|
+
}), [ J ]);
|
|
1141
|
+
var Nr = (0, t.useCallback)((function(e, r) {
|
|
1142
|
+
var t = new Set(Tr.current);
|
|
1143
|
+
var n;
|
|
1144
|
+
if (N) {
|
|
1145
|
+
if (t.has(r)) {
|
|
1146
|
+
t["delete"](r);
|
|
1123
1147
|
} else {
|
|
1124
|
-
|
|
1148
|
+
t.add(r);
|
|
1125
1149
|
}
|
|
1150
|
+
n = Array.from(t);
|
|
1126
1151
|
} else {
|
|
1127
1152
|
// non-multiple mode must always have a value
|
|
1128
|
-
|
|
1153
|
+
n = [ r ];
|
|
1129
1154
|
}
|
|
1130
|
-
var
|
|
1131
|
-
if (
|
|
1132
|
-
|
|
1155
|
+
var l = !ge;
|
|
1156
|
+
if (l) {
|
|
1157
|
+
lr(n);
|
|
1133
1158
|
}
|
|
1134
|
-
if (
|
|
1159
|
+
if (N) {
|
|
1135
1160
|
// in uncontrolled multiple mode, keep the menu open
|
|
1136
|
-
if (
|
|
1137
|
-
|
|
1161
|
+
if (l) {
|
|
1162
|
+
Fe(true);
|
|
1138
1163
|
}
|
|
1139
1164
|
} else {
|
|
1140
|
-
var
|
|
1165
|
+
var a;
|
|
1141
1166
|
// non-multiple mode only supports a single selection
|
|
1142
1167
|
// so close the menu once a selection is made
|
|
1143
|
-
|
|
1168
|
+
Br({
|
|
1144
1169
|
reason: "contentClick"
|
|
1145
1170
|
});
|
|
1146
|
-
(
|
|
1171
|
+
(a = fr.current) === null || a === void 0 ? void 0 : a.focus();
|
|
1147
1172
|
}
|
|
1148
|
-
|
|
1149
|
-
values:
|
|
1150
|
-
name:
|
|
1173
|
+
H === null || H === void 0 ? void 0 : H(e, {
|
|
1174
|
+
values: n,
|
|
1175
|
+
name: V,
|
|
1151
1176
|
reason: "valueToggle"
|
|
1152
1177
|
});
|
|
1153
|
-
}), [
|
|
1154
|
-
var
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
if (
|
|
1158
|
-
clearTimeout(
|
|
1178
|
+
}), [ Br, ge, N, V, H ]);
|
|
1179
|
+
var Vr = function e() {
|
|
1180
|
+
dr.current = null;
|
|
1181
|
+
mr.current = [];
|
|
1182
|
+
if (br.current) {
|
|
1183
|
+
clearTimeout(br.current);
|
|
1159
1184
|
}
|
|
1160
1185
|
};
|
|
1161
|
-
var
|
|
1162
|
-
var n;
|
|
1186
|
+
var Fr = (0, t.useCallback)((function(e) {
|
|
1163
1187
|
// this doesn't make sense if we can't select multiple values
|
|
1164
|
-
|
|
1188
|
+
if (!N) {
|
|
1165
1189
|
return;
|
|
1166
1190
|
}
|
|
1167
|
-
var
|
|
1168
|
-
var
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1191
|
+
var r = Tr.current;
|
|
1192
|
+
var t = new Set(r);
|
|
1193
|
+
var n = new Set([].concat(Me(r), Me(wr.current)));
|
|
1194
|
+
// to keep track of custom values we create a copy of selected values and remove
|
|
1195
|
+
// items as they are accounted for in children, leaving only custom values
|
|
1196
|
+
var l = new Set(n);
|
|
1197
|
+
var a = new Set;
|
|
1198
|
+
Rr.forEach((function(e) {
|
|
1199
|
+
if (tr(e)) {
|
|
1200
|
+
// this value is being represented in children so it is not custom
|
|
1201
|
+
l["delete"](e.props.value);
|
|
1202
|
+
}
|
|
1203
|
+
if (tr(e) && n.has(e.props.value) && (!e.props.disabled || t.has(e.props.value))) {
|
|
1204
|
+
a.add(e.props.value);
|
|
1205
|
+
}
|
|
1173
1206
|
}));
|
|
1174
|
-
|
|
1175
|
-
|
|
1207
|
+
var o = [].concat(Me(Array.from(l)), Me(Array.from(a)));
|
|
1208
|
+
if (!ge) {
|
|
1209
|
+
lr(o);
|
|
1176
1210
|
}
|
|
1177
|
-
|
|
1178
|
-
values:
|
|
1179
|
-
name:
|
|
1211
|
+
H === null || H === void 0 ? void 0 : H(e, {
|
|
1212
|
+
values: o,
|
|
1213
|
+
name: V,
|
|
1180
1214
|
reason: "selectAll"
|
|
1181
1215
|
});
|
|
1182
|
-
}), [
|
|
1183
|
-
var
|
|
1184
|
-
var n;
|
|
1216
|
+
}), [ Rr, ge, N, V, H ]);
|
|
1217
|
+
var Kr = (0, t.useCallback)((function(e) {
|
|
1185
1218
|
// this doesn't make sense if we can't select multiple values
|
|
1186
|
-
|
|
1219
|
+
if (!N) {
|
|
1187
1220
|
return;
|
|
1188
1221
|
}
|
|
1189
|
-
var
|
|
1190
|
-
var
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
return pn(e) && (p()(t, e.props.value) && e.props.disabled || p()(l, e.props.value));
|
|
1194
|
-
})).map((function(e) {
|
|
1195
|
-
return e.props.value;
|
|
1196
|
-
}));
|
|
1197
|
-
if (!Se) {
|
|
1198
|
-
rn(a);
|
|
1222
|
+
var r = new Set(Tr.current);
|
|
1223
|
+
var t = new Set(Tr.current);
|
|
1224
|
+
for (var n = 0; n < wr.current.length; n += 1) {
|
|
1225
|
+
t["delete"](wr.current[n]);
|
|
1199
1226
|
}
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1227
|
+
var l = new Set;
|
|
1228
|
+
for (var a = 0; a < Rr.length; a += 1) {
|
|
1229
|
+
var o = Rr[a];
|
|
1230
|
+
// this will unselect all selected values unless those values are disabled or hidden by the filter
|
|
1231
|
+
if (tr(o) && (r.has(o.props.value) && o.props.disabled || t.has(o.props.value))) {
|
|
1232
|
+
l.add(o.props.value);
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1235
|
+
var i = Array.from(l);
|
|
1236
|
+
if (!ge) {
|
|
1237
|
+
lr(i);
|
|
1238
|
+
}
|
|
1239
|
+
H === null || H === void 0 ? void 0 : H(e, {
|
|
1240
|
+
values: i,
|
|
1241
|
+
name: V,
|
|
1203
1242
|
reason: "clearAll"
|
|
1204
1243
|
});
|
|
1205
|
-
}), [
|
|
1206
|
-
var
|
|
1207
|
-
if (
|
|
1208
|
-
|
|
1244
|
+
}), [ Rr, ge, N, V, H ]);
|
|
1245
|
+
var Hr = (0, t.useCallback)((function(e) {
|
|
1246
|
+
if (Ve && !P) {
|
|
1247
|
+
W === null || W === void 0 ? void 0 : W(e);
|
|
1209
1248
|
}
|
|
1210
|
-
}), [
|
|
1211
|
-
var
|
|
1212
|
-
var
|
|
1213
|
-
if (
|
|
1214
|
-
if (
|
|
1249
|
+
}), [ Ve, P, W ]);
|
|
1250
|
+
var zr = (0, t.useCallback)((function(e) {
|
|
1251
|
+
var r = e.key;
|
|
1252
|
+
if (r === "Tab") {
|
|
1253
|
+
if (ce && hr.current && Or.current <= 1) {
|
|
1215
1254
|
e.preventDefault();
|
|
1216
|
-
|
|
1255
|
+
Nr(e, hr.current);
|
|
1217
1256
|
}
|
|
1218
1257
|
}
|
|
1219
1258
|
if (e.shiftKey || e.metaKey || e.ctrlKey) {
|
|
1220
|
-
if (
|
|
1259
|
+
if (r === "a" && (e.ctrlKey || e.metaKey)) {
|
|
1221
1260
|
// handle control + A
|
|
1222
|
-
if (
|
|
1223
|
-
|
|
1261
|
+
if (jr.current === "all") {
|
|
1262
|
+
Kr(e);
|
|
1224
1263
|
} else {
|
|
1225
|
-
|
|
1264
|
+
Fr(e);
|
|
1226
1265
|
}
|
|
1227
1266
|
}
|
|
1228
1267
|
return;
|
|
1229
1268
|
}
|
|
1230
|
-
if (
|
|
1269
|
+
if (r === "ArrowDown") {
|
|
1231
1270
|
e.preventDefault();
|
|
1232
|
-
|
|
1233
|
-
if (
|
|
1234
|
-
var
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
Nn(e);
|
|
1271
|
+
Ee(Math.min(Pe + 1, ae === "checkbox" ? Or.current : Or.current - 1));
|
|
1272
|
+
if (s && W) {
|
|
1273
|
+
var n = t.Children.toArray(s).length - (2 + Tr.current.length);
|
|
1274
|
+
if (Pe === n) {
|
|
1275
|
+
Hr(e);
|
|
1238
1276
|
}
|
|
1239
1277
|
}
|
|
1240
1278
|
}
|
|
1241
|
-
if (
|
|
1279
|
+
if (r === "ArrowUp") {
|
|
1242
1280
|
e.preventDefault();
|
|
1243
|
-
|
|
1281
|
+
Ee(Math.max(Pe - 1, 0));
|
|
1244
1282
|
}
|
|
1245
|
-
if (
|
|
1246
|
-
if (
|
|
1247
|
-
if (
|
|
1248
|
-
|
|
1283
|
+
if (r === "Enter" && hr.current && Ve) {
|
|
1284
|
+
if (hr.current === "selectAll") {
|
|
1285
|
+
if (jr.current === "all") {
|
|
1286
|
+
Kr(e);
|
|
1249
1287
|
} else {
|
|
1250
|
-
|
|
1288
|
+
Fr(e);
|
|
1251
1289
|
}
|
|
1252
1290
|
} else {
|
|
1253
1291
|
e.preventDefault();
|
|
1254
|
-
|
|
1292
|
+
Nr(e, hr.current);
|
|
1255
1293
|
}
|
|
1256
1294
|
}
|
|
1257
|
-
}), [
|
|
1258
|
-
var
|
|
1259
|
-
var t =
|
|
1295
|
+
}), [ Pe, s, Kr, Hr, Fr, W, Ve, ae, ce, Nr ]);
|
|
1296
|
+
var Wr = (0, t.useCallback)((function(e, r) {
|
|
1297
|
+
var t = r.value;
|
|
1260
1298
|
e.preventDefault();
|
|
1261
|
-
if (!
|
|
1299
|
+
if (!Ve) {
|
|
1262
1300
|
return;
|
|
1263
1301
|
}
|
|
1264
|
-
|
|
1265
|
-
}), [
|
|
1266
|
-
var
|
|
1302
|
+
Nr(e, t);
|
|
1303
|
+
}), [ Ve, Nr ]);
|
|
1304
|
+
var $r = (0, t.useCallback)((function(e, r) {
|
|
1267
1305
|
var t = e.nativeEvent.key;
|
|
1268
1306
|
// Checking for a single character to avoid complications from double-byte languages and emojis.
|
|
1269
1307
|
if (t.length === 1) {
|
|
1270
|
-
var
|
|
1308
|
+
var n = [];
|
|
1271
1309
|
var l = {
|
|
1272
1310
|
index: 0,
|
|
1273
1311
|
value: t
|
|
1274
1312
|
};
|
|
1275
|
-
if (!
|
|
1313
|
+
if (!dr.current) {
|
|
1276
1314
|
if (t === " ") {
|
|
1277
|
-
|
|
1315
|
+
Vr();
|
|
1278
1316
|
return;
|
|
1279
1317
|
}
|
|
1280
|
-
|
|
1281
|
-
} else if (
|
|
1282
|
-
l.index =
|
|
1283
|
-
|
|
1318
|
+
n = Ce(yr.current, l);
|
|
1319
|
+
} else if (mr.current.length > 1) {
|
|
1320
|
+
l.index = dr.current.index + 1;
|
|
1321
|
+
n = Ce(mr.current, l);
|
|
1284
1322
|
}
|
|
1285
|
-
if (
|
|
1323
|
+
if (n.length) {
|
|
1286
1324
|
var a;
|
|
1287
1325
|
var o = 0;
|
|
1288
1326
|
// If the active option is a first character match, cycle to the next matching option.
|
|
1289
|
-
if (l.index === 0 &&
|
|
1290
|
-
var i =
|
|
1327
|
+
if (l.index === 0 && n.length > 1) {
|
|
1328
|
+
var i = n.indexOf(yr.current[r]);
|
|
1291
1329
|
if (i >= 0) {
|
|
1292
|
-
o = i ===
|
|
1330
|
+
o = i === n.length - 1 ? 0 : i + 1;
|
|
1293
1331
|
}
|
|
1294
1332
|
}
|
|
1295
|
-
var u =
|
|
1333
|
+
var u = n[o];
|
|
1296
1334
|
var c = u.value, s = u.label;
|
|
1297
|
-
var f =
|
|
1335
|
+
var f = Sr.current[nr(c, s)];
|
|
1298
1336
|
f === null || f === void 0 ? void 0 : (a = f.focus) === null || a === void 0 ? void 0 : a.call(f);
|
|
1299
1337
|
}
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
if (
|
|
1303
|
-
clearTimeout(
|
|
1338
|
+
mr.current = n;
|
|
1339
|
+
dr.current = l;
|
|
1340
|
+
if (br.current) {
|
|
1341
|
+
clearTimeout(br.current);
|
|
1304
1342
|
}
|
|
1305
|
-
|
|
1343
|
+
br.current = setTimeout(Vr, 500);
|
|
1306
1344
|
e.preventDefault();
|
|
1307
1345
|
e.stopPropagation();
|
|
1308
1346
|
}
|
|
1309
1347
|
}), []);
|
|
1310
|
-
var
|
|
1311
|
-
var t =
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1348
|
+
var Xr = (0, t.useCallback)((function(e, r) {
|
|
1349
|
+
var t = r.value;
|
|
1350
|
+
Te(t);
|
|
1351
|
+
Fe(true);
|
|
1352
|
+
Ee(0);
|
|
1353
|
+
$ === null || $ === void 0 ? void 0 : $(e, {
|
|
1316
1354
|
keyword: t
|
|
1317
1355
|
});
|
|
1318
|
-
}), [
|
|
1319
|
-
var
|
|
1356
|
+
}), [ $ ]);
|
|
1357
|
+
var Ur = (0, t.useCallback)((function() {
|
|
1320
1358
|
$e(true);
|
|
1321
1359
|
}), []);
|
|
1322
|
-
var
|
|
1360
|
+
var Jr = (0, t.useCallback)((function() {
|
|
1323
1361
|
$e(false);
|
|
1324
1362
|
}), []);
|
|
1325
|
-
var
|
|
1326
|
-
if (
|
|
1327
|
-
(0,
|
|
1363
|
+
var Gr = (0, t.useCallback)((function(e) {
|
|
1364
|
+
if (gr.current !== Pe) {
|
|
1365
|
+
(0, D.scrollIntoViewIfNeeded)(e);
|
|
1328
1366
|
}
|
|
1329
|
-
}), [
|
|
1330
|
-
var
|
|
1367
|
+
}), [ Pe ]);
|
|
1368
|
+
var Qr = (0, t.useCallback)((function(e, r, t) {
|
|
1331
1369
|
if (t) {
|
|
1332
|
-
|
|
1370
|
+
Cr.current = e;
|
|
1333
1371
|
}
|
|
1334
1372
|
if (e == null) {
|
|
1335
|
-
delete
|
|
1373
|
+
delete Sr.current[r];
|
|
1336
1374
|
} else {
|
|
1337
|
-
|
|
1375
|
+
Sr.current[r] = e;
|
|
1338
1376
|
}
|
|
1339
|
-
}), [
|
|
1340
|
-
var
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
}), [
|
|
1344
|
-
var
|
|
1345
|
-
var e;
|
|
1346
|
-
return
|
|
1347
|
-
}), [ Rn ]);
|
|
1348
|
-
var Gn = t.Children.toArray(d);
|
|
1349
|
-
var Qn = Jn.some((function(e) {
|
|
1350
|
-
var n = i()(Gn, (function(n) {
|
|
1351
|
-
return pn(n) && n.props.value === e;
|
|
1352
|
-
}));
|
|
1353
|
-
return n && !n.props.disabled;
|
|
1377
|
+
}), [ Sr ]);
|
|
1378
|
+
var Yr = (0, t.useCallback)((function(e) {
|
|
1379
|
+
fr.current = e;
|
|
1380
|
+
Re(m, e);
|
|
1381
|
+
}), [ m, fr ]);
|
|
1382
|
+
var Zr = qr.some((function(e) {
|
|
1383
|
+
var r = Mr.get(e);
|
|
1384
|
+
return r && !r.props.disabled;
|
|
1354
1385
|
}));
|
|
1355
|
-
var
|
|
1356
|
-
var
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
var e = function e(
|
|
1386
|
+
var et = ie === "immediately" ? Dr() : Je;
|
|
1387
|
+
var rt = (0, t.useMemo)((function() {
|
|
1388
|
+
Or.current = 0;
|
|
1389
|
+
kr.current = undefined;
|
|
1390
|
+
xr.current = 0;
|
|
1391
|
+
hr.current = undefined;
|
|
1392
|
+
yr.current = [];
|
|
1393
|
+
var e = function e(r, t) {
|
|
1363
1394
|
return function(e) {
|
|
1364
|
-
return
|
|
1395
|
+
return Qr(e, r, t);
|
|
1365
1396
|
};
|
|
1366
1397
|
};
|
|
1367
|
-
var
|
|
1398
|
+
var r;
|
|
1368
1399
|
var a = 0;
|
|
1369
1400
|
var o = false;
|
|
1370
1401
|
// used to avoid overwriting the selected item ref in multiple mode
|
|
1371
|
-
var
|
|
1372
|
-
var
|
|
1402
|
+
var i;
|
|
1403
|
+
var u = new Set(qr);
|
|
1404
|
+
var s = new Set(et !== null && et !== void 0 ? et : []);
|
|
1405
|
+
var f = Rr.reduce((function(c, f, d) {
|
|
1373
1406
|
// ignore Headings and Dividers
|
|
1374
|
-
if (!
|
|
1375
|
-
|
|
1376
|
-
return
|
|
1407
|
+
if (!tr(f)) {
|
|
1408
|
+
c.push(f);
|
|
1409
|
+
return c;
|
|
1377
1410
|
}
|
|
1378
|
-
var
|
|
1411
|
+
var p = f.props, v = p.disabled, b = p.hidden, m = p.label, y = p.value;
|
|
1379
1412
|
// Find out if the search string exactly matches a value
|
|
1380
|
-
if (
|
|
1381
|
-
|
|
1413
|
+
if (y === qe) {
|
|
1414
|
+
r = true;
|
|
1382
1415
|
}
|
|
1383
|
-
var
|
|
1384
|
-
var
|
|
1385
|
-
var
|
|
1386
|
-
var
|
|
1387
|
-
var
|
|
1388
|
-
if (
|
|
1389
|
-
|
|
1390
|
-
label:
|
|
1391
|
-
value:
|
|
1416
|
+
var h = u.has(y);
|
|
1417
|
+
var S = !!h && !v && !i;
|
|
1418
|
+
var O = l && !N && !g && !P && !W;
|
|
1419
|
+
var C = nr(y, m);
|
|
1420
|
+
var k = -1;
|
|
1421
|
+
if (O && !v && !b) {
|
|
1422
|
+
yr.current.push({
|
|
1423
|
+
label: m,
|
|
1424
|
+
value: y
|
|
1392
1425
|
});
|
|
1393
|
-
|
|
1426
|
+
k = yr.current.length - 1;
|
|
1394
1427
|
}
|
|
1395
1428
|
// Format the Menu.Item
|
|
1396
|
-
var
|
|
1397
|
-
elementRef: e(
|
|
1398
|
-
key:
|
|
1399
|
-
onClick:
|
|
1400
|
-
onKeyDown:
|
|
1401
|
-
return
|
|
1429
|
+
var x = (0, t.cloneElement)(f, {
|
|
1430
|
+
elementRef: e(C, S),
|
|
1431
|
+
key: f.key || d,
|
|
1432
|
+
onClick: Wr,
|
|
1433
|
+
onKeyDown: O ? function(e) {
|
|
1434
|
+
return $r(e, k);
|
|
1402
1435
|
} : undefined,
|
|
1403
|
-
selected:
|
|
1404
|
-
multiple:
|
|
1436
|
+
selected: h,
|
|
1437
|
+
multiple: N,
|
|
1405
1438
|
role: "option"
|
|
1406
1439
|
});
|
|
1407
|
-
if (
|
|
1408
|
-
|
|
1440
|
+
if (S) {
|
|
1441
|
+
i = true;
|
|
1409
1442
|
}
|
|
1410
|
-
if (
|
|
1443
|
+
if (s.has(y)) {
|
|
1411
1444
|
if (a === 0) {
|
|
1412
|
-
|
|
1445
|
+
c.splice(a, 0, n().createElement(w.Divider, {
|
|
1413
1446
|
key: "topDivider"
|
|
1414
1447
|
}));
|
|
1415
1448
|
o = true;
|
|
1416
1449
|
}
|
|
1417
|
-
|
|
1450
|
+
c.splice(a, 0, x);
|
|
1418
1451
|
a += 1;
|
|
1419
1452
|
} else {
|
|
1420
|
-
|
|
1453
|
+
c.push(x);
|
|
1421
1454
|
}
|
|
1422
|
-
return
|
|
1455
|
+
return c;
|
|
1423
1456
|
}), []);
|
|
1424
1457
|
// In multiple mode, add missing items
|
|
1425
|
-
if (
|
|
1426
|
-
|
|
1427
|
-
var
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
n = true;
|
|
1458
|
+
if (N) {
|
|
1459
|
+
for (var d = qr.length - 1; d >= 0; d -= 1) {
|
|
1460
|
+
var p = qr[d];
|
|
1461
|
+
var v = Mr.get(p);
|
|
1462
|
+
if (!v) {
|
|
1463
|
+
if (p === qe) {
|
|
1464
|
+
r = true;
|
|
1433
1465
|
}
|
|
1434
|
-
var
|
|
1435
|
-
var
|
|
1466
|
+
var b = s.has(p);
|
|
1467
|
+
var m = et.length;
|
|
1436
1468
|
if (a === 0) {
|
|
1437
|
-
|
|
1469
|
+
f.splice(0, 0, n().createElement(w.Divider, {
|
|
1438
1470
|
key: "topDivider"
|
|
1439
1471
|
}));
|
|
1440
1472
|
a += 1;
|
|
1441
1473
|
o = true;
|
|
1442
1474
|
}
|
|
1443
|
-
var
|
|
1444
|
-
var
|
|
1445
|
-
|
|
1446
|
-
elementRef: e(
|
|
1447
|
-
label:
|
|
1448
|
-
value:
|
|
1449
|
-
key: "missing-value-".concat(
|
|
1450
|
-
onClick:
|
|
1451
|
-
multiple:
|
|
1475
|
+
var y = String(p);
|
|
1476
|
+
var h = nr(p, y);
|
|
1477
|
+
f.splice(b ? 0 : m + 1, 0, n().createElement(U, {
|
|
1478
|
+
elementRef: e(h),
|
|
1479
|
+
label: y,
|
|
1480
|
+
value: p,
|
|
1481
|
+
key: "missing-value-".concat(p),
|
|
1482
|
+
onClick: Wr,
|
|
1483
|
+
multiple: N,
|
|
1452
1484
|
selected: true
|
|
1453
1485
|
}));
|
|
1454
|
-
if (
|
|
1486
|
+
if (b) {
|
|
1455
1487
|
a += 1;
|
|
1456
1488
|
}
|
|
1457
1489
|
}
|
|
1458
|
-
}
|
|
1490
|
+
}
|
|
1459
1491
|
}
|
|
1460
|
-
var
|
|
1492
|
+
var S = g === "controlled";
|
|
1461
1493
|
// Filter the items
|
|
1462
|
-
var
|
|
1463
|
-
|
|
1464
|
-
if (
|
|
1465
|
-
return (0,
|
|
1494
|
+
var O = (0, M.stringToKeywords)(qe);
|
|
1495
|
+
f = S ? f : f.filter((function(e) {
|
|
1496
|
+
if (tr(e)) {
|
|
1497
|
+
return (0, M.testPhrase)(e.props.label, O);
|
|
1466
1498
|
}
|
|
1467
1499
|
return true;
|
|
1468
1500
|
// Keep all headers and non-interactive options
|
|
1469
1501
|
})).map((function(e) {
|
|
1470
|
-
if (!
|
|
1502
|
+
if (!tr(e)) {
|
|
1471
1503
|
return e;
|
|
1472
1504
|
}
|
|
1473
1505
|
// highlight matched text
|
|
1474
|
-
var
|
|
1506
|
+
var r = O && (0, M.keywordLocations)(e.props.label, O);
|
|
1475
1507
|
|
|
1476
1508
|
return (0, t.cloneElement)(e, {
|
|
1477
|
-
matchRanges:
|
|
1509
|
+
matchRanges: r || undefined
|
|
1478
1510
|
});
|
|
1479
1511
|
}));
|
|
1480
1512
|
// Add the option to add the new value
|
|
1481
|
-
if (
|
|
1482
|
-
var
|
|
1483
|
-
var
|
|
1484
|
-
var
|
|
1485
|
-
|
|
1486
|
-
elementRef: e(
|
|
1487
|
-
label:
|
|
1488
|
-
value:
|
|
1513
|
+
if (c && !r && qe) {
|
|
1514
|
+
var C = o ? a + 1 : a;
|
|
1515
|
+
var k = "".concat(qe, " (new value)");
|
|
1516
|
+
var x = nr(qe, k);
|
|
1517
|
+
f.splice(C, 0, n().createElement(U, {
|
|
1518
|
+
elementRef: e(x),
|
|
1519
|
+
label: k,
|
|
1520
|
+
value: qe,
|
|
1489
1521
|
key: "newValue",
|
|
1490
|
-
multiple:
|
|
1491
|
-
onClick:
|
|
1522
|
+
multiple: N,
|
|
1523
|
+
onClick: Wr
|
|
1492
1524
|
}));
|
|
1493
1525
|
}
|
|
1494
1526
|
// When selectAll is a menu item, add an offset so that activeItem accounts for the extra selectAll option.
|
|
1495
|
-
var
|
|
1496
|
-
var
|
|
1527
|
+
var j = ae === "checkbox" && N && f.length > 1 ? 1 : 0;
|
|
1528
|
+
var E = true;
|
|
1497
1529
|
// Highlight the selected Items and remove hidden
|
|
1498
|
-
|
|
1530
|
+
f = f.reduce((function(e, r) {
|
|
1499
1531
|
// ignore Dividers & Headings
|
|
1500
|
-
if (!
|
|
1501
|
-
e.push(
|
|
1532
|
+
if (!tr(r)) {
|
|
1533
|
+
e.push(r);
|
|
1502
1534
|
return e;
|
|
1503
1535
|
}
|
|
1504
1536
|
// Ignore any hidden items
|
|
1505
|
-
if (
|
|
1537
|
+
if (r.props && r.props.hidden) {
|
|
1506
1538
|
return e;
|
|
1507
1539
|
}
|
|
1508
|
-
if (
|
|
1509
|
-
|
|
1540
|
+
if (r.props.selected && !r.props.disabled && kr.current == null) {
|
|
1541
|
+
kr.current = Or.current;
|
|
1510
1542
|
}
|
|
1511
|
-
var
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
if (
|
|
1516
|
-
|
|
1543
|
+
var n = j === Pe;
|
|
1544
|
+
j += 1;
|
|
1545
|
+
Or.current += 1;
|
|
1546
|
+
xr.current += r.props.selected ? 1 : 0;
|
|
1547
|
+
if (r.key !== "newValue" && !r.props.disabled && !r.props.selected) {
|
|
1548
|
+
E = false;
|
|
1517
1549
|
}
|
|
1518
|
-
if (!
|
|
1519
|
-
e.push(
|
|
1550
|
+
if (!n || !We) {
|
|
1551
|
+
e.push(r);
|
|
1520
1552
|
return e;
|
|
1521
1553
|
}
|
|
1522
|
-
if (!
|
|
1523
|
-
|
|
1554
|
+
if (!r.props.disabled) {
|
|
1555
|
+
hr.current = r.props.value;
|
|
1524
1556
|
}
|
|
1525
|
-
var l = (0, t.cloneElement)(
|
|
1526
|
-
active:
|
|
1527
|
-
elementRef:
|
|
1528
|
-
id:
|
|
1557
|
+
var l = (0, t.cloneElement)(r, {
|
|
1558
|
+
active: n,
|
|
1559
|
+
elementRef: Gr,
|
|
1560
|
+
id: we
|
|
1529
1561
|
});
|
|
1530
1562
|
e.push(l);
|
|
1531
1563
|
return e;
|
|
1532
1564
|
}), []);
|
|
1533
|
-
|
|
1565
|
+
jr.current = xr.current === 0 && "none" || E && "all" || "some";
|
|
1534
1566
|
// add select all option
|
|
1535
|
-
if (
|
|
1536
|
-
var
|
|
1537
|
-
var
|
|
1538
|
-
if (
|
|
1539
|
-
if (
|
|
1540
|
-
|
|
1567
|
+
if (ae === "checkbox" && N && Or.current > 0) {
|
|
1568
|
+
var A = Pe === 0 && !!g;
|
|
1569
|
+
var L;
|
|
1570
|
+
if (jr.current === "all") {
|
|
1571
|
+
if (qe === "") {
|
|
1572
|
+
L = (0, q._)("Clear all");
|
|
1541
1573
|
} else {
|
|
1542
|
-
|
|
1574
|
+
L = (0, q._)("Clear all matches");
|
|
1543
1575
|
}
|
|
1544
|
-
} else if (
|
|
1545
|
-
|
|
1576
|
+
} else if (qe === "") {
|
|
1577
|
+
L = (0, q._)("Select all");
|
|
1546
1578
|
} else {
|
|
1547
|
-
|
|
1579
|
+
L = (0, q._)("Select all matches");
|
|
1548
1580
|
}
|
|
1549
|
-
if (
|
|
1550
|
-
|
|
1581
|
+
if (A) {
|
|
1582
|
+
hr.current = "selectAll";
|
|
1551
1583
|
}
|
|
1552
|
-
|
|
1584
|
+
f.unshift( n().createElement(oe, {
|
|
1553
1585
|
key: "select-all-option",
|
|
1554
|
-
active:
|
|
1555
|
-
elementRef:
|
|
1556
|
-
id:
|
|
1557
|
-
onClick:
|
|
1558
|
-
label:
|
|
1559
|
-
selected:
|
|
1560
|
-
totalCount: !!
|
|
1561
|
-
tabIndex:
|
|
1562
|
-
}),
|
|
1586
|
+
active: A,
|
|
1587
|
+
elementRef: Gr,
|
|
1588
|
+
id: A ? we : undefined,
|
|
1589
|
+
onClick: jr.current === "all" ? Kr : Fr,
|
|
1590
|
+
label: L,
|
|
1591
|
+
selected: jr.current === "all" || jr.current !== "none" && "some",
|
|
1592
|
+
totalCount: !!de && qr.length || undefined,
|
|
1593
|
+
tabIndex: g ? -1 : undefined
|
|
1594
|
+
}), n().createElement(w.Divider, {
|
|
1563
1595
|
key: "selectAllDivider"
|
|
1564
1596
|
}));
|
|
1565
1597
|
}
|
|
1566
|
-
|
|
1567
|
-
if (
|
|
1568
|
-
e.push(
|
|
1598
|
+
wr.current = f.reduce((function(e, r) {
|
|
1599
|
+
if (tr(r)) {
|
|
1600
|
+
e.push(r.props.value);
|
|
1569
1601
|
}
|
|
1570
1602
|
return e;
|
|
1571
1603
|
}), []);
|
|
1572
|
-
return
|
|
1573
|
-
}), [
|
|
1574
|
-
var
|
|
1575
|
-
var t =
|
|
1576
|
-
var u =
|
|
1604
|
+
return f;
|
|
1605
|
+
}), [ Pe, we, l, c, Rr, Mr, qr, g, qe, Gr, Kr, Wr, $r, Qr, Fr, P, N, et, W, ae, We, de ]);
|
|
1606
|
+
var tt = function e(r) {
|
|
1607
|
+
var t = r.anchorWidth, l = r.maxHeight, o = r.placement, i = r.toggleId;
|
|
1608
|
+
var u = er({
|
|
1577
1609
|
anchorWidth: t,
|
|
1578
|
-
isMultiple:
|
|
1610
|
+
isMultiple: N,
|
|
1579
1611
|
maxHeight: l,
|
|
1580
|
-
menuStyle:
|
|
1612
|
+
menuStyle: B
|
|
1581
1613
|
});
|
|
1582
|
-
var c =
|
|
1614
|
+
var c = qr.length > 0 && !Zr && !g ? 0 : undefined;
|
|
1583
1615
|
var s = {
|
|
1584
|
-
"aria-multiselectable":
|
|
1585
|
-
childrenStart: !!
|
|
1586
|
-
activeItemId:
|
|
1587
|
-
filterA11yId:
|
|
1588
|
-
filterKeyword:
|
|
1589
|
-
hasChildren:
|
|
1590
|
-
return
|
|
1616
|
+
"aria-multiselectable": N || undefined,
|
|
1617
|
+
childrenStart: !!g && n().createElement(sr, {
|
|
1618
|
+
activeItemId: we,
|
|
1619
|
+
filterA11yId: Ar,
|
|
1620
|
+
filterKeyword: qe,
|
|
1621
|
+
hasChildren: rt.some((function(e) {
|
|
1622
|
+
return tr(e);
|
|
1591
1623
|
})),
|
|
1592
|
-
inputId:
|
|
1593
|
-
inputRef:
|
|
1594
|
-
menuListboxId:
|
|
1595
|
-
multiple:
|
|
1596
|
-
onClearAll:
|
|
1597
|
-
onSelectAll:
|
|
1598
|
-
onTextBlur:
|
|
1599
|
-
onTextChange:
|
|
1600
|
-
onTextFocus:
|
|
1601
|
-
onTextKeyDown:
|
|
1602
|
-
optionSelection:
|
|
1624
|
+
inputId: x,
|
|
1625
|
+
inputRef: j,
|
|
1626
|
+
menuListboxId: ke,
|
|
1627
|
+
multiple: N,
|
|
1628
|
+
onClearAll: Kr,
|
|
1629
|
+
onSelectAll: Fr,
|
|
1630
|
+
onTextBlur: Jr,
|
|
1631
|
+
onTextChange: Xr,
|
|
1632
|
+
onTextFocus: Ur,
|
|
1633
|
+
onTextKeyDown: zr,
|
|
1634
|
+
optionSelection: jr,
|
|
1603
1635
|
placement: o,
|
|
1604
|
-
selectAllAppearance:
|
|
1636
|
+
selectAllAppearance: ae,
|
|
1605
1637
|
textHasFocus: We
|
|
1606
1638
|
}),
|
|
1607
|
-
focusMode:
|
|
1608
|
-
isLoading:
|
|
1609
|
-
labelledBy: "".concat(
|
|
1639
|
+
focusMode: g ? "never" : undefined,
|
|
1640
|
+
isLoading: P,
|
|
1641
|
+
labelledBy: "".concat(Ar !== null && Ar !== void 0 ? Ar : "", " ").concat(i !== null && i !== void 0 ? i : "").trim(),
|
|
1610
1642
|
// NVDA ignores aria-labelledby attribute on popover, but reads it on menu
|
|
1611
|
-
menuId:
|
|
1612
|
-
onScrollBottom:
|
|
1643
|
+
menuId: ke,
|
|
1644
|
+
onScrollBottom: W ? Hr : undefined,
|
|
1613
1645
|
placement: o !== null && o !== void 0 ? o : undefined,
|
|
1614
|
-
noOptionsMessage:
|
|
1615
|
-
footerMessage:
|
|
1646
|
+
noOptionsMessage: K,
|
|
1647
|
+
footerMessage: S,
|
|
1616
1648
|
animateLoading: a,
|
|
1617
|
-
loadingMessage:
|
|
1618
|
-
onScroll:
|
|
1649
|
+
loadingMessage: I,
|
|
1650
|
+
onScroll: z,
|
|
1619
1651
|
style: u,
|
|
1620
1652
|
tabIndex: c
|
|
1621
1653
|
};
|
|
1622
|
-
if (
|
|
1654
|
+
if (fe) {
|
|
1623
1655
|
|
|
1624
|
-
return
|
|
1625
|
-
virtualization:
|
|
1626
|
-
}, s),
|
|
1656
|
+
return n().createElement(C.VirtualizedResultsMenu, _e({
|
|
1657
|
+
virtualization: fe
|
|
1658
|
+
}, s), rt);
|
|
1627
1659
|
}
|
|
1628
1660
|
|
|
1629
|
-
return
|
|
1661
|
+
return n().createElement(k(), s, rt);
|
|
1630
1662
|
};
|
|
1631
1663
|
var nt = (0, t.useMemo)((function() {
|
|
1632
1664
|
|
|
1633
|
-
return
|
|
1634
|
-
appearance:
|
|
1635
|
-
append:
|
|
1636
|
-
currentValues:
|
|
1637
|
-
"data-test":
|
|
1638
|
-
describedBy:
|
|
1639
|
-
disabled:
|
|
1640
|
-
elementRef:
|
|
1641
|
-
error:
|
|
1642
|
-
inline:
|
|
1643
|
-
labelText:
|
|
1644
|
-
labelledBy:
|
|
1645
|
-
multiple:
|
|
1646
|
-
onClick:
|
|
1647
|
-
placeholder:
|
|
1648
|
-
prefixLabel:
|
|
1649
|
-
prepend:
|
|
1650
|
-
required:
|
|
1651
|
-
suffixLabel:
|
|
1652
|
-
toggle:
|
|
1653
|
-
toggleContent:
|
|
1654
|
-
|
|
1655
|
-
|
|
1665
|
+
return n().createElement(pr, _e({
|
|
1666
|
+
appearance: i,
|
|
1667
|
+
append: u,
|
|
1668
|
+
currentValues: qr,
|
|
1669
|
+
"data-test": N ? "multiselect" : "select",
|
|
1670
|
+
describedBy: v,
|
|
1671
|
+
disabled: b,
|
|
1672
|
+
elementRef: Yr,
|
|
1673
|
+
error: y,
|
|
1674
|
+
inline: O,
|
|
1675
|
+
labelText: A,
|
|
1676
|
+
labelledBy: E,
|
|
1677
|
+
multiple: N,
|
|
1678
|
+
onClick: X,
|
|
1679
|
+
placeholder: Z,
|
|
1680
|
+
prefixLabel: ee,
|
|
1681
|
+
prepend: re,
|
|
1682
|
+
required: Q,
|
|
1683
|
+
suffixLabel: ue,
|
|
1684
|
+
toggle: de,
|
|
1685
|
+
toggleContent: ve,
|
|
1686
|
+
maxLabelItems: me
|
|
1687
|
+
}, ye), s);
|
|
1688
|
+
}), [ i, u, qr, N, v, b, Yr, y, O, A, E, X, Z, ee, re, Q, ue, de, ve, me, ye, s ]);
|
|
1656
1689
|
|
|
1657
|
-
return
|
|
1658
|
-
closeReasons:
|
|
1659
|
-
inputId:
|
|
1660
|
-
"aria-labelledby":
|
|
1690
|
+
return n().createElement(h(), {
|
|
1691
|
+
closeReasons: rr,
|
|
1692
|
+
inputId: x,
|
|
1693
|
+
"aria-labelledby": Ar,
|
|
1661
1694
|
toggle: nt,
|
|
1662
|
-
onRequestOpen:
|
|
1663
|
-
onRequestClose:
|
|
1664
|
-
open:
|
|
1695
|
+
onRequestOpen: _r,
|
|
1696
|
+
onRequestClose: Br,
|
|
1697
|
+
open: Ve,
|
|
1665
1698
|
openWithArrowKeys: true,
|
|
1666
|
-
repositionMode:
|
|
1667
|
-
defaultPlacement:
|
|
1668
|
-
canCoverAnchor:
|
|
1699
|
+
repositionMode: ne,
|
|
1700
|
+
defaultPlacement: d,
|
|
1701
|
+
canCoverAnchor: Ae().innerHeight < 500,
|
|
1669
1702
|
retainFocus: false,
|
|
1670
|
-
takeFocus:
|
|
1671
|
-
},
|
|
1703
|
+
takeFocus: qr.length === 0 || qr.length > 0 && !Zr || !!g
|
|
1704
|
+
}, tt);
|
|
1672
1705
|
}
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
/* harmony default export */ const
|
|
1706
|
+
br.propTypes = Ye;
|
|
1707
|
+
br.componentType = "SelectBase";
|
|
1708
|
+
br.Option = U;
|
|
1709
|
+
br.Divider = w.Divider;
|
|
1710
|
+
br.Heading = w.Heading;
|
|
1711
|
+
/* harmony default export */ const mr = br;
|
|
1679
1712
|
// CONCATENATED MODULE: ./src/SelectBase/index.ts
|
|
1680
|
-
module.exports =
|
|
1713
|
+
module.exports = r;
|
|
1681
1714
|
/******/})();
|