@splunk/react-ui 4.21.1 → 4.22.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/CHANGELOG.md +17 -1
- package/Code.js +0 -1
- package/Color.js +238 -235
- package/ComboBox.js +195 -183
- package/Menu.js +100 -101
- package/Multiselect.js +655 -641
- package/RadioBar.js +91 -67
- package/ResultsMenu.js +107 -122
- package/Search.js +258 -246
- package/Select.js +461 -457
- package/Slider.js +87 -76
- package/TabBar.js +99 -84
- package/Table.js +805 -673
- package/package.json +5 -5
- package/types/src/Color/Color.d.ts +0 -1
- package/types/src/RadioBar/RadioBar.d.ts +1 -0
- package/types/src/ResultsMenu/ResultsMenu.d.ts +0 -2
- package/types/src/Select/docs/examples/Icons.d.ts +1 -9
- package/types/src/Slider/Slider.d.ts +1 -0
- package/types/src/TabBar/Tab.d.ts +10 -1
- package/types/src/TabBar/TabBar.d.ts +4 -2
- package/types/src/Table/Head.d.ts +7 -3
- package/types/src/Table/Table.d.ts +3 -2
- package/types/src/Table/TableContext.d.ts +2 -0
- package/Code.js.LICENSE.txt +0 -8
package/ComboBox.js
CHANGED
|
@@ -61,10 +61,10 @@
|
|
|
61
61
|
e.r(t);
|
|
62
62
|
// EXPORTS
|
|
63
63
|
e.d(t, {
|
|
64
|
-
Divider: () => /* reexport */
|
|
65
|
-
Heading: () => /* reexport */
|
|
66
|
-
Option: () => /* reexport */
|
|
67
|
-
default: () => /* reexport */
|
|
64
|
+
Divider: () => /* reexport */ I.Divider,
|
|
65
|
+
Heading: () => /* reexport */ I.Heading,
|
|
66
|
+
Option: () => /* reexport */ X,
|
|
67
|
+
default: () => /* reexport */ he
|
|
68
68
|
});
|
|
69
69
|
// CONCATENATED MODULE: external "react"
|
|
70
70
|
const n = require("react");
|
|
@@ -78,50 +78,53 @@
|
|
|
78
78
|
// CONCATENATED MODULE: external "lodash/has"
|
|
79
79
|
const u = require("lodash/has");
|
|
80
80
|
var c = e.n(u);
|
|
81
|
-
// CONCATENATED MODULE: external "lodash/
|
|
82
|
-
const s = require("lodash/
|
|
81
|
+
// CONCATENATED MODULE: external "lodash/memoize"
|
|
82
|
+
const s = require("lodash/memoize");
|
|
83
83
|
var f = e.n(s);
|
|
84
|
-
// CONCATENATED MODULE: external "lodash/
|
|
85
|
-
const p = require("lodash/
|
|
84
|
+
// CONCATENATED MODULE: external "lodash/omit"
|
|
85
|
+
const p = require("lodash/omit");
|
|
86
86
|
var d = e.n(p);
|
|
87
|
-
// CONCATENATED MODULE: external "lodash/
|
|
88
|
-
const v = require("lodash/
|
|
87
|
+
// CONCATENATED MODULE: external "lodash/pick"
|
|
88
|
+
const v = require("lodash/pick");
|
|
89
89
|
var h = e.n(v);
|
|
90
|
+
// CONCATENATED MODULE: external "lodash/some"
|
|
91
|
+
const y = require("lodash/some");
|
|
92
|
+
var b = e.n(y);
|
|
90
93
|
// CONCATENATED MODULE: external "@splunk/ui-utils/filter"
|
|
91
|
-
const
|
|
94
|
+
const m = require("@splunk/ui-utils/filter");
|
|
92
95
|
// CONCATENATED MODULE: external "@splunk/ui-utils/id"
|
|
93
|
-
const
|
|
96
|
+
const g = require("@splunk/ui-utils/id");
|
|
94
97
|
// CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
|
|
95
|
-
const
|
|
98
|
+
const O = require("@splunk/ui-utils/i18n");
|
|
96
99
|
// CONCATENATED MODULE: external "@splunk/ui-utils/keyboard"
|
|
97
|
-
const
|
|
100
|
+
const S = require("@splunk/ui-utils/keyboard");
|
|
98
101
|
// CONCATENATED MODULE: external "@splunk/react-ui/Menu"
|
|
99
|
-
const
|
|
102
|
+
const I = require("@splunk/react-ui/Menu");
|
|
100
103
|
// CONCATENATED MODULE: external "@splunk/react-ui/Popover"
|
|
101
|
-
const
|
|
102
|
-
var S = e.n(I);
|
|
103
|
-
// CONCATENATED MODULE: external "@splunk/react-ui/ResultsMenu"
|
|
104
|
-
const C = require("@splunk/react-ui/ResultsMenu");
|
|
104
|
+
const C = require("@splunk/react-ui/Popover");
|
|
105
105
|
var w = e.n(C);
|
|
106
|
-
// CONCATENATED MODULE: external "@splunk/react-ui/
|
|
107
|
-
const k = require("@splunk/react-ui/
|
|
106
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/ResultsMenu"
|
|
107
|
+
const k = require("@splunk/react-ui/ResultsMenu");
|
|
108
108
|
var P = e.n(k);
|
|
109
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/Text"
|
|
110
|
+
const j = require("@splunk/react-ui/Text");
|
|
111
|
+
var x = e.n(j);
|
|
109
112
|
// CONCATENATED MODULE: ./src/ComboBox/Option.tsx
|
|
110
|
-
function
|
|
113
|
+
function R(e) {
|
|
111
114
|
"@babel/helpers - typeof";
|
|
112
115
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
113
|
-
|
|
116
|
+
R = function e(t) {
|
|
114
117
|
return typeof t;
|
|
115
118
|
};
|
|
116
119
|
} else {
|
|
117
|
-
|
|
120
|
+
R = function e(t) {
|
|
118
121
|
return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
119
122
|
};
|
|
120
123
|
}
|
|
121
|
-
return
|
|
124
|
+
return R(e);
|
|
122
125
|
}
|
|
123
|
-
function
|
|
124
|
-
|
|
126
|
+
function M() {
|
|
127
|
+
M = Object.assign || function(e) {
|
|
125
128
|
for (var t = 1; t < arguments.length; t++) {
|
|
126
129
|
var n = arguments[t];
|
|
127
130
|
for (var o in n) {
|
|
@@ -132,11 +135,11 @@
|
|
|
132
135
|
}
|
|
133
136
|
return e;
|
|
134
137
|
};
|
|
135
|
-
return
|
|
138
|
+
return M.apply(this, arguments);
|
|
136
139
|
}
|
|
137
|
-
function
|
|
140
|
+
function V(e, t) {
|
|
138
141
|
if (e == null) return {};
|
|
139
|
-
var n =
|
|
142
|
+
var n = D(e, t);
|
|
140
143
|
var o, r;
|
|
141
144
|
if (Object.getOwnPropertySymbols) {
|
|
142
145
|
var i = Object.getOwnPropertySymbols(e);
|
|
@@ -149,7 +152,7 @@
|
|
|
149
152
|
}
|
|
150
153
|
return n;
|
|
151
154
|
}
|
|
152
|
-
function
|
|
155
|
+
function D(e, t) {
|
|
153
156
|
if (e == null) return {};
|
|
154
157
|
var n = {};
|
|
155
158
|
var o = Object.keys(e);
|
|
@@ -161,12 +164,12 @@
|
|
|
161
164
|
}
|
|
162
165
|
return n;
|
|
163
166
|
}
|
|
164
|
-
function
|
|
167
|
+
function E(e, t) {
|
|
165
168
|
if (!(e instanceof t)) {
|
|
166
169
|
throw new TypeError("Cannot call a class as a function");
|
|
167
170
|
}
|
|
168
171
|
}
|
|
169
|
-
function
|
|
172
|
+
function _(e, t) {
|
|
170
173
|
for (var n = 0; n < t.length; n++) {
|
|
171
174
|
var o = t[n];
|
|
172
175
|
o.enumerable = o.enumerable || false;
|
|
@@ -175,12 +178,12 @@
|
|
|
175
178
|
Object.defineProperty(e, o.key, o);
|
|
176
179
|
}
|
|
177
180
|
}
|
|
178
|
-
function
|
|
179
|
-
if (t)
|
|
180
|
-
if (n)
|
|
181
|
+
function q(e, t, n) {
|
|
182
|
+
if (t) _(e.prototype, t);
|
|
183
|
+
if (n) _(e, n);
|
|
181
184
|
return e;
|
|
182
185
|
}
|
|
183
|
-
function
|
|
186
|
+
function A(e, t) {
|
|
184
187
|
if (typeof t !== "function" && t !== null) {
|
|
185
188
|
throw new TypeError("Super expression must either be null or a function");
|
|
186
189
|
}
|
|
@@ -191,41 +194,41 @@
|
|
|
191
194
|
configurable: true
|
|
192
195
|
}
|
|
193
196
|
});
|
|
194
|
-
if (t)
|
|
197
|
+
if (t) B(e, t);
|
|
195
198
|
}
|
|
196
|
-
function
|
|
197
|
-
|
|
199
|
+
function B(e, t) {
|
|
200
|
+
B = Object.setPrototypeOf || function e(t, n) {
|
|
198
201
|
t.__proto__ = n;
|
|
199
202
|
return t;
|
|
200
203
|
};
|
|
201
|
-
return
|
|
204
|
+
return B(e, t);
|
|
202
205
|
}
|
|
203
|
-
function
|
|
204
|
-
var t =
|
|
206
|
+
function T(e) {
|
|
207
|
+
var t = H();
|
|
205
208
|
return function n() {
|
|
206
|
-
var o =
|
|
209
|
+
var o = K(e), r;
|
|
207
210
|
if (t) {
|
|
208
|
-
var i =
|
|
211
|
+
var i = K(this).constructor;
|
|
209
212
|
r = Reflect.construct(o, arguments, i);
|
|
210
213
|
} else {
|
|
211
214
|
r = o.apply(this, arguments);
|
|
212
215
|
}
|
|
213
|
-
return
|
|
216
|
+
return L(this, r);
|
|
214
217
|
};
|
|
215
218
|
}
|
|
216
|
-
function
|
|
217
|
-
if (t && (
|
|
219
|
+
function L(e, t) {
|
|
220
|
+
if (t && (R(t) === "object" || typeof t === "function")) {
|
|
218
221
|
return t;
|
|
219
222
|
}
|
|
220
|
-
return
|
|
223
|
+
return F(e);
|
|
221
224
|
}
|
|
222
|
-
function
|
|
225
|
+
function F(e) {
|
|
223
226
|
if (e === void 0) {
|
|
224
227
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
225
228
|
}
|
|
226
229
|
return e;
|
|
227
230
|
}
|
|
228
|
-
function
|
|
231
|
+
function H() {
|
|
229
232
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
230
233
|
if (Reflect.construct.sham) return false;
|
|
231
234
|
if (typeof Proxy === "function") return true;
|
|
@@ -236,13 +239,13 @@
|
|
|
236
239
|
return false;
|
|
237
240
|
}
|
|
238
241
|
}
|
|
239
|
-
function
|
|
240
|
-
|
|
242
|
+
function K(e) {
|
|
243
|
+
K = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
|
|
241
244
|
return t.__proto__ || Object.getPrototypeOf(t);
|
|
242
245
|
};
|
|
243
|
-
return
|
|
246
|
+
return K(e);
|
|
244
247
|
}
|
|
245
|
-
function
|
|
248
|
+
function N(e, t, n) {
|
|
246
249
|
if (t in e) {
|
|
247
250
|
Object.defineProperty(e, t, {
|
|
248
251
|
value: n,
|
|
@@ -255,7 +258,7 @@
|
|
|
255
258
|
}
|
|
256
259
|
return e;
|
|
257
260
|
}
|
|
258
|
-
var
|
|
261
|
+
var z = {
|
|
259
262
|
/** @private */
|
|
260
263
|
active: i().bool,
|
|
261
264
|
description: i().string,
|
|
@@ -272,7 +275,7 @@
|
|
|
272
275
|
truncate: i().bool,
|
|
273
276
|
value: i().string.isRequired
|
|
274
277
|
};
|
|
275
|
-
var
|
|
278
|
+
var W = {
|
|
276
279
|
active: false,
|
|
277
280
|
descriptionPosition: "bottom",
|
|
278
281
|
disabled: false,
|
|
@@ -282,18 +285,18 @@
|
|
|
282
285
|
* An option within a `ComboBox`. This inherits from
|
|
283
286
|
* [PureComponent](https://reactjs.org/docs/react-api.html#reactpurecomponent)
|
|
284
287
|
* so any elements passed to it must also be pure.
|
|
285
|
-
*/ var
|
|
286
|
-
|
|
287
|
-
var t =
|
|
288
|
+
*/ var U = function(e) {
|
|
289
|
+
A(n, e);
|
|
290
|
+
var t = T(n);
|
|
288
291
|
function n() {
|
|
289
292
|
var e;
|
|
290
|
-
|
|
293
|
+
E(this, n);
|
|
291
294
|
for (var o = arguments.length, r = new Array(o), i = 0; i < o; i++) {
|
|
292
295
|
r[i] = arguments[i];
|
|
293
296
|
}
|
|
294
297
|
e = t.call.apply(t, [ this ].concat(r));
|
|
295
|
-
|
|
296
|
-
|
|
298
|
+
N(F(e), "item", null);
|
|
299
|
+
N(F(e), "handleClick", (function(t) {
|
|
297
300
|
var n = e.props, o = n.disabled, r = n.onClick, i = n.value;
|
|
298
301
|
if (!o) {
|
|
299
302
|
r === null || r === void 0 ? void 0 : r(t, {
|
|
@@ -303,7 +306,7 @@
|
|
|
303
306
|
}));
|
|
304
307
|
return e;
|
|
305
308
|
}
|
|
306
|
-
|
|
309
|
+
q(n, [ {
|
|
307
310
|
key: "scrollIntoViewIfNeeded",
|
|
308
311
|
value: function e() {
|
|
309
312
|
var t;
|
|
@@ -314,10 +317,10 @@
|
|
|
314
317
|
value: function e() {
|
|
315
318
|
var t = this;
|
|
316
319
|
// eslint-disable-next-line no-unused-vars
|
|
317
|
-
var n = this.props, r = n.value, i = n.label, a =
|
|
320
|
+
var n = this.props, r = n.value, i = n.label, a = V(n, [ "value", "label" ]);
|
|
318
321
|
var l = i === undefined ? r : i;
|
|
319
322
|
|
|
320
|
-
return o().createElement(
|
|
323
|
+
return o().createElement(I.Item, M({
|
|
321
324
|
ref: function e(n) {
|
|
322
325
|
t.item = n;
|
|
323
326
|
},
|
|
@@ -332,9 +335,9 @@
|
|
|
332
335
|
} ]);
|
|
333
336
|
return n;
|
|
334
337
|
}(n.PureComponent);
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
/* harmony default export */ const
|
|
338
|
+
N(U, "propTypes", z);
|
|
339
|
+
N(U, "defaultProps", W);
|
|
340
|
+
/* harmony default export */ const X = U;
|
|
338
341
|
// CONCATENATED MODULE: ./src/utils/updateReactRef.ts
|
|
339
342
|
/**
|
|
340
343
|
* Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
|
|
@@ -342,7 +345,7 @@
|
|
|
342
345
|
* @param ref - The React callback or object ref. Can be `null` or `undefined`.
|
|
343
346
|
* @param current - The new value of the ref.
|
|
344
347
|
*/
|
|
345
|
-
function
|
|
348
|
+
function Y(e, t) {
|
|
346
349
|
if (e) {
|
|
347
350
|
if (typeof e === "function") {
|
|
348
351
|
e(t);
|
|
@@ -355,21 +358,21 @@
|
|
|
355
358
|
}
|
|
356
359
|
}
|
|
357
360
|
// CONCATENATED MODULE: ./src/ComboBox/ComboBox.tsx
|
|
358
|
-
function
|
|
361
|
+
function G(e) {
|
|
359
362
|
"@babel/helpers - typeof";
|
|
360
363
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
361
|
-
|
|
364
|
+
G = function e(t) {
|
|
362
365
|
return typeof t;
|
|
363
366
|
};
|
|
364
367
|
} else {
|
|
365
|
-
|
|
368
|
+
G = function e(t) {
|
|
366
369
|
return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
367
370
|
};
|
|
368
371
|
}
|
|
369
|
-
return
|
|
372
|
+
return G(e);
|
|
370
373
|
}
|
|
371
|
-
function
|
|
372
|
-
|
|
374
|
+
function J() {
|
|
375
|
+
J = Object.assign || function(e) {
|
|
373
376
|
for (var t = 1; t < arguments.length; t++) {
|
|
374
377
|
var n = arguments[t];
|
|
375
378
|
for (var o in n) {
|
|
@@ -380,9 +383,9 @@
|
|
|
380
383
|
}
|
|
381
384
|
return e;
|
|
382
385
|
};
|
|
383
|
-
return
|
|
386
|
+
return J.apply(this, arguments);
|
|
384
387
|
}
|
|
385
|
-
function
|
|
388
|
+
function Q(e, t) {
|
|
386
389
|
var n = Object.keys(e);
|
|
387
390
|
if (Object.getOwnPropertySymbols) {
|
|
388
391
|
var o = Object.getOwnPropertySymbols(e);
|
|
@@ -393,29 +396,29 @@
|
|
|
393
396
|
}
|
|
394
397
|
return n;
|
|
395
398
|
}
|
|
396
|
-
function
|
|
399
|
+
function Z(e) {
|
|
397
400
|
for (var t = 1; t < arguments.length; t++) {
|
|
398
401
|
var n = arguments[t] != null ? arguments[t] : {};
|
|
399
402
|
if (t % 2) {
|
|
400
|
-
|
|
401
|
-
|
|
403
|
+
Q(Object(n), true).forEach((function(t) {
|
|
404
|
+
ce(e, t, n[t]);
|
|
402
405
|
}));
|
|
403
406
|
} else if (Object.getOwnPropertyDescriptors) {
|
|
404
407
|
Object.defineProperties(e, Object.getOwnPropertyDescriptors(n));
|
|
405
408
|
} else {
|
|
406
|
-
|
|
409
|
+
Q(Object(n)).forEach((function(t) {
|
|
407
410
|
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
408
411
|
}));
|
|
409
412
|
}
|
|
410
413
|
}
|
|
411
414
|
return e;
|
|
412
415
|
}
|
|
413
|
-
function
|
|
416
|
+
function $(e, t) {
|
|
414
417
|
if (!(e instanceof t)) {
|
|
415
418
|
throw new TypeError("Cannot call a class as a function");
|
|
416
419
|
}
|
|
417
420
|
}
|
|
418
|
-
function
|
|
421
|
+
function ee(e, t) {
|
|
419
422
|
for (var n = 0; n < t.length; n++) {
|
|
420
423
|
var o = t[n];
|
|
421
424
|
o.enumerable = o.enumerable || false;
|
|
@@ -424,12 +427,12 @@
|
|
|
424
427
|
Object.defineProperty(e, o.key, o);
|
|
425
428
|
}
|
|
426
429
|
}
|
|
427
|
-
function
|
|
428
|
-
if (t)
|
|
429
|
-
if (n)
|
|
430
|
+
function te(e, t, n) {
|
|
431
|
+
if (t) ee(e.prototype, t);
|
|
432
|
+
if (n) ee(e, n);
|
|
430
433
|
return e;
|
|
431
434
|
}
|
|
432
|
-
function
|
|
435
|
+
function ne(e, t) {
|
|
433
436
|
if (typeof t !== "function" && t !== null) {
|
|
434
437
|
throw new TypeError("Super expression must either be null or a function");
|
|
435
438
|
}
|
|
@@ -440,41 +443,41 @@
|
|
|
440
443
|
configurable: true
|
|
441
444
|
}
|
|
442
445
|
});
|
|
443
|
-
if (t)
|
|
446
|
+
if (t) oe(e, t);
|
|
444
447
|
}
|
|
445
|
-
function
|
|
446
|
-
|
|
448
|
+
function oe(e, t) {
|
|
449
|
+
oe = Object.setPrototypeOf || function e(t, n) {
|
|
447
450
|
t.__proto__ = n;
|
|
448
451
|
return t;
|
|
449
452
|
};
|
|
450
|
-
return
|
|
453
|
+
return oe(e, t);
|
|
451
454
|
}
|
|
452
|
-
function
|
|
453
|
-
var t =
|
|
455
|
+
function re(e) {
|
|
456
|
+
var t = le();
|
|
454
457
|
return function n() {
|
|
455
|
-
var o =
|
|
458
|
+
var o = ue(e), r;
|
|
456
459
|
if (t) {
|
|
457
|
-
var i =
|
|
460
|
+
var i = ue(this).constructor;
|
|
458
461
|
r = Reflect.construct(o, arguments, i);
|
|
459
462
|
} else {
|
|
460
463
|
r = o.apply(this, arguments);
|
|
461
464
|
}
|
|
462
|
-
return
|
|
465
|
+
return ie(this, r);
|
|
463
466
|
};
|
|
464
467
|
}
|
|
465
|
-
function
|
|
466
|
-
if (t && (
|
|
468
|
+
function ie(e, t) {
|
|
469
|
+
if (t && (G(t) === "object" || typeof t === "function")) {
|
|
467
470
|
return t;
|
|
468
471
|
}
|
|
469
|
-
return
|
|
472
|
+
return ae(e);
|
|
470
473
|
}
|
|
471
|
-
function
|
|
474
|
+
function ae(e) {
|
|
472
475
|
if (e === void 0) {
|
|
473
476
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
474
477
|
}
|
|
475
478
|
return e;
|
|
476
479
|
}
|
|
477
|
-
function
|
|
480
|
+
function le() {
|
|
478
481
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
479
482
|
if (Reflect.construct.sham) return false;
|
|
480
483
|
if (typeof Proxy === "function") return true;
|
|
@@ -485,13 +488,13 @@
|
|
|
485
488
|
return false;
|
|
486
489
|
}
|
|
487
490
|
}
|
|
488
|
-
function
|
|
489
|
-
|
|
491
|
+
function ue(e) {
|
|
492
|
+
ue = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
|
|
490
493
|
return t.__proto__ || Object.getPrototypeOf(t);
|
|
491
494
|
};
|
|
492
|
-
return
|
|
495
|
+
return ue(e);
|
|
493
496
|
}
|
|
494
|
-
function
|
|
497
|
+
function ce(e, t, n) {
|
|
495
498
|
if (t in e) {
|
|
496
499
|
Object.defineProperty(e, t, {
|
|
497
500
|
value: n,
|
|
@@ -504,7 +507,7 @@
|
|
|
504
507
|
}
|
|
505
508
|
return e;
|
|
506
509
|
}
|
|
507
|
-
var
|
|
510
|
+
var se = {
|
|
508
511
|
animateLoading: i().bool,
|
|
509
512
|
append: i().bool,
|
|
510
513
|
children: i().node,
|
|
@@ -536,7 +539,7 @@
|
|
|
536
539
|
size: i().oneOf([ "small", "medium", "large" ]),
|
|
537
540
|
value: i().string
|
|
538
541
|
};
|
|
539
|
-
var
|
|
542
|
+
var fe = {
|
|
540
543
|
animateLoading: false,
|
|
541
544
|
controlledFilter: false,
|
|
542
545
|
defaultPlacement: "vertical",
|
|
@@ -545,51 +548,59 @@
|
|
|
545
548
|
inline: false,
|
|
546
549
|
isLoadingOptions: false,
|
|
547
550
|
menuStyle: {},
|
|
548
|
-
placeholder: (0,
|
|
551
|
+
placeholder: (0, O._)("Select..."),
|
|
549
552
|
size: "medium"
|
|
550
553
|
};
|
|
551
|
-
function
|
|
554
|
+
function pe(e, t) {
|
|
552
555
|
var n = t.clientX, o = t.clientY;
|
|
553
556
|
var r = e.getBoundingClientRect(), i = r.top, a = r.left, l = r.bottom, u = r.right;
|
|
554
557
|
return n > a && n < u && o > i && o < l;
|
|
555
558
|
}
|
|
559
|
+
var de = f()((function(e) {
|
|
560
|
+
var t = e.anchorWidth, n = e.maxHeight, o = e.menuStyle;
|
|
561
|
+
return l()({
|
|
562
|
+
maxHeight: n,
|
|
563
|
+
overflow: "auto",
|
|
564
|
+
width: Math.max(t !== null && t !== void 0 ? t : 0, 200)
|
|
565
|
+
}, o);
|
|
566
|
+
}));
|
|
556
567
|
/**
|
|
557
568
|
* `ComboBox` allows the user to select a predefined string or enter a new value. Unlike `Select`
|
|
558
569
|
* and `Multiselect`, `Option` value must always be a string and `Option` does not have a label
|
|
559
570
|
* property.
|
|
560
|
-
*/ var
|
|
561
|
-
|
|
562
|
-
var t =
|
|
571
|
+
*/ var ve = function(e) {
|
|
572
|
+
ne(r, e);
|
|
573
|
+
var t = re(r);
|
|
563
574
|
// @docs-props-type ComboBoxPropsBase
|
|
564
575
|
function r(e) {
|
|
565
576
|
var i;
|
|
566
|
-
|
|
577
|
+
$(this, r);
|
|
567
578
|
i = t.call(this, e);
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
579
|
+
ce(ae(i), "activeItemId", void 0);
|
|
580
|
+
ce(ae(i), "activeValue", void 0);
|
|
581
|
+
ce(ae(i), "availableOptionCount", 0);
|
|
582
|
+
ce(ae(i), "controlledExternally", void 0);
|
|
583
|
+
ce(ae(i), "focusCalledInternally", false);
|
|
584
|
+
ce(ae(i), "options", void 0);
|
|
585
|
+
ce(ae(i), "popoverId", void 0);
|
|
586
|
+
ce(ae(i), "previousActiveIndex", null);
|
|
587
|
+
ce(ae(i), "textInput", null);
|
|
588
|
+
ce(ae(i), "handleInputMount", (function(e) {
|
|
578
589
|
i.textInput = e;
|
|
579
|
-
|
|
590
|
+
Y(i.props.inputRef, e);
|
|
580
591
|
}));
|
|
581
|
-
|
|
592
|
+
ce(ae(i), "handleAnchorMount", (function(e) {
|
|
582
593
|
i.setState({
|
|
583
594
|
anchor: e
|
|
584
595
|
});
|
|
585
|
-
|
|
596
|
+
Y(i.props.elementRef, e);
|
|
586
597
|
}));
|
|
587
|
-
|
|
598
|
+
ce(ae(i), "handleActiveOptionMount", (function(e) {
|
|
588
599
|
if (i.previousActiveIndex !== i.state.activeIndex) {
|
|
589
600
|
e === null || e === void 0 ? void 0 : e.scrollIntoViewIfNeeded();
|
|
590
601
|
}
|
|
591
602
|
}));
|
|
592
|
-
|
|
603
|
+
ce(ae(i), "handleInputFocus", (function(e) {
|
|
593
604
|
var t, n;
|
|
594
605
|
/* SUI-930 On IE 11 this handler is essentially deferred after calling
|
|
595
606
|
* this.textInput.focus(). this.focusCalledInternally enables the focus event to be ignored
|
|
@@ -600,7 +611,7 @@
|
|
|
600
611
|
}
|
|
601
612
|
(t = (n = i.props).onFocus) === null || t === void 0 ? void 0 : t.call(n, e);
|
|
602
613
|
}));
|
|
603
|
-
|
|
614
|
+
ce(ae(i), "handleChange", (function(e, t) {
|
|
604
615
|
var n, o;
|
|
605
616
|
var r = t.value, a = t.selectedOption;
|
|
606
617
|
var l = i.props.name;
|
|
@@ -622,19 +633,19 @@
|
|
|
622
633
|
name: l
|
|
623
634
|
});
|
|
624
635
|
}));
|
|
625
|
-
|
|
626
|
-
i.handleChange(e,
|
|
636
|
+
ce(ae(i), "handleSelectOption", (function(e, t) {
|
|
637
|
+
i.handleChange(e, Z(Z({}, t), {}, {
|
|
627
638
|
selectedOption: true
|
|
628
639
|
}));
|
|
629
640
|
i.focusCalledInternally = true;
|
|
630
641
|
i.focus();
|
|
631
642
|
i.close();
|
|
632
643
|
}));
|
|
633
|
-
|
|
644
|
+
ce(ae(i), "handleInputKeyDown", (function(e) {
|
|
634
645
|
var t = i.props, o = t.children, r = t.onKeyDown, a = t.onScrollBottom;
|
|
635
646
|
var l = i.availableOptionCount;
|
|
636
647
|
var u = i.activeValue;
|
|
637
|
-
var c = (0,
|
|
648
|
+
var c = (0, S.keycode)(e.nativeEvent);
|
|
638
649
|
if (i.state.open) {
|
|
639
650
|
switch (c) {
|
|
640
651
|
case "enter":
|
|
@@ -676,67 +687,67 @@
|
|
|
676
687
|
default:
|
|
677
688
|
// do nothing
|
|
678
689
|
}
|
|
679
|
-
} else if ((0,
|
|
690
|
+
} else if ((0, S.addsCharacter)(e.nativeEvent) !== false || // Safari 9.0 returns undefined
|
|
680
691
|
c === "enter" || c === "backspace" || c === "down" || c === "up") {
|
|
681
692
|
i.open();
|
|
682
693
|
}
|
|
683
694
|
r === null || r === void 0 ? void 0 : r(e);
|
|
684
695
|
}));
|
|
685
|
-
|
|
696
|
+
ce(ae(i), "handleInputClick", (function() {
|
|
686
697
|
if (!i.state.open && !i.props.disabled) {
|
|
687
698
|
i.open();
|
|
688
699
|
}
|
|
689
700
|
}));
|
|
690
|
-
|
|
701
|
+
ce(ae(i), "handleRequestClose", (function(e) {
|
|
691
702
|
var t = e.event, n = e.reason;
|
|
692
|
-
var o = n === "offScreen" || n === "escapeKey" || n === "clickAway" && i.state.anchor && !
|
|
703
|
+
var o = n === "offScreen" || n === "escapeKey" || n === "clickAway" && i.state.anchor && !pe(i.state.anchor, t);
|
|
693
704
|
if (o) {
|
|
694
705
|
i.close();
|
|
695
706
|
}
|
|
696
707
|
}));
|
|
697
|
-
|
|
708
|
+
ce(ae(i), "handleScrollBottom", (function(e) {
|
|
698
709
|
if (i.state.open && !i.props.isLoadingOptions) {
|
|
699
710
|
var t, n;
|
|
700
711
|
(t = (n = i.props).onScrollBottom) === null || t === void 0 ? void 0 : t.call(n, e);
|
|
701
712
|
}
|
|
702
713
|
}));
|
|
703
|
-
|
|
714
|
+
ce(ae(i), "renderMenu", (function(e) {
|
|
704
715
|
var t = e.anchorWidth, r = e.maxHeight;
|
|
705
|
-
var a = i.props,
|
|
706
|
-
var
|
|
707
|
-
var
|
|
708
|
-
var
|
|
709
|
-
var
|
|
710
|
-
if (e.type ===
|
|
716
|
+
var a = i.props, l = a.children, u = a.controlledFilter, s = a.isLoadingOptions, f = a.menuStyle, p = a.onScrollBottom;
|
|
717
|
+
var d = i.state, v = d.activeIndex, y = d.typedValue;
|
|
718
|
+
var g = i.getValue();
|
|
719
|
+
var S = n.Children.toArray(l).filter(n.isValidElement);
|
|
720
|
+
var C = b()(S, (function(e) {
|
|
721
|
+
if (e.type === I.Heading) {
|
|
711
722
|
return false;
|
|
712
723
|
}
|
|
713
724
|
if (e.props.label === undefined) {
|
|
714
|
-
return e.props.value ===
|
|
725
|
+
return e.props.value === g;
|
|
715
726
|
}
|
|
716
|
-
if (e.props.label !== undefined &&
|
|
717
|
-
return e.props.label ===
|
|
727
|
+
if (e.props.label !== undefined && y !== undefined) {
|
|
728
|
+
return e.props.label === g;
|
|
718
729
|
}
|
|
719
|
-
return e.props.value ===
|
|
730
|
+
return e.props.value === g;
|
|
720
731
|
}));
|
|
721
|
-
if (!
|
|
722
|
-
|
|
723
|
-
description: (0,
|
|
732
|
+
if (!C && g) {
|
|
733
|
+
S.unshift( o().createElement(X, {
|
|
734
|
+
description: (0, O._)("(New value)"),
|
|
724
735
|
descriptionPosition: "right",
|
|
725
736
|
key: "currentValueOption",
|
|
726
|
-
value:
|
|
727
|
-
"data-test-current-value-option":
|
|
737
|
+
value: g,
|
|
738
|
+
"data-test-current-value-option": g
|
|
728
739
|
}));
|
|
729
740
|
}
|
|
730
741
|
// Highlight Active
|
|
731
742
|
i.availableOptionCount = 0;
|
|
732
743
|
i.activeValue = undefined;
|
|
733
|
-
var
|
|
734
|
-
i.options = (
|
|
744
|
+
var w = (0, m.stringToKeywords)(y ? g : i.getDisplayValue());
|
|
745
|
+
i.options = (u ? S : S.filter((function(e) {
|
|
735
746
|
if (e.props.label !== undefined) {
|
|
736
|
-
return (0,
|
|
747
|
+
return (0, m.testPhrase)(e.props.label, w);
|
|
737
748
|
}
|
|
738
749
|
if (e.props.value !== undefined) {
|
|
739
|
-
return (0,
|
|
750
|
+
return (0, m.testPhrase)(e.props.value, w);
|
|
740
751
|
}
|
|
741
752
|
return true;
|
|
742
753
|
// Keep all headers and non-interactive options
|
|
@@ -745,11 +756,11 @@
|
|
|
745
756
|
// ignore Headings and Dividers
|
|
746
757
|
return e;
|
|
747
758
|
}
|
|
748
|
-
var o = i.availableOptionCount ===
|
|
759
|
+
var o = i.availableOptionCount === v;
|
|
749
760
|
i.availableOptionCount += 1;
|
|
750
761
|
var r = e.props.label !== undefined ? e.props.label : e.props.value;
|
|
751
762
|
var a = e.props.matchRanges;
|
|
752
|
-
var l = !
|
|
763
|
+
var l = !u && g && (C || t > 0) ? (0, m.keywordLocations)(r, w) || undefined : undefined;
|
|
753
764
|
if (o) {
|
|
754
765
|
i.activeValue = e.props.value;
|
|
755
766
|
|
|
@@ -767,17 +778,18 @@
|
|
|
767
778
|
matchRanges: a || l
|
|
768
779
|
});
|
|
769
780
|
}));
|
|
781
|
+
var k = de({
|
|
782
|
+
anchorWidth: t,
|
|
783
|
+
maxHeight: r,
|
|
784
|
+
menuStyle: f
|
|
785
|
+
});
|
|
770
786
|
|
|
771
|
-
return o().createElement(
|
|
772
|
-
style:
|
|
773
|
-
overflow: "auto",
|
|
774
|
-
width: Math.max(t !== null && t !== void 0 ? t : 0, 200)
|
|
775
|
-
}, p),
|
|
787
|
+
return o().createElement(P(), J({
|
|
788
|
+
style: k,
|
|
776
789
|
controlledExternally: true,
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
}, d()(i.props, "className", "noOptionsMessage", "footerMessage", "animateLoading", "loadingMessage", "onScroll")), i.options);
|
|
790
|
+
onScrollBottom: p ? i.handleScrollBottom : undefined,
|
|
791
|
+
isLoading: s
|
|
792
|
+
}, h()(i.props, "className", "noOptionsMessage", "footerMessage", "animateLoading", "loadingMessage", "onScroll")), i.options);
|
|
781
793
|
}));
|
|
782
794
|
i.state = {
|
|
783
795
|
activeIndex: 0,
|
|
@@ -787,13 +799,13 @@
|
|
|
787
799
|
value: e.defaultValue || ""
|
|
788
800
|
};
|
|
789
801
|
i.controlledExternally = c()(e, "value");
|
|
790
|
-
i.popoverId = (0,
|
|
791
|
-
i.activeItemId = (0,
|
|
802
|
+
i.popoverId = (0, g.createDOMID)("popover");
|
|
803
|
+
i.activeItemId = (0, g.createDOMID)("active-item");
|
|
792
804
|
if (false) {}
|
|
793
805
|
if (false) {}
|
|
794
806
|
return i;
|
|
795
807
|
}
|
|
796
|
-
|
|
808
|
+
te(r, [ {
|
|
797
809
|
key: "componentDidUpdate",
|
|
798
810
|
value: function e(t, n) {
|
|
799
811
|
if (false) {}
|
|
@@ -863,14 +875,14 @@
|
|
|
863
875
|
var a = this.getValue();
|
|
864
876
|
var l = this.getDisplayValue();
|
|
865
877
|
|
|
866
|
-
return o().createElement(
|
|
878
|
+
return o().createElement(x(), J({
|
|
867
879
|
autoCapitalize: "off",
|
|
868
880
|
autoComplete: "off",
|
|
869
881
|
autoCorrect: "off",
|
|
870
882
|
spellCheck: false,
|
|
871
883
|
canClear: true,
|
|
872
884
|
"data-test": "combo-box"
|
|
873
|
-
},
|
|
885
|
+
}, d()(this.props, "animateLoading", "className", "controlledFilter", "defaultValue", "footerMessage", "isLoadingOptions", "loadingMessage", "menuStyle", "noOptionsMessage", "onClose", "onOpen", "onScroll", "onScrollBottom", "spellCheck"), {
|
|
874
886
|
"data-test-popover-id": this.popoverId,
|
|
875
887
|
"data-test-label": l,
|
|
876
888
|
"data-test-value": a,
|
|
@@ -886,9 +898,9 @@
|
|
|
886
898
|
"aria-activedescendant": this.activeItemId,
|
|
887
899
|
"aria-expanded": i,
|
|
888
900
|
"aria-haspopup": true,
|
|
889
|
-
"aria-label": (0,
|
|
901
|
+
"aria-label": (0, O._)("Value input"),
|
|
890
902
|
"aria-controls": i ? this.popoverId : undefined
|
|
891
|
-
}), o().createElement(
|
|
903
|
+
}), o().createElement(w(), {
|
|
892
904
|
anchor: r,
|
|
893
905
|
autoCloseWhenOffScreen: true,
|
|
894
906
|
canCoverAnchor: false,
|
|
@@ -902,12 +914,12 @@
|
|
|
902
914
|
} ]);
|
|
903
915
|
return r;
|
|
904
916
|
}(n.Component);
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
/* harmony default export */ const
|
|
917
|
+
ce(ve, "propTypes", se);
|
|
918
|
+
ce(ve, "defaultProps", fe);
|
|
919
|
+
ce(ve, "Option", X);
|
|
920
|
+
ce(ve, "Divider", I.Divider);
|
|
921
|
+
ce(ve, "Heading", I.Heading);
|
|
922
|
+
/* harmony default export */ const he = ve;
|
|
911
923
|
// CONCATENATED MODULE: ./src/ComboBox/index.ts
|
|
912
924
|
module.exports = t;
|
|
913
925
|
/******/})();
|