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